/* ClearWax Floating Widgets & Conversational Chat (Global) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Onest:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #769283;
    --primary-dark: #4b6154;
    --primary-light: #8fa89b;
    --accent: #ccb280;
    --text: #34403f;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --font-headings: 'Onest', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   FLOATING CONTACT WIDGET & WHATSAPP POPUP INTEGRATION
   ========================================================================== */
.cw-floating-contact-wrap {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 996;
    pointer-events: none;
}

/* Floating Contact Widget */
.cw-floating-contact {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    overflow: hidden;
    pointer-events: auto;
}

.cw-floating-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
}

.cw-floating-item svg {
    display: block;
    fill: currentColor !important;
    stroke: none !important;
    width: 22px;
    height: 22px;
}

.cw-floating-email {
    background-color: #bd081c;
    color: #ffffff !important;
}

.cw-floating-whatsapp {
    background-color: #25d366;
    color: #ffffff !important;
    position: relative;
}

.cw-floating-phone {
    background-color: var(--primary);
    color: #ffffff !important;
}

.cw-floating-item:hover {
    filter: brightness(95%);
    transform: scale(1.08);
    z-index: 10;
}

/* Attention pulse effect on WhatsApp button */
.cw-wa-pulse-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #25d366;
    opacity: 0;
    pointer-events: none;
}

.cw-has-wa-popup .cw-wa-pulse-ring {
    animation: cwWaPulseRing 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes cwWaPulseRing {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    70% {
        transform: scale(1.38);
        opacity: 0;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.cw-wa-badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    background-color: #25d366;
    border: 2px solid #ffffff;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 6px rgba(37, 211, 102, 0.8);
    pointer-events: none;
}

.cw-has-wa-popup .cw-wa-badge-dot {
    opacity: 1;
    transform: scale(1);
}

/* WhatsApp Interactive Popup Card */
.cw-wa-popup {
    position: relative;
    width: 320px;
    max-width: calc(100vw - 32px);
    margin-right: 14px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: visible;
    font-family: var(--font-body);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(14px);
    transition: opacity 0.22s ease-out, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
    will-change: transform, opacity;
    z-index: 100000;
}

/* Pointer arrow pointing to sticky WhatsApp button on desktop */
.cw-wa-popup::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #ffffff;
    filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.04));
    pointer-events: none;
}

.cw-wa-popup.cw-wa-popup-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* WhatsApp Header */
.cw-wa-popup-header {
    background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    color: #ffffff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.cw-wa-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.cw-wa-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.cw-wa-avatar svg {
    stroke: #ffffff;
}

.cw-wa-online-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #25d366;
    border: 2px solid #075e54;
    border-radius: 50%;
}

.cw-wa-header-info {
    flex: 1;
    min-width: 0;
}

.cw-wa-header-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: -0.2px;
    font-family: var(--font-headings);
}

.cw-wa-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.cw-wa-dot {
    width: 6px;
    height: 6px;
    background-color: #25d366;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #25d366;
    animation: cwWaStatusPulse 1.8s infinite;
}

@keyframes cwWaStatusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.cw-wa-close-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.cw-wa-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* WhatsApp Message Body */
.cw-wa-popup-body {
    padding: 16px;
    background: #eae6df;
    background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
    background-size: 12px 12px;
}

.cw-wa-chat-bubble {
    background: #ffffff;
    border-radius: 12px;
    border-top-left-radius: 3px;
    padding: 10px 14px 8px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cw-wa-bubble-sender {
    font-size: 11.5px;
    font-weight: 700;
    color: #075e54;
    margin-bottom: 4px;
}

.cw-wa-bubble-text {
    font-size: 13.5px;
    line-height: 1.45;
    color: #111b21;
    margin: 0 0 6px 0;
}

.cw-wa-bubble-time {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #667781;
}

.cw-wa-checks {
    color: #53bdeb;
    font-size: 11px;
    letter-spacing: -1.5px;
    font-weight: bold;
}

/* WhatsApp Footer & CTA */
.cw-wa-popup-footer {
    padding: 14px 16px 12px 16px;
    background: #ffffff;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-wa-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #25d366;
    color: #ffffff !important;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    transition: all 0.25s ease;
}

.cw-wa-cta-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
    flex-shrink: 0;
}

.cw-wa-cta-btn:hover {
    background: #20ba5a;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
    color: #ffffff !important;
}

.cw-wa-footer-badge {
    text-align: center;
    font-size: 11px;
    color: #8696a0;
    font-weight: 500;
}

