/* Estilos para el menú móvil */

/* Cabecera móvil */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 80px;
    padding: 1rem !important;
    display: none; /* Inicialmente oculto, se mostrará con JS */
}

/* Ajustes para el logo en el menú móvil */
.mobile-header .navbar-brand.logo-head {
    height: 55px;
    width: 200px;
    background: url(/o/energia-theme/images/logo-BE-mobile.svg);
    background-size: contain; /* Ajusta el tamaño para mantener la nitidez */
    background-position: left center;
    background-repeat: no-repeat;
    transition: all .4s;
    text-decoration: none;
    color: transparent;
    margin-right: 0;
    image-rendering: -webkit-optimize-contrast; /* Mejora la nitidez en Chrome/Safari */
    image-rendering: crisp-edges; /* Mejora la nitidez en Firefox */
}

.mobile-header-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: flex-start;
}

/* Estilo para el botón hamburguesa */
.burger {
    position: relative;
    width: 35px;
    height: 25px;
    background: transparent;
    cursor: pointer;
    display: block;
}

.burger input {
    display: none;
}

.burger span {
    display: block;
    position: absolute;
    height: 4px;
    width: 100%;
    background: black;
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.burger span:nth-of-type(1) {
    top: 0px;
    transform-origin: left center;
}

.burger span:nth-of-type(2) {
    top: 50%;
    transform: translateY(-50%);
    transform-origin: left center;
}

.burger span:nth-of-type(3) {
    top: 100%;
    transform-origin: left center;
    transform: translateY(-100%);
}

.burger input:checked ~ span:nth-of-type(1) {
    transform: rotate(45deg);
    top: 3px;
    left: 5px;
}

.burger input:checked ~ span:nth-of-type(2) {
    width: 0%;
    opacity: 0;
}

.burger input:checked ~ span:nth-of-type(3) {
    transform: rotate(-45deg);
    top: 28px;
    left: 5px;
}

/* Sidebar menú móvil */
#mobileSidebar.mobile-sidebar {
    width: 100%; /* Ocupa todo el ancho de la pantalla */
    height: calc(100vh - 80px);
    background-color: #ffffff;
    color: #000000;
    padding: 15px;
    position: fixed;
    top: 80px;
    left: -100%; /* Inicialmente oculto */
    z-index: 1000;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: scroll; /* Garantizar scroll vertical en iOS */
    -webkit-overflow-scrolling: touch; /* Mejorar scroll en iOS */
    display: none; /* Inicialmente oculto, se mostrará con JS */
    text-align: center; /* Centrar el texto */
}

#mobileSidebar.mobile-sidebar.active {
    left: 0;
}

#mobileSidebar.mobile-sidebar ul {
    list-style: none;
    padding: 15px 0;
    margin: 0 auto; /* Centrar horizontalmente */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrar elementos horizontalmente */
    width: 100%; /* Asegurar que ocupa todo el ancho disponible */
    max-width: 300px; /* Limitar el ancho para mejor apariencia */
}

#mobileSidebar.mobile-sidebar ul li {
    margin: 15px 0;
    width: 100%;
    text-align: center; /* Centrar el texto */
}

#mobileSidebar.mobile-sidebar ul li a {
    text-decoration: none;
    color: #000000;
    display: block; /* Cambio a block para mejor compatibilidad con iOS */
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1.3em;
    font-weight: 500;
    text-align: center;
}

#mobileSidebar.mobile-sidebar ul li a:hover {
    background-color: #f5f5f5;
    transform: scale(1.02);
}

.icon {
    margin-right: 15px;
}

/* Clase para el menú hamburguesa activo */
.burger.active span:nth-of-type(1) {
    transform: rotate(45deg);
    top: 3px;
    left: 5px;
}

.burger.active span:nth-of-type(2) {
    width: 0%;
    opacity: 0;
}

.burger.active span:nth-of-type(3) {
    transform: rotate(-45deg);
    top: 28px;
    left: 5px;
}

/* Para dispositivos muy pequeños */
@media (max-width: 320px) {
    #mobileSidebar.mobile-sidebar ul li a {
        font-size: 1.1em;
        padding: 10px;
    }
}