/* ==========================================================================
   Штыковские двери — каталог
   ========================================================================== */

.cat-styles { margin-top: 18px; }
.cat-styles .tag { flex: 0 0 auto; }

.catalog { display: block; padding-bottom: 40px; }
@media (min-width: 1024px) {
    .catalog { display: grid; grid-template-columns: 268px 1fr; gap: 32px; align-items: start; }
}

/* ============================ Фильтры ============================ */
.filters {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
    display: flex; flex-direction: column;
    max-height: 88vh; background: var(--bg);
    border-radius: 14px 14px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(101%); transition: transform .3s var(--ease);
    visibility: hidden;
}
.filters.is-open { transform: none; visibility: visible; }

.filters__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px var(--pad) 10px; border-bottom: 1px solid var(--line);
}
.filters__head h2 { margin: 0; font-size: 19px; }
.filters__body { flex: 1; overflow-y: auto; padding: 4px var(--pad) 8px; }
.filters__foot {
    padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); display: grid; gap: 6px;
}
.filters__backdrop { position: fixed; inset: 0; z-index: 84; background: rgba(16, 18, 20, .45); }

@media (min-width: 1024px) {
    .filters {
        position: sticky; top: 120px; transform: none; visibility: visible;
        max-height: calc(100vh - 140px); border-radius: var(--radius-lg);
        border: 1px solid var(--line); box-shadow: none; z-index: 1;
    }
    .filters__head { padding: 16px 18px 10px; }
    .filters__head .ibtn { display: none; }
    .filters__body { padding: 4px 18px 8px; }
    .filters__foot { padding: 12px 18px; }
    .filters__backdrop { display: none !important; }
}

.fgroup { border-bottom: 1px solid var(--line-2); }
.fgroup:last-child { border-bottom: 0; }
.fgroup__head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; padding: 14px 0; background: none; border: 0; text-align: left;
    font-size: 14px; font-weight: 700;
}
.fgroup__head::after {
    content: ""; width: 9px; height: 9px; flex-shrink: 0;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease);
}
.fgroup.is-open .fgroup__head::after { transform: rotate(-135deg) translateY(-2px); }
.fgroup__body { display: none; padding-bottom: 14px; }
.fgroup.is-open .fgroup__body { display: block; }

.fopt {
    display: flex; align-items: center; gap: 9px; padding: 6px 0;
    font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.fopt input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.fopt__n { margin-left: auto; font-size: 12px; color: var(--muted-2); }
.fopt.is-empty { opacity: .38; pointer-events: none; }

.fswatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.fswatch {
    position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); padding: 0; overflow: hidden;
}
.fswatch.is-on { border-color: var(--accent); }
.fswatch.is-on::after {
    content: "✓"; position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.frange { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.frange input {
    width: 100%; min-width: 0; padding: 8px 10px; font-size: 14px;
    border: 1px solid var(--line); border-radius: var(--radius);
}
.frange span { color: var(--muted); }
.fslider { width: 100%; accent-color: var(--accent); }

/* ============================ Панель управления ============================ */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 12px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.toolbar__found { margin: 0; font-size: 14px; color: var(--muted); }
.toolbar__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar__filters { flex-shrink: 0; }
@media (min-width: 1024px) { .toolbar__filters { display: none; } }
.toolbar__badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.select--sm { min-height: 38px; padding: 7px 32px 7px 12px; font-size: 14px; }

.viewmode { display: none; gap: 2px; }
@media (min-width: 700px) { .viewmode { display: flex; } }
.viewmode__btn {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted);
}
.viewmode__btn svg { width: 17px; height: 17px; }
.viewmode__btn.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }

/* ============================ Сетка товаров ============================ */
.products { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .products { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .products { grid-template-columns: repeat(4, 1fr); } }

.products.is-list { grid-template-columns: 1fr; }
.products.is-list .card { flex-direction: row; }
.products.is-list .card__media { flex: 0 0 130px; aspect-ratio: 3 / 4; }
@media (min-width: 700px) { .products.is-list .card__media { flex: 0 0 200px; } }
.products.is-list .card__body { padding: 16px; }
.products.is-list .card__actions { grid-template-columns: 180px auto; justify-content: start; }
.products.is-list .card__fav { top: 10px; right: 10px; }

.catalog__more {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 14px; margin-top: 26px;
}
.catalog__more .btn { flex: 1 1 240px; max-width: 320px; }
.perpage { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.perpage .select { width: auto; }

/* ============================ Не нашли ============================ */
.notfound {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
    margin-top: 36px; padding: 26px; background: var(--accent-tint); border-radius: var(--radius-lg);
}
.notfound h3 { margin-bottom: 6px; }
.notfound p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 58ch; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.notfound__actions .btn { flex: 1 1 220px; }

/* ============================ Коллекции ============================ */
.collections { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .collections { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .collections { grid-template-columns: repeat(4, 1fr); } }
.coll {
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.coll:hover { border-color: var(--muted-2); box-shadow: var(--shadow); }
.coll__media { aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.coll__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.coll:hover .coll__media img { transform: scale(1.05); }
.coll__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.coll__style { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.coll h3 { font-size: 16px; margin: 0; }
.coll p { font-size: 13px; color: var(--muted); margin: 0; }
.coll__price { margin-top: auto; padding-top: 6px; font-weight: 800; }
.coll__price small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
