/* Modern CSS Grid Responsive */
.products-container:after {
   content: "";
   display: block;
   clear: both;
}

.custom-product-grid.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 30%, 350px), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    padding-inline: clamp(0.5rem, 2vw, 1rem);
    justify-content: center;
    align-items: start;
}

.custom-product-item {
    width: 100%;
    aspect-ratio: 3 / 5;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: clamp(0.375rem, 1.5vw, 0.5rem);
    overflow: hidden;
    background-color: #2d2d2d;
    -webkit-transition: transform 0.2s ease, filter 0.2s ease;
    transition: transform 0.2s ease, filter 0.2s ease;
}

@media (max-width: 768px) {
    .custom-product-grid.products-container {
        grid-template-columns: 1fr;
        gap: clamp(1rem, 4vw, 1.5rem);
    }
    
    .custom-product-item {
        max-width: 70%;
        margin: 0 auto;
    }
}

.custom-product-item a.custom-product-link {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Sección de la imagen */
.custom-product-image {
    flex: 1 0 auto;
    text-align: center;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-product-image img {
    max-width: clamp(40%, 50%, 70%);
    height: auto;
    display: inline-block;
    border-radius: clamp(0.25rem, 1vw, 0.375rem);
    object-fit: contain;
}

/* Sección de la información */
.custom-product-info {
    display: flex;
    flex-direction: column;
    background-color: #1f1f1f;
    padding: clamp(0.75rem, 3vw, 1.25rem);
    box-sizing: border-box;
    text-align: left;
    min-height: 40%;
    gap: clamp(0.25rem, 1vw, 0.5rem);
}

/* Título del producto */
.product-title {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: #fff;
    line-height: 1.3;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Hover en toda la tarjeta */
.custom-product-item:hover {
    -webkit-filter: brightness(1.15);
    filter: brightness(1.15);
    cursor: pointer;
    -webkit-transform: translateY(-4px);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Precio del producto */
.product-price {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    margin-top: clamp(0.5rem, 2vw, 1rem);
    color: #fff;
}

/* Estilo para Categoría y Marca */
.product-extra-info {
    font-size: clamp(0.75rem, 1.8vw, 0.875rem);
    color: #ccc;
    margin-top: auto;
}

.product-extra-info p {
    margin: clamp(0.25rem, 1vw, 0.375rem) 0;
}

.product-extra-info strong {
    color: #fff;
}

/* Layout de productos */
.fila-productos {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    justify-content: center;
}

/* Estilo del ripple */
.ripple-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    -webkit-transform: scale(0);
    transform: scale(0);
    -webkit-animation: rippleAnimation 0.6s ease-out forwards;
    animation: rippleAnimation 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 999; /* Asegura que el ripple esté por encima del contenido */
}

@-webkit-keyframes rippleAnimation {
    to {
        -webkit-transform: scale(100);
        transform: scale(100);
        opacity: 0;
    }
}

@keyframes rippleAnimation {
    to {
        -webkit-transform: scale(100);
        transform: scale(100); /* Ajusta el valor según el tamaño de la tarjeta */
        opacity: 0;
    }
}