/* Mobile & Tablet Styles (Responsive Bottom Bar Integration) */
@media (max-width: 768px) {
    .cw-floating-contact-wrap {
        right: 0;
        left: 0;
        bottom: 20px;
        top: auto;
        transform: none;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }

    .cw-floating-contact {
        right: auto;
        top: auto;
        bottom: auto;
        transform: none;
        flex-direction: row;
        border-radius: 30px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .cw-floating-item {
        width: 60px;
        height: 50px;
        border-radius: 0;
    }

    .cw-floating-item:hover {
        transform: translateY(-4px) scale(1.05);
    }

    /* WhatsApp Popup positioned directly above bottom bar */
    .cw-wa-popup {
        margin-right: 0;
        margin-bottom: 14px;
        width: 320px;
        max-width: calc(100vw - 32px);
        transform: translateY(20px) scale(0.96);
    }

    .cw-wa-popup.cw-wa-popup-visible {
        transform: translateY(0) scale(1);
    }

    /* Pointer arrow pointing down to WhatsApp button in bottom bar */
    .cw-wa-popup::after {
        right: auto;
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        border-top: 8px solid #ffffff;
        border-bottom: none;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.04));
    }
}

@media (max-width: 480px) {
    .cw-wa-popup {
        width: 300px;
        max-width: calc(100vw - 24px);
    }

    .cw-wa-bubble-text {
        font-size: 13px;
    }
}

/* ==========================================================================
   THEME LINK HOVER OVERRIDES PROTECTION
   ========================================================================== */
.cw-speed-landing-page a:hover {
    color: inherit;
}

/* Explicit button text hover protections */
.cw-speed-landing-page .cw-btn-primary:hover,
.cw-speed-landing-page .cw-btn-submit:hover,
.cw-speed-landing-page .cw-btn-contact-submit:hover,
.cw-speed-landing-page .cw-btn-faq-emerg:hover,
.cw-speed-landing-page .cw-floating-item:hover,
.cw-speed-landing-page .cw-service-card-btn-overlay:hover {
    color: #ffffff !important;
}

.cw-speed-landing-page .cw-btn-secondary:hover {
    color: #ffffff !important;
}

.cw-speed-landing-page .cw-btn-header:hover {
    color: #ffffff !important;
}

/* Link-specific hover overrides */
.cw-speed-landing-page .cw-header-contact-item:hover,
.cw-speed-landing-page .cw-header-contact-item:hover .cw-contact-text-label {
    color: var(--primary) !important;
}

.cw-speed-landing-page .cw-feature-readmore:hover,
.cw-speed-landing-page .cw-feature-readmore:hover .cw-readmore-text {
    color: var(--primary-dark) !important;
}

.cw-speed-landing-page .cw-footer-contact-item a:hover,
.cw-speed-landing-page .cw-footer-menu a:hover,
.cw-speed-landing-page .cw-footer-social-icon:hover {
    color: var(--accent) !important;
}

.cw-phone-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 20px;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    height: 54px;
}

.cw-phone-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

.cw-phone-prefix {
    color: var(--text);
    font-weight: 600;
    margin-right: 12px;
    user-select: none;
    font-size: 0.95rem;
    border-right: 1px solid var(--border);
    padding-right: 12px;
    height: 24px;
    display: flex;
    align-items: center;
}

.cw-phone-input-wrapper input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    flex: 1;
    margin: 0 !important;
    height: 100% !important;
    font-size: 0.95rem !important;
    color: var(--text) !important;
}

/* Contact form wrapper specific overrides */
.cw-cta-contact-card .cw-phone-input-wrapper {
    border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
    border-radius: 12px;
    padding: 0 18px;
    height: 50px;
}

.cw-cta-contact-card .cw-phone-input-wrapper input {
    color: var(--primary-dark) !important;
    font-size: 0.92rem !important;
}

.cw-cta-contact-card .cw-phone-prefix {
    color: var(--primary-dark);
    border-right: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
    font-size: 0.92rem;
}

@media (max-width: 440px) {
    .cw-hero-actions {
        flex-direction:column;
        gap:25px;
    }
}

/* ==========================================================================
   CONVERSATIONAL CHAT WIDGET STYLES
   ========================================================================== */

/* Floating Launcher Wrap */
.cw-chat-launcher-wrap {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: auto;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
    font-family: var(--font-body);
}

