/* ================================
   HEADER GENERAL
   ================================ */
#header {
    background: rgba(0, 0, 0, 1) !important;
    transition: background-color 0.3s ease-in-out !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

#header.transparent {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ================================
   HEADER TOP (Dirección y redes)
   ================================ */
#header .header-top {
    height: auto !important;
    min-height: 24px !important;
    margin-top: 5px !important;
    background: transparent !important;
    transition: min-height 0.4s ease !important;
    overflow: visible !important;
}

/* Expandir header-top cuando el dropdown está activo - solo en desktop */
@media (min-width: 769px) {
    #header .header-top:has(#menu-usuario .menu-has-children.active) {
        min-height: 150px !important;
    }
}

#header .header-top a {
    color: #fff !important;
    font-size: 12px !important;
    text-decoration: none !important;
}

#header .header-top ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#header .top-head-left ul li,
#header .top-head-right ul li {
    display: inline-block !important;
}

#header .top-head-left ul li {
    margin-right: 10px !important;
    color: #ffffff !important;
    padding-top: 8px !important;
    line-height: 1.5 !important;
}

#header .top-head-left ul li a {
    color: #ffffff !important;
}

#header .top-head-right ul {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

#header .top-head-right ul li {
    margin-left: 10px !important;
}

#header .top-head-right ul li a {
    transition: all 0.3s ease 0s !important;
    color: #ffffff !important;
}

/* ================================
   LOGO
   ================================ */
#header #logo img {
    max-height: 60px !important;
}

/* ================================
   MENÚ PRINCIPAL
   ================================ */
#header .nav-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

#header .nav-menu > li {
    position: relative !important;
    margin-left: 25px !important;
}

#header .nav-menu a {
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 500 !important;
    padding: 0px 0 !important;
    display: block !important;
    transition: all 0.3s ease-in-out !important;
    position: relative !important;
}

#header .nav-menu a:hover {
    color: #ff8c42 !important;
}

#header .nav-menu a::after {
    content: '' !important;
    position: absolute !important;
    width: 0 !important;
    height: 2px !important;
    bottom: 0 !important;
    left: 0 !important;
    background-color: #ff8c42 !important;
    transition: width 0.3s ease-in-out !important;
}

#header .nav-menu a:hover::after {
    width: 100% !important;
}

/* ================================
   DROPDOWN MENÚ
   ================================ */
#header .menu-has-children > ul {
    position: absolute !important;
    top: calc(100% + 15px) !important;
    left: 0 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0px !important;
    min-width: 100px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.2s ease-in-out !important;
    z-index: 999 !important;
}

#header .menu-has-children:hover > ul {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

#header .menu-has-children ul li {
    margin: 0 !important;
}

#header .menu-has-children ul a {
    padding: 8px 15px !important;
    color: #fff !important;
    font-weight: normal !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Sub-dropdowns */
#header .menu-has-children ul .menu-has-children ul {
    left: 100% !important;
    top: 0 !important;
}

/* ================================
   ICONO DE FLECHA EN SUBMENÚ
   ================================ */
.nav-menu li.menu-has-children > a:after {
    content: '\f107';
    font-family: FontAwesome;
    margin-left: 5px;
    font-size: 10px;
}

/* ================================
   INTERACCIÓN EN SUBMENÚS
   ================================ */
.nav-menu .menu-has-children ul {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    transform: translateY(-10px);
    display: block;
}

.nav-menu .menu-has-children:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .menu-has-children ul li:hover > a {
    color: #ff8c42 !important;
    background: rgba(255, 255, 255, 0.05);
}

/* ================================
   BOTÓN MENÚ HAMBURGUESA (oculto en desktop)
   ================================ */
.mobile-menu-toggle {
    display: none;
}

