/* ==========================================================
   shop.css — استایل‌های اضافه صفحه فروشگاه
   وابسته به متغیرها و کامپوننت‌های assets/style.css است
   ========================================================== */

/* ---------- عنوان صفحه ---------- */
.shop-top {
    padding: 26px 0 8px
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 10px
}

.crumbs a:hover {
    color: var(--primary)
}

.crumbs i {
    font-size: .6rem
}

.crumbs [aria-current] {
    color: var(--text);
    font-weight: 700
}

.shop-top h1 {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.5
}

.shop-top h1::after {
    content: "";
    display: block;
    width: 54px;
    height: 5px;
    border-radius: 9px;
    background: var(--lime);
    margin-top: 6px
}

.shop-top p {
    color: var(--muted);
    margin-top: 6px
}

/* ---------- چیدمان ---------- */
.shop-sec {
    padding: 22px 0 52px
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 26px;
    align-items: start
}

/* ---------- فیلترها ---------- */
.filters {
    position: sticky;
    top: 86px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    max-height: calc(100vh - 106px);
    overflow-y: auto
}

.f-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px
}

.f-head h2 {
    font-size: 1.05rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px
}

.f-head h2 i {
    color: var(--primary)
}

.f-reset {
    border: 0;
    background: none;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: .85rem;
    padding: 4px 8px;
    border-radius: 8px
}

[data-theme="dark"] .f-reset {
    color: var(--primary)
}

.f-reset:hover {
    background: var(--surface-2)
}

.f-close {
    display: none
}

.f-group {
    padding: 16px 0;
    border-top: 1px solid var(--border)
}

.f-group:first-of-type {
    border-top: 0
}

.f-group h3 {
    font-size: .95rem;
    margin-bottom: 10px
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    font-size: .93rem
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex: none;
    cursor: pointer
}

.check .n {
    margin-inline-start: auto;
    color: var(--muted);
    font-size: .8rem
}

.range-val {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .85rem;
    margin-top: 4px
}

.range-val strong {
    color: var(--text)
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer
}

.f-apply {
    display: none;
    width: 100%;
    margin-top: 14px
}

/* ---------- نوار ابزار ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px
}

.toolbar .sbox {
    flex: 1;
    min-width: 200px
}

.toolbar .field {
    width: auto
}

.toolbar .sbox .field {
    width: 100%
}

.toolbar select.field {
    min-width: 170px
}

.filter-btn {
    display: none
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface)
}

.view-toggle button {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    transition: .2s
}

.view-toggle button[aria-pressed="true"] {
    background: var(--primary);
    color: #fff
}

.result-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: .9rem
}

.result-bar b {
    color: var(--text)
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 2px 12px;
    border-radius: 99px;
    background: var(--surface-2);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: .8rem;
    border: 0
}

[data-theme="dark"] .chip {
    color: var(--primary)
}

.chip i {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .65rem;
    transition: .2s
}

.chip:hover i {
    background: var(--primary);
    color: #fff
}

/* ---------- شبکه محصولات (در صفحه فروشگاه) ---------- */
.shop-layout .products {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 18px
}

.card .thumb .stock {
    position: absolute;
    bottom: 10px;
    inset-inline-start: 10px;
    font-size: .72rem;
    font-weight: 700;
    padding: 0 10px;
    border-radius: 99px;
    background: rgba(0, 0, 0, .45);
    color: #fff
}

.card.out {
    opacity: .72
}

.card.out .add {
    pointer-events: none;
    opacity: .45
}

/* حالت لیستی */
.products.list {
    grid-template-columns: 1fr !important
}

.products.list .card {
    flex-direction: row;
    gap: 14px
}

.products.list .thumb {
    width: 200px;
    height: auto;
    min-height: 150px;
    flex: none
}

.products.list .card .body {
    justify-content: center
}

/* ---------- صفحه‌بندی ---------- */
.pager {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px
}

.pager button {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 700;
    transition: .2s
}

.pager button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary)
}

.pager button[aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff
}

.pager button:disabled {
    opacity: .4;
    cursor: not-allowed
}

/* ---------- حالت خالی ---------- */
.empty {
    text-align: center;
    padding: 56px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 24px;
    color: var(--muted)
}

.empty i {
    font-size: 2.6rem;
    color: var(--border);
    margin-bottom: 10px
}

.empty h3 {
    color: var(--text);
    margin-bottom: 4px
}

.empty .btn {
    margin-top: 16px
}

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
    z-index: 90
}

.filter-overlay.open {
    opacity: 1;
    visibility: visible
}

/* ---------- ریسپانسیو ---------- */
@media (max-width:900px) {
    .shop-layout {
        grid-template-columns: 1fr
    }

    .filter-btn {
        display: inline-flex
    }

    .filters {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(340px, 90vw);
        max-height: none;
        border-radius: 0;
        border-top-left-radius: 24px;
        border-bottom-left-radius: 24px;
        z-index: 100;
        transform: translateX(105%);
        transition: transform .35s cubic-bezier(.22, .8, .28, 1);
        box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .35)
    }

    .filters.open {
        transform: none
    }

    .f-close {
        display: grid
    }

    .f-apply {
        display: inline-flex
    }
}

@media (max-width:560px) {
    .shop-top h1 {
        font-size: 1.5rem
    }

    .toolbar select.field {
        flex: 1;
        min-width: 0
    }

    .products.list .card {
        flex-direction: column
    }

    .products.list .thumb {
        width: 100%;
        min-height: 140px
    }
}