/* Estilos para arreglar el scroll en móvil */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Asegurar que el contenido principal sea scrolleable */
main, .container, .row {
    position: relative;
    overflow: visible;
}

/* Ajustes para el menú móvil */
.mobile-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
    display: none; /* Se muestra con media query */
    padding: 10px 0 !important;
    height: auto !important;
    border-top: 1px solid #eee !important;
}

.mobile-menu ul {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.mobile-menu li {
    text-align: center !important;
    flex: 1 !important;
}

.mobile-menu a {
    color: #666 !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    font-size: 11px !important;
    padding: 5px !important;
}

.mobile-menu a.active {
    color: #ED8161 !important; /* Color primario */
}

.mobile-menu iconify-icon {
    font-size: 24px !important;
    margin-bottom: 2px !important;
}

/* Ajustes para el carrito lateral */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 10001 !important; /* Encima del menú */
    transition: right 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px; /* Espacio para el menú móvil */
}

.cart-sidebar.active {
    right: 0;
}

/* Ajustes para modales */
.modal {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    z-index: 10002 !important; /* Encima de todo */
}

/* Ajustes para el preloader */
.preloader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

/* Mostrar menú solo en móvil y iPad (incluyendo iPad Pro) */
@media (max-width: 1024px) {
    .mobile-menu {
        display: block !important;
    }
    body {
        padding-bottom: 80px !important;
    }
    /* Ocultar elementos de escritorio que puedan estorbar */
    .desktop-only {
        display: none !important;
    }

    /* Ocultar footer y otros elementos marcados como mobile-hide */
    .mobile-hide {
        display: none !important;
    }
    
    /* Ocultar elementos de escritorio Bootstrap */
    .d-none.d-lg-flex {
        display: none !important;
    }
    
    /* Mostrar elementos de móvil Bootstrap */
    .d-flex.d-lg-none {
        display: flex !important;
    }
    
    /* Asegurar que el carrito no se solape con el menú móvil */
    .cart-sidebar {
        height: calc(100vh - 70px) !important;
        bottom: 70px !important;
        top: 0 !important;
    }
}

/* Utilidad para ancho automático responsivo */
@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}