/* Ocultar botón duplicado generado por main.js */
#mobile-nav-toggle {
    display: none !important;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    /* Mostrar botón hamburguesa */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 1001;
        position: relative;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #fff;
        margin: 3px 0;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Ocultar navegación por defecto en móvil */
    #nav-menu-container {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        z-index: 1000;
        padding-top: 80px;
        overflow-y: auto;
    }
    
    #nav-menu-container.mobile-open {
        display: block !important;
    }
    
    #nav-menu-container .nav-menu {
        flex-direction: column !important;
        align-items: center !important;
        padding: 20px !important;
    }
    
    #nav-menu-container .nav-menu > li {
        margin: 10px 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    #nav-menu-container .nav-menu a {
        padding: 15px !important;
        font-size: 16px !important;
    }
    
    /* Submenús en móvil */
    #header .menu-has-children > ul {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: rgba(255, 255, 255, 0.1) !important;
        display: none;
        margin-top: 10px !important;
        border-radius: 8px;
    }
    
    #header .menu-has-children.mobile-submenu-open > ul {
        display: block !important;
    }
    
    #header .menu-has-children ul a {
        padding: 12px 20px !important;
    }
    
    /* Sub-submenús */
    #header .menu-has-children ul .menu-has-children ul {
        left: 0 !important;
        margin-left: 15px !important;
    }
    
    /* Logo más pequeño en móvil */
    #header #logo img {
        max-height: 45px !important;
    }
    
    /* Ajustar header en móvil */
    #header .container {
        padding: 10px 15px !important;
    }
    
    #header .row {
        justify-content: space-between !important;
    }
    
    /* Ocultar dirección en móvil para más espacio */
    #header .top-head-left {
        display: none !important;
    }
    
    #header .top-head-right {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    #header .top-head-right ul {
        justify-content: flex-end !important;
        padding-right: 50px !important;
    }

    #header .header-top {
        position: relative !important;
        min-height: auto !important;
        overflow: visible !important;
        transition: min-height 0.4s ease !important;
    }

    /* Expandir header-top cuando el dropdown está activo en móvil */
    #header .header-top:has(#menu-usuario .menu-has-children.active) {
        min-height: 180px !important;
    }

    /* ================================
       MENÚ USUARIO EN MÓVIL
       ================================ */
    #menu-usuario {
        padding-right: 0 !important;
        justify-content: flex-end !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    #menu-usuario .menu-has-children {
        min-width: auto !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        position: relative !important;
    }

    #menu-usuario .menu-has-children > a {
        min-width: auto !important;
        justify-content: flex-end !important;
        padding: 5px 0 !important;
        font-size: 12px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Dropdown en móvil - integrado en el header */
    #menu-usuario .menu-has-children > ul {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        margin-top: 12px !important;
        min-width: auto !important;
        width: 100% !important;
        text-align: right !important;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        max-height: 0 !important;
        overflow: hidden !important;
        z-index: 9999 !important;
        transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.4s ease !important;
        transform: none !important;
    }

    /* Mostrar dropdown cuando está activo en móvil */
    #menu-usuario .menu-has-children.active > ul {
        opacity: 1 !important;
        visibility: visible !important;
        max-height: 300px !important;
        overflow: visible !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    #menu-usuario .menu-has-children ul li {
        text-align: right !important;
        display: block !important;
        list-style: none !important;
        margin-bottom: 10px !important;
    }
    #menu-usuario .menu-has-children ul li:first-child {
        margin-top: 10px !important;
    }
    #menu-usuario .menu-has-children ul li:last-child {
        margin-bottom: 0 !important;
    }

    #menu-usuario .menu-has-children ul a {
        justify-content: flex-end !important;
        min-width: auto !important;
        padding: 8px 0 !important;
        font-size: 14px !important;
        border-bottom: none !important;
        display: flex !important;
        color: white !important;
        background: transparent !important;
        line-height: 1.5 !important;
    }

    #menu-usuario .menu-has-children ul li:last-child a {
        border-bottom: none !important;
    }

    /* Deshabilitar hover en móvil - solo click */
    #menu-usuario .menu-has-children:hover > ul {
        opacity: 0 !important;
        visibility: hidden !important;
        max-height: 0 !important;
    }

    /* Asegurar que active sobrescriba hover */
    #menu-usuario .menu-has-children.active:hover > ul {
        opacity: 1 !important;
        visibility: visible !important;
        max-height: 200px !important;
    }
}

@media (max-width: 768px) {
    .nuevo-footer {
        width: 100% !important;
        padding: 40px 0 !important;
        margin: 0 !important;
    }

    .footer-contenedor {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 30px;
        padding: 0 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .footer-columna {
        flex: 1 1 100%;
        width: 100%;
    }

    .footer-formulario {
        flex-direction: column;
        border-radius: 10px;
    }

    .footer-formulario input {
        border-radius: 10px 10px 0 0;
        text-align: center;
        padding: 12px 15px;
    }

    .footer-formulario button {
        border-radius: 0 0 10px 10px;
        padding: 12px 15px;
    }

    .footer-redes {
        justify-content: center;
    }

    .footer-titulo {
        font-size: 1.1rem;
    }

    .footer-texto {
        font-size: 0.9rem;
    }

    .nuevo-footer {
        padding: 40px 0;
    }
}

@media (max-width: 576px) {
    .nuevo-footer {
        padding: 30px 0 !important;
        width: 100% !important;
    }

    .footer-contenedor {
        gap: 25px;
        padding: 0 15px !important;
    }

    .footer-titulo {
        font-size: 1rem;
    }

    .footer-texto {
        font-size: 0.85rem;
    }

    .footer-redes a {
        padding: 8px;
        font-size: 14px;
    }

    .footer-copyright {
        font-size: 0.75rem;
    }

    /* Menú usuario en pantallas pequeñas */
    #menu-usuario .menu-has-children > a {
        font-size: 12px !important;
        padding: 8px 0 !important;
    }

    #menu-usuario .menu-has-children ul a {
        font-size: 12px !important;
        padding: 6px 0 !important;
    }
}

