/* ============================================ */
/* RESPONSIVE - VERSIÓN MÓVIL COMPLETA */
/* ============================================ */

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    /* Navbar */
    nav .grid-cols-3 {
        grid-template-columns: 1fr 1fr !important;
    }

    nav .text-xl {
        font-size: 0.875rem !important;
    }

    nav .h-12 {
        height: 32px !important;
    }

    /* Hero */
    .hero-slider-container {
        height: 40vh !important;
        min-height: 250px !important;
    }

    .hero-slide img {
        height: 40vh !important;
    }

    .hero-content h1 {
        font-size: 1.25rem !important;
    }

    .hero-content p {
        font-size: 0.75rem !important;
    }

    .hero-btn {
        padding: 0.4rem 1rem !important;
        font-size: 0.7rem !important;
    }

    /* Pestañas */
    .tab-btn {
        padding: 0.25rem 0.75rem !important;
        font-size: 0.7rem !important;
    }

    /* Grid propiedades */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Tarjetas */
    .card img {
        height: 150px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    .card-price {
        font-size: 16px !important;
    }

    /* Footer */
    footer .grid {
        gap: 20px !important;
    }

    .slider-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }

    .slider-dot {
        width: 5px !important;
        height: 5px !important;
    }
}

/* Tablets (481px a 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-slider-container {
        height: 50vh !important;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-content h1 {
        font-size: 1.75rem !important;
    }

    .tab-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

/* Desktop pequeño (769px a 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop normal (1025px a 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Desktop grande (1281px en adelante) */
@media (min-width: 1281px) {
    .grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============================================ */
/* OPTIMIZACIONES GENERALES */
/* ============================================ */

/* Transiciones suaves para todos los elementos interactivos */
a,
button,
.card {
    transition: all 0.3s ease;
}

/* Sombra más sutil en hover de tarjetas */
.card:hover {
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Botón flotante de WhatsApp más pequeño en móvil */
@media (max-width: 640px) {
    .fixed.bottom-6.right-6 {
        bottom: 16px !important;
        right: 16px !important;
        padding: 10px !important;
    }

    .fixed.bottom-6.right-6 i {
        font-size: 1rem !important;
    }
}

/* Panel admin - menú responsivo */
@media (max-width: 768px) {
    .bg-white.border-b .flex {
        overflow-x: auto;
        gap: 12px;
    }

    .bg-white.border-b .flex a {
        padding: 12px 8px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Tablas admin con scroll horizontal */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
}

/* Dashboard admin - tarjetas responsivas */
@media (max-width: 640px) {
    .admin-dashboard .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

/* Mejora de accesibilidad */
a:focus,
button:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* ============================================ */
/* CORRECCIÓN NAVBAR RESPONSIVO */
/* ============================================ */

/* Móvil (grid-cols-2) - Logo izquierda, Hora derecha */
nav .grid-cols-2 {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    width: 100% !important;
}

nav .grid-cols-2 > div:first-child {
    justify-self: start !important;
    text-align: left !important;
}

nav .grid-cols-2 > div:last-child {
    justify-self: end !important;
    text-align: right !important;
}

/* Desktop (grid-cols-3) - Logo izquierda, centro vacío, hora derecha */
@media (min-width: 768px) {
    nav .grid-cols-3 {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        width: 100% !important;
    }

    nav .grid-cols-3 > div:first-child {
        justify-self: start !important;
        text-align: left !important;
    }

    nav .grid-cols-3 > div:last-child {
        justify-self: end !important;
        text-align: right !important;
    }
}
