/* ============================================================
   SHARED HEADER / NAV / AGENDAR BUTTON
   Carregado por todas as páginas do site para garantir que o
   menu e o botão de WhatsApp sejam idênticos em qualquer lugar.
   ============================================================ */

/* Nenhum elemento deve renderizar em itálico — anula o default dos browsers
   para <em>, <i>, <cite>, <address>, <dfn>, <var>. */
em, i, cite, address, dfn, var { font-style: normal; }

/* ===== HEADER ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 8%;
    background-color: rgba(16, 36, 52, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 6px 16px -4px rgba(0, 0, 0, 0.45),
        0 12px 28px -8px rgba(0, 0, 0, 0.30);
}

.site-logo {
    font-family: 'Spectral', serif;
    font-size: 1.55rem;
    font-weight: 400;
    color: var(--text-white);
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.site-logo span { color: #2AB7E6; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 2.1rem;
}

.site-nav a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--accent); }

/* ===== LANGUAGE SWITCHER (globe + dropdown) ===== */
.site-nav .lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-white);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-right: 0.2rem;
    transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.site-nav .lang-switcher:hover {
    opacity: 1;
    color: var(--accent);
    background-color: rgba(255, 255, 255, 0.04);
}
.lang-flag {
    width: 1.4rem;
    height: auto;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    display: block;
}
.lang-current {
    line-height: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-white);
    margin: 0 auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== ICON BASE ===== */
.icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ===== FOOTER SOCIAL ICONS (compartilhado, todas as páginas) ===== */
.footer-social {
    display: flex;
    gap: 0.85rem;
    margin-top: 1.1rem;
    flex-wrap: wrap;
}
.footer-social a {
    color: #9ba5aa;
    display: inline-flex;
    transition: color 0.2s ease, transform 0.2s ease;
}
.footer-social a:hover {
    color: var(--accent, #1E8FE0);
    transform: translateY(-2px);
}
.footer-social svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ===== BUTTONS (Agendar via WhatsApp) ===== */
/* Abordagem original (resgatada do prompt 2026-05-21 00:07):
   - Ícone é a REFERÊNCIA (tamanho fixo, não escala)
   - Pílula é a VARIÁVEL — sua altura == altura VISÍVEL do ícone
   Como corpo+stroke do SVG = ~96% do viewBox, pílula = 0.96 * icon. */
:root {
    --btn-icon-h: 3.91rem;
    --btn-pill-h: 3.91rem;
}

.btn-primary {
    --aura: 37, 211, 102;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(180deg, #ffffff 0%, #f3f3f3 100%) !important;
    color: #111;
    height: var(--btn-pill-h);
    padding: 0 1.74rem 0 0.425rem;
    border: none;
    border-radius: 60px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    box-shadow:
        0 10px 18px -6px rgba(0, 0, 0, 0.25),
        0 20px 32px -12px rgba(0, 0, 0, 0.18),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 2px 1px rgba(255, 255, 255, 1),
        inset 0 -4px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* =====================================================
   COREOGRAFIA SINCRONIZADA (ciclo de 4s)
   0–15%   → telefone vibra
   15–35%  → brilho passa na pílula WhatsApp
   40–65%  → cruz pulsa (batida forte + batida fraca, como coração)
   65–80%  → brilho passa na pílula Emergência
   80–100% → pausa de 0,8s
   ===================================================== */

.wa-phone-shake {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation: waPhoneRing 4s ease-in-out infinite;
}

@keyframes waPhoneRing {
    0%, 15%, 100% { transform: rotate(0deg); }
    2%    { transform: rotate(-18deg); }
    4%    { transform: rotate(16deg); }
    6%    { transform: rotate(-14deg); }
    8%    { transform: rotate(12deg); }
    10%   { transform: rotate(-10deg); }
    12%   { transform: rotate(7deg); }
    13.5% { transform: rotate(-3deg); }
}

.cross-pulse {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation: crossPulse 4s ease-in-out infinite;
}

@keyframes crossPulse {
    0%, 40%, 57.5%, 100% { transform: scale(1); }
    45% { transform: scale(1.28); }   /* batida forte (sístole) */
    50% { transform: scale(1); }
    54% { transform: scale(1.10); }   /* batida fraca, menos ampla (eco) */
}

/* Pulse sutil do calendar-check: destaque discreto, não emergência */
.check-pulse {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation: checkPulse 5s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 55%, 100% { transform: scale(1); }
    62% { transform: scale(1.08); }   /* destaque suave, único pulso por ciclo */
    72% { transform: scale(1); }
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 55px;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.12),
        inset 0 -1px 1px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 1;
}

.btn-shine {
    position: absolute;
    inset: 0;
    border-radius: 60px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -55%;
    width: 50%;
    height: 120%;
    background: linear-gradient(110deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0) 70%);
    transform: skewX(-22deg);
    mix-blend-mode: overlay;
    animation: btnShineIdle 4s linear infinite;
}

/* Brilho padrão (WhatsApp): passa após o telefone vibrar (15–35%) */
@keyframes btnShineIdle {
    0%, 15% { left: -55%; }
    35%     { left: 150%; }
    100%    { left: 150%; }
}

/* Brilho da pílula Emergência: começa imediatamente após a cruz pulsar (57,5–80%) */
.btn-emergencia .btn-shine::before {
    animation: btnShineEmergency 4s linear infinite;
}

@keyframes btnShineEmergency {
    0%, 57.5% { left: -55%; }
    80%       { left: 150%; }
    100%      { left: 150%; }
}

/* Brilho da pílula Agendar online: timing diferente para não competir com Agendar Consulta (WhatsApp) ao lado */
.btn-agendar-online .btn-shine::before {
    animation: btnShineAgendar 5s linear infinite;
}

@keyframes btnShineAgendar {
    0%, 72% { left: -55%; }   /* atraso maior que o WhatsApp idle, pulse aparece logo após o ícone destacar */
    90%     { left: 150%; }
    100%    { left: 150%; }
}

.btn-shine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(var(--aura), 0.5) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 22px -6px rgba(0, 0, 0, 0.28),
        0 26px 42px -14px rgba(0, 0, 0, 0.22),
        0 3px 6px rgba(0, 0, 0, 0.10),
        inset 0 2px 1px rgba(255, 255, 255, 1),
        inset 0 -4px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover .btn-shine::before {
    animation: none;
    left: 150%;
}

.btn-primary:active {
    transform: scale(0.97) translateY(-1px);
    transition: transform 0.08s ease;
}

.btn-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: -0.425rem;
    filter:
        drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.28))
        drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18))
        drop-shadow(0 0.5px 0.8px rgba(0, 0, 0, 0.10));
    position: relative;
    z-index: 6;
}

