/* Estilos del catálogo */
.products-catalog {
    
}

.catalog-hero {
    background-color: var(--primary-blue);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.catalog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* Filtros */
.filters-section {
    padding: 30px 0;
    background: var(--light-gray);
    position: sticky;
    top: 50px;
    z-index: 90;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 20px;
}

.search-filter {
    position: relative;
}

#product-search {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
}

.search-results {
    position: absolute;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.show {
    display: block;
}

.search-results div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-results div:hover {
    background: var(--light-gray);
}

.category-filter select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

/* Grid de productos */
.products-grid-section {
    padding: 40px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--primary-blue);
}

.product-image {
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.view-detail {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-blue);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.view-detail:hover {
    background: var(--secondary-blue);
}

/* Preloader skeleton */
.skeleton-loader {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
}

.skeleton-card {
    height: 300px;
    background: #f5f5f5;
    border-radius: 8px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.pagination button:hover:not(.active) {
    background: var(--light-gray);
}

/* Responsive */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.product-card.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.3s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.products-grid.loading {
    opacity: 0.6;
    transition: opacity 0.2s ease;
    min-height: 600px; /* evita salto al limpiar contenido */
}
