.product-grid-widget {
    width: 100%;
    max-width: 100%;
    grid-column: 1 / -1; /* Hace que ocupe todo el ancho del grid padre */
}

/* Grid Layout */
.product-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 30px;
}

/* Product Item */
.product-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Product Image */
.product-item a {
    display: block;
    position: relative;
    overflow: hidden;
}

.product-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover img {
    transform: scale(1.05);
}

/* Product Content */
.product-item .product-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-item .product-title {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 0 8px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-item .price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.product-item .price del {
    color: #999;
    font-size: 0.9em;
    margin-right: 8px;
}

.product-item .price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Add to Cart Button */
.product-item .button {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
    margin-top: auto;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.product-item .button:hover {
    background: #2980b9;
}

/* Loader */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Load More Button */
.load-more-button {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 20px auto;
    display: none;
}

.load-more-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.load-more-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Pagination */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.page-number {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #f5f5f5;
}

.page-number.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .product-item .product-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-number {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.9rem;
    }
}

/* Empty State */
.no-products {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.no-products p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}



/* Estilos para el contenedor del loader */
/* Grid de productos */
.product-grid-widget .product-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

/* Grid de skeletons */
.product-grid-widget .skeleton-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    grid-column: 1 / -1; /* Asegura que el skeleton ocupe todo el ancho */
}

/* Estilos para el skeleton item */
.product-grid-widget .skeleton-item {
    background: #fff;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 0; /* Quitamos el margin bottom ya que usamos gap */
    border: 1px solid #eee;
    width: 100%;
    height: 100%;
}

/* Aseguramos que los items también ocupen todo el espacio */
.product-grid-widget .product-grid > * {
    width: 100%;
    min-width: 0; /* Previene desbordamiento */
}

/* Efecto de pulso para los elementos skeleton */
.skeleton-pulse {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Elementos del skeleton */
.skeleton-item .skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
}

.skeleton-item .skeleton-title {
    height: 20px;
    width: 85%;
    margin-bottom: 10px;
}

.skeleton-item .skeleton-price {
    height: 24px;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-item .skeleton-button {
    height: 36px;
    width: 100%;
}

/* Responsive */
@media (max-width: 1200px) {
    .product-grid-widget .product-grid,
    .product-grid-widget .skeleton-grid {
        --columns: 3;
    }
}

@media (max-width: 768px) {
    .product-grid-widget .product-grid,
    .product-grid-widget .skeleton-grid {
        --columns: 2;
    }
}

@media (max-width: 480px) {
    .product-grid-widget .product-grid,
    .product-grid-widget .skeleton-grid {
        --columns: 1;
    }
}

/* Animación del pulso */
@keyframes pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}