/**
 * Estilos adicionales para el catálogo y productos
 * Complementa Tailwind CSS con estilos específicos del tema
 */

/* ==================== 
   UTILIDADES GENERALES 
   ==================== */

/* Clases para truncar texto */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animaciones suaves */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover elevación */
.hover-lift:hover {
    transform: translateY(-5px);
}

/* ==================== 
   CATÁLOGO - RESPONSIVE 
   ==================== */

/* Grid de productos responsivo */
@media (max-width: 640px) {
    #productos-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1.5rem;
    }
    
    /* Filtros en mobile */
    .filtro-categoria {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }
    
    /* Scroll horizontal para filtros en mobile */
    .filtros-container {
        overflow-x: auto;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filtros-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .filtros-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 2px;
    }
    
    .filtros-container::-webkit-scrollbar-thumb {
        background: #1d9bdd;
        border-radius: 2px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    #productos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #productos-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem;
    }
}

/* ==================== 
   PRODUCTO INDIVIDUAL 
   ==================== */

/* Breadcrumb responsive */
@media (max-width: 640px) {
    .breadcrumb-container {
        font-size: 0.75rem;
        padding: 1rem 0;
    }
    
    .breadcrumb-container span {
        margin: 0 0.25rem;
    }
}

/* Layout del producto en mobile */
@media (max-width: 1024px) {
    .producto-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .producto-galeria {
        order: 1;
    }
    
    .producto-info {
        order: 2;
    }
}

/* Thumbnails de galería */
.thumbnail-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .thumbnail-grid {
        gap: 0.5rem;
    }
    
    .thumbnail-btn {
        width: 4rem;
        height: 4rem;
    }
}

/* ==================== 
   PAGINACIÓN 
   ==================== */

/* Paginación responsive */
@media (max-width: 640px) {
    .paginacion-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .paginacion-ajax-btn,
    .paginacion-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-width: 2.5rem;
    }
}

/* ==================== 
   ANIMACIONES Y EFECTOS 
   ==================== */

/* Fade in para productos */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay para animaciones */
.fade-in:nth-child(1) { transition-delay: 0s; }
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in:nth-child(6) { transition-delay: 0.5s; }

/* Hover effects */
.producto-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.producto-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==================== 
   BADGES Y ETIQUETAS 
   ==================== */

.categoria-badge {
    background: linear-gradient(135deg, #1d9bdd, #1d4ed8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stock-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stock-disponible {
    background-color: #dcfce7;
    color: #166534;
}

.stock-bajo-pedido {
    background-color: #fef3c7;
    color: #92400e;
}

.stock-agotado {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ==================== 
   FORMULARIOS Y BOTONES 
   ==================== */

/* Botones con gradiente */
.btn-gradient {
    background: linear-gradient(135deg, #1d9bdd, #1d4ed8);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}

/* Botones outline */
.btn-outline {
    background: transparent;
    border: 2px solid #1d9bdd;
    color: #1d9bdd;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-outline:hover {
    background: #1d9bdd;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.3);
}

/* ==================== 
   ACCESSIBILITY 
   ==================== */

/* Focus states */
.filtro-categoria:focus,
.paginacion-ajax-btn:focus,
.btn-gradient:focus,
.btn-outline:focus {
    outline: 2px solid #1d9bdd;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 
   PRINT STYLES 
   ==================== */

@media print {
    .filtro-categoria,
    .paginacion-container,
    #productos-loader {
        display: none !important;
    }
    
    .producto-item {
        break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .bg-blue-500,
    .bg-blue-600 {
        background-color: #374151 !important;
    }
}

/* ==================== 
   DARK MODE SUPPORT 
   ==================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
}

/* ==================== 
   CUSTOM SCROLLBARS 
   ==================== */

/* Webkit scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}