/**
 * ============================================
 * QUIMEG - Estilos de Paginación
 * ============================================
 * Archivo: pagination.css
 * Ubicación: D:\xampp\htdocs\quimeg\css\pagination.css
 * Fecha: 2025-11-04
 * 
 * Descripción:
 * Estilos para el sistema de paginación del catálogo de productos
 * ============================================
 */

/* ========================================
   CONTENEDOR DE PAGINACIÓN
======================================== */
.pagination-container {
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

/* ========================================
   INFORMACIÓN DE RESULTADOS
======================================== */
.pagination-info {
    color: #666;
    font-size: 0.95rem;
    text-align: center;
}

.pagination-info strong {
    color: #0066cc;
    font-weight: 600;
}

/* ========================================
   CONTROLES DE PAGINACIÓN
======================================== */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f8f9fa;
    border-color: #0066cc;
    color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.pagination-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
    font-weight: 600;
    cursor: default;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn i {
    font-size: 0.9rem;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: #999;
    font-size: 1.2rem;
    line-height: 40px;
}

/* ========================================
   ESTADOS DE CARGA Y ERROR
======================================== */
.loading-state,
.error-state,
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.loading-state i,
.error-state i,
.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.loading-state i {
    color: #0066cc;
    animation: spin 1s linear infinite;
}

.error-state i {
    color: #dc3545;
}

.empty-state i {
    color: #dee2e6;
}

.loading-state p,
.error-state p,
.empty-state p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.error-state .btn {
    margin-top: 1rem;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   AJUSTES DEL GRID DE PRODUCTOS
======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    min-height: 400px; /* Altura mínima para evitar saltos */
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .pagination-container {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }
    
    .pagination-info {
        font-size: 0.85rem;
    }
    
    .pagination-controls {
        gap: 0.35rem;
    }
    
    .pagination-btn {
        min-width: 35px;
        height: 35px;
        padding: 0 0.5rem;
        font-size: 0.85rem;
    }
    
    .pagination-ellipsis {
        padding: 0 0.25rem;
        font-size: 1rem;
    }
    
    /* Ocultar algunos números en móvil */
    .pagination-controls .pagination-btn:nth-child(n+8):nth-last-child(n+4) {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
}

/* ========================================
   ANIMACIONES SUAVES
======================================== */
.product-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ACCESIBILIDAD
======================================== */
.pagination-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.pagination-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   MODO OSCURO (OPCIONAL)
======================================== */
@media (prefers-color-scheme: dark) {
    .pagination-container {
        background: #1a1a2e;
    }
    
    .pagination-info {
        color: #e8e8e8;
    }
    
    .pagination-btn {
        background: #2d2d44;
        border-color: #3d3d5a;
        color: #e8e8e8;
    }
    
    .pagination-btn:hover:not(.disabled):not(.active) {
        background: #3d3d5a;
    }
    
    .pagination-ellipsis {
        color: #666;
    }
}