/* ─── AA Contact Buttons — Frontend CSS v2.0.1 ──────────────────────────────
   Zero emoji. Pure SVG. Cross-browser compatible (Chrome, Firefox, Safari).
   ────────────────────────────────────────────────────────────────────────── */

/* ── Floating wrapper ────────────────────────────────────────────────────── */
.aac-buttons-wrap.aac-floating {
    position: fixed;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;   /* allow clicks to pass through wrapper gaps */
}
.aac-float-right { right: 20px; align-items: flex-end; }
.aac-float-left  { left:  20px; align-items: flex-start; }

/* Inline / shortcode wrapper */
.aac-buttons-wrap:not(.aac-floating) {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ── Button base ─────────────────────────────────────────────────────────── */
.aac-btn {
    pointer-events: all;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 50px;
    background: var(--aac-btn-color, #25D366);
    color: #ffffff !important;
    text-decoration: none !important;
    overflow: hidden;
    cursor: pointer;
    box-shadow:
        0 4px 16px rgba(0,0,0,.22),
        0 1px 4px  rgba(0,0,0,.14);
    transition:
        transform .22s cubic-bezier(.34,1.56,.64,1),
        box-shadow .22s ease;
    /* size driven by CSS custom property set inline */
    width:  var(--aac-btn-size, 56px);
    height: var(--aac-btn-size, 56px);
    /* icon-only by default (no label) */
    padding: 0;
    flex-shrink: 0;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    outline-offset: 3px;
}

/* When label is present — widen to pill shape */
.aac-btn.aac-has-label {
    padding: 0 18px 0 14px;
    width: auto;
    min-width: var(--aac-btn-size, 56px);
}

.aac-btn:hover {
    transform: scale(1.09) translateY(-3px);
    box-shadow:
        0 10px 30px rgba(0,0,0,.28),
        0 2px 8px   rgba(0,0,0,.18);
    color: #ffffff !important;
}
.aac-btn:active  { 
    transform: scale(.95); 
    color: #ffffff !important; 
}
.aac-btn:focus,
.aac-btn:visited {
    color: #ffffff !important;
}
.aac-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,.7);
}

/* ── SVG icon container ──────────────────────────────────────────────────── */
.aac-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.aac-icon svg { 
    display: block; 
    fill: #ffffff !important; 
}

/* ── Label ───────────────────────────────────────────────────────────────── */
.aac-label {
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: .15px;
    line-height: 1;
    white-space: nowrap;
}

/* ── Ripple animation ────────────────────────────────────────────────────── */
.aac-ripple {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,.22);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transition: transform .5s ease, opacity .5s ease;
}
.aac-btn.aac-ripple-active .aac-ripple {
    transform: scale(2.8);
    opacity: 0;
    transition: transform .5s ease, opacity .5s ease;
}

