/* ═══════════════════════════════════════════════════════
   SELF CENTER · WhatsApp Component
   FAB premium (o botão flutuante é hoje um link direto pro
   WhatsApp — não abre modal; .cw-modal__close abaixo é
   reaproveitado só pelo botão de fechar do bio-modal em
   style.css, ver web/site/index.html)
   ═══════════════════════════════════════════════════════ */

:root {
    --cw-verde:       #005558;
    --cw-text:        #1a2e2f;
    --cw-text-muted:  #6a8082;
    --cw-ease:        cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── FAB ─────────────────────────────────────────────── */
.cw-fab {
    position: fixed;
    bottom: clamp(1rem, 2.4vw, 1.75rem);
    right:  clamp(1rem, 2.4vw, 1.75rem);
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1.2rem 0.55rem 0.55rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 999px;
    box-shadow:
        0 14px 38px rgba(14,27,42,.16),
        0 4px 12px rgba(177,223,249,.25),
        inset 0 1px 0 rgba(255,255,255,.7);
    cursor: pointer;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--cw-text);
    transform: translateY(14px) scale(.92);
    opacity: 0;
    pointer-events: none;
    /* FIX (achado de auditoria pré-deploy): antes só opacity/pointer-events
       controlavam a visibilidade — o FAB continuava focável por teclado (Tab)
       mesmo invisível, antes do usuário rolar a página. visibility:hidden
       tira do fluxo de foco; o delay na transição de visibility garante que
       ela só muda DEPOIS do fade de opacity terminar, preservando a
       animação de saída existente. */
    visibility: hidden;
    transition:
        transform .55s var(--cw-ease),
        opacity .45s ease,
        box-shadow .35s ease,
        background .25s ease,
        visibility 0s linear .45s;
}
.cw-fab.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}
.cw-fab:hover {
    background: #fff;
    box-shadow:
        0 22px 52px rgba(0,40,42,.22),
        0 6px 20px rgba(0,85,88,.28),
        inset 0 1px 0 rgba(255,255,255,.85);
    transform: translateY(-3px) scale(1.01);
}
.cw-fab:focus-visible {
    outline: none;
    background: #fff;
    box-shadow:
        0 22px 52px rgba(30,18,8,.2),
        0 0 0 4px rgba(37,211,102,.4),
        inset 0 1px 0 rgba(255,255,255,.85);
    transform: translateY(-3px) scale(1.01);
}
.cw-fab:active { transform: translateY(-1px) scale(.99); }

.cw-fab__core {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006b6f 0%, #003b3d 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow:
        inset 0 -2px 6px rgba(0,0,0,.22),
        inset 0 1px 1px rgba(255,255,255,.18),
        0 4px 14px rgba(0,85,88,.4);
}
.cw-fab__icon {
    filter: brightness(0) invert(1);
    width: 24px; height: 24px;
}

.cw-fab__halo,
.cw-fab__ring {
    position: absolute;
    left: 0.55rem;
    top: 50%;
    width: 46px; height: 46px;
    border-radius: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.cw-fab__halo {
    background: rgba(0,107,111,.55);
    filter: blur(8px);
    animation: cw-fab-halo 2.4s ease-out infinite;
    z-index: 0;
}
.cw-fab__ring {
    border: 2px solid rgba(0,107,111,.55);
    animation: cw-fab-ring 2.4s ease-out infinite .6s;
    z-index: 1;
}
@keyframes cw-fab-halo {
    0%   { transform: translateY(-50%) scale(.9);  opacity: .6; }
    100% { transform: translateY(-50%) scale(1.45); opacity: 0; }
}
@keyframes cw-fab-ring {
    0%   { transform: translateY(-50%) scale(1);   opacity: .65; }
    100% { transform: translateY(-50%) scale(1.85); opacity: 0; }
}

.cw-fab__label {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-align: left;
    padding-right: 0.15rem;
}
.cw-fab__label strong {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--cw-text);
    letter-spacing: -0.005em;
}
.cw-fab__label span {
    font-size: 0.7rem;
    color: var(--cw-text-muted);
    margin-top: 2px;
}

/* ── BOTÃO DE FECHAR (reaproveitado pelo bio-modal, ver style.css) ── */
.cw-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(30,18,8,.08);
    backdrop-filter: blur(8px);
    color: var(--cw-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .25s var(--cw-ease), color .2s;
}
.cw-modal__close:hover {
    background: #fff;
    color: var(--cw-verde);
    transform: rotate(90deg) scale(1.05);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 540px) {
    /* FAB mais compacto em mobile, centralizado e respeitando safe-area */
    .cw-fab {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        right: 1rem;
        padding: 0.5rem;
        box-shadow: 0 12px 28px rgba(30,18,8,.22), 0 4px 10px rgba(37,211,102,.32);
    }
    .cw-fab__label { display: none; }
    .cw-fab__halo, .cw-fab__ring { left: 0.5rem; }
    .cw-fab__core { width: 44px; height: 44px; }
    .cw-fab__halo, .cw-fab__ring { width: 44px; height: 44px; }
}

@media (max-width: 480px) {
    .cw-modal__close {
        top: 1.4rem;
        right: 1rem;
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 380px) {
    .cw-fab { right: 0.85rem; bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); }
}

/* Touch devices: alvos confortáveis */
@media (pointer: coarse) {
    .cw-modal__close { width: 44px; height: 44px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cw-fab, .cw-fab__halo, .cw-fab__ring {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}
