/* ================================================================
   PRODUCT GRID — Galería de 13 productos con imagen real.
   Recreación 1:1 del widget HTML embebido original.
   ================================================================ */
.product-gallery-section {
    background-color: #F4F6F8;
}

.product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* 13 tarjetas: la última queda centrada ocupando 2 columnas */
    .product-grid__card:last-child {
        grid-column: 2 / span 2;
    }
}

.product-grid__card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
    border: 1px solid rgba(10, 34, 54, 0.12);
    border-radius: var(--radius-2xl);
    box-shadow: 0 10px 24px rgba(10, 34, 54, 0.1);
    opacity: 0;
    transform: translateY(14px);
    animation: product-grid-reveal 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.product-grid__card::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 2;
    border: 1px dashed rgba(10, 34, 54, 0.18);
    border-radius: var(--radius-xl);
    opacity: 0.55;
    pointer-events: none;
    transition: opacity var(--transition-base), border-color var(--transition-base);
}

.product-grid__card:nth-child(1)  { animation-delay: 0.06s; }
.product-grid__card:nth-child(2)  { animation-delay: 0.10s; }
.product-grid__card:nth-child(3)  { animation-delay: 0.14s; }
.product-grid__card:nth-child(4)  { animation-delay: 0.18s; }
.product-grid__card:nth-child(5)  { animation-delay: 0.22s; }
.product-grid__card:nth-child(6)  { animation-delay: 0.26s; }
.product-grid__card:nth-child(7)  { animation-delay: 0.30s; }
.product-grid__card:nth-child(8)  { animation-delay: 0.34s; }
.product-grid__card:nth-child(9)  { animation-delay: 0.38s; }
.product-grid__card:nth-child(10) { animation-delay: 0.42s; }
.product-grid__card:nth-child(11) { animation-delay: 0.46s; }
.product-grid__card:nth-child(12) { animation-delay: 0.50s; }
.product-grid__card:nth-child(13) { animation-delay: 0.54s; }

@keyframes product-grid-reveal {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.product-grid__card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: rgba(0, 192, 230, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 192, 230, 0.4), 0 18px 40px rgba(10, 34, 54, 0.18);
}

.product-grid__card:hover::before {
    opacity: 0.9;
    border-color: rgba(0, 192, 230, 0.5);
}

.product-grid__media {
    position: relative;
    height: 230px;
    background:
        linear-gradient(180deg, rgba(10, 34, 54, 0.05), rgba(10, 34, 54, 0.02)),
        #e9eef2;
}

.product-grid__media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 34, 54, 0) 0%, rgba(10, 34, 54, 0.26) 100%);
    opacity: 0.85;
    pointer-events: none;
}

.product-grid__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.05) contrast(1.05);
    transition: transform var(--transition-slow), filter var(--transition-slow);
}

.product-grid__card:hover .product-grid__image {
    transform: scale(1.08);
    filter: saturate(1.12) contrast(1.1);
}

.product-grid__caption {
    position: absolute;
    z-index: 3;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px 14px 11px 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(14, 47, 63, 0.95), rgba(14, 47, 63, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(10, 34, 54, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.product-grid__caption::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 2px;
    background: var(--color-secondary);
    opacity: 0.95;
}

.product-grid__name {
    margin: 0;
    max-width: 26ch;
    font-size: clamp(13px, 1.05vw, 17px);
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text-inverse);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

/* Última card (13): imagen sin overlay absoluto, caption abajo en flujo normal */
.product-grid__card:last-child .product-grid__media {
    height: auto;
}

.product-grid__card:last-child .product-grid__image {
    height: 230px;
}

.product-grid__card:last-child .product-grid__caption {
    position: relative;
    z-index: 3;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 12px;
}
