/* ── Conversion features: sticky mobile CTA + SMS widget + exit-intent modal ──
   Loaded site-wide. All features respect prefers-reduced-motion where relevant. */

/* ═════════ Sticky mobile CTA bar (mobile only) ═════════ */
.mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: none;
    padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(15,15,15,0.85), rgba(15,15,15,0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(196, 90, 60, 0.18);
    box-shadow: 0 -12px 32px rgba(0,0,0,0.4);
    transform: translateY(120%);
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-cta-bar.mcb-visible { transform: translateY(0); }
.mobile-cta-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.55rem;
    max-width: 640px;
    margin: 0 auto;
}
.mcb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.55rem 0.4rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text, #fff);
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255,255,255,0.03);
    transition: background 180ms, border-color 180ms, transform 120ms;
    min-height: 52px;
}
.mcb-btn:active { transform: scale(0.97); }
.mcb-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
.mcb-btn.mcb-primary {
    background: linear-gradient(135deg, #C45A3C, #E17554);
    color: #fff;
    border-color: rgba(255,255,255,0.15);
    font-weight: 600;
}
.mcb-btn:not(.mcb-primary):hover { background: rgba(255,255,255,0.07); }

/* Desktop hidden; mobile shown */
@media (max-width: 768px) {
    .mobile-cta-bar { display: block; }
    /* Give body room so bar doesn't overlay bottom content */
    body.mcb-active { padding-bottom: 84px; }
}


/* ═════════ SMS chat widget (corner button + expanded panel) ═════════ */
.sms-widget {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 80;
}
.sms-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #C45A3C, #E17554);
    color: #fff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(196,90,60,0.35), 0 4px 8px rgba(0,0,0,0.25);
    transition: transform 200ms, box-shadow 200ms;
}
.sms-widget-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 32px rgba(196,90,60,0.45); }
.sms-widget-btn svg { width: 22px; height: 22px; }
.sms-widget-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 280px;
    padding: 1rem 1.1rem 1.1rem;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.5);
    display: none;
    animation: smsWidgetIn 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sms-widget-panel.open { display: block; }
