/* ═══════════════════════════════════════════════════════════════
   CATEGORY LEAF PAGE — filter sidebar + sticky toolbar + product grid
   File: assets/css/category-leaf.css
   Covers markup from: Taxonomy-product-cat.php (.archive-layout),
   content-search-filters.php (.filter-sidebar + WC widgets),
   category-leaf.php (.archive-header / .archive-toolbar-row / .product-grid),
   content-product.php (.product-card)
   Uses the color variables already defined in style.css :root
   (--primary, --primary-dark, --accent, --accent-dark, --text,
   --text-light, --bg, --border, --white). Falls back to --red
   locally in case Category-hub.css isn't loaded on this branch.
═══════════════════════════════════════════════════════════════ */

:root {
    --red: #9B1E22;
    --blue-btn: #9B1E22;
    --blue-btn-dark: #7A171B;
}

/* ─── PAGE LAYOUT / FILTER SIDEBAR / ARCHIVE HEADER / TOOLBAR ─────
   These used to be duplicated here AND in shop-archive.css, with
   different grid vs flexbox layouts and different mobile breakpoints
   (900px here vs 991px — the breakpoint main.js's off-canvas drawer
   JS actually uses). Loading both was the cause of the broken/
   non-responsive filter sidebar. shop-archive.css is now the single
   source of truth for .archive-layout / .filter-sidebar /
   .archive-header / .archive-toolbar and their responsive behavior;
   see that file instead. Nothing below this point changed. */


/* ─── PRODUCT GRID / CARDS ──────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.product-grid .product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-grid .product-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #6E6E6E;
}

.product-grid .product-card__image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  
    background: #FCFAF8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 18px;
}

.product-grid .product-card__discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    background: var(--red, #9B1E22);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1;
}

.product-grid .product-card__brand-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 10px;
}

.product-grid .product-card__brand {
    font-size: 11px;
    color: var(--text-light);
}

.product-grid .product-card__stars {
    font-size: 11px;
    color: #9B1E22;
    letter-spacing: 1px;
}

.product-grid .product-card__image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-grid .product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-grid .product-card__title {
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 6px;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-grid .product-card__title a {
    color: var(--text);
    text-decoration: none;
}

.product-grid .product-card__title a:hover {
    color: var(--primary);
}

.product-grid .product-card__sku {
    font-size: 11.5px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.product-grid .product-card__price {
    font-size: 18px;
    font-weight: 800;
    color: var(--red);
    margin-bottom: 6px;
}

.product-grid .product-card__price del {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-light);
    margin-right: 6px;
}

.product-grid .product-card__stock-in {
    font-size: 12px;
    font-weight: 600;
    color: #2a7a2a;
    margin-bottom: 10px;
}

.product-grid .product-card__stock-out {
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
    margin-bottom: 10px;
}

.product-grid .product-card__footer {
    margin-top: auto;
}

.product-grid .product-card__footer .button,
.product-grid .product-card__footer .add_to_cart_button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--blue-btn);
    color: #FFFFFF !important;
    border: none;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s;
}

.product-grid .product-card__footer .button:hover,
.product-grid .product-card__footer .add_to_cart_button:hover {
    background: var(--blue-btn-dark);
}


/* ─── FEATURED PRODUCT CAROUSEL CARDS (product-carousel.php / .dcs-card) ──
   Reference: "Featured" cards with brand + title + price + Shop Now
   button. Scoped to .dcs-card only so the site-wide .dcs-btn--accent
   (used for other CTAs like hero banners) stays untouched. ────────── */
.dcs-card .dcs-btn--accent {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.dcs-card .dcs-btn--accent:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
}


/* ─── GRID / LIST VIEW TOGGLE ────────────────────────────────────
   Client-side only display preference, toggled by the buttons in
   content-archive-toolbar-extra.php (see main.js). Does not affect
   what products are shown, only how the same grid is laid out. */
.product-grid.is-list-view {
    grid-template-columns: 1fr;
}

.product-grid.is-list-view .product-card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.product-grid.is-list-view .product-card__image-wrap {
    width: 140px;
    flex: 0 0 140px;
    aspect-ratio: auto;
    height: 110px;
    margin-bottom: 0;
}

.product-grid.is-list-view .product-card__body {
    flex-direction: column;
}


/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid.is-list-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .product-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 10px;
    }
}