/* ==========================================================================
   Тема «default» — витрина интернет-магазина
   ========================================================================== */

:root {
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bg: #ffffff;
    --surface: #f5f6f8;
    --surface-2: #eceef2;
    --card: #ffffff;
    --border: #e6e8ec;
    --text: #12141a;
    --text-2: #4a5060;
    --muted: #8a909c;
    --accent: #5b4cf0;
    --accent-hover: #4a3ad8;
    --accent-soft: #efedff;
    --accent-text: #4a3ad8;
    --sale: #ef3e4a;
    --success: #16a065;
    --warning: #d48806;
    --star: #ffb020;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 2px 8px rgba(18, 20, 26, .06), 0 10px 30px rgba(18, 20, 26, .05);
    --shadow-lg: 0 20px 60px rgba(18, 20, 26, .18);
    --container: 1320px;
    --header-h: 72px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e0f13;
        --surface: #17191f;
        --surface-2: #20232b;
        --card: #15171c;
        --border: #262a33;
        --text: #eceef3;
        --text-2: #b0b6c3;
        --muted: #7d8492;
        --accent: #8b7ffb;
        --accent-hover: #a097fc;
        --accent-soft: #221f3f;
        --accent-text: #b4abff;
        --shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 750; }
h2 { font-size: clamp(21px, 2.4vw, 28px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 650; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
main { min-height: 60vh; padding-bottom: 64px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.link-more { color: var(--accent-text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ---------------------------------------------------------------- Buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
    background: var(--surface); color: var(--text); font-weight: 650; cursor: pointer; white-space: nowrap;
    transition: background .15s, transform .1s, box-shadow .15s, color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { border-color: var(--text); background: transparent; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; padding: 0; }
.btn.added { background: var(--success); color: #fff; box-shadow: none; }

/* ------------------------------------------------------------------ Forms */

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], input:not([type]), select, textarea {
    width: 100%; height: 48px; padding: 0 16px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--card); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 120px; padding: 12px 16px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select { appearance: none; padding-right: 40px; cursor: pointer;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a909c' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field.error input, .field.error textarea { border-color: var(--sale); }
.field .error-text { color: var(--sale); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; background: var(--surface); }
.alert-success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.alert-error { background: color-mix(in srgb, var(--sale) 12%, transparent); color: var(--sale); }

/* ----------------------------------------------------------------- Header */

.topline { background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.topline .container { display: flex; align-items: center; gap: 20px; height: 38px; }
.topline nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.topline nav a { white-space: nowrap; }
.topline nav a.active { color: var(--accent-text); font-weight: 600; }
.topline .right { margin-left: auto; display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.topline select { height: 28px; padding: 0 26px 0 8px; border-radius: 7px; font-size: 13px; width: auto; background-position: right 7px center; }

.header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.header > .container { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.03em; white-space: nowrap; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), #c04cf0); display: grid; place-items: center; color: #fff; font-size: 19px; }
.logo:hover { color: var(--text); }
.catalog-btn { height: 46px; }
.search { position: relative; flex: 1; max-width: 640px; }
.search input { height: 46px; padding-left: 46px; background: var(--surface); border-color: transparent; }
.search input:focus { background: var(--card); }
.search > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; background: var(--card);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 70vh; overflow-y: auto;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.search-results a:hover, .search-results a.active { background: var(--surface); color: var(--text); }
.search-results img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface); }
.search-results .price { margin-left: auto; font-weight: 650; white-space: nowrap; }
.search-results .group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-action { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 12px; font-size: 12px; color: var(--text-2); position: relative; }
.header-action:hover { background: var(--surface); color: var(--text); }
.header-action .icon { width: 24px; height: 24px; }
.cart-count {
    position: absolute; top: 2px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}
.cart-count:empty { display: none; }
.menu-btn { display: none; }

/* Каталог-меню */
.catalog-menu {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 28px 0 32px; display: none;
}
.catalog-menu.open { display: block; }
.catalog-menu .cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 32px; }
.catalog-menu h4 { margin: 0 0 8px; font-size: 16px; }
.catalog-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--text-2); font-size: 15px; }

/* ------------------------------------------------------------- Breadcrumbs */

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); padding: 20px 0 10px; }
.breadcrumbs a:hover { color: var(--accent-text); }
.breadcrumbs .sep { opacity: .5; }

/* --------------------------------------------------------------- Hero */

.hero {
    margin-top: 24px; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 64px); position: relative; overflow: hidden;
    background: radial-gradient(800px 400px at 85% 10%, color-mix(in srgb, #c04cf0 40%, transparent), transparent),
                radial-gradient(700px 400px at 10% 110%, color-mix(in srgb, var(--accent) 45%, transparent), transparent), #17132e;
    color: #fff; min-height: 340px; display: flex; flex-direction: column; justify-content: center;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 56px); max-width: 720px; margin-bottom: 14px; }
.hero p { font-size: clamp(16px, 1.6vw, 19px); max-width: 560px; opacity: .85; margin-bottom: 28px; }
.hero .btn-primary { background: #fff; color: #17132e; box-shadow: none; }
.hero .btn-primary:hover { background: #f0eefc; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .35); }

.benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.benefit { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface); }
.benefit .icon { width: 28px; height: 28px; color: var(--accent); }
.benefit b { display: block; font-size: 15px; }
.benefit span { font-size: 13.5px; color: var(--muted); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.cat-tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 140px; padding: 18px;
    border-radius: var(--radius); background: var(--surface); transition: transform .2s, box-shadow .2s;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.cat-tile b { font-size: 17px; }
.cat-tile img { width: 72px; height: 72px; object-fit: contain; align-self: flex-end; border-radius: 10px; }
.cat-tile .count { font-size: 13px; color: var(--muted); }

/* -------------------------------------------------------- Product cards */

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px 18px; }
.products-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-card { display: flex; flex-direction: column; position: relative; border-radius: var(--radius); }
.product-card .media {
    position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 12px;
}
.product-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .media img { transform: scale(1.04); }
.product-card .media .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.badges { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 700; background: var(--text); color: var(--bg); width: fit-content; }
.badge-sale { background: var(--sale); color: #fff; }
.badge-hit { background: var(--accent); color: #fff; }
.badge-out { background: var(--surface-2); color: var(--text-2); }
.product-card .title { font-size: 15px; line-height: 1.35; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .brand { font-size: 13px; color: var(--muted); }
.product-card .rating { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.product-card .rating .icon { width: 14px; height: 14px; color: var(--star); }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price .now { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.price .old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.price .now.sale { color: var(--sale); }
.product-card .buy { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; }
.product-card .buy select { height: 42px; font-size: 14px; }
.product-card .buy .btn { height: 42px; flex: 1; padding: 0 14px; }
.swatches { display: flex; gap: 5px; margin-bottom: 6px; }
.swatches span { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); }

/* ------------------------------------------------------------- Catalog */

.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.catalog-head h1 { margin: 0; }
.catalog-head .count { color: var(--muted); font-size: 15px; }
.subcats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 19px; background: var(--surface); font-size: 14.5px; font-weight: 550; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); }
.chip .x { opacity: .6; }

.catalog-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar select { width: auto; height: 42px; }
.filter-btn, .filter-panel-head { display: none !important; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* Фильтр */
.filter { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.filter-group { border-bottom: 1px solid var(--border); padding: 16px 0; }
.filter-group:first-child { padding-top: 0; }
.filter-title { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; font-size: 15px; text-align: left; }
.filter-title .icon { transition: transform .2s; color: var(--muted); }
.filter-group.collapsed .filter-title .icon { transform: rotate(-90deg); }
.filter-group.collapsed .filter-body { display: none; }
.filter-body { margin-top: 12px; display: grid; gap: 8px; }
.filter-body.scroll { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.filter-option { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.filter-option .cnt { margin-left: auto; color: var(--muted); font-size: 13px; }
.filter-option.disabled { opacity: .4; }
.filter-hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.color-opt { position: relative; cursor: pointer; }
.color-opt input { position: absolute; opacity: 0; }
.color-opt span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s; }
.color-opt input:checked + span { box-shadow: 0 0 0 2px var(--accent); }
.color-opt.disabled { opacity: .3; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range input { height: 42px; padding: 0 12px; font-size: 14.5px; }
.filter-more { color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.filter-foot { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0 4px; display: grid; gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }

.loading { opacity: .5; pointer-events: none; transition: opacity .2s; }

/* Пагинация */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 36px; }
.pagination a, .pagination span { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; background: var(--surface); }
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current { background: var(--text); color: var(--bg); }
.pagination .dots { background: none; }

.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state .icon { width: 56px; height: 56px; opacity: .4; margin-bottom: 12px; }

/* --------------------------------------------------------------- Product */

.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 8px; }
.gallery { position: sticky; top: calc(var(--header-h) + 16px); display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
.gallery-main { position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); cursor: zoom-in; grid-column: 2; grid-row: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; flex-direction: column; gap: 10px; grid-column: 1; grid-row: 1; max-height: 600px; overflow-y: auto; scrollbar-width: none; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; aspect-ratio: 1; }
.gallery-thumbs button.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery.single { grid-template-columns: minmax(0, 1fr); }
.gallery.single .gallery-main { grid-column: 1; }

.product-info h1 { font-size: clamp(24px, 2.6vw, 34px); margin-bottom: 10px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.product-meta .rating { color: var(--text); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.product-meta .rating .icon { width: 16px; height: 16px; color: var(--star); }
.product-price { margin: 18px 0 6px; }
.product-price .now { font-size: 34px; }
.product-price .old { font-size: 18px; }
.save { display: inline-block; background: color-mix(in srgb, var(--sale) 12%, transparent); color: var(--sale); font-weight: 700; padding: 3px 10px; border-radius: 8px; font-size: 14px; }

.axis { margin: 20px 0; }
.axis-title { font-weight: 650; margin-bottom: 10px; font-size: 15px; }
.axis-title span { font-weight: 400; color: var(--text-2); }
.axis-values { display: flex; flex-wrap: wrap; gap: 8px; }
.axis-btn {
    min-width: 52px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card);
    cursor: pointer; font-weight: 600; font-size: 15px; transition: border-color .15s, background .15s;
}
.axis-btn:hover { border-color: var(--text-2); }
.axis-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.axis-btn.unavailable { color: var(--muted); background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--surface) 6px 7px); }
.axis-btn.color { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--border); }
.axis-btn.color.active { box-shadow: 0 0 0 2px var(--accent); background: none; }
.axis-btn.color.unavailable { opacity: .35; }
.variant-list { display: grid; gap: 8px; margin: 18px 0; }
.variant-opt { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; }
.variant-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.variant-opt .vp { margin-left: auto; font-weight: 700; }

.buy-box { display: flex; gap: 12px; align-items: center; margin: 22px 0 14px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; height: 54px; border-radius: 14px; background: var(--surface); }
.qty button { width: 46px; height: 100%; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.qty button:hover { color: var(--text); }
.qty input { width: 48px; height: 100%; border: 0; background: none; text-align: center; padding: 0; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty input:focus { box-shadow: none; }
.qty.sm { height: 40px; border-radius: 10px; }
.qty.sm button { width: 34px; }
.qty.sm input { width: 36px; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--success); }
.stock.low { color: var(--warning); }
.stock.out { color: var(--muted); }
.product-annotation { color: var(--text-2); }
.perks { display: grid; gap: 10px; margin-top: 22px; padding: 18px; border-radius: var(--radius); background: var(--surface); }
.perks div { display: flex; gap: 12px; align-items: center; font-size: 14.5px; }
.perks .icon { color: var(--accent); }

.tabs-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 56px 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs-nav button { background: none; border: 0; padding: 14px 18px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 16px; }
.tabs-nav button.active { color: var(--text); border-color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.rich { max-width: 860px; }
.rich img { border-radius: 12px; margin: 16px 0; }
.rich h2, .rich h3 { margin-top: 1.4em; }
.rich ul, .rich ol { padding-left: 1.3em; }
.rich table { border-collapse: collapse; width: 100%; }
.rich td, .rich th { border: 1px solid var(--border); padding: 8px 12px; }
.specs { width: 100%; max-width: 860px; border-collapse: collapse; }
.specs td { padding: 12px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.specs td:first-child { color: var(--text-2); width: 45%; padding-right: 24px; }
.specs .hint { display: block; color: var(--muted); font-size: 13px; }

.reviews { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.review { padding: 18px 0; border-bottom: 1px solid var(--border); }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.review-head b { font-size: 15.5px; }
.stars { display: inline-flex; color: var(--star); }
.stars .icon { width: 16px; height: 16px; }
.stars .off { color: var(--surface-2); }
.review-form { padding: 22px; border-radius: var(--radius); background: var(--surface); display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.rate-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate-input input { display: none; }
.rate-input label { cursor: pointer; color: var(--surface-2); }
.rate-input label .icon { width: 28px; height: 28px; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: var(--star); }
.pending { display: inline-block; font-size: 12.5px; background: var(--surface); padding: 2px 8px; border-radius: 6px; color: var(--muted); }

.product-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 14.5px; }
.product-nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

/* ---------------------------------------------------------------- Cart */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto 40px; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cart-item img, .cart-item .ph { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.cart-item .name { font-weight: 650; }
.cart-item .variant { color: var(--muted); font-size: 14px; }
.cart-item .sum { font-weight: 750; font-size: 18px; white-space: nowrap; min-width: 110px; text-align: right; }
.cart-remove { width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.cart-remove:hover { background: var(--surface); color: var(--sale); }
.summary { position: sticky; top: calc(var(--header-h) + 16px); padding: 24px; border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 12px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; }
.summary-row.total { font-size: 22px; font-weight: 800; padding-top: 12px; border-top: 1px solid var(--border); }
.summary-row.discount { color: var(--success); }
.coupon { display: flex; gap: 8px; }
.coupon input { height: 44px; }
.coupon .btn { height: 44px; }

.checkout { margin-top: 40px; display: grid; gap: 28px; }
.step h2 { display: flex; gap: 12px; align-items: center; font-size: 22px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 16px; flex: none; }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { margin-top: 3px; }
.option .o-title { font-weight: 650; }
.option .o-desc { color: var(--text-2); font-size: 14px; }
.option .o-desc p:last-child { margin: 0; }
.option .o-price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.option.disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- Order */

.order-status { display: flex; gap: 16px; align-items: center; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 28px; flex-wrap: wrap; }
.order-status .big { width: 54px; height: 54px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; flex: none; }
.order-status .big .icon { width: 28px; height: 28px; }
.status-pill { display: inline-flex; padding: 5px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent-text); }
.status-pill.paid { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.payment-box { padding: 24px; border-radius: var(--radius-lg); border: 1.5px solid var(--border); display: grid; gap: 14px; }

/* ---------------------------------------------------------------- Blog */

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.post-card { display: flex; flex-direction: column; gap: 10px; }
.post-card .cover { aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .date { font-size: 13.5px; color: var(--muted); }
.post-card h3 { margin: 0; }
.post-card .ann { color: var(--text-2); font-size: 15px; }
.article { max-width: 800px; }
.article .date { color: var(--muted); margin-bottom: 18px; }
.article .cover { border-radius: var(--radius-lg); margin-bottom: 28px; }

/* ------------------------------------------------------------ Account */

.auth { max-width: 460px; margin: 40px auto; padding: 32px; border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 16px; }
.auth h1 { font-size: 28px; margin: 0; }
.account { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.orders-list { display: grid; gap: 10px; }
.order-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--surface); }
.order-row:hover { color: var(--text); background: var(--surface-2); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.contact-card { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 14px; }
.contact-card div { display: flex; gap: 12px; align-items: center; }
.contact-card .icon { color: var(--accent); }

/* ---------------------------------------------------------------- Footer */

.footer { background: var(--surface); padding: 56px 0 28px; margin-top: 40px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer h4 { margin: 0 0 12px; font-size: 15px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--text-2); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer .about { color: var(--text-2); max-width: 340px; }

/* ------------------------------------------------------- Toast, drawer */

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100; opacity: 0;
    background: var(--text); color: var(--bg); padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg);
    display: flex; gap: 14px; align-items: center; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: var(--bg); font-weight: 700; text-decoration: underline; white-space: nowrap; }
.toast.error { background: var(--sale); color: #fff; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 20, .45); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(380px, 88vw); z-index: 90; background: var(--bg); padding: 20px;
    transform: translateX(-100%); transition: transform .3s; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.drawer.right { left: auto; right: 0; transform: translateX(100%); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-head h3 { margin: 0; }
.drawer nav a { display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--border); font-weight: 550; }
.drawer .sub { padding-left: 16px; }
.drawer .sub a { font-weight: 400; color: var(--text-2); }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
dialog.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 12px; }
dialog.lightbox .close { position: fixed; top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; display: grid; place-items: center; }
dialog.lightbox .nav { position: fixed; top: 50%; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; display: grid; place-items: center; transform: translateY(-50%); }
dialog.lightbox .prev { left: 16px; }
dialog.lightbox .next { right: 16px; }

.admin-bar { position: fixed; bottom: 16px; left: 16px; z-index: 70; display: flex; gap: 6px; }
.admin-bar a { background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }

/* ------------------------------------------------------------ Responsive */

@media (max-width: 1100px) {
    .catalog-layout { grid-template-columns: minmax(0, 1fr); }
    .filter-btn { display: inline-flex !important; }
    .filter-panel-head { display: flex !important; }
    .filter-panel {
        position: fixed; top: 0; bottom: 0; left: 0; width: min(380px, 90vw); z-index: 90; background: var(--bg); padding: 20px;
        transform: translateX(-100%); transition: transform .3s; overflow-y: auto; box-shadow: var(--shadow-lg);
    }
    .filter-panel.open { transform: none; }
    .filter { position: static; max-height: none; overflow: visible; }
    .product { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .gallery { position: static; }
    .cart-layout, .account, .contact-grid, .reviews { grid-template-columns: minmax(0, 1fr); }
    .summary, .review-form { position: static; }
    .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .products-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    :root { --header-h: 64px; }
    .container { padding: 0 16px; }
    .topline { display: none; }
    .menu-btn { display: inline-flex; }
    .catalog-btn, .header-action span { display: none; }
    .header > .container { gap: 8px; }
    .logo { font-size: 0; gap: 0; }
    .logo-mark { font-size: 18px; }
    .search { order: 0; }
    .header-action { padding: 6px; }
    .cart-count { right: 0; }
    .products-grid, .products-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
    .product-card .buy select { display: none; }
    .price .now { font-size: 17px; }
    .gallery { grid-template-columns: minmax(0, 1fr); }
    .gallery-main { grid-column: 1; }
    .gallery-thumbs { grid-column: 1; grid-row: 2; flex-direction: row; max-height: none; overflow-x: auto; }
    .gallery-thumbs button { width: 64px; flex: none; }
    .cart-item { grid-template-columns: 72px minmax(0, 1fr) 36px; grid-template-rows: auto auto; }
    .cart-item img, .cart-item .ph { width: 72px; height: 72px; grid-row: span 2; }
    .cart-item .qty { grid-column: 2; }
    .cart-item .sum { grid-column: 2; text-align: left; }
    .cart-item .cart-remove { grid-column: 3; grid-row: 1; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .benefits { grid-template-columns: minmax(0, 1fr); }
    .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .order-row { grid-template-columns: 1fr auto; }
    .buy-box .btn-lg { flex: 1; }
    .hero { min-height: 280px; }
}

/* ======================================================= 1.1: новые блоки */
.product-card { position: relative; }
.card-actions { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.card-action { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); color: var(--text-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: color .15s, transform .15s; }
.card-action:hover { color: var(--accent); transform: scale(1.06); }
.card-action.active { color: var(--sale); }
.card-action[data-list="compare"].active { color: var(--accent); }
.link-action { border: 0; background: none; padding: 0; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 14px; }
.link-action:hover, .link-action.active { color: var(--accent); }
.link-action[data-list="favorite"].active { color: var(--sale); }
.gallery-main { position: relative; }
.stock.backorder { color: var(--accent-text); }
.stock-backorder { color: var(--accent-text); }
.tiers { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--text-2); margin: -4px 0 10px; }
.buy-box { flex-wrap: wrap; }
.city-delivery { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); font-size: 14px; margin: 14px 0; }
.bundle { margin: 14px 0; font-size: 14.5px; }
.bundle ul { margin: 6px 0 0; padding-left: 18px; }
.city-link { display: inline-flex; align-items: center; gap: 4px; }

dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 26px; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(10, 12, 18, .55); }
dialog.modal h3 { margin: 0 0 8px; font-size: 21px; }
dialog.modal form { display: grid; gap: 12px; }
dialog.modal .close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.city-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 12px; max-height: 60vh; overflow: auto; margin-top: 10px; }
.city-list a { padding: 6px 0; color: var(--text-2); }
.city-list a.active, .city-list a:hover { color: var(--accent); }
.city-filter { width: 100%; margin-top: 6px; }

.compare-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.compare { border-collapse: collapse; min-width: 100%; font-size: 14.5px; }
table.compare th, table.compare td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; min-width: 180px; }
table.compare th:first-child, table.compare td:first-child { position: sticky; left: 0; background: var(--bg); color: var(--muted); min-width: 150px; font-weight: 500; }
table.compare th { position: relative; font-weight: 600; }
table.compare th img { width: 140px; height: 140px; object-fit: contain; display: block; margin-bottom: 8px; }
table.compare tr[data-same] td { color: var(--muted); }
.compare-remove { position: absolute; right: 8px; top: 8px; }
.compare-remove button { border: 0; background: var(--surface); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--text-2); display: grid; place-items: center; }
.subpages { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
    .hide-sm { display: none !important; }
    .card-action { width: 30px; height: 30px; }
}
