/* ==========================================================================
   ZAREK — COLLECTION PAGE
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLLECTION HERO — slim banner w/ category title
   -------------------------------------------------------------------------- */
.collection-hero {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-black);
}

.collection-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.collection-hero__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(26, 26, 26, 0.55);
    z-index: 2;
}

.collection-hero__content {
    position: relative;
    z-index: 3;
    padding: 0 var(--container-padding);
    text-align: center;
    color: var(--color-white);
}

.collection-hero__title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: var(--weight-bold);
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: var(--space-md);
}

.collection-hero__subtitle {
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-light);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    color: var(--color-white);
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   2. FILTER BAR — top row + category chips
   -------------------------------------------------------------------------- */
.collection-filters {
    padding: var(--space-2xl) 0 var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.collection-filters__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.collection-filters__count {
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-light);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.sort-control {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.sort-control__label {
    font-family: var(--font-sans);
    font-size: var(--font-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--letter-spacing-nav);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.sort-control__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 8px 28px 8px 0;
    font-family: var(--font-sans);
    font-size: var(--font-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--letter-spacing-nav);
    text-transform: uppercase;
    color: var(--color-text);
    background: transparent
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%231A1A1A' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>")
        no-repeat right 4px center;
    background-size: 10px 7px;
    border: none;
    border-bottom: 1px solid var(--color-text);
    border-radius: 0;
    cursor: pointer;
}

.sort-control__select:focus {
    outline: none;
    border-bottom-color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   FILTER CHIPS — clickable category pills
   -------------------------------------------------------------------------- */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-chip {
    display: inline-block;
    padding: 8px 18px;
    font-family: var(--font-sans);
    font-size: var(--font-xs);
    font-weight: var(--weight-medium);
    line-height: 1;
    letter-spacing: var(--letter-spacing-nav);
    text-transform: uppercase;
    color: var(--color-text);
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--color-text);
}

.filter-chip.is-active {
    color: var(--color-white);
    background-color: var(--color-text);
    border-color: var(--color-text);
}

/* --------------------------------------------------------------------------
   3. PRODUCT GRID — 4 desktop / 2 tablet / 2 mobile / 1 small mobile
   -------------------------------------------------------------------------- */
.collection-products {
    padding: var(--space-2xl) 0 var(--space-3xl);
}

.collection-products__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl) var(--space-lg);
}

/* --------------------------------------------------------------------------
   PRODUCT CARD — collection variant w/ Add-to-Cart on hover
   -------------------------------------------------------------------------- */
.product-card-c {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.product-card-c__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: var(--color-bg-light);
    margin-bottom: var(--space-md);
}

.product-card-c__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 0.6s ease;
}

.product-card-c:hover .product-card-c__img {
    filter: brightness(0.92);
    transform: scale(1.02);
}

.product-card-c__badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    line-height: 1;
    letter-spacing: var(--letter-spacing-label);
    text-transform: uppercase;
    color: var(--color-white);
    background-color: var(--color-accent);
    border-radius: var(--radius-sm);
    z-index: 2;
}