/* ── WhatsApp pulse ring (floating only) ─────────────────────────────────── */
.aac-floating .aac-btn-whatsapp::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid var(--aac-btn-color, #25D366);
    opacity: 0;
    pointer-events: none;
    animation: aac-pulse 2.8s ease-out infinite;
}
.aac-floating .aac-btn-whatsapp.aac-has-label::before {
    border-radius: 50px; /* match pill shape */
}
@keyframes aac-pulse {
    0%   { transform: scale(.84); opacity: .65; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

/* ── Entrance slide-in ───────────────────────────────────────────────────── */
.aac-floating .aac-btn {
    animation: aac-slide-up .5s cubic-bezier(.34,1.56,.64,1) both;
}
.aac-floating .aac-btn:nth-child(1) { animation-delay: .05s; }
.aac-floating .aac-btn:nth-child(2) { animation-delay: .18s; }
@keyframes aac-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(.82); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
.aac-float-left .aac-btn {
    animation-name: aac-slide-right;
}
@keyframes aac-slide-right {
    from { opacity: 0; transform: translateX(-28px) scale(.82); }
    to   { opacity: 1; transform: translateX(0)     scale(1);   }
}

/* ── Body scroll lock when modal is open ────────────────────────────────── */
body.aac-modal-open {
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEAD CAPTURE MODAL
═══════════════════════════════════════════════════════════════════════════ */

/* Overlay */
.aac-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: aac-fade-in .2s ease both;
}
/* Hidden state — override display:flex when [hidden] */
.aac-modal-overlay[hidden] {
    display: none !important;
}
@keyframes aac-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal box */
.aac-modal-box {
    background: #1E293B;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    padding: 38px 34px 32px;
    max-width: 430px;
    width: 100%;
    position: relative;
    box-shadow: 0 32px 80px rgba(0,0,0,.55);
    animation: aac-modal-pop .32s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes aac-modal-pop {
    from { opacity: 0; transform: scale(.86) translateY(18px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* Close button */
.aac-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 50%;
    color: #94A3B8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .18s, color .18s;
}
.aac-modal-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.aac-modal-close:focus-visible { outline: 2px solid #25D366; outline-offset: 2px; }

/* Icon */
.aac-modal-icon {
    width: 72px; height: 72px;
    background: rgba(37,211,102,.1);
    border: 1px solid rgba(37,211,102,.2);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: #25D366;
}

/* Heading & subtext */
.aac-modal-heading {
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 20px; font-weight: 700;
    color: #F1F5F9; text-align: center;
    margin: 0 0 8px; line-height: 1.25;
}
.aac-modal-subtext {
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px; color: #64748B;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.55;
}

/* Form */
.aac-lead-form { display: flex; flex-direction: column; gap: 14px; }
.aac-form-group { display: flex; flex-direction: column; gap: 5px; }
.aac-form-group label {
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 12px; font-weight: 600;
    color: #94A3B8; text-transform: uppercase; letter-spacing: .5px;
}
.aac-optional { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }
.aac-form-group input {
    background: rgba(255,255,255,.06);
    border: 1.5px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #F1F5F9;
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: border-color .2s, background .2s;
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.aac-form-group input:focus {
    border-color: #25D366;
    background: rgba(37,211,102,.06);
}
.aac-form-group input::placeholder { color: #475569; }
.aac-required { color: #EF4444; margin-left: 2px; }

/* Error state */
.aac-form-group input.aac-input-error { border-color: #EF4444; }
.aac-field-error {
    font-size: 12px; color: #F87171;
    font-family: -apple-system, 'Segoe UI', sans-serif;
}
.aac-field-error[hidden] { display: none; }

/* Submit button */
.aac-lead-submit {
    display: flex;
    align-items: center; justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    transition: opacity .18s, transform .15s;
    margin-top: 4px;
    width: 100%;
}
.aac-lead-submit:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.aac-lead-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.aac-lead-submit:focus-visible { outline: 2px solid #25D366; outline-offset: 2px; }

/* Skip link */
.aac-lead-skip {
    background: none; border: none;
    color: #475569; font-size: 13px;
    cursor: pointer; text-decoration: underline;
    text-align: center; padding: 4px 0;
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    transition: color .15s;
    width: 100%;
}
.aac-lead-skip:hover { color: #94A3B8; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .aac-floating      { bottom: 16px; }
    .aac-float-right   { right: 14px; }
    .aac-float-left    { left:  14px; }
    .aac-modal-box     { padding: 28px 20px 24px; border-radius: 18px; }
    .aac-modal-heading { font-size: 18px; }
}

/* ── Reduced-motion preference ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .aac-btn,
    .aac-ripple,
    .aac-floating .aac-btn,
    .aac-floating .aac-btn-whatsapp::before,
    .aac-modal-overlay,
    .aac-modal-box { animation: none !important; transition: none !important; }
}


/* ── Premium Expandable Menu ─────────────────────────────────────────────── */
.aac-buttons-wrap {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.aac-expand-menu {
    position: absolute;
    bottom: calc(100% + 16px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    padding: 12px;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.92);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 10000;
    width: max-content;
    max-width: calc(100vw - 40px); /* prevent overflow on tiny mobile */
}
.aac-float-left .aac-expand-menu {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}
.aac-buttons-wrap:not(.aac-floating) .aac-expand-menu {
    bottom: auto;
    top: calc(100% + 16px);
    transform-origin: top right;
    transform: translateY(-12px) scale(0.92);
}

.aac-buttons-wrap.aac-is-open .aac-expand-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.aac-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none !important;
    color: #0f172a !important;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}
.aac-menu-item:hover, .aac-menu-item:focus {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.aac-menu-item:active {
    transform: translateY(0);
}
.aac-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--aac-item-color, #25D366);
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.aac-menu-icon svg {
    fill: currentColor !important;
    display: block;
    width: 22px;
    height: 22px;
}
.aac-menu-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.aac-menu-text strong {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.aac-menu-text small {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}

/* Toggle Button Improvements */
.aac-main-toggle {
    z-index: 10001; /* Stay above menu if overlapping */
}
.aac-main-toggle .aac-icon {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.aac-buttons-wrap.aac-is-open .aac-main-toggle .aac-icon-open {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
}
.aac-buttons-wrap:not(.aac-is-open) .aac-main-toggle .aac-icon-close {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}
