/* ============================================
   MENU MODERNO E CONFIGURÁVEL
   Sistema de navegação profissional com mega menu
   ============================================ */

/* Navegação Principal */
.header__nav {
    display: flex;
    align-items: center;
}

.header__nav ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__nav > ul > li {
    position: relative;
}

.header__nav > ul > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.header__nav > ul > li > a i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.header__nav > ul > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #0066FF;
}

.header__nav > ul > li > a:hover i {
    transform: scale(1.1);
}

.header__nav > ul > li.active > a {
    background: #0066FF;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.header__nav > ul > li.active > a i {
    color: #fff;
}

/* Dropdown Indicator */
.header__nav > ul > li.has-dropdown > a::after {
    content: '\f107';
    font-family: 'FontAwesome';
    margin-left: 4px;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.header__nav > ul > li.has-dropdown:hover > a::after {
    transform: rotate(180deg);
}

/* Garantir que o hover funcione corretamente */
.header__nav > ul > li.has-dropdown {
    position: relative;
    z-index: 10;
}

.header__nav > ul > li.has-dropdown:hover,
.header__nav > ul > li.has-dropdown:focus-within {
    z-index: 10010;
}

/* Manter dropdown aberto quando mouse está sobre ele */
.header__dropdown:hover,
.header__megamenu:hover {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Menu */
.header__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10011;
    padding: 12px;
    margin-top: 0;
}

/* Criar área de hover entre o menu e o dropdown - SEM ESPAÇO */
.header__nav > ul > li.has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0;
    background: transparent;
    z-index: 10010;
}

.header__nav > ul > li:hover .header__dropdown,
.header__nav > ul > li.has-dropdown:hover .header__dropdown {
    opacity: 1;
    visibility: visible;
}

.header__dropdown ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__dropdown li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.header__dropdown li a i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    color: #0066FF;
    transition: transform 0.3s ease;
}

.header__dropdown li a:hover {
    background: #f8f9fa;
    color: #0066FF;
    transform: translateX(4px);
}

.header__dropdown li a:hover i {
    transform: scale(1.15);
}

/* Mega Menu */
.header__megamenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: 90vw;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10011;
    padding: 30px;
    margin-top: 0;
}

.header__nav > ul > li:hover .header__megamenu,
.header__nav > ul > li.has-dropdown:hover .header__megamenu {
    opacity: 1;
    visibility: visible;
}

.header__megamenu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.header__megamenu-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header__megamenu-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header__megamenu-title i {
    color: #0066FF;
    font-size: 1.1rem;
}

.header__megamenu-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header__megamenu-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header__megamenu-links a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: #999;
    transition: all 0.3s ease;
}

.header__megamenu-links a:hover {
    background: #f8f9fa;
    color: #0066FF;
    transform: translateX(4px);
}

.header__megamenu-links a:hover i {
    color: #0066FF;
    transform: scale(1.1);
}

/* Featured Item no Mega Menu */
.header__megamenu-featured {
    background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    margin-top: 12px;
}

.header__megamenu-featured h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header__megamenu-featured p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.header__megamenu-featured a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #CDFF00;
    color: #000;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.header__megamenu-featured a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 255, 0, 0.3);
}

/* Badge no Menu */
.header__menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    margin-left: 4px;
}

.header__menu-badge--new {
    background: #CDFF00;
    color: #000;
}

.header__menu-badge--hot {
    background: #ff4757;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsivo - Mobile */
@media (max-width: 991px) {
    .header__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: #fff;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 2001;
        overflow-y: auto;
        padding: 80px 0 30px;
    }

    .header__nav.active {
        right: 0;
    }

    .header__nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .header__nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .header__nav > ul > li > a {
        color: #333;
        padding: 16px 24px;
        border-radius: 0;
        justify-content: space-between;
    }

    .header__nav > ul > li > a:hover {
        background: #f8f9fa;
        color: #0066FF;
    }

    .header__nav > ul > li.active > a {
        background: #f8f9fa;
        color: #0066FF;
    }

    /* Dropdown Mobile */
    .header__nav > ul > li.has-dropdown > a::after {
        content: '\f105';
    }

    .header__nav > ul > li.has-dropdown.open > a::after {
        transform: rotate(90deg);
    }

    /* Submenu - Simples e direto */
    .header__dropdown,
    .header__megamenu {
        display: none;
        background: #f8f9fa;
    }

    .header__nav > ul > li.has-dropdown.open .header__dropdown,
    .header__nav > ul > li.has-dropdown.open .header__megamenu {
        display: block;
    }

    .header__dropdown li a {
        padding: 14px 24px 14px 48px;
        display: block;
        color: #555;
        border-bottom: 1px solid #e9ecef;
    }
    
    .header__dropdown li a:hover {
        background: #fff;
        color: #0066FF;
    }

    .header__megamenu {
        padding: 8px 0;
    }

    .header__megamenu-grid {
        display: block;
    }

    .header__megamenu-column {
        padding: 0;
    }

    .header__megamenu-links {
        display: block;
    }

    .header__megamenu-links a {
        padding: 14px 24px 14px 48px;
        color: #555;
        border-bottom: 1px solid #e9ecef;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header__megamenu-links a:hover {
        background: #fff;
        color: #0066FF;
    }
    
    .header__megamenu-featured {
        display: none;
    }
}

/* Tablet */
@media (max-width: 1200px) and (min-width: 992px) {
    .header__nav > ul {
        gap: 4px;
    }

    .header__nav > ul > li > a {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .header__megamenu {
        width: 700px;
    }

    .header__megamenu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animações */
.header__nav > ul > li {
    animation: fadeInDown 0.5s ease;
    animation-fill-mode: both;
}

.header__nav > ul > li:nth-child(1) { animation-delay: 0.1s; }
.header__nav > ul > li:nth-child(2) { animation-delay: 0.15s; }
.header__nav > ul > li:nth-child(3) { animation-delay: 0.2s; }
.header__nav > ul > li:nth-child(4) { animation-delay: 0.25s; }
.header__nav > ul > li:nth-child(5) { animation-delay: 0.3s; }

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Behavior */
.header--scrolled .header__nav > ul > li > a {
    padding: 10px 16px;
}

/* Acessibilidade */
.header__nav a:focus {
    outline: 2px solid #0066FF;
    outline-offset: 2px;
}

/* Loading State */
.header__nav.loading {
    pointer-events: none;
    opacity: 0.6;
}
