/* ══════════════════════════════════════════════════════
   PRODUCT LIST PAGE — product-list.css
   ══════════════════════════════════════════════════════ */

/* ── Page wrapper ──────────────────────────────────────── */
.product-list-page {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px 20px 100px;
    background: var(--white);
}

/* ── Top bar ───────────────────────────────────────────── */
.product-list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.title-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--black);
    line-height: 1;
    margin: 0;
}

/* Result count — muted, small, sits right of title */
.result-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--mid);
    white-space: nowrap;
}

/* ── Sort + filter controls ────────────────────────────── */
.product-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-form { display: flex; align-items: center; }

.sort-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.sort-label select {
    padding: 9px 30px 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--black);
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-label select:focus { border-color: var(--black); }

/* ── Filter button (mobile/tablet only) ────────────────── */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1.5px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.filter-btn:hover {
    background: var(--black);
    color: var(--white);
}

/* Active filter count badge on the button */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--black);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}

.filter-btn:hover .filter-count-badge {
    background: var(--white);
    color: var(--black);
}

/* ── Search bar ─────────────────────────────────────────── */
.product-search-form {
    display: flex;
    align-items: center;
    margin: 0 0 28px;
    border: 1.5px solid #e4e4e4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
}

.product-search-form:focus-within {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(13,13,13,.06);
}

.search-icon {
    flex-shrink: 0;
    margin-left: 16px;
    color: #b0b0b0;
    pointer-events: none;
}

.product-search-form input {
    flex: 1;
    height: 48px;
    border: none;
    padding: 0 12px;
    font-size: 14px;
    color: var(--black);
    background: var(--white);
    outline: none;
    min-width: 0;
}

.product-search-form input::placeholder { color: #b0b0b0; }

.product-search-form button {
    height: 48px;
    padding: 0 24px;
    border: none;
    border-left: 1.5px solid var(--border);
    background: var(--black);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.product-search-form button:hover { background: #2a2a2a; }

/* Clear search × */
.search-clear {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--off-white);
    color: var(--mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.search-clear:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* ── Category slider ────────────────────────────────────── */
.cat-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 20px;
}

/* Fade edges to hint scrollability */
.cat-slider-wrap::before,
.cat-slider-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 2;
}
.cat-slider-wrap::before { left: 36px;  background: linear-gradient(to right,  var(--white), transparent); }
.cat-slider-wrap::after  { right: 36px; background: linear-gradient(to left, var(--white), transparent); }

.cat-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 8px;
    cursor: grab;
    flex: 1;
    min-width: 0;
}

.cat-slider::-webkit-scrollbar { display: none; }
.cat-slider:active { cursor: grabbing; }

/* Arrow buttons */
.cat-slider-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--black);
    transition: opacity .2s ease, background .2s ease, color .2s ease;
    z-index: 3;
}

.cat-slider-arrow:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* Pills inside the slider */
.cat-pill {
    flex-shrink: 0;
    padding: 7px 16px;
    background: var(--off-white);
    border: 1.5px solid transparent;
    border-radius: 40px;
    text-decoration: none;
    color: var(--black);
    font-size: 13px;
    font-weight: 500;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}

.cat-pill:hover {
    background: #e8e8e8;
    border-color: var(--border);
}

.cat-pill--active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* ── Active filter chips ─────────────────────────────────── */
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
    padding: 12px 16px;
    background: var(--off-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.active-filters__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--mid);
    margin-right: 4px;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 40px;
    font-size: 12px;
    font-weight: 500;
    color: var(--black);
}

.active-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    color: var(--black);
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    transition: background var(--transition);
    flex-shrink: 0;
}

.active-chip__remove:hover {
    background: var(--black);
    color: var(--white);
}

.active-filters__clear {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--mid);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.active-filters__clear:hover { color: var(--black); }

/* ══════════════════════════════════════════════════════
   PRODUCT GRID + CARDS
══════════════════════════════════════════════════════ */

