/* ------------------------------------------------------------------
 *  Страница каталога: шапка раздела, фильтры, карточки, просмотр фото
 * ------------------------------------------------------------------ */

.catalog-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-bottom: 1px solid #eef2ff;
    padding: 44px 0 40px;
}
.catalog-hero h1 {
    font-size: 2.3rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}
.catalog-hero p { color: #475569; font-size: 1.05rem; max-width: 720px; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 14px;
}
.breadcrumbs a { color: #2563eb; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ── панель фильтров ── */
.catalog-toolbar {
    position: sticky;
    top: 74px;
    z-index: 90;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eef2ff;
    padding: 14px 0;
    margin-bottom: 28px;
}
.toolbar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.catalog-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
}
.catalog-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}
.catalog-search input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.catalog-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.catalog-sort {
    padding: 11px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    background: #fff;
    font: inherit;
    font-size: 0.92rem;
    color: #0f172a;
    cursor: pointer;
}
.catalog-sort:focus { outline: none; border-color: #2563eb; }

.chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.chip i { color: #94a3b8; font-size: 0.85rem; }
.chip:hover { border-color: #2563eb; color: #2563eb; }
.chip:hover i { color: #2563eb; }
.chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.chip.active i { color: #fff; }
.chip-count {
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 10px;
    padding: 1px 7px;
}
.chip.active .chip-count { background: rgba(255, 255, 255, 0.22); color: #fff; }

.catalog-count { font-size: 0.88rem; color: #64748b; margin-bottom: 16px; }

/* ── карточки ── */
#catalogGrid { margin-top: 0; }

.product-card { display: flex; flex-direction: column; text-align: left; }
.product-card-media {
    position: relative;
    display: block;
    width: 100%;
    height: 210px;
    padding: 0;
    border: none;
    background: #f8fafc;
    cursor: zoom-in;
    overflow: hidden;
}
.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.3s ease;
}
.product-card:hover .product-card-media img { transform: scale(1.04); }
/* без увеличения по клику (витрина на главной) */
.product-card-media:not([data-zoom]) { cursor: default; }
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 11px;
    border-radius: 40px;
}
.product-card-body { display: flex; flex-direction: column; flex: 1; }
.product-card-body p { min-height: 34px; }
.product-card-foot { margin-top: auto; display: grid; gap: 12px; }
.product-card-foot .product-price { text-align: left; }
.product-price-ask { font-size: 1.05rem; font-weight: 700; color: #475569; }
.btn-order { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-build {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.btn-build:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-order.in-cart {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.btn-order.in-cart:hover { background: #15803d; border-color: #15803d; }

/* ── пусто / показать ещё ── */
.catalog-empty {
    text-align: center;
    padding: 56px 20px;
    color: #475569;
}
.catalog-empty i { font-size: 2.4rem; color: #cbd5e1; margin-bottom: 16px; }
.catalog-empty h3 { font-size: 1.2rem; color: #0f172a; margin-bottom: 8px; }
.catalog-more-wrap { text-align: center; margin: 32px 0 8px; }
#catalogMore {
    padding: 12px 30px;
    border: 1.5px solid #2563eb;
    border-radius: 40px;
    background: #fff;
    color: #2563eb;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
#catalogMore:hover { background: #2563eb; color: #fff; }
#catalogReset {
    margin-top: 14px;
    padding: 10px 24px;
    border: 1.5px solid #cbd5e1;
    border-radius: 40px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
#catalogReset:hover { border-color: #2563eb; color: #2563eb; }

/* ── блок помощи под каталогом ── */
.catalog-help {
    background: #f1f5f9;
    border-radius: 32px;
    padding: 32px 28px;
    text-align: center;
    margin: 56px 0 70px;
}
.catalog-help i { font-size: 2rem; color: #2563eb; }
.catalog-help h2 { font-size: 1.4rem; margin: 14px 0 10px; color: #0f172a; }
.catalog-help p { color: #475569; max-width: 640px; margin: 0 auto 18px; }
.catalog-help .btn-group { justify-content: center; }

/* ── просмотр изображения ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(3px);
}
.lightbox.show { display: flex; }
.lightbox figure {
    background: #fff;
    border-radius: 24px;
    padding: 18px;
    max-width: min(720px, 92vw);
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lightbox img {
    max-width: 100%;
    max-height: 70dvh;
    object-fit: contain;
    border-radius: 14px;
    background: #f8fafc;
}
.lightbox figcaption {
    text-align: center;
    font-weight: 700;
    color: #0f172a;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

@media (max-width: 900px) {
    .catalog-toolbar { top: 0; }
    .catalog-hero h1 { font-size: 1.9rem; }
}
@media (max-width: 640px) {
    .catalog-hero { padding: 28px 0 26px; }
    .catalog-hero h1 { font-size: 1.6rem; }
    .catalog-hero p { font-size: 0.95rem; }
    .catalog-toolbar { padding: 10px 0; }
    .chips { gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .chip { flex: 0 0 auto; }
    .product-card-media { height: 170px; }
    .catalog-help { padding: 24px 18px; border-radius: 24px; margin-bottom: 48px; }
}

/* ── цвета и варианты товара ── */
.variants { display: grid; gap: 6px; }
.variants-label { font-size: 0.8rem; color: #64748b; }
.variants-label b { color: #0f172a; font-weight: 700; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
    width: 42px;
    height: 42px;
    padding: 2px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.15s;
    flex-shrink: 0;
}
.swatch img { width: 100%; height: 100%; object-fit: contain; display: block; }
.swatch:hover { border-color: #93b4fb; }
.swatch.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.consumable-card .variants { justify-items: center; margin-bottom: 10px; }
.consumable-card .swatches { justify-content: center; }
