/* БХТ Офис-маркет */

:root {
  --brand: #126766;
  --brand-hover: #0d5251;
  --brand-soft: #e3f1f0;
  --brand-text: #0f5b5a;
  --bg: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --border: #e3e6e8;
  --border-strong: #cfd4d8;
  --text: #1a1f23;
  --text-2: #5b6670;
  --text-3: #8a949c;
  --danger: #d3302f;
  --danger-soft: #fdecec;
  --warning: #a35f00;
  --warning-soft: #fff4e0;
  --success: #1d7a3e;
  --success-soft: #e6f5ea;
  --info-soft: #e8f0fb;
  --info: #24569c;
  --img-bg: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 2px 8px rgba(16, 24, 32, .05);
  --shadow-lg: 0 8px 28px rgba(16, 24, 32, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #3aa7a1;
  --brand-hover: #4bbab4;
  --brand-soft: #173533;
  --brand-text: #7fd0ca;
  --bg: #111416;
  --surface: #1a1e21;
  --surface-2: #22272b;
  --border: #2c3236;
  --border-strong: #3a4146;
  --text: #e8ecee;
  --text-2: #a3adb4;
  --text-3: #78838b;
  --danger: #ff6b6a;
  --danger-soft: #3a1d1d;
  --warning: #f2b45a;
  --warning-soft: #3a2c15;
  --success: #5fcf86;
  --success-soft: #17301f;
  --info-soft: #1a2a40;
  --info: #8db6f0;
  --img-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75em; }
code { font: 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.page { padding: 20px 0 56px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ——— Шапка ——— */

.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-main { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.logo:hover { text-decoration: none; }
.logo img { height: 28px; width: auto; }
.logo span { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }

.search { flex: 1; display: flex; max-width: 720px; position: relative; }
.search input {
  flex: 1; min-width: 0; height: 42px;
  padding: 0 44px 0 14px;
  border: 2px solid var(--brand); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
  outline: none;
}
.search input::placeholder { color: var(--text-3); }
.search button {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 7px; background: var(--brand); color: #fff; cursor: pointer;
}
.search button:hover { background: var(--brand-hover); }
.search input::-webkit-search-cancel-button { display: none; }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hdr-link {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; padding: 6px 8px; border-radius: 10px;
  color: var(--text-2); font-size: 12px; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.hdr-link:hover { color: var(--brand-text); background: var(--surface-2); text-decoration: none; }
.hdr-link.active { color: var(--brand-text); }
.hdr-link .i { width: 22px; height: 22px; }
.badge-count {
  position: absolute; top: 1px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.badge-count:empty, .badge-count[data-count="0"] { display: none; }

.header-sub { border-top: 1px solid var(--border); }
.subnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 11px 14px; color: var(--text-2); font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--brand-text); border-bottom-color: var(--brand); }
.subnav .subnav-right { margin-left: auto; }

.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ——— Кнопки и формы ——— */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-soft { background: var(--brand-soft); color: var(--brand-text); }
.btn-soft:hover { filter: brightness(.97); }
.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: none; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a949c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-sm, .select-sm { height: 34px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.form-grid > * { grid-column: span 12; }
.form-grid .c-3 { grid-column: span 3; }
.form-grid .c-4 { grid-column: span 4; }
.form-grid .c-6 { grid-column: span 6; }
.form-grid .c-8 { grid-column: span 8; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }

/* ——— Панели, уведомления ——— */

.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px; font-size: 14px;
  background: var(--info-soft); color: var(--info);
}
.flash > span { flex: 1; color: var(--text); }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-danger { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warning-soft); color: var(--warning); }
.flash-close { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0; line-height: 0; }
.flash-close:hover { color: var(--text); }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; background: var(--warning-soft); color: var(--text); }
.notice-info { background: var(--info-soft); }
.notice-danger { background: var(--danger-soft); }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 18px; border-radius: 10px; background: #1f2529; color: #fff;
  font-size: 14px; box-shadow: var(--shadow-lg); max-width: min(90vw, 440px);
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .i { width: 48px; height: 48px; stroke-width: 1.5; color: var(--text-3); margin: 0 auto 12px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .sub { width: 100%; margin-top: -8px; color: var(--text-2); font-size: 14px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }

/* ——— Каталог ——— */

.shop { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
.side-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 0 0 8px; }
.cats { display: flex; flex-direction: column; gap: 1px; }
.cats a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 14px;
}
.cats a:hover { background: var(--surface); text-decoration: none; }
.cats a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.cats .cnt { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.cats a.active .cnt { color: inherit; }

.budget-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.budget-card summary { list-style: none; cursor: default; }
.budget-card summary::-webkit-details-marker { display: none; }
.budget { padding: 8px 0; }
.budget + .budget { border-top: 1px solid var(--border); }
.budget-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.budget-name { color: var(--text-2); }
.budget-left { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-left.zero { color: var(--danger); }
.bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin: 6px 0 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.bar > i.hot { background: var(--warning); }
.bar > i.full { background: var(--danger); }
.budget-sub { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h1 { font-size: 24px; }
.toolbar .total { color: var(--text-3); font-size: 14px; }
.toolbar .tools { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .select { width: auto; height: 36px; font-size: 14px; }
.chips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--border-strong); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.results { position: relative; transition: opacity .15s; }
.results.loading { opacity: .5; pointer-events: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--img-bg); }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.card-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #c2c8cc; background: var(--surface-2); }
.card-img .noimg .i { width: 40px; height: 40px; stroke-width: 1.4; }
.tag { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.tag-out { background: #2a2f33; color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.price { font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-name {
  color: var(--text); font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.card-name:hover { color: var(--brand-text); text-decoration: none; }
.card-meta { font-size: 12px; color: var(--text-3); min-height: 1.45em; }
.card-meta .low { color: var(--warning); }
.card-buy { margin-top: auto; padding-top: 6px; }

.qty { display: flex; align-items: center; height: 40px; border-radius: 10px; background: var(--brand-soft); overflow: hidden; }
.qty button {
  width: 40px; height: 100%; border: 0; background: none; color: var(--brand-text);
  display: grid; place-items: center; cursor: pointer;
}
.qty button:hover { background: rgba(0, 0, 0, .05); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty input {
  flex: 1; min-width: 0; width: 48px; height: 100%; border: 0; background: none; text-align: center;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--brand-text); outline: none;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm { height: 34px; }
.qty-sm button { width: 34px; }

.more { display: flex; justify-content: center; padding: 24px 0 8px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 10px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ——— Карточка товара ——— */

.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.pdp-img { background: var(--img-bg); border-radius: var(--radius); aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); }
.pdp-img img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.pdp-img .noimg { color: #c2c8cc; }
.pdp-img .noimg .i { width: 72px; height: 72px; stroke-width: 1.2; }
.pdp-info h1 { font-size: 24px; margin-bottom: 12px; }
.pdp-desc { color: var(--text); white-space: pre-line; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin: 16px 0; }
.props dt { color: var(--text-2); }
.props dd { margin: 0; }
.buybox { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.buybox .price { font-size: 30px; }
.buybox .qty { height: 48px; }
.buybox .qty button { width: 48px; }
.buybox-note { font-size: 13px; color: var(--text-2); }
.section-title { font-size: 20px; margin: 36px 0 14px; }

/* ——— Корзина ——— */

.cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.cart-lines { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-line { display: grid; grid-template-columns: 88px minmax(0, 1fr) 132px 120px 36px; gap: 16px; align-items: center; padding: 16px 20px; }
.cart-line + .cart-line { border-top: 1px solid var(--border); }
.cart-line .thumb { width: 88px; height: 88px; border-radius: 8px; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cart-line .thumb .noimg { color: #c2c8cc; }
.cart-line .name { color: var(--text); font-weight: 500; }
.cart-line .name:hover { color: var(--brand-text); }
.cart-line .sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.cart-line .sum { font-weight: 700; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-line .rm { color: var(--text-3); }
.cart-line .rm:hover { color: var(--danger); background: var(--danger-soft); }
.summary { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sum-row .num { font-weight: 600; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sum-total b { font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.over { color: var(--danger); }

/* ——— Таблицы ——— */

.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .03em;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }
.table .clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; color: #c2c8cc; }
.table .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table tr.dim td { opacity: .55; }
.row-link { color: var(--text); font-weight: 500; }
.row-link:hover { color: var(--brand-text); }

.status { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.status-sent { background: var(--info-soft); color: var(--info); }
.status-processing { background: var(--warning-soft); color: var(--warning); }
.status-completed { background: var(--success-soft); color: var(--success); }
.status-cancelled { background: var(--surface-2); color: var(--text-3); }
.status-deleted { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; background: var(--surface); border: 1px solid var(--border); }
.tabs a:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.tabs a.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.tabs .cnt { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input, .filters .select { width: auto; flex: 1 1 200px; max-width: 360px; }

.pager { display: flex; gap: 4px; justify-content: center; align-items: center; padding: 20px 0 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; color: var(--text); }
.pager a:hover { background: var(--surface); text-decoration: none; }
.pager .current { background: var(--brand); color: #fff; font-weight: 600; }
.pager .gap { color: var(--text-3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: var(--text); }
a.stat:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

.img-preview { width: 160px; height: 160px; border-radius: 10px; background: var(--img-bg); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.img-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.success-box { text-align: center; padding: 28px 20px; }
.success-box .mark { width: 56px; height: 56px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 0 auto 12px; }
.success-box .mark .i { width: 28px; height: 28px; stroke-width: 2.5; }

/* ——— Вход ——— */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-card .logo-big { height: 40px; width: auto; margin-bottom: 20px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card form { margin-top: 22px; }
.auth-foot { margin-top: 16px; font-size: 13px; color: var(--text-3); text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 36px; border: 0; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.pw-toggle:hover { color: var(--text); }

/* ——— Адаптив ——— */

@media (max-width: 1180px) {
  .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .buybox { grid-column: 1 / -1; position: static; }
}

@media (max-width: 960px) {
  .shop { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .sidebar .cats-block { display: none; }
  .chips { display: flex; }
  .budget-card summary { cursor: pointer; display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
  .budget-card:not([open]) .budget-list { display: none; }
  .cart, .layout-2 { grid-template-columns: 1fr; }
  .summary { position: static; }
  .form-grid .c-3, .form-grid .c-4 { grid-column: span 6; }
  .form-grid .c-6, .form-grid .c-8 { grid-column: span 12; }
}

@media (min-width: 961px) {
  .budget-card summary .chev { display: none; }
  .budget-card summary { pointer-events: none; }
  .budget-card .budget-list { display: block !important; }
}

@media (max-width: 720px) {
  :root { --header-h: 108px; }
  .container { padding: 0 12px; }
  .page { padding-top: 14px; }
  .header-main { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 8px 4px; }
  .logo span { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hdr-link { min-width: 52px; padding: 4px 6px; font-size: 11px; }
  .hdr-link .lbl-long { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding: 10px; }
  .card-img img { padding: 8px; }
  .price { font-size: 17px; }
  .toolbar h1 { font-size: 20px; }
  .toolbar .tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .pdp { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "img info rm" "img qty sum"; gap: 8px 12px; padding: 14px; }
  .cart-line .thumb { grid-area: img; width: 72px; height: 72px; }
  .cart-line .info { grid-area: info; }
  .cart-line .qty { grid-area: qty; width: 124px; }
  .cart-line .sum { grid-area: sum; }
  .cart-line .rm { grid-area: rm; align-self: start; }
  .form-grid .c-3, .form-grid .c-4 { grid-column: span 12; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  h1 { font-size: 22px; }
  .panel { padding: 16px; }
}

/* ——— ФОКС-ИИ ——— */

.fox-hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 8px 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 16px 22px 16px 8px;
  border-radius: 20px;
  background:
    radial-gradient(420px 240px at 16% 100%, rgba(143, 196, 168, .5), transparent 70%),
    linear-gradient(115deg, #e5f3ee 0%, var(--surface) 48%);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
[data-theme="dark"] .fox-hero {
  background:
    radial-gradient(420px 240px at 16% 100%, rgba(58, 167, 161, .28), transparent 70%),
    linear-gradient(115deg, #16302e 0%, var(--surface) 52%);
}
.fox-hero-art { display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.fox-hero-art img { width: 100%; height: 420px; object-fit: contain; object-position: bottom center; }
.fox-copy { min-width: 0; }
.fox-copy-top { display: flex; align-items: flex-start; gap: 12px; }
.fox-copy-top > div { min-width: 0; }
.fox-hero:not(.has-chat) [data-fox-clear] { visibility: hidden; }
.fox-kicker {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.fox-title { margin: 8px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.fox-lead { margin: 0; color: var(--text-2); font-size: 14px; max-width: 62ch; }
.fox-log {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 300px; overflow-y: auto; margin: 14px 0;
  padding-right: 4px; scrollbar-width: thin;
}
.fox-log:empty { display: none; margin: 0; }
.fox-msg { max-width: min(92%, 640px); padding: 10px 12px; border-radius: 14px; font-size: 14px; }
.fox-msg-text { white-space: pre-wrap; }
.fox-msg-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.fox-msg-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
[data-theme="dark"] .fox-msg-assistant { background: var(--surface-2); }
.fox-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.fox-suggest button {
  padding: 7px 14px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.fox-suggest button:hover { border-color: var(--border-strong); }
.fox-form { display: flex; gap: 8px; }
.fox-form .input { flex: 1; min-width: 0; }
.fox-form .btn { flex: none; }
.fox-picks-wrap { margin-top: 10px; }
.fox-picks-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fox-picks { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.fox-picks .card { flex: 0 0 180px; }
.fox-msg-user .fox-picks-wrap { display: none; }

.fox-img { object-fit: contain; }
.fox-img-login { flex: none; height: min(640px, 78vh); width: auto; max-width: min(260px, 38vw); object-position: bottom; }
.fox-img-empty { display: block; height: 260px; width: 220px; max-width: 100%; object-fit: contain; margin: 0 auto 8px; }
.fox-img-peek { height: 104px; width: 150px; max-width: 150px; object-fit: contain; object-position: right bottom; margin-left: auto; flex: none; }
.fox-img-summary { display: block; width: 180px; height: 140px; max-width: 100%; object-fit: contain; margin: 0 auto 12px; }
.fox-img-side { display: block; height: 380px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; }
.fox-img-truck { width: min(280px, 42%); height: 190px; object-fit: contain; object-position: center bottom; flex: none; }

.fox-success { display: flex; align-items: center; gap: 8px 18px; text-align: left; }
.fox-banner {
  display: flex; align-items: center; gap: 8px 18px;
  margin: 0 0 22px; padding: 8px 22px 8px 8px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.fox-banner-art { width: min(340px, 42%); height: 180px; object-fit: contain; object-position: left bottom; flex: none; }
[data-theme="dark"] .fox-banner {
  background:
    radial-gradient(360px 180px at 12% 100%, rgba(58, 167, 161, .22), transparent 70%),
    var(--surface);
}
.fox-nudge {
  display: flex; align-items: center; gap: 14px;
  margin-top: 28px; padding: 8px 16px 8px 8px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); color: var(--text);
}
.fox-nudge:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.fox-nudge img { width: 78px; height: 150px; object-fit: contain; object-position: bottom; flex: none; }
.auth-layout { display: flex; align-items: flex-end; justify-content: center; gap: 8px; width: min(920px, 100%); }
.auth-layout .auth-card { flex: none; }

@media (max-width: 720px) {
  .fox-hero { grid-template-columns: 1fr; padding: 14px 14px 16px; }
  .fox-hero-art img { height: 250px; }
  .fox-title { font-size: 22px; }
  .fox-form { flex-direction: column; }
  .fox-success, .fox-banner { flex-direction: column; text-align: center; }
  .fox-success .row, .fox-banner { justify-content: center; }
  .fox-img-login { height: 220px; max-width: 140px; }
  .fox-img-truck, .fox-banner-art { width: 220px; height: 150px; }
  .fox-img-side { height: 260px; }
  .fox-nudge { align-items: flex-start; }
  .auth-layout { flex-direction: column; align-items: center; }
}