@keyframes smsWidgetIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sms-widget-panel h4 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--text, #fff); }
.sms-widget-panel p { margin: 0 0 0.85rem; color: var(--text-muted, #999); font-size: 0.85rem; line-height: 1.4; }
.sms-widget-panel .sms-widget-cta {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #C45A3C, #E17554);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: filter 150ms;
}
.sms-widget-panel .sms-widget-cta:hover { filter: brightness(1.1); }
.sms-widget-panel .sms-widget-note { margin: 0.65rem 0 0; color: var(--text-muted, #999); font-size: 0.75rem; text-align: center; }
.sms-widget-close {
    position: absolute; top: 8px; right: 8px;
    width: 24px; height: 24px;
    background: transparent; border: none; color: var(--text-muted, #999);
    cursor: pointer; font-size: 1.2rem; line-height: 1;
}

/* Hide SMS widget bottom-right when mobile CTA bar visible (avoid overlap) */
@media (max-width: 768px) {
    .sms-widget { bottom: 92px; right: 0.85rem; }
    .sms-widget-btn { width: 48px; height: 48px; }
    .sms-widget-btn svg { width: 18px; height: 18px; }
    .sms-widget-panel { width: min(260px, calc(100vw - 2rem)); right: 0; }
}


/* ═════════ Exit-intent modal ═════════ */
.exit-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: exitOverlayIn 220ms ease-out;
}
.exit-modal-overlay.open { display: flex; }
@keyframes exitOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.exit-modal {
    max-width: 480px;
    width: 100%;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 2rem 1.75rem 1.75rem;
    position: relative;
    animation: exitModalIn 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes exitModalIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.exit-modal-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px;
    background: transparent; border: none; color: var(--text-muted, #999);
    cursor: pointer; font-size: 1.4rem; line-height: 1;
    border-radius: 50%;
    transition: background 150ms;
}
.exit-modal-close:hover { background: rgba(255,255,255,0.05); }
.exit-modal h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: var(--text, #fff);
    line-height: 1.2;
}
.exit-modal p {
    margin: 0 0 1.25rem;
    color: var(--text-muted, #999);
    font-size: 0.95rem;
    line-height: 1.5;
}
.exit-modal-form {
    display: grid;
    gap: 0.7rem;
}
.exit-modal-form input {
    padding: 0.7rem 0.9rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text, #fff);
    font-size: 0.95rem;
    font-family: inherit;
}
.exit-modal-form input:focus {
    outline: none;
    border-color: #C45A3C;
    box-shadow: 0 0 0 3px rgba(196,90,60,0.15);
}
.exit-modal-form button {
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, #C45A3C, #E17554);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: filter 150ms, transform 100ms;
    font-family: inherit;
}
.exit-modal-form button:hover { filter: brightness(1.1); }
.exit-modal-form button:active { transform: scale(0.98); }
.exit-modal-note {
    margin: 0.9rem 0 0;
    color: var(--text-muted, #999);
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.4;
}


/* ═════════ Inline mini quote form ═════════
   Matches the site .glow-card pattern: theme-aware via CSS custom properties,
   accent-glow hover overlay via ::before, subtle lift on hover, focus rings
   mirror the main /contact form's .form-group treatment. */
.mini-quote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.85rem 1.85rem 1.75rem;
    background: var(--bg-card, #141820);
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: var(--radius, 1.25rem);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1),
                border-color 400ms cubic-bezier(0.32, 0.72, 0, 1),
                box-shadow 400ms cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}
/* Hover glow overlay — matches .card-glow pattern from style.css */
.mini-quote::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(196,90,60,0.14), transparent 55%, rgba(196,120,80,0.06));
    opacity: 0;
    transition: opacity 500ms cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
    z-index: 0;
}
.mini-quote:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover, rgba(196,90,60,0.25));
    box-shadow: 0 16px 40px rgba(196,90,60,0.08), 0 4px 12px rgba(0,0,0,0.05);
}
.mini-quote:hover::before { opacity: 1; }
/* All children need z-index above the ::before overlay */
.mini-quote > * { position: relative; z-index: 1; }

/* Eyebrow: small orange dot + uppercase label — matches .section-eyebrow */
.mini-quote-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted, #8888a0);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.mini-quote-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent, #C45A3C);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-glow, rgba(196,90,60,0.4));
}

.mini-quote-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.35rem;
    flex-wrap: wrap;
}
.mini-quote-header > div:first-child { flex: 1 1 240px; min-width: 0; }
.mini-quote h3 {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--text, #f0f0f5);
    font-weight: 700;
    letter-spacing: -0.005em;
}
.mini-quote-subtitle {
    margin: 0;
    color: var(--text-muted, #8888a0);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Phone pill: matches the small chip pattern used on service pages */
.mini-quote-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text, #f0f0f5);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 999px;
    font-size: 0.88rem;
    white-space: nowrap;
    background: var(--bg-elevated, transparent);
    transition: border-color 220ms ease, background 220ms ease, transform 120ms ease;
}
.mini-quote-phone:hover {
    border-color: var(--border-hover, rgba(196,90,60,0.25));
    background: var(--accent-glow-soft, rgba(196,90,60,0.06));
}
.mini-quote-phone:active { transform: scale(0.98); }
.mini-quote-phone svg { color: var(--accent, #C45A3C); }

/* Form grid: name + phone + button */
.mini-quote-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.7rem;
}
.mini-quote-form input {
    padding: 0.85rem 1rem;
    background: var(--bg-elevated, #1a1f2a);
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 0.75rem;
    color: var(--text, #f0f0f5);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    min-width: 0;
    transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}
.mini-quote-form input::placeholder {
    color: var(--text-muted, #8888a0);
    opacity: 0.65;
    font-weight: 400;
}
.mini-quote-form input:hover:not(:focus) {
    border-color: var(--border-hover, rgba(196,90,60,0.25));
}
.mini-quote-form input:focus {
    outline: none;
    border-color: var(--accent, #C45A3C);
    box-shadow: 0 0 0 3px var(--accent-glow-soft, rgba(196,90,60,0.06)),
                0 0 20px rgba(196,90,60,0.06);
}
.mini-quote-form input:active { transform: scale(0.995); }

/* Button: matches .btn-primary treatment */
.mini-quote-form button {
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, var(--accent, #C45A3C), var(--accent-bright, #E08868));
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.925rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 4px 14px var(--accent-glow, rgba(196,90,60,0.2)), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1),
                box-shadow 260ms cubic-bezier(0.32, 0.72, 0, 1),
                filter 180ms ease;
}
.mini-quote-form button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 8px 22px var(--accent-glow, rgba(196,90,60,0.3)), inset 0 1px 0 rgba(255,255,255,0.15);
}
.mini-quote-form button:active { transform: translateY(0) scale(0.985); }
.mini-quote-form button:disabled { opacity: 0.65; cursor: wait; }

/* Footer note */
.mini-quote-note {
    margin: 1rem 0 0;
    color: var(--text-muted, #8888a0);
    font-size: 0.8rem;
    line-height: 1.55;
}
.mini-quote-note a { color: var(--accent, #C45A3C); font-weight: 600; text-decoration: none; }
.mini-quote-note a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Success state */
.mini-quote-success {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.28);
    border-radius: 0.75rem;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}
[data-theme="light"] .mini-quote-success { color: #059669; }
.mini-quote-success.visible { display: block; }

/* Light-theme accent boosts (dark shadows too heavy on light bg) */
[data-theme="light"] .mini-quote {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.03);
}
[data-theme="light"] .mini-quote:hover {
    box-shadow: 0 4px 12px rgba(196,90,60,0.08), 0 12px 32px rgba(0,0,0,0.05);
}
[data-theme="light"] .mini-quote-form button {
    box-shadow: 0 4px 14px rgba(196,90,60,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Mobile — stack the grid */
@media (max-width: 640px) {
    .mini-quote { padding: 1.5rem 1.35rem 1.4rem; }
    .mini-quote-header { flex-direction: column; gap: 0.85rem; margin-bottom: 1.15rem; }
    .mini-quote-phone { align-self: flex-start; }
    .mini-quote-form { grid-template-columns: 1fr; gap: 0.65rem; }
    .mini-quote-form button { width: 100%; padding: 0.95rem 1.25rem; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .mini-quote, .mini-quote::before, .mini-quote-form input, .mini-quote-form button {
        transition: none !important;
    }
    .mini-quote:hover { transform: none; }
    .mini-quote-form button:hover { transform: none; }
}


/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-cta-bar, .sms-widget-panel, .exit-modal, .exit-modal-overlay {
        animation: none !important;
        transition: none !important;
    }
}
