/* 
 * ESTILOS ADICIONALES PARA MÓVILES Y TABLETS
 * Mejoras específicas para la experiencia móvil
 */

/* ============================================
   BREAKPOINTS PERSONALIZADOS
   ============================================ */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    
    /* Navbar móvil */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Hero section móvil */
    .hero-section {
        /* padding: 40px 0; */
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-right: 0 !important;
    }
    
    /* Cards de productos móvil */
    .product-card {
        margin-bottom: 15px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-text {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    /* Botones móvil */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    /* Formularios móvil */
    .form-control {
        padding: 15px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    /* Carrito móvil */
    .cart-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-item {
        padding: 10px 0;
    }
    
    .quantity-input {
        width: 50px;
        font-size: 0.9rem;
    }
    
    /* Categorías móvil */
    .category-card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .category-icon {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    /* Footer móvil */
    footer .col-md-4 {
        margin-bottom: 25px;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 15px;
    }
    
    /* Paginación móvil */
    .page-link {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
        margin: 0 2px;
    }
    
    /* Búsqueda móvil */
    .d-flex.me-3 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Alertas móvil */
    .alert {
        margin: 10px;
        border-radius: 8px;
    }
}

/* ============================================
   SMALL DEVICES (landscape phones, 576px and up)
   ============================================ */

@media (min-width: 576px) and (max-width: 767.98px) {
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .product-image {
        height: 220px;
    }
    
    .category-card {
        padding: 25px;
    }
    
    .cart-image {
        width: 60px;
        height: 60px;
    }
    
    .quantity-input {
        width: 60px;
    }
}

/* ============================================
   MEDIUM DEVICES (tablets, 768px and up)
   ============================================ */

@media (min-width: 768px) and (max-width: 991.98px) {
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .product-image {
        height: 230px;
    }
    
    .cart-image {
        width: 70px;
        height: 70px;
    }
    
    .quantity-input {
        width: 70px;
    }
}

/* ============================================
   MEJORAS TÁCTILES PARA DISPOSITIVOS MÓVILES
   ============================================ */

/* Área táctil mínima de 44px para iOS */
@media (max-width: 991.98px) {
    
    .btn, .page-link, .form-control, .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Botones de carrito más grandes en móvil */
    .btn-add-cart, .btn-remove-cart {
        min-height: 48px;
        font-weight: 600;
    }
    
    /* Enlaces de navegación más espaciados */
    .navbar-nav .nav-link {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    /* Dropdowns más amigables para móvil */
    .dropdown-menu {
        min-width: 200px;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ============================================
   OPTIMIZACIONES PARA PANTALLAS TÁCTILES
   ============================================ */

/* Hover states solo para dispositivos no táctiles */
@media (hover: hover) and (pointer: fine) {
    .product-card:hover,
    .category-card:hover,
    .btn:hover {
        transform: translateY(-5px);
    }
}

/* Para dispositivos táctiles, usar active en lugar de hover */
@media (hover: none) and (pointer: coarse) {
    .product-card:active,
    .category-card:active,
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Quitar transformaciones hover en móvil */
    .product-card:hover,
    .category-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* ============================================
   MEJORAS ESPECÍFICAS PARA LA NAVEGACIÓN MÓVIL
   ============================================ */

@media (max-width: 991.98px) {
    
    /* Navbar colapsable mejorado */
    .navbar-collapse {
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 10px;
    }
    
    /* Búsqueda en móvil */
    .navbar .d-flex {
        order: -1;
        width: 100%;
        margin-bottom: 15px;
        margin-right: 0 !important;
    }
    
    /* Carrito en móvil */
    .navbar .nav-item:has(.fa-shopping-cart) {
        order: 1;
    }
    
    /* Badge del carrito más visible en móvil */
    .badge {
        font-size: 0.7rem;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
    }
}

/* ============================================
   OPTIMIZACIONES PARA RENDIMIENTO EN MÓVIL
   ============================================ */

/* Reducir animaciones en dispositivos de baja potencia */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   MODO OSCURO PARA MÓVILES
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Estas reglas se pueden activar si se desea soporte para modo oscuro */
    /*
    :root {
        --primary-color: #0d6efd;
        --secondary-color: #6c757d;
        --background-color: #121212;
        --text-color: #ffffff;
    }
    
    body {
        background-color: var(--background-color);
        color: var(--text-color);
    }
    
    .card {
        background-color: #1e1e1e;
        border-color: #333;
    }
    */
}

/* ============================================
   LANDSCAPE ORIENTATION ESPECÍFICO
   ============================================ */

@media screen and (orientation: landscape) and (max-height: 500px) {
    
    /* Ajustes para landscape en móviles */
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* ============================================
   UTILITIES ESPECÍFICAS PARA MÓVIL
   ============================================ */

/* Clases utilitarias para mostrar/ocultar en móvil */
@media (max-width: 767.98px) {
    .d-mobile-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-flex {
        display: flex !important;
    }
}

@media (min-width: 768px) {
    .d-desktop-none {
        display: none !important;
    }
}