.product-card-c__add {
    position: absolute;
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: var(--font-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--letter-spacing-nav);
    text-transform: uppercase;
    color: var(--color-white);
    background-color: var(--color-text);
    border: 1px solid var(--color-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease,
        background-color 0.2s ease;
    z-index: 3;
}

.product-card-c:hover .product-card-c__add,
.product-card-c:focus-within .product-card-c__add {
    opacity: 1;
    transform: translateY(0);
}

.product-card-c__add:hover {
    color: var(--color-text);
    background-color: var(--color-white);
}

.product-card-c__name {
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-regular);
    line-height: var(--line-height-base);
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.product-card-c__prices {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.product-card-c__price--old {
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-light);
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-card-c__price--new {
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   4. PAGINATION — minimal numbered nav
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    padding: var(--space-2xl) 0 var(--space-3xl);
}

.pagination__list {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: var(--font-sans);
    font-size: var(--font-sm);
    font-weight: var(--weight-medium);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.pagination__link:hover {
    border-color: var(--color-border);
}

.pagination__link.is-active {
    color: var(--color-white);
    background-color: var(--color-text);
    border-color: var(--color-text);
}

.pagination__link--next {
    font-size: var(--font-md);
    font-weight: var(--weight-light);
    line-height: 1;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET (768–1024) & MOBILE
   -------------------------------------------------------------------------- */

/* TABLET — 768 to 1024 */
@media (max-width: 1024px) {
    .collection-products__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }
}

/* MOBILE — below 768 */
@media (max-width: 768px) {
    .collection-hero {
        height: 280px;
    }

    .collection-filters {
        padding: var(--space-xl) 0 var(--space-md);
    }

    .collection-products {
        padding: var(--space-xl) 0 var(--space-2xl);
    }

    /* 2 columns at all mobile widths per spec */
    .collection-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg) var(--space-md);
    }

    .collection-filters__top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }

    /* On touch devices, always show Add to Cart since hover doesn't apply */
    .product-card-c__add {
        opacity: 1;
        transform: translateY(0);
    }

    /* Filter chips can scroll horizontally if they overflow */
    .filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 calc(var(--space-md) * -1);
        padding: 0 var(--space-md);
    }

    .filter-chips::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* SMALL MOBILE — below 480 */
@media (max-width: 480px) {
    .collection-hero {
        height: 220px;
    }

    .collection-products__grid {
        gap: var(--space-md) var(--space-sm);
    }

    .filter-chip {
        padding: 7px 14px;
        font-size: 10px;
    }

    .product-card-c__name {
        font-size: var(--font-xs);
    }

    .product-card-c__price--old,
    .product-card-c__price--new {
        font-size: var(--font-xs);
    }

    .product-card-c__badge {
        top: var(--space-sm);
        left: var(--space-sm);
        padding: 4px 8px;
        font-size: 9px;
    }

    .product-card-c__add {
        height: 38px;
        font-size: 10px;
        left: var(--space-sm);
        right: var(--space-sm);
        bottom: var(--space-sm);
    }

    .pagination {
        padding: var(--space-xl) 0 var(--space-2xl);
    }

    .pagination__link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: var(--font-xs);
    }
}

/* COLLECTION TABS */
.collection-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #e5e5e5;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.collection-tabs::-webkit-scrollbar {
    display: none;
}

.collection-tab {
    display: inline-block;
    padding: 16px 28px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    background: transparent;
}

.collection-tab:hover {
    color: #1a1a1a;
    border-bottom-color: #888;
}

.collection-tab.is-active {
    background: #1a1a1a;
    color: #fff;
    border-bottom-color: #1a1a1a;
}

.collection-tab--sale {
    color: #c0392b;
}

.collection-tab--sale.is-active {
    background: #c0392b;
    color: #fff;
    border-bottom-color: #c0392b;
}

/* COLLECTION DESCRIPTION */
.collection-description {
    padding: 56px 0 40px;
    text-align: center;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
}

.collection-description__title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 20px;
}

.collection-description__text {
    font-size: 14px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.75;
    letter-spacing: 0.01em;
}

.load-more-spinner {
    display: none;
    justify-content: center;
    padding: 40px 0;
}

.load-more-spinner.is-visible {
    display: flex;
}

.load-more-spinner__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1a1a1a;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 768px) {
    .product-card__cta,
    .btn-primary.featured__cta,
    .product-card .btn-primary {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-card .add-to-cart,
    .product-card button[class*="add"],
    .product-card .btn-cart,
    .product-card-c__add {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .collection-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scrollbar-width: none;
    }
    .collection-tabs::-webkit-scrollbar { display: none; }
}

body {
  animation: fadeInPage 0.3s ease forwards;
}

@keyframes fadeInPage {
  from { opacity: 0; }
  to { opacity: 1; }
}