/* Launcher Button */
.cw-chat-launcher-btn {
    pointer-events: auto;
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    box-shadow: 0 10px 25px -4px rgba(0, 98, 227, 0.4), 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    position: relative !important;
    overflow: visible !important;
    padding: 0 !important;
    line-height: normal !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.cw-chat-launcher-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 30px -4px rgba(0, 98, 227, 0.5), 0 6px 14px rgba(0, 0, 0, 0.15) !important;
}

.cw-chat-launcher-btn:active {
    transform: scale(0.96);
}

/* Pulse Ring */
.cw-chat-launcher-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.8;
    animation: cwChatPulse 2.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes cwChatPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Unread Badge */
.cw-chat-unread-badge {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45) !important;
    animation: cwBadgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 10 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}

@keyframes cwBadgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Launcher Icons */
.cw-chat-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cw-chat-launcher-icon svg {
    stroke: #ffffff;
}

.cw-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.7);
}

.cw-chat-open .cw-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.7);
}

.cw-chat-open .cw-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Teaser Bubble */
.cw-chat-teaser {
    pointer-events: auto;
    position: relative;
    max-width: 270px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cw-chat-teaser.cw-teaser-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cw-chat-teaser::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: 22px;
    right: auto;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #ffffff;
}

.cw-chat-teaser-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.cw-chat-teaser-close:hover {
    color: #475569;
    background-color: transparent;
}

.cw-chat-teaser-inner {
    padding: 12px 28px 12px 14px;
}

.cw-chat-teaser-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, white);
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.cw-chat-teaser-msg {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: #334155;
}

.cw-chat-teaser-msg strong {
    color: var(--primary-dark);
}

/* ==========================================================================
   Chat Widget Main Window
   ========================================================================== */
.cw-chat-widget {
    position: fixed;
    bottom: 96px;
    left: 24px;
    right: auto;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 20, 60, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transform-origin: bottom left;
    transition: opacity 0.22s ease-out, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
    will-change: transform, opacity;
    font-family: var(--font-body);
}

.cw-chat-widget.cw-chat-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Chat Header */
.cw-chat-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    flex-shrink: 0;
}

.cw-chat-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cw-chat-avatar-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.cw-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.cw-chat-avatar svg {
    stroke: #ffffff;
}

.cw-chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--primary-dark);
}

.cw-chat-header-meta {
    display: flex;
    flex-direction: column;
}

.cw-chat-header-name {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    font-family: var(--font-headings);
}

.cw-chat-header-status {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.cw-chat-pulse-light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    box-shadow: 0 0 6px #22c55e;
}

.cw-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-chat-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.cw-chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

/* Progress Bar */
.cw-chat-progress-wrap {
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.cw-chat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #22c55e 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Messages Stream */
.cw-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.cw-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.cw-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Message Rows */
.cw-msg-row {
    display: flex;
    gap: 8px;
    animation: cwMsgFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cwMsgFadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.cw-msg-row.cw-msg-bot {
    align-self: flex-start;
    max-width: 86%;
}

.cw-msg-row.cw-msg-user {
    align-self: flex-end;
    max-width: 82%;
    flex-direction: row-reverse;
}

.cw-msg-bot-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
}

.cw-msg-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
}

.cw-msg-bot .cw-msg-bubble {
    background: #ffffff;
    color: var(--text);
    border-radius: 16px 16px 16px 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cw-msg-user .cw-msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 2px 8px rgba(0, 98, 227, 0.25);
}

.cw-msg-bubble p {
    margin: 0 0 6px 0;
}

.cw-msg-bubble p:last-child {
    margin-bottom: 0;
}

.cw-msg-time {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.65;
}

.cw-msg-bot .cw-msg-time {
    text-align: left;
    color: #64748b;
}

.cw-msg-user .cw-msg-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.85);
}

/* Typing Indicator */
.cw-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 10px;
    background: #f8fafc;
    flex-shrink: 0;
}

.cw-chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.cw-chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: cwTypingBounce 1.4s infinite ease-in-out both;
}

.cw-chat-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.cw-chat-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes cwTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; background: var(--primary); }
}

.cw-chat-typing-text {
    font-size: 11px;
    color: #94a3b8;
}

