/* =========================================================
   Header — barra fixa com nav em pílula
   ========================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(250, 245, 236, 0.82);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s var(--ease), background 0.4s var(--ease), height 0.4s var(--ease);
}

.site-header.scrolled {
    height: calc(var(--header-h) - 8px);
    background: rgba(250, 245, 236, 0.94);
    border-bottom-color: var(--line);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    width: 100%;
}

/* ---------- Logo ---------- */
.logo a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.logo-img {
    height: 34px;
    width: auto;
    max-width: 190px;
    transition: opacity 0.3s var(--ease);
}

.logo a:hover .logo-img {
    opacity: 0.72;
}

/* ---------- Navegação ---------- */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(20, 34, 25, 0.045);
    border: 1px solid var(--line);
}

.main-nav a {
    display: block;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-2);
    white-space: nowrap;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.main-nav a:hover {
    background: var(--paper-card);
    color: var(--forest);
}

.main-nav a[aria-current="page"] {
    background: var(--forest);
    color: var(--paper);
}

/* ---------- CTA do header ---------- */
.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    min-height: 46px;
    border-radius: 999px;
    background: var(--forest);
    color: var(--paper);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: var(--transition);
}

.header-cta .btn-icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
}

.header-cta:hover {
    background: var(--apricot-texto);
    transform: translateY(-1px);
}

/* ---------- Botão hambúrguer ---------- */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper-card);
}

.mobile-menu-toggle span {
    position: absolute;
    left: 50%;
    width: 19px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.mobile-menu-toggle span:nth-child(1) { top: 18px; }
.mobile-menu-toggle span:nth-child(2) { top: 23.5px; }
.mobile-menu-toggle span:nth-child(3) { top: 29px; }

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateX(-50%) translateY(5.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateX(-50%) translateY(-5.5px) rotate(-45deg);
}

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
    .main-nav a {
        padding: 9px 12px;
        font-size: 13.5px;
    }

    .header-cta span {
        display: none;
    }

    .header-cta {
        padding: 12px 16px;
    }
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }

    .header-cta {
        order: 2;
        margin-left: auto;
    }

    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--paper);
        padding: 34px 26px calc(46px + env(safe-area-inset-bottom, 0px));
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
        overflow-y: auto;
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background: none;
        border: 0;
        border-top: 1px solid var(--line);
    }

    .main-nav li {
        border-bottom: 1px solid var(--line);
    }

    .main-nav a {
        padding: 20px 4px;
        border-radius: 0;
        font-family: var(--display);
        font-size: 27px;
        font-weight: 500;
        letter-spacing: -0.01em;
        color: var(--ink);
    }

    .main-nav a:hover,
    .main-nav a[aria-current="page"] {
        background: none;
        color: var(--apricot-texto);
    }

    .main-nav.active li {
        animation: navItemIn 0.5s var(--ease) both;
    }

    .main-nav.active li:nth-child(1) { animation-delay: 0.04s; }
    .main-nav.active li:nth-child(2) { animation-delay: 0.09s; }
    .main-nav.active li:nth-child(3) { animation-delay: 0.14s; }
    .main-nav.active li:nth-child(4) { animation-delay: 0.19s; }
    .main-nav.active li:nth-child(5) { animation-delay: 0.24s; }
    .main-nav.active li:nth-child(6) { animation-delay: 0.29s; }

    @keyframes navItemIn {
        from { opacity: 0; transform: translateY(14px); }
        to { opacity: 1; transform: none; }
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 29px;
    }

    .header-cta {
        min-height: 46px;
        min-width: 46px;
        padding: 12px 14px;
    }
}