.product-list-page .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Card */
.product-card {
    position: relative;
    overflow: hidden;
    background: var(--white);
    border: 1px solid #e0e0e0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,.09);
}

/* Thumbnail */
.product-thumb {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.product-img-link { display: block; position: relative; z-index: 1; }

.product-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1.2;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.product-card:hover .product-thumb img { transform: scale(1.04); }

.product-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Action buttons — slide in from right on desktop */
.product-actions {
    position: absolute;
    top: 14px;
    right: -56px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3;
    transition: right .3s ease;
}

.product-card:hover .product-actions { right: 14px; }

.product-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--black);
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    text-decoration: none;
    overflow: hidden;
}

.product-action-btn:hover {
    background: var(--black);
    color: var(--white);
    transform: scale(1.08);
}

/* Wishlist active state */
.wishlist-btn--active {
    background: #ff4b4b !important;
    color: var(--white) !important;
    border: none;
}

.wishlist-btn--active svg { fill: var(--white); stroke: var(--white); }

/* Desktop sliding Add-to-Cart bar */
.product-cart {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -56px;
    z-index: 3;
    transition: bottom .3s ease;
}

.product-card:hover .product-cart { bottom: 0; }

.product-cart button,
.product-cart a {
    width: 100%;
    height: 48px;
    border: none;
    background: var(--black);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: background .2s ease;
}

.product-cart button:hover,
.product-cart a:hover {
    background: var(--accent);
    color: var(--black);
}

/* Badge */
.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    background: var(--black);
    color: var(--white);
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.product-badge--custom {
    background: #5c3d9e; /* distinct color for custom vs options */
}

/* Card content */
.product-content { padding: 14px 14px 16px; }

/* Name first — what is it? */
.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
    text-transform: uppercase;
    margin: 0 0 6px;
    letter-spacing: .2px;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Price second — how much? */
.product-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
    color: var(--black);
    line-height: 1;
}

.price-original {
    font-size: 13px;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
}

.price-save {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    background: #fff0f0;
    color: #cc3333;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.price-dash { color: #aaa; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 64px 24px;
    color: var(--mid);
}

.empty-state svg { margin-bottom: 16px; opacity: .35; }

.empty-state__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--black);
    margin: 0 0 6px;
}

.empty-state__sub {
    font-size: 14px;
    color: var(--mid);
    margin: 0 0 24px;
}

.empty-state__cta {
    display: inline-block;
    padding: 12px 28px;
    background: var(--black);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.empty-state__cta:hover { background: #2a2a2a; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    margin-top: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination a {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #f5f5f5;
    color: var(--black);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background .2s ease, color .2s ease;
}

.pagination a:hover { background: #e0e0e0; }

.pagination a.active,
.pagination a[aria-current="page"] {
    background: var(--black);
    color: var(--white);
    pointer-events: none;
}

.pagination__arrow {
    font-size: 20px;
    font-weight: 400 !important;
}

.pagination__ellipsis {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--mid);
}

/* ══════════════════════════════════════════════════════
   FILTER SIDEBAR
══════════════════════════════════════════════════════ */

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 9998;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-sidebar {
    position: fixed;
    top: 0;
    left: -380px;
    width: 340px;
    height: 100vh;
    background: var(--white);
    z-index: 9999;
    transition: left .38s cubic-bezier(.4,0,.2,1);
    box-shadow: 20px 0 60px rgba(0,0,0,.10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-sidebar.active { left: 0; }

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.filter-head h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: -.2px;
    margin: 0;
}

.filter-close {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black);
    font-size: 24px;
    line-height: 1;
    padding: 0;
    transition: var(--transition);
}

.filter-close:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.filter-sidebar form {
    flex: 1;
    overflow-y: auto;
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
}

.filter-sidebar form::-webkit-scrollbar { width: 4px; }
.filter-sidebar form::-webkit-scrollbar-track { background: transparent; }
.filter-sidebar form::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.filter-box {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.filter-box:last-of-type { border-bottom: none; }

.filter-box h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin: 0 0 14px;
}

.filter-box label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--black);
    cursor: pointer;
    transition: color var(--transition);
    user-select: none;
}