/* Quick Chips Container */
.cw-chat-chips {
    padding: 4px 16px 12px;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.cw-chat-chip-btn {
    appearance: none;
    background: #ffffff;
    color: var(--primary-dark);
    border: 1.5px solid color-mix(in srgb, var(--primary) 28%, #e2e8f0);
    border-radius: 20px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    text-align: left;
}

.cw-chat-chip-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(0, 98, 227, 0.25);
}

.cw-chat-chip-btn:active {
    transform: translateY(0);
}

/* Chat Footer & Input */
.cw-chat-footer {
    padding: 10px 14px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cw-chat-form {
    margin: 0;
}

.cw-chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    border-radius: 24px;
    padding: 3px 6px 3px 14px;
    transition: all 0.2s ease;
}

.cw-chat-input-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.cw-chat-input-prefix {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid #cbd5e1;
    user-select: none;
}

.cw-chat-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 13.5px;
    color: var(--text);
    padding: 7px 0;
    min-width: 0;
    font-family: inherit;
}

.cw-chat-input::placeholder {
    color: #94a3b8;
}

.cw-chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.cw-chat-send-btn svg {
    stroke: #ffffff;
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.cw-chat-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
}

.cw-chat-send-btn:not(:disabled):hover {
    background: var(--primary-dark);
    transform: scale(1.06);
}

.cw-chat-footer-brand {
    text-align: center;
    margin-top: 6px;
}

.cw-chat-footer-brand span {
    font-size: 10.5px;
    color: #94a3b8;
}

/* Success Card in Chat */
.cw-chat-success-card {
    background: #ffffff;
    border: 1.5px solid #22c55e;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.12);
    margin-top: 6px;
}

.cw-chat-success-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 8px;
}

.cw-chat-success-summary {
    font-size: 12.5px;
    line-height: 1.5;
    color: #334155;
    background: #f0fdf4;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.cw-chat-success-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-chat-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cw-chat-cta-wa {
    background: #25d366;
    color: #ffffff !important;
}

.cw-chat-cta-wa:hover {
    background: #20ba5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.cw-chat-cta-phone {
    background: var(--primary);
    color: #ffffff !important;
}

.cw-chat-cta-phone:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 98, 227, 0.35);
}

/* ==========================================================================
   Responsive Behavior (Mobile Viewport)
   ========================================================================== */
@media (max-width: 600px) {
    .cw-chat-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .cw-chat-widget.cw-chat-visible {
        transform: translateY(0);
    }

    .cw-chat-launcher-wrap {
        bottom: 24px;
        left: 16px;
        right: auto;
        align-items: flex-start;
    }

    .cw-chat-launcher-btn {
        width: 54px;
        height: 54px;
    }

    .cw-chat-teaser {
        max-width: 240px;
        left: 0;
        right: auto;
    }
}

/* ==========================================================================
   Phone Click Intercept & Instant Callback Modal
   ========================================================================== */
.cw-callback-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cw-callback-modal.cw-callback-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cw-callback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 24, 19, 0.78);
    cursor: pointer;
    will-change: opacity;
}

.cw-callback-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.06);
    padding: 32px 28px 26px;
    z-index: 2;
    transform: translateY(16px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    will-change: transform;
}

.cw-callback-modal.cw-callback-active .cw-callback-card {
    transform: translateY(0);
}

.cw-callback-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.cw-callback-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.cw-callback-header {
    text-align: center;
    margin-bottom: 22px;
}

.cw-callback-icon-wrap {
    position: relative;
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-callback-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #0062e3), var(--primary-dark, #002c6d));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 98, 227, 0.32);
    position: relative;
    z-index: 2;
}

.cw-callback-icon svg {
    width: 26px;
    height: 26px;
}

.cw-callback-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2.5px solid var(--accent, #00d4aa);
    animation: cwCallbackPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
    opacity: 0.7;
}

@keyframes cwCallbackPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.22);
        opacity: 0;
    }
    100% {
        transform: scale(0.92);
        opacity: 0;
    }
}

.cw-callback-title {
    font-size: 21px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.25;
}

.cw-callback-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.cw-callback-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw-callback-field {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 6px;
}

.cw-callback-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.cw-callback-label .cw-required {
    color: #ef4444;
}

.cw-callback-label .cw-optional {
    color: #94a3b8;
    font-weight: 400;
    font-size: 12px;
}

/* Phone Wrapper Control */
#cw-callback-modal .cw-callback-phone-wrapper,
#cw-email-modal .cw-callback-phone-wrapper {
    display: flex !important;
    align-items: stretch !important;
    height: 52px !important;
    min-height: 52px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#cw-callback-modal .cw-callback-phone-wrapper:focus-within,
