/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
}

.navbar.scrolled {
    background: var(--overlay-bg, rgba(13, 17, 23, 0.98));
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    /* backdrop-filter removido - quebra position:sticky em elementos da página */
    border-bottom: 1px solid var(--border-color);
}

/* Header com fundo solido em paginas internas */
.navbar.navbar-solid {
    background: #0d1117;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    /* backdrop-filter removido - quebra position:sticky em elementos da página */
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-right: 20px;
    transition: transform 0.3s ease;
    position: relative;
}

.logo:hover {
    transform: scale(1.05);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

.logo span {
    color: var(--accent);
    transition: color 0.3s ease;
}

.logo:hover span {
    background: linear-gradient(90deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mobile-icon {
    display: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

/* Hamburger bars (CSS morph) */
.mobile-icon .hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    transform-origin: center;
}

.mobile-icon.active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-icon.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.mobile-icon.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.nav-item {
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-link {
    color: #fff;
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0 1rem;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.8;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 70%;
    background: var(--accent);
}

.button-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-button {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
    height: 44px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: -1;
}

.nav-button:hover {
    filter: brightness(1.15);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.5);
}

.nav-button:hover::before {
    opacity: 1;
}

.mobile-nav-button {
    display: none;
}

/* Botao Login/Minha Conta - Desktop */
.nav-button-login {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-light, #fff);
    padding: 10px 20px;
    border-radius: 50px;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 44px;
    text-decoration: none;
}

.nav-button-login i {
    font-size: 16px;
}

.nav-button-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Botao Usuario - Mobile */
.mobile-user-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light, #fff);
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* ==========================================================================
   Focus Styles — All interactive header elements (WCAG 2.4.7)
   ========================================================================== */
.mobile-icon:focus-visible,
.nav-link:focus-visible,
.nav-button:focus-visible,
.nav-button-login:focus-visible,
.mobile-user-btn:focus-visible,
.mobile-nav-button:focus-visible,
.logo:focus-visible {
    outline: 2px solid var(--accent, #ff8c1a);
    outline-offset: 3px;
}

/* ==========================================================================
   Active page indicator
   ========================================================================== */
.current-menu-item > .nav-link,
.current_page_item > .nav-link {
    color: var(--accent, #ff8c1a);
}

.current-menu-item > .nav-link::after,
.current_page_item > .nav-link::after {
    width: 70%;
    background: var(--accent);
}

/* ==========================================================================
   Mobile Menu (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        z-index: 900;
    }

    .mobile-icon {
        display: inline-flex;
        z-index: 920;
    }

    /* Nav menu - fullscreen overlay */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: var(--overlay-bg, rgba(13, 17, 23, 0.98));
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 910;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
        transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.35s;
    }

    .nav-menu.active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* Staggered entrance for menu items */
    .nav-menu.active .nav-item {
        animation: menuItemFadeIn 0.3s ease forwards;
        opacity: 0;
    }
    .nav-menu.active .nav-item:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu.active .nav-item:nth-child(2) { animation-delay: 0.1s; }
    .nav-menu.active .nav-item:nth-child(3) { animation-delay: 0.15s; }
    .nav-menu.active .nav-item:nth-child(4) { animation-delay: 0.2s; }
    .nav-menu.active .nav-item:nth-child(5) { animation-delay: 0.25s; }
    .nav-menu.active .nav-item:nth-child(6) { animation-delay: 0.3s; }
    .nav-menu.active .nav-item:nth-child(7) { animation-delay: 0.35s; }

    @keyframes menuItemFadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Nav items - column layout */
    .nav-item {
        width: 100%;
        height: auto;
    }

    .nav-link {
        text-align: center;
        padding: 1.5rem;
        width: 100%;
        display: block;
        font-size: 1.1rem;
        transition: color 0.2s ease, background-color 0.2s ease;
    }

    /* Tap feedback on mobile links */
    .nav-link:active {
        background: rgba(255, 255, 255, 0.08);
        color: var(--accent, #ff8c1a);
    }

    .nav-link:hover {
        color: var(--accent, #ff8c1a);
    }

    .nav-link::after {
        display: none;
    }

    /* Active page indicator on mobile */
    .current-menu-item > .nav-link,
    .current_page_item > .nav-link {
        color: var(--accent, #ff8c1a);
        position: relative;
    }

    .current-menu-item > .nav-link::before,
    .current_page_item > .nav-link::before {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0.5rem;
        transform: translateX(-50%);
        width: 24px;
        height: 2px;
        background: var(--accent, #ff8c1a);
        border-radius: 2px;
    }

    /* Focus styles on mobile overlay */
    .nav-menu.active .nav-link:focus-visible {
        outline: 2px solid var(--accent, #ff8c1a);
        outline-offset: -2px;
        border-radius: 4px;
    }

    /* Hide desktop buttons, show mobile user btn */
    .nav-button {
        display: none;
    }

    .nav-button-login {
        display: none;
    }

    .mobile-user-btn {
        display: flex;
    }
}