.btn-icon-circle .icon {
    /* Ícone fica no tamanho original (referência). Pílula é a que se
       ajusta. Margin-left posiciona o corpo do ícone com left semi-
       círculo coincidindo com left semicírculo da pílula. */
    width: var(--btn-icon-h);
    height: var(--btn-icon-h);
    overflow: visible;
}

.btn-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
}

.btn-text-subtitle {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0c5a2a;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

.btn-primary:hover .btn-text-subtitle {
    color: #1ea659;
    text-shadow:
        0 0 2px rgba(46, 224, 110, 0.18),
        0 0 6px rgba(46, 224, 110, 0.08);
}

.btn-primary--sm {
    height: 1.879rem;
    gap: 0.4rem;
    padding: 0 0.8rem 0 0.221rem;
    box-shadow:
        0 4px 8px -2px rgba(0, 0, 0, 0.22),
        0 8px 14px -4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}
.btn-primary--sm::before {
    inset: 2.125px;
    border-radius: 50px;
}
.btn-primary--sm .btn-icon-circle {
    margin-left: -0.221rem;
}
.btn-primary--sm .btn-icon-circle .icon {
    width: 1.879rem;
    height: 1.879rem;
}
.btn-primary--sm .btn-text-subtitle {
    font-size: 0.78rem;
    font-weight: 700;
}
.btn-primary--sm:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 12px -2px rgba(0, 0, 0, 0.26),
        0 12px 20px -6px rgba(0, 0, 0, 0.18),
        0 2px 3px rgba(0, 0, 0, 0.10),
        inset 0 1px 1px rgba(255, 255, 255, 1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}

/* ===== MOBILE NAV ===== */
@media (max-width: 960px) {
    .nav-toggle { display: flex; }

    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(78vw, 320px);
        height: 100vh;
        height: 100dvh; /* iOS Safari: respeita a URL bar dinâmica */
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1.8rem;
        padding: 2rem 2.4rem;
        background-color: #122a3a;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
        transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 950; /* fica acima do bottom-nav (850) e float-wa (860) */
    }
    .site-nav.open { right: 0; }
    .site-nav a { font-size: 1.05rem; color: var(--text-white); }
    .nav-btn-agendar { display: none; }
}

