/* ============================================
   Cozzi Cotton Product Grid - Revamped Card Layout
   ============================================ */

:root {
    /* Brand palette */
    --cozzicotton-primary: #B89658;
    --cozzicotton-primary-hover: #947844;
    --cozzicotton-gold: #d4af37;
}

/* Grid container */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Desktop default (≥992px) */
    gap: 32px;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* Tablet (768–991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-media {
        height: 260px; /* smaller media height for mobile */
    }
}

/* Card */
.product-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
}

/* Media (image container) */
.product-media {
    position: relative;
    height: 340px; /* desktop height */
    overflow: hidden;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* image fills card */
    transform: scale(1);
    transition: transform .5s ease;
}

.product-card:hover .product-media img {
    transform: scale(1.08); /* zoom effect on hover */
}

/* Meta (title, artist, price) */
.product-meta {
    padding: 14px 16px 16px;
    color: #1A1A1A;
}

.product-title {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.25;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--cozzicotton-primary-hover);
}

.product-artist {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 6px;
}

.product-price {
    font-weight: 600;
    color: var(--cozzicotton-primary);
}

.product-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

.product-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-item img:hover {
    transform: scale(1.02);
}

.product-info {
    text-align: center;
    margin-top: 10px;
}

/* Title styling */
.product-info h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    word-break: break-word;
}

/* Make title clickable with clean link style */
.product-info h4 a {
    text-decoration: none;
    color: inherit;
}

.product-info h4 a:hover {
    text-decoration: underline;
}

/* Price styling */
.product-info .price {
    margin-top: 6px;
    font-weight: 500;
    font-size: 1.2rem;
    color: #111;
}

/* -------------------------------------------------------------------------
   Phase 1 - Size pills under product cards

   Goal: Quick conversion win without implementing stock-aware listing yet.
   We only show in-stock sizes (computed server-side) and each pill is clickable
   to the product PDP with a pre-selected variant (?variant=<child_id>).
------------------------------------------------------------------------- */

.cc-size-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Slightly tighter spacing inside cards (home sections) */
.cc-size-row--card {
    margin-top: 8px;
}

.cc-size-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.02);
    color: #111;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.cc-size-pill:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cc-size-pill:focus {
    outline: 2px solid rgba(0, 0, 0, 0.25);
    outline-offset: 2px;
}

.cc-size-pill--more {
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}
