/* ==========================================================================
   1. VARIÁVEIS DO PROJETO (Ajuste as cores e tamanhos conforme necessário)
   ========================================================================== */
:root {
    --el-bg-header: #FD8932;
    --el-text-primary: #ffffff;
    --el-accent: #fff;
    --el-header-height: 80px;
    --el-transition: all 0.3s ease;
}

/* ==========================================================================
   2. ESTILOS GERAIS & DESKTOP (Telas Grandes)
   ========================================================================== */
.el-nav-wrapper {
    width: 100%;
    background-color: var(--el-bg-header);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
}

.el-site-header {
    width: 100%;
    height: var(--el-header-height);
    display: flex;
    align-items: center;
    padding: 8px;
}

.el-header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.el-logo-container {
    display: flex;
    align-items: center;
    height: calc(var(--el-header-height) - 20px);
    z-index: 1210;
}

.el-logo-link {
    display: inline-block;
    height: 100%;
}

.el-logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.el-nav-list {
    display: flex;
    list-style: none;
    gap: 24px;
}

.el-nav-item {
    position: relative;
}

.el-nav-link {
    font-size: 15px;
    font-weight: 700;      
    font-style: italic;     
    color: var(--el-text-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--el-transition);
}

.el-nav-link:hover {
    color: var(--el-accent);
}

.el-chevron-icon {
    transition: transform 0.3s ease;
}

/* Submenus - Estrutura Padrão (Desktop) */
.el-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #ffffff;
    border-radius: 6px;
    padding: 0.5rem 0;
    min-width: 210px;
    list-style: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: var(--el-transition);
}

.el-submenu-link {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    font-style: italic;
    color: #333333;
    text-decoration: none;
    transition: var(--el-transition);
}

.el-submenu-link:hover {
    color: #ffffff;
    background-color: #000000;
}

/* Botão Hamburguer - Escondido no Desktop */
.el-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative; 
    z-index: 1200;
}

.el-menu-toggle .el-bar {
    width: 100%;
    height: 2px;
    background-color: var(--el-text-primary);
    transition: var(--el-transition);
}

/* ==========================================================================
   3. REGRAS DE INTERAÇÃO APENAS PARA DESKTOP (Telas a partir de 992px)
   --------------------------------------------------------------------------
   Isolar as regras de hover aqui evita bugs de toque lateral nos celulares.
   ========================================================================== */
@media (min-width: 992px) {
    .el-has-dropdown:hover .el-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0); /* Abre centralizado */
    }

    .el-has-dropdown:hover .el-chevron-icon {
        transform: rotate(180deg);
    }
}

/* ==========================================================================
   4. ESTILOS APENAS PARA MOBILE (Telas menores ou iguais a 991px)
   ========================================================================== */
@media (max-width: 991px) {
    .el-menu-toggle {
        display: flex;
    }

    .el-logo-container {
        height: calc(var(--el-header-height) - 30px);
    }

    /* Menu Lateral Gaveta */
    .el-nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        background-color: var(--el-bg-header);
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        padding: 100px 0 2rem 0;
        transition: var(--el-transition);
        z-index: 1050;
        overflow-y: auto;
        box-shadow: -8px 0 25px rgba(0,0,0,0.15);
    }

    .el-nav-menu.is-active {
        right: 0;
    }

    /* Lista Principal (Mobile) */
    .el-nav-list {
        flex-direction: column;
        align-items: center; 
        gap: 0.5rem;
        width: 100%;
    }

    .el-nav-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Link Principal (Mobile) */
    .el-nav-link {
        font-size: 1.4rem; 
        width: 100%;
        justify-content: center; 
        padding: 1rem 1.5rem;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Sanfona Submenu no Mobile - CENTRALIZADO E SEM TRANSLAÇÃO LATERAL */
    .el-submenu {
        position: relative;
        top: 0;
        left: 0;
        /* Força a escala e movimentação apenas para baixo, sem herdar o translateX(-50%) */
        transform: scaleY(0.95) translateY(-10px) translateX(0) !important; 
        transform-origin: top center;
        background-color: rgba(0, 0, 0, 0.12); 
        border: none;
        box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
        padding: 0;
        width: 90%; 
        margin: 0 auto; /* Centraliza perfeitamente o bloco */
        max-height: 0;
        overflow: hidden;
        display: block; 
        opacity: 0;
        visibility: hidden;
        border-radius: 8px; 
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s ease, 
                    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    padding 0.35s ease;
    }

    /* Estado Ativo/Aberto do Submenu no Mobile */
    .el-submenu.is-open {
        max-height: 500px; 
        opacity: 1;
        visibility: visible;
        /* Garante que continue sem deslocamento lateral após abrir */
        transform: scaleY(1) translateY(0) translateX(0) !important; 
        padding: 0.75rem 0;
        margin: 0.5rem auto; 
    }

    .el-submenu li {
        width: 100%;
    }

    /* Links do Submenu (Mobile) */
    .el-submenu-link {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.15rem; 
        text-align: center; 
        color: var(--el-text-primary);
        display: block;
        transition: background-color 0.2s ease;
    }
    
    .el-submenu-link:hover,
    .el-submenu-link:active {
        background-color: rgba(0, 0, 0, 0.25); 
    }

    /* Rotação do ícone de seta no Mobile */
    .el-has-dropdown.is-open .el-chevron-icon {
        transform: rotate(180deg);
    }

    /* Transformação dos traços do botão hambúrguer ao ativar */
    .el-menu-toggle.is-active .el-bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
        background-color: var(--el-text-primary);
    }
    .el-menu-toggle.is-active .el-bar:nth-child(2) {
        transform: translateY(-6px) rotate(-45deg);
        background-color: var(--el-text-primary);
    }
}