/* Estilos generales del header - Judit*/
/* Header con ajuste a ancho del contenedor */
header {
    margin-bottom:40px;/*Esto hay que sacarlo es solo para diferencia elheader*/
    background-color: white;
    color: #ad0103;
    padding: 10px 0; /* Ajusta el padding para que el header no tenga exceso de espacio */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; /* Asegura que el header ocupe todo el ancho disponible */
}

header img {
    max-height: 70px;
    width: auto; /* Asegura que el logo no se estire */
}

.menu-toggle {
    font-size: 1.7rem;
    font-weight: bold; 
    padding-left:8rem;
    background: none;
    border: none;
    color: #ad0103;
    cursor: pointer;
}

/* Navbar para móviles */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    background: white;
   /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
    border-radius: 5px;
    width: 150px;   
}

nav ul.active {
    display: flex;
   /* margin-top:2px;*/
}

nav ul li {
    text-align: center;
    /*padding: 10px;*/
}

nav ul li a {
    text-decoration: none;
    color: #ad0103;
    font-size: 18px;
    display: block;
    padding: 0;
    width: 100%;
}


nav ul li a:hover {
    background-color: #f8f8f8;
    text-decoration: none;
    border-radius: 5px;     
    color: #ad0103;
}

/* Estilos para el footer - Judit*/
footer {
    background-color: #ad0103; 
    color: #f8f8f8;             
    padding: 20px 0;           
    text-align: center;        
    font-size: 0.8rem;     
    width:100%;
    bottom: 0px;
    margin-top: auto;   
}

footer p {
    margin: 5px;                  
    font-weight: normal;     
}

.submenu-admin {
    display: none;
    flex-direction: column;
    position: absolute; /* o "fixed" si lo deseas fijo en la pantalla */
    top: 20%; /* Lo posicionamos debajo del elemento principal */
    background-color: white;
    color: #212529;
    list-style-type: none;
    z-index: 999;
    list-style: none;
    padding: 1rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 150px;
    justify-content: center;
}
.submenu-admin li{
    padding: 5px;

}
.submenu-admin.open {
    max-height: 200px;
    gap: 5px;
}

.submenu-admin.active {
    display: block;
}
.menu li:hover .submenu-admin  {
    display: block;
}

.menu {
    list-style: none;
    position: absolute;
    margin: 60px 90px 0 0;
    padding: 0;
    gap: 1rem;
    /*display: none; Inicialmente oculto en dispositivos móviles */
    text-align: start;
    background-color: white;
    z-index: 999; /* Asegúrate de que el menú esté por encima de otros elementos */
    display: flex !important;
    flex-direction: column;
    box-shadow: none;
}

.logout-btn{
    width: 100%;
}

/* Asegurarse de que los <ul> y <li> se vean bien */
.header-navegacion-lateral nav ul {
    list-style: none;
    padding: 0;
}

.header-navegacion-lateral nav li {
    margin-bottom: 1rem;
}

.header-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}
.navbar-admin {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100%;
    background-color: #fff;
    transition: right 0.3s ease;
    z-index: 999;
    padding: 2rem 1rem;
    justify-content: flex-start;
    align-items: start;
}

.navbar-admin.open {
    right: 0;
    justify-content: flex-start;
}

.menu li {
    margin-bottom: 1rem;
}

.menu a, .submenu-toggle {
    text-decoration: none;
    font-size: 1rem;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    padding: 10px;
}

@media (max-width: 767px) {
    /* Solo se aplica a header con clase .header-navegacion-lateral */
    .header-navegacion-lateral nav {
        position: fixed;
        top: 0;
        right: -100%; /* Oculto fuera de la pantalla */
        width: 75%;
        max-width: 300px;
        height: 100%;
        background-color: white;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
        padding: 2rem 1rem;
    }
    .header-navegacion-lateral nav ul {
        display: flex !important;
        flex-direction: column;
        margin-top: 60px;
        margin-right: 90px;
        gap: 1rem;
        box-shadow: none;
    }
    nav ul li {
        text-align: left;
        padding: 0;
        margin-bottom: 10px;
    }
    nav ul li a{
        text-decoration: none;
        color: #ad0103;
        font-size: 18px;
        display: block;
        padding: 0;
    }
    /* Cuando se activa la clase 'open', se muestra desde la derecha */
    nav.open {
        right: 0;
    }
    /* Estilos para el botón del menú */
    .menu-toggle {
        font-size: 1.5rem;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1000;
    }
}

@media (min-width: 768px) {
    header {
        padding: 15px 0; 
        margin-bottom:40px;
    }

   
    h1 {
        font-size: 2rem;
    }

    .menu-toggle {
        display: none;
    }
    nav ul {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        box-shadow: none;
        width: auto;
        align-items: center;
    }
    .menu {
        display: flex;
        justify-content: center;
        text-align: center;
        position: static;
        flex-direction: row;
        gap: 2rem;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    nav ul li {
        padding-right: 0;
    }
    nav ul li a{
        font-size: inherit;
    }
    footer {
        padding: 30px 0;       
        font-size: 1rem;  
    }
    
    .header-navegacion-lateral nav {
        position: static;
        width: auto;
        height: auto;
        background: none;
        box-shadow: none;
        display: block;
        padding: 0;
        right: 0;
    }
    .header-navegacion-lateral nav ul {
        display: flex;
        gap: 1rem;
    }
    .header-navegacion-lateral nav li {
    margin-bottom: 0;
    }
    .header-navegacion-lateral .menu-toggle {
        display: none;
    }
    .navbar-admin {
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
        padding: 0px;
        display: block;
        right: 0;
        box-shadow: none;
        transform: none;
    }
    .menu li {
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
        position: relative;
        width: 100%;
        height: 100%;
    }
    .has-submenu:hover .submenu-admin {
        display: block;
    }
    .submenu-admin{
        top: 100%; /* Lo posicionamos debajo del elemento principal */
        margin-right: 200px;
        position: absolute;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        padding: 0.5rem 0;
        display: none;
    }
    .submenu-toggle {
        cursor: pointer;
        pointer-events: none; /* evita clics en desktop */
    }
    .submenu-toggle:hover{
        color: #ad0103;
    }



}
