/* صفحهٔ لیست محصولات (همراه app.css بارگذاری می‌شود) */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.btn--block { width: 100%; }

/* ============ عنوان صفحه ============ */
.page-head { padding-block: 32px 8px; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumb a:hover { color: var(--accent); }

.page-head__title { margin: 0; font-size: 28px; }
.page-head__desc { margin: 6px 0 0; max-width: 560px; }

/* ============ چیدمان ============ */
.shop {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    padding-top: 24px;
    align-items: start;
}

.grid--shop { grid-template-columns: repeat(3, 1fr); }

/* ============ فیلترها ============ */
.filters {
    position: sticky;
    top: 90px;
    padding-inline-end: 24px;
    border-inline-end: 1px solid var(--line);
}

.filter { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.filter:last-of-type { border-bottom: 0; margin-bottom: 8px; }

.filter__title {
    display: block;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}
.filter__title small { font-weight: 400; }

.radio, .check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 14px;
    cursor: pointer;
}
.radio input, .check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* سایزها */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}
.chip span:hover { border-color: var(--text); }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* رنگ‌ها */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch__dot {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c);
    border: 1px solid var(--line);
    box-shadow: 0 0 0 2px #fff inset;
    transition: box-shadow .2s, border-color .2s;
}
.swatch input:checked + .swatch__dot { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset, 0 0 0 2px var(--text); }
.swatch input:focus-visible + .swatch__dot { outline: 2px solid var(--accent); outline-offset: 2px; }

/* قیمت */
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range .input { padding: 9px 10px; text-align: center; min-width: 0; }

.filters__actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.filters__clear { font-size: 13px; color: var(--muted); }
.filters__clear:hover { color: var(--accent); }

/* ============ نوار بالای لیست ============ */
.shop__bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.shop__count { margin-inline-end: auto; font-size: 14px; }
.sort { width: auto; padding: 8px 14px; cursor: pointer; }

.filters-btn { display: none; padding: 8px 16px; }

/* ============ صفحه‌بندی ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 48px;
}
.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    transition: border-color .2s, background .2s;
}
a.pagination__item:hover { border-color: var(--text); }
.pagination__item.is-current { background: var(--text); border-color: var(--text); color: #fff; }
.pagination__item.is-disabled { color: #c5c0b8; }

/* ============ حالت خالی ============ */
.empty {
    padding: 64px 20px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty p { margin-bottom: 16px; }

/* ============ ریسپانسیو ============ */
@media (max-width: 1000px) {
    .grid--shop { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .shop { grid-template-columns: 1fr; gap: 0; }

    .filters-btn { display: inline-flex; }

    .filters {
        display: none;
        position: static;
        margin-bottom: 24px;
        padding: 20px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--bg-soft);
    }
    .filters-toggle:checked ~ .filters { display: block; }
}

@media (max-width: 520px) {
    .grid--shop { gap: 16px; }
    .page-head__title { font-size: 23px; }
}