#cw-email-modal .cw-callback-phone-wrapper:focus-within {
    border-color: var(--primary, #0062e3) !important;
    box-shadow: 0 0 0 3.5px rgba(0, 98, 227, 0.12) !important;
    background: #ffffff !important;
}

/* Phone Prefix (+44) */
#cw-callback-modal .cw-callback-prefix,
#cw-email-modal .cw-callback-prefix {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    background: #f1f5f9 !important;
    border: none !important;
    border-right: 1.5px solid #cbd5e1 !important;
    user-select: none !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Phone Input Inside Wrapper (Strictly borderless & seamless) */
#cw-callback-modal input#cw-callback-phone,
#cw-callback-modal .cw-callback-phone-wrapper input,
#cw-email-modal input#cw-email-phone,
#cw-email-modal .cw-callback-phone-wrapper input {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    border: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 15px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    line-height: normal !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

#cw-callback-modal input#cw-callback-phone:focus,
#cw-callback-modal .cw-callback-phone-wrapper input:focus,
#cw-email-modal input#cw-email-phone:focus,
#cw-email-modal .cw-callback-phone-wrapper input:focus {
    border: 0 !important;
    border-style: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Text & Email Inputs (Matching exact height, border, radius & state) */
#cw-callback-modal input#cw-callback-name,
#cw-callback-modal .cw-callback-input-text,
#cw-email-modal input#cw-email-address,
#cw-email-modal input#cw-email-name,
#cw-email-modal .cw-callback-input-text {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 16px !important;
    margin: 0 !important;
    font-size: 15px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    line-height: normal !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

#cw-callback-modal input#cw-callback-name:focus,
#cw-callback-modal .cw-callback-input-text:focus,
#cw-email-modal input#cw-email-address:focus,
#cw-email-modal input#cw-email-name:focus,
#cw-email-modal .cw-callback-input-text:focus {
    border-color: var(--primary, #0062e3) !important;
    box-shadow: 0 0 0 3.5px rgba(0, 98, 227, 0.12) !important;
    background: #ffffff !important;
    outline: none !important;
}

/* Textarea in Modal */
#cw-email-modal textarea#cw-email-message,
#cw-email-modal .cw-callback-textarea,
.cw-callback-textarea {
    width: 100% !important;
    height: auto !important;
    min-height: 85px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    font-size: 14.5px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    line-height: 1.45 !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none !important;
}

#cw-email-modal textarea#cw-email-message:focus,
#cw-email-modal .cw-callback-textarea:focus,
.cw-callback-textarea:focus {
    border-color: var(--primary, #0062e3) !important;
    box-shadow: 0 0 0 3.5px rgba(0, 98, 227, 0.12) !important;
    background: #ffffff !important;
    outline: none !important;
}

/* Placeholder styling */
#cw-callback-modal input::placeholder,
#cw-email-modal input::placeholder,
#cw-email-modal textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.cw-callback-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary, #0062e3), var(--primary-dark, #002c6d));
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 98, 227, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    margin-top: 4px;
}

.cw-callback-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 98, 227, 0.4);
}

.cw-callback-submit-btn:active {
    transform: translateY(0);
}

.cw-callback-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.cw-callback-status {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    font-weight: 600;
}

.cw-callback-status.cw-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.cw-callback-status.cw-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.cw-callback-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#cw-callback-inputs-wrap,
#cw-email-inputs-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#cw-callback-inputs-wrap.cw-hidden,
#cw-email-inputs-wrap.cw-hidden {
    display: none;
}

.cw-callback-divider {
    display: none;
    position: relative;
    text-align: center;
    margin: 22px 0 16px;
}

.cw-callback-divider.cw-revealed {
    display: block;
    animation: cwFadeInUp 0.3s ease;
}

.cw-callback-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.cw-callback-divider span {
    position: relative;
    background: #ffffff;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    z-index: 2;
}

.cw-callback-direct-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cw-callback-direct-wrap.cw-revealed {
    display: flex;
    animation: cwFadeInUp 0.35s ease;
}

@keyframes cwFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cw-callback-direct-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cw-callback-direct-btn:hover {
    background: #e2e8f0;
    color: var(--primary, #0062e3) !important;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.cw-callback-direct-btn svg {
    color: var(--primary, #0062e3);
    flex-shrink: 0;
}

.cw-callback-hours {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 480px) {
    .cw-callback-card {
        padding: 26px 18px 22px;
        border-radius: 16px;
    }
    .cw-callback-title {
        font-size: 19px;
    }
}