.filter-box label:last-child { margin-bottom: 0; }
.filter-box label:hover { color: var(--mid); }

.filter-box input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    background: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
    border-radius: 3px;
}

.filter-box input[type="checkbox"]:checked {
    background: var(--black);
    border-color: var(--black);
}

.filter-box input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: 2px solid var(--white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.filter-box input[type="checkbox"]:hover:not(:checked) {
    border-color: var(--black);
}

/* Price range slider */
.filter-box input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin-bottom: 10px;
    background: linear-gradient(to right, #0d0d0d 100%, #e8e6e1 100%);
}

.filter-box input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--black);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    cursor: pointer;
    border: 3px solid var(--white);
    outline: 1.5px solid var(--black);
    transition: transform var(--transition);
}

.filter-box input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.filter-price-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--mid);
    margin-top: 4px;
}

.filter-price-display span {
    background: var(--off-white);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--black);
    font-weight: 600;
}

/* Filter action buttons */
.filter-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.filter-actions button,
.filter-actions a {
    flex: 1;
    height: 46px;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.filter-actions .apply-btn {
    background: var(--black);
    color: var(--white);
}

.filter-actions .apply-btn:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
}

.filter-actions .clear-btn {
    background: var(--off-white);
    color: var(--black);
    border: 1.5px solid var(--border);
}

.filter-actions .clear-btn:hover {
    background: #e0e0e0;
}

/* ══════════════════════════════════════════════════════
   DESKTOP STICKY SIDEBAR LAYOUT (≥993px)
══════════════════════════════════════════════════════ */

@media (min-width: 993px) {

    .product-list-page {
        display: grid;
        grid-template-columns: 270px 1fr;
        gap: 40px;
        align-items: start;
    }

    .product-list-top,
    .product-search-form,
    .category-pills,
    .active-filters,
    .product-list-page > .products,
    .pagination {
        grid-column: 2;
    }

    .filter-sidebar {
        position: sticky;
        top: 110px;
        left: auto;
        grid-column: 1;
        grid-row: 1 / span 7;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 130px);
        box-shadow: none;
        z-index: 1;
        overflow: hidden;
    }

    .filter-sidebar,
    .filter-sidebar.active {
        left: auto;
        transition: none;
    }

    .filter-overlay { display: none !important; }
    .filter-close   { display: none !important; }
    .filter-btn     { display: none !important; }

    .product-list-page .products {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }
}

/* ══════════════════════════════════════════════════════
   TABLET (≤768px)
══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .product-list-page { padding: 20px 16px 56px; }
    .page-title { font-size: 20px; }

    .product-list-page .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Always show action buttons on touch — no hover needed */
    .product-actions,
    .product-card:hover .product-actions {
        right: 8px !important;
        top: 8px !important;
        gap: 7px;
    }

    .product-action-btn {
        width: 36px;
        height: 36px;
    }

    /* Hide desktop sliding cart bar on touch — users tap card title or action btn */
    .product-cart,
    .product-cart.desktop-cart {
        display: none !important;
    }

    .product-title { font-size: 12px; }
    .product-price { font-size: 13px; }

    .filter-sidebar { width: 100%; left: -100%; }
    .filter-sidebar.active { left: 0; }

    .filter-head,
    .filter-sidebar form,
    .filter-actions { padding-left: 18px; padding-right: 18px; }

    .product-search-form button { padding: 0 16px; font-size: 12px; }

    .category-pills { gap: 6px; margin-bottom: 14px; }
    .pill { font-size: 12px; padding: 6px 12px; }

    .active-filters { padding: 10px 12px; gap: 6px; }
}

/* ══════════════════════════════════════════════════════
   MOBILE (≤480px)
══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .product-list-page .products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-content { padding: 10px 10px 12px; }
    .product-title { font-size: 11px; }
    .product-price { font-size: 12px; }
    .price-save { display: none; } /* too cramped on tiny cards */
}