/* ── product-modern.css — exact match to reference design ─────────────────── */

* { box-sizing: border-box; }

body { background: #fff; font-family: 'Segoe UI', system-ui, sans-serif; }

#product_container {
    width: 96%;
    max-width: 1360px;
    margin: 0 auto 60px;
}

/* ── BREADCRUMB ──────────────────────────────────────────────────────────── */
.catName ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 12px 0 8px;
    margin: 0;
    font-size: 12px;
    color: #aaa;
}
.catName ul .sep { color: #ccc; }
.catName ul li a { color: #888; text-decoration: none; }
.catName ul li a:hover { color: #333; text-decoration: underline; }
.catName ul li:last-child a { color: #333; font-weight: 600; }

/* ── TOOLBAR ─────────────────────────────────────────────────────────────── */
.product-toolbar {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 6px 0 20px;
}
.product-toolbar h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}
.product-toolbar h1 span {
    font-size: 14px;
    color: #888;
    font-weight: 400;
    margin-left: 8px;
}
.toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toolbar-right .sort-icon { color: #666; font-size: 15px; }
.toolbar-right label { font-size: 13px; color: #555; white-space: nowrap; }

#sortPrice {
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
}
#sortPrice:focus { border-color: #333; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.product-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

/* ── FILTER SIDEBAR ──────────────────────────────────────────────────────── */
.filter-sidebar {
    width: 215px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e8e8e8 transparent;
    padding-right: 8px;
    border-right: 1px solid #f0f0f0;
    margin-right: 28px;
}
.filter-sidebar::-webkit-scrollbar { width: 3px; }
.filter-sidebar::-webkit-scrollbar-thumb { background: #e0e0e0; }

/* Filters header row */
.filter-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 14px;
}
.filter-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: .01em;
}
.filter-active-count { color: #1a1a1a; font-weight: 700; }
.filter-clear-btn {
    background: none;
    border: none;
    color: #1a9e6a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: none;
}
.filter-clear-btn:hover { text-decoration: underline; }

.filter-loading { font-size: 12px; color: #bbb; padding: 8px 0; }

/* Filter section */
.filter-section { border-bottom: 1px solid #f0f0f0; }
.filter-section:last-child { border-bottom: none; }

.filter-section-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: 8px;
}
.filter-section-head:hover { background: none; }

/* Colored dot indicator */
.filter-section-head::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #bbb;
    transition: background .15s;
}
/* Active sections get orange dot */
.filter-section-head.has-selection::before { background: #c8832a; }

.filter-section-head span {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: .01em;
}
.filter-section-head .fas {
    font-size: 11px;
    color: #999;
    transition: transform .2s;
}
.filter-section-head.open .fas { transform: rotate(180deg); }

/* Body */
.filter-section-body {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0 0 10px 16px;
}
.filter-section-body.open { display: flex; }

/* Checkbox row */
.filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    line-height: 1.4;
}
.filter-check:hover .check-label { color: #1a1a1a; }
.filter-check input[type=checkbox] {
    width: 14px;
    height: 14px;
    accent-color: #c8832a;
    cursor: pointer;
    flex-shrink: 0;
}
.check-label {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    transition: color .12s;
}
.filter-check input:checked ~ .check-label { color: #1a1a1a; font-weight: 600; }

/* Rating stars */
.rating-stars { color: #f59e0b; }

/* Color swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 6px;
}
.color-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.color-swatch input { display: none; }
.swatch-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .15s, box-shadow .15s;
}
.color-swatch input:checked + .swatch-circle {
    transform: scale(1.2);
    box-shadow: 0 0 0 2.5px #c8832a;
}
.swatch-label { font-size: 10px; color: #999; }

/* ── ACTIVE CHIPS ────────────────────────────────────────────────────────── */
.active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 50px;
}
.filter-chip button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}
.filter-chip button:hover { color: #e63946; }

/* ── PRODUCT SECTION ─────────────────────────────────────────────────────── */
.product-section { flex: 1; min-width: 0; }

/* ── PRODUCT GRID — 3 columns ────────────────────────────────────────────── */
.product_item_box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: transparent;
}

.no-products {
    background: #fff;
    grid-column: 1/-1;
    padding: 80px 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* ── PRODUCT CARD — matches reference exactly ───────────────────────────── */
.product-card {
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); z-index: 1; }

/* Image */
.product-card-img-wrap {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f8f8f8;
}
.product-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.product-card:hover .product-card-img-wrap img { transform: scale(1.04); }

/* Fit tag — top left (e.g. "OVERSIZED FIT") */
.fit-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,.92);
    color: #555;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 3px;
    pointer-events: none;
    text-transform: uppercase;
}

/* Discount badge */
.discount-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #e63946;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
}

/* Wishlist heart */
.wish-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: transform .15s;
    z-index: 2;
}
.wish-btn i { font-size: 13px; color: #bbb; transition: color .18s; pointer-events: none; }
.wish-btn:hover { transform: scale(1.1); }
.wish-btn:hover i, .wish-btn.active i { color: #e63946; }
.wish-btn.active { border-color: #ffe0e0; }

/* Rating pill — overlaps bottom of image (matches reference) */
.prod-rating-pill {
    position: absolute;
    bottom: 14px;
    left: 10px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,.10);
    pointer-events: none;
}
.prod-rating-pill .fas { color: #f59e0b; font-size: 9px; }

/* Info section */
.product-card-info { padding: 10px 12px 14px; }
.prod-brand {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 3px;
    line-height: 1.3;
}
.prod-brand::after { content: '®'; font-size: 9px; vertical-align: super; }
.product-card-info h5 {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    margin: 0 0 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.product-card-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.price-eff  { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.price-orig { font-size: 12px; color: #aaa; text-decoration: line-through; }
.price-disc { font-size: 12px; color: #e63946; font-weight: 700; }

/* Green offers badge (e.g. "Buy 2 for 1199") */
.prod-offer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #edfbf1;
    border: 1px solid #b8ead0;
    color: #1a8c3d;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 4px;
}
.prod-offer .fas { font-size: 9px; }

.tribe-price {
    font-size: 11px;
    color: #c8832a;
    margin: 4px 0 0;
    display: inline-block;
}

/* ── SPINNER ─────────────────────────────────────────────────────────────── */
#spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.8);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}
.spinner1 {
    width: 40px;
    height: 40px;
    border: 3px solid #f0e8df;
    border-top-color: #c8832a;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .product-layout  { flex-direction: column; }
    .filter-sidebar  { width: 100%; position: static; max-height: none; border-right: none; padding-right: 0; margin-right: 0; border-bottom: 1px solid #f0f0f0; padding-bottom: 12px; margin-bottom: 20px; }
    .product_item_box { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
}
@media (max-width: 480px) {
    .product_item_box { grid-template-columns: repeat(2,1fr); }
    #product_container { width: 98%; }
}

/* ── MOBILE STICKY FILTER BAR ────────────────────────────────────────────── */
.mobile-filter-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    z-index: 200;
    padding: 10px 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,.10);
}
.mfb-btn {
    flex: 1;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    font-family: inherit;
}
.mfb-btn .fas { font-size: 16px; color: #c8832a; }
.mfb-badge {
    position: absolute;
    top: 0; right: calc(50% - 28px);
    background: #e63946;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfb-divider {
    width: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* ── MOBILE FILTER DRAWER ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .mobile-filter-bar { display: flex; }
    body { padding-bottom: 60px; }

    .filter-sidebar {
        position: fixed !important;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 85vw !important;
        max-width: 320px;
        z-index: 300;
        transition: left .3s ease;
        border-radius: 0 !important;
        max-height: 100vh !important;
        /* override the static styles above when drawer mode */
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        background: #fff;
        overflow-y: auto;
        padding: 20px 16px;
    }
    .filter-sidebar.mobile-open { left: 0; }
    body.filter-overlay-active::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 299;
    }
}