/* ================================
   ESTILOS FOOTER
   ================================ */
.nuevo-footer {
    background-color: #0e0e0e; 
    color: #f1f1f1;
    padding: 50px 0;
    font-family: 'Poppins', sans-serif;
    border-top: 2px solid #b14a3b;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.footer-contenedor {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-columna {
    flex: 1 1 200px;
}

.footer-titulo {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid #b14a3b;
    display: inline-block;
    padding-bottom: 5px;
}

.footer-texto {
    color: #dcdcdc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-formulario {
    display: flex;
    background-color: #1a1a1a;
    border-radius: 30px;
    overflow: hidden;
}

.footer-formulario input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    background: none;
    color: #fff;
    outline: none;
    font-size: 0.95rem;
}

.footer-formulario button {
    background-color: #b14a3b;
    border: none;
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.footer-formulario button:hover {
    background-color: #d65a4a;
}

.footer-redes {
    display: flex;
    gap: 15px;
}

.footer-redes a {
    color: #fff;
    background-color: #1a1a1a;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.footer-redes a:hover {
    background-color: #b14a3b;
    transform: scale(1.1);
}

.footer-copyright {
    color: #777;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* ================================
   MENU USUARIO EN HEADER TOP
   ================================ */
#menu-usuario {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-right: 30px;
    display: flex;
    height: auto;
    align-items: flex-start;
    justify-content: flex-end;
}

#menu-usuario > li {
    display: inline-block;
    margin-left: 0;
    position: relative;
}

#menu-usuario > li > a {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 5px 0;
    display: inline-block;
}

#menu-usuario > li > a:hover {
    color: #ff8c42 !important;
}

#menu-usuario .menu-has-children {
    position: relative;
    min-width: 200px;
}

/* Trigger (nombre usuario) - primer elemento de la lista con fondo transparente */
#menu-usuario .menu-has-children > a {
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 0 !important;
    margin-top: 0 !important;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    background: transparent;
    transition: all 0.4s ease;
    width: 100%;
    border: none;
    border-radius: 0;
    min-width: 200px;
}

#menu-usuario .menu-has-children > a:hover {
    color: #ff6600 !important;
}

/* Color naranja cuando el dropdown está activo */
#menu-usuario .menu-has-children.active > a {
    color: #ff6600 !important;
}

#menu-usuario .menu-has-children > a i {
    font-size: 16px;
}

/* Dropdown panel - completamente transparente */
#menu-usuario .menu-has-children > ul {
    position: absolute;
    top: calc(100% - 6px);
    margin-top: -18px !important;
    right: 0;
    left: auto;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease !important;
    z-index: 9999;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
    transform: none !important;
    min-width: 200px;
    width: 100%;
}

/* DESHABILITAR hover para menú de usuario - solo click */
#menu-usuario .menu-has-children:hover > ul {
    opacity: 0 !important;
    visibility: hidden !important;
    max-height: 0 !important;
}

/* Mostrar panel cuando tiene clase active (click) */
#menu-usuario .menu-has-children.active > ul {
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 250px !important;
}

#menu-usuario .menu-has-children ul li {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
    list-style: none !important;
}

/* Items del dropdown - continuación de la lista con mismo ancho */
#menu-usuario .menu-has-children ul a {
    padding: 8px 0px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    transition: all 0.4s ease !important;
    white-space: nowrap !important;
    position: relative !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-bottom: none !important;
    min-width: 200px !important;
    justify-content: flex-end !important;
}

#menu-usuario .menu-has-children ul a:hover {
    color: #ff6600 !important;
}

#menu-usuario .menu-has-children ul a i {
    font-size: 16px;
    width: 10px;
    text-align: center;
}

/* ================================
   MODAL SESION EXPIRADA
   ================================ */
.session-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.session-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.session-modal-content {
    background: #1a1a1a;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border-top: 4px solid #b14a3b;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.session-modal-overlay.active .session-modal-content {
    transform: translateY(0);
}

.session-modal-icon {
    font-size: 60px;
    color: #b14a3b;
    margin-bottom: 20px;
}

.session-modal-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #fff;
    font-weight: 600;
}

.session-modal-message {
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.6;
    font-size: 15px;
}

.session-modal-btn {
    background-color: #b14a3b;
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(177, 74, 59, 0.3);
}

.session-modal-btn:hover {
    background-color: #d65a4a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(177, 74, 59, 0.5);
}
