/* ============================================
   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;
}

/* -------------------------------------------------------------------------
   Catalogue pagination
------------------------------------------------------------------------- */

.catalog-pagination {
    margin: 12px auto 28px;
    padding: 18px 20px;
    border: 1px solid #e7e3da;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfaf5 100%);
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
}

.catalog-pagination__summary {
    margin: 0 0 14px;
    color: #6B7280;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.catalog-pagination__controls {
    display: grid;
    grid-template-columns: minmax(118px, auto) 1fr minmax(118px, auto);
    gap: 12px;
    align-items: center;
}

.catalog-pagination__pages {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.catalog-pagination__link,
.catalog-pagination__page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(184, 150, 88, 0.24);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.catalog-pagination__link:hover,
.catalog-pagination__link:focus,
.catalog-pagination__page-link:hover,
.catalog-pagination__page-link:focus {
    text-decoration: none;
    transform: translateY(-1px);
}

.catalog-pagination__link:focus,
.catalog-pagination__page-link:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(184, 150, 88, 0.18);
}

.catalog-pagination__link--prev {
    background: #fff;
    color: #2F343A;
}

.catalog-pagination__link--prev:hover,
.catalog-pagination__link--prev:focus {
    background: #f8f5ef;
    border-color: rgba(184, 150, 88, 0.4);
    color: #2F343A;
}

.catalog-pagination__link--next {
    background: var(--cozzicotton-primary);
    border-color: var(--cozzicotton-primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(184, 150, 88, 0.22);
}

.catalog-pagination__link--next:hover,
.catalog-pagination__link--next:focus {
    background: var(--cozzicotton-primary-hover);
    border-color: var(--cozzicotton-primary-hover);
    color: #fff;
}

.catalog-pagination__link--edge {
    gap: 8px;
    white-space: nowrap;
}

.catalog-pagination__page-link {
    background: #fff;
    color: #4B5563;
}

.catalog-pagination__page-link:hover,
.catalog-pagination__page-link:focus {
    background: #f8f5ef;
    border-color: rgba(184, 150, 88, 0.4);
    color: #7a5a24;
}

.catalog-pagination__page-link.is-current {
    background: rgba(184, 150, 88, 0.14);
    border-color: rgba(184, 150, 88, 0.42);
    color: #7a5a24;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.catalog-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 44px;
    color: #9CA3AF;
    font-size: 18px;
    font-weight: 700;
}

.catalog-pagination__link.is-disabled {
    background: #F9FAFB;
    border-style: dashed;
    color: #9CA3AF;
    box-shadow: none;
    transform: none;
}

.catalog-pagination__chevron {
    font-size: 15px;
    line-height: 1;
}

@media (max-width: 767px) {
    .catalog-pagination {
        padding: 16px 14px;
        margin-bottom: 16px;
    }

    .catalog-pagination__summary {
        margin-bottom: 12px;
        font-size: 13px;
    }

    .catalog-pagination__controls {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .catalog-pagination__pages {
        grid-column: 1 / -1;
        order: -1;
        gap: 6px;
        margin-bottom: 2px;
    }

    .catalog-pagination__link,
    .catalog-pagination__page-link {
        min-height: 42px;
        min-width: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .catalog-pagination__link--edge {
        justify-content: center;
        width: 100%;
    }
}
