/**
 * MEJORAS RESPONSIVE PARA MOBILE
 * Archivo: assets/css/mobile-optimizations.css
 * Propósito: Sobreescribir estilos para pantallas pequeñas
 * 
 * Incluir en index.html DESPUÉS de style.css:
 * <link rel="stylesheet" href="assets/css/mobile-optimizations.css">
 */

/* ============================================
   BREAKPOINTS ESTÁNDAR
   ============================================
   - xs: 0px - 576px (Móvil pequeño)
   - sm: 576px - 768px (Móvil grande)
   - md: 768px - 992px (Tablet)
   - lg: 992px - 1200px (Desktop)
   - xl: 1200px+ (Desktop grande)
*/

/* ============================================
   PANTALLAS MUY PEQUEÑAS (< 480px)
   ============================================ */
@media (max-width: 480px) {
    
    /* Reducir padding general */
    body {
        font-size: 14px;
    }
    
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero Section */
    .hero-section {
        flex-direction: column;
        padding: 20px 15px;
    }
    
    .hero-left {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .hero-title {
        font-size: 24px !important;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .hero-right {
        width: 100%;
    }
    
    .hero-img {
        max-height: 250px;
        object-fit: cover;
    }
    
    .circle-deco {
        display: none; /* Ocultar decoraciones en móvil */
    }
    
    /* Botones */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px !important;
        font-size: 14px !important;
        width: 100%;
    }
    
    .btn-animated {
        width: 100%;
    }
    
    /* Stats */
    .hero-stats {
        justify-content: space-around !important;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stat-block {
        flex: 0 0 45%;
        text-align: center;
    }
    
    .stat-number {
        font-size: 20px !important;
    }
    
    .stat-label {
        font-size: 12px !important;
    }
    
    /* Carousel de Categorías */
    .carousel slide {
        padding: 0;
    }
    
    .carousel-control-prev, .carousel-control-next {
        width: 8%;
    }
    
    .carousel-control-prev-icon, .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }
    
    .category-card {
        margin-bottom: 15px !important;
        padding: 15px !important;
    }
    
    .category-title {
        font-size: 16px !important;
        margin-bottom: 8px;
    }
    
    .category-desc {
        font-size: 12px !important;
        margin-bottom: 10px;
    }
    
    .category-link {
        font-size: 13px !important;
    }
    
    .category-icon-square {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Productos */
    .product-card {
        margin-bottom: 20px;
    }
    
    .product-category {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }
    
    .product-title {
        font-size: 16px !important;
        margin: 10px 0 8px 0;
    }
    
    .product-description {
        font-size: 12px !important;
        line-height: 1.4;
    }
    
    .product-features {
        font-size: 12px !important;
    }
    
    .product-features li {
        padding: 4px 0;
    }
    
    .product-price {
        font-size: 18px !important;
    }
    
    .cart-btn {
        padding: 10px 15px !important;
        font-size: 13px !important;
        border-radius: 6px;
    }
    
    .cart-btn i {
        margin-right: 5px;
    }
    
    /* Beneficios */
    .benefits-section {
        padding: 30px 15px !important;
    }
    
    .benefit-block {
        margin-bottom: 20px !important;
        text-align: center;
    }
    
    .benefit-icon {
        font-size: 40px !important;
        margin-bottom: 10px;
    }
    
    .benefit-title {
        font-size: 16px !important;
    }
    
    .benefit-desc {
        font-size: 13px !important;
    }
    
    .benefit-img {
        max-height: 300px !important;
        border-radius: 15px !important;
    }
    
    /* Contact Form */
    .contact-form-card, .contact-info-card {
        padding: 20px !important;
        margin-bottom: 20px;
    }
    
    .form-title, .info-title {
        font-size: 18px !important;
    }
    
    .contact-input {
        font-size: 14px !important;
        padding: 10px 12px !important;
        margin-bottom: 12px;
    }
    
    .info-block {
        margin-bottom: 15px !important;
    }
    
    .info-icon {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px;
        font-size: 18px !important;
    }
    
    .info-label {
        font-size: 12px !important;
    }
    
    .info-text {
        font-size: 14px !important;
    }
    
    /* Footer */
    .custom-footer {
        padding: 30px 15px !important;
    }
    
    .footer-brand-title {
        font-size: 18px !important;
    }
    
    .footer-desc {
        font-size: 13px !important;
    }
    
    .footer-title {
        font-size: 16px !important;
    }
    
    .footer-list li, .footer-help-list li {
        font-size: 13px !important;
        margin-bottom: 8px;
    }
    
    /* Menú Flotante */
    #draggable-menu {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .menu-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    .menu-item img {
        width: 35px !important;
        height: 35px !important;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 10px !important;
    }
    
    .modal-content {
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .modal-body {
        font-size: 14px;
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
    
}

/* ============================================
   MÓVILES MEDIANOS (480px - 768px)
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .product-card {
        margin-bottom: 20px;
    }
    
    .category-title {
        font-size: 18px;
    }
    
    .benefit-block {
        margin-bottom: 25px;
    }
    
    /* Carousel items como columna única en móvil */
    .carousel-item {
        display: flex;
        justify-content: center;
    }
    
    .carousel-item .row {
        width: 100%;
    }
    
    .carousel-item .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
}

/* ============================================
   MEJORAS GENERALES PARA TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    
    /* Aumentar área de click */
    button, a, .cart-btn, .category-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remover hover states que no funcionan en touch */
    .product-card:hover {
        transform: none;
    }
    
    /* Mejorar contraste para legibilidad en sol */
    .hero-title {
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    /* Botones más grandes */
    .btn {
        font-size: 16px !important;
        padding: 12px 24px !important;
    }
    
}

/* ============================================
   CORRECCIONES PARA VIEWPORT ESPECIALES
   ============================================ */

/* Landscape mode en móviles pequeños */
@media (max-height: 500px) {
    .hero-section {
        padding: 15px;
    }
    
    .hero-left {
        margin-bottom: 15px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-img {
        max-height: 200px;
    }
}

/* iPhone X notch compatibility */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ============================================
   OPTIMIZACIONES DE PERFORMANCE
   ============================================ */

/* Utilizar GPU para animaciones */
.logo-img, .hero-img, .product-img {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reducir animaciones en dispositivos menos potentes */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   DARK MODE SUPPORT (Opcional - Futuro)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Aquí agregarían estilos para dark mode */
    /* Por ahora no es necesario */
}

/* ============================================
   ORIENTACIÓN ESPECÍFICA
   ============================================ */

/* Retratos verticales */
@media (orientation: portrait) {
    body {
        /* Sin cambios especiales necesarios */
    }
}

/* Paisaje horizontal */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        min-height: auto;
    }
    
    .hero-stats {
        display: none; /* Ocultar en paisaje pequeño para ahorrar espacio */
    }
}

/* ============================================
   FIXES PARA NAVEGADORES ESPECÍFICOS
   ============================================ */

/* Safari iOS */
@supports (-webkit-touch-callout: none) {
    .cart-btn {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 10px;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    .modal {
        position: fixed;
        /* Fix para Firefox en móvil */
    }
}

/* ============================================
   IMPRESIÓN / PRINT
   ============================================ */

@media print {
    .menu, .custom-header, .custom-footer, .contact-form-card {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ============================================
   FIN DE MOBILE OPTIMIZATIONS
   ============================================ */