@media (max-width: 600px) {
    .site-header { padding: 1rem 6%; }
    /* CTA pills no mobile: texto menor + menos padding direito pra
       "Agendar Consulta" caber inteiro ao lado do ícone sem cortar.
       Não afeta menu (.btn-primary--sm) nem mapa (.localizacao-cta)
       porque ambos sobrescrevem font-size e padding próprios. */
    .btn-text-subtitle { font-size: 1.02rem; }
    .sobre-actions .btn-primary,
    .section-cta .btn-primary,
    .cta-final .btn-wrap .btn-primary { padding-right: 1rem; }
}

/* ============================================================
   MOBILE PREMIUM APP-LIKE LAYER
   Bottom nav fixa + WhatsApp flutuante + header sticky-hide +
   tap feedback + smooth scroll com offset + view transitions
   Tudo aplica apenas em telas <= 960px (mobile + small tablet).
   ============================================================ */

/* Smooth scroll com offset pro header fixo */
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }

/* Header sticky-hide: esconde no scroll-down, volta no scroll-up */
.site-header {
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
    will-change: transform;
}
.site-header.header-hidden {
    transform: translateY(-100%);
}

/* Tap feedback universal — só em devices sem hover (touch) */
@media (hover: none) and (pointer: coarse) {
    .card,
    .btn-primary,
    a[class*="btn"],
    .bottom-nav-item,
    .float-wa {
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.12s ease;
    }
    .card:active {
        transform: scale(0.975);
    }
    .bottom-nav-item:active {
        transform: scale(0.92);
    }
    .float-wa:active {
        transform: scale(0.92);
    }
}

/* Bottom nav fixa (mobile only) */
.bottom-nav {
    display: none;
}

@media (max-width: 960px) {
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(8, 26, 32, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.32);
        z-index: 850;
        padding: 0.5rem 0 calc(0.55rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        text-decoration: none;
        color: rgba(255, 255, 255, 0.66);
        font-family: 'Montserrat', sans-serif;
        font-size: 0.66rem;
        font-weight: 500;
        letter-spacing: 0.3px;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s ease, transform 0.12s ease;
        padding: 0.25rem 0.2rem;
    }
    .bottom-nav-item svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        stroke-width: 1.8;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .bottom-nav-item.active {
        color: var(--accent);
    }
    .bottom-nav-item.active svg {
        filter: drop-shadow(0 0 6px rgba(217, 175, 80, 0.35));
    }

    /* Reserva espaço pro bottom-nav no fim da página */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

/* WhatsApp flutuante (mobile only) */
.float-wa {
    display: none;
}

@media (max-width: 960px) {
    .float-wa {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        right: 1rem;
        width: 64px;
        height: 64px;
        background: transparent;
        z-index: 860;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.2s ease;
        /* Sombra de profundidade no formato do speech bubble */
        filter:
            drop-shadow(0 4px 8px rgba(30, 163, 85, 0.35))
            drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22))
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
    }
    .float-wa svg {
        width: 100%;
        height: 100%;
        display: block;
        overflow: visible;
    }
}

/* View Transitions API — transições suaves entre páginas */
@view-transition {
    navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.28s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Esconde bottom-nav e float-wa quando o drawer mobile abre.
   Usa :has() (suportado em Chrome 105+, Safari 15.4+, ambos 2022+).
   Browsers antigos exibem ambos sob o drawer (degradação aceitável). */
@media (max-width: 960px) {
    body:has(.site-nav.open) .bottom-nav,
    body:has(.site-nav.open) .float-wa {
        opacity: 0;
        pointer-events: none;
        transform: translateY(20px);
        transition: opacity 0.22s ease, transform 0.22s ease;
    }
}

/* Respeita preferência por reduzir movimento */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .site-header { transition: none; }
    .float-wa::after { animation: none; }
    .wa-phone-shake,
    .cross-pulse,
    .check-pulse,
    .btn-shine::before { animation: none; }
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}
