:root {
  color-scheme: dark;
  --brand: #4d7cff;
  --brand-600: #3a66e8;
  --brand-700: #2b4fc4;
  --brand-soft: rgba(77, 124, 255, .14);
  --brand-grad: linear-gradient(135deg, #4d7cff, #8b5cf6);
  --navy: #0d1020;
  --navy-2: #12152a;
  --bg: #0a0a0c;
  --card: #141419;
  --card-2: #1b1b21;
  --ink: #f5f5f7;
  --muted: #8e8e93;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .2);
  --sep: rgba(255, 255, 255, .07);
  --green: #34c759;
  --red: #ff453a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
  --glass: rgba(12, 12, 16, .72);
  --photo-bg: #fff;
  --photo-dark-bg: #101013;
  --header-fg: #fff;
  --header-border: rgba(255, 255, 255, .08);
  --header-chip-bg: rgba(255, 255, 255, .07);
  --header-chip-border: rgba(255, 255, 255, .16);
  --header-chip-hover: rgba(255, 255, 255, .13);
  --header-input-bg: rgba(255, 255, 255, .1);
  --header-input-hover: rgba(255, 255, 255, .14);
  --header-input-fg: #fff;
  --header-muted: #a6adc0;
  --header-focus-ring: rgba(255, 255, 255, .18);
  --topbar-bg: rgba(255, 255, 255, .04);
  --topbar-border: rgba(255, 255, 255, .06);
  --topbar-fg: #9aa2b8;
  --topbar-link: #c6cdf0;
  --topbar-link-hover: #fff;
  --input-bg: #1b1b21;
  --input-border: rgba(255, 255, 255, .12);
  --input-ph: #6b6b73;
  --input-disabled-bg: #121216;
  --input-disabled-fg: #6b6b73;
  --cat-fg: #b6bccb;
  --cat-name: #6f7686;
  --cat-cnt-bg: rgba(255, 255, 255, .08);
  --cat-cnt-fg: #8f99ad;
  --out-fg: #6f7686;
  --out-dot: #4a4a52;
  --footer-bg: #0c0c0f;
  --footer-border: rgba(255, 255, 255, .08);
  --footer-fg: #9aa2b8;
  --footer-h: #fff;
  --footer-link: #aeb6c9;
  --footer-link-hover: #fff;
  --toast-bg: rgba(20, 20, 25, .92);
  --sb-thumb: #3a3a42;
  --sb-track: #101013;
  --alert-light-bg: rgba(255, 255, 255, .08);
  --alert-light-brd: rgba(255, 255, 255, .12);
  --alert-secondary-bg: rgba(255, 255, 255, .06);
  --alert-secondary-brd: rgba(255, 255, 255, .1);
  --alert-info-fg: #9dbaff;
  --alert-info-brd: rgba(77, 124, 255, .3);
  --alert-danger-fg: #ff9d95;
  --alert-danger-brd: rgba(255, 69, 58, .3);
  --alert-warning-fg: #ffd76a;
  --alert-warning-brd: rgba(255, 214, 10, .28);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--muted);
  --bs-emphasis-color: var(--ink);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f6;
  --card: #ffffff;
  --card-2: #f0f0f4;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .2);
  --sep: rgba(0, 0, 0, .07);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .04);
  --glass: rgba(255, 255, 255, .82);
  --header-fg: #1d1d1f;
  --header-border: rgba(0, 0, 0, .08);
  --header-chip-bg: rgba(0, 0, 0, .05);
  --header-chip-border: rgba(0, 0, 0, .12);
  --header-chip-hover: rgba(0, 0, 0, .09);
  --header-input-bg: rgba(0, 0, 0, .06);
  --header-input-hover: rgba(0, 0, 0, .09);
  --header-input-fg: #1d1d1f;
  --header-muted: #86868b;
  --header-focus-ring: rgba(77, 124, 255, .25);
  --topbar-bg: rgba(0, 0, 0, .02);
  --topbar-border: rgba(0, 0, 0, .06);
  --topbar-fg: #6e6e73;
  --topbar-link: #4a4a55;
  --topbar-link-hover: #1d1d1f;
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, .16);
  --input-ph: #a1a1aa;
  --input-disabled-bg: #f0f0f4;
  --input-disabled-fg: #a1a1aa;
  --cat-fg: #51515a;
  --cat-name: #8e8e93;
  --cat-cnt-bg: rgba(0, 0, 0, .06);
  --cat-cnt-fg: #6e6e73;
  --out-fg: #8e8e93;
  --out-dot: #c7c7cc;
  --footer-bg: #ececf0;
  --footer-border: rgba(0, 0, 0, .08);
  --footer-fg: #6e6e73;
  --footer-h: #1d1d1f;
  --footer-link: #4a4a55;
  --footer-link-hover: #1d1d1f;
  --toast-bg: rgba(255, 255, 255, .95);
  --sb-thumb: #c7c7cc;
  --sb-track: #ececf0;
  --alert-light-bg: #ffffff;
  --alert-light-brd: rgba(0, 0, 0, .1);
  --alert-secondary-bg: #f2f2f7;
  --alert-secondary-brd: rgba(0, 0, 0, .08);
  --alert-info-fg: #2b4fc4;
  --alert-warning-fg: #92610a;
  --alert-warning-brd: rgba(255, 214, 10, .45);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--muted);
  --bs-emphasis-color: var(--ink);
}

* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 8px; }
::-webkit-scrollbar-track { background: var(--sb-track); }

body {
  background: var(--bg);
  font-family: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { min-height: 60vh; flex: 1; }

a { color: var(--brand); }
a:hover { color: var(--brand-600); }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--input-border);
  background-color: var(--input-bg);
  color: var(--ink);
  padding: .55rem .85rem;
}
.form-control::placeholder { color: var(--input-ph); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  background-color: var(--input-bg);
  color: var(--ink);
  box-shadow: 0 0 0 .22rem rgba(77, 124, 255, .2);
}
.form-control:disabled, .form-select:disabled { background-color: var(--input-disabled-bg); color: var(--input-disabled-fg); }
.form-select option { color: var(--ink); background: var(--card); }

.form-check-input {
  background-color: var(--input-bg);
  border-color: var(--line-strong);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(77, 124, 255, .2); border-color: var(--brand); }
.form-label { color: var(--muted); font-weight: 600; }

.btn { border-radius: 50rem; font-weight: 600; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 8px 22px rgba(77, 124, 255, .35); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-outline-light { border-radius: 50rem; }
.btn-outline-danger { border-color: var(--red); color: var(--red); }
.btn-outline-danger:hover { background: var(--red); border-color: var(--red); }
.btn-lg { border-radius: 50rem; }

/* ===== Шапка (стекло) ===== */
.site-header {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: var(--header-fg);
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--header-border);
}
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  font-size: .8rem;
  color: var(--topbar-fg);
}
.topbar a { color: var(--topbar-link); text-decoration: none; }
.topbar a:hover { color: var(--topbar-link-hover); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--header-fg);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .2px;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--header-fg); }
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  box-shadow: 0 6px 18px rgba(77, 124, 255, .45);
}
.brand-logo svg { width: 24px; height: 24px; }
.header-tg { color: #27a7e7; }
.header-tg:hover { color: #3cb5f0; }

.store-inline .form-select {
  width: 200px;
  background: var(--header-input-bg);
  color: var(--header-input-fg);
  border: 1px solid var(--header-chip-border);
  border-radius: 50rem;
  padding: .3rem .85rem;
  font-size: .85rem;
  font-weight: 500;
}
.store-inline .form-select:focus {
  box-shadow: 0 0 0 .2rem var(--header-focus-ring);
  border-color: var(--brand);
}
.store-inline .form-select option { color: var(--ink); background: var(--card); }

.search-form { flex: 1; max-width: 800px; }
.search-form .form-control {
  border-radius: 50rem;
  border: none;
  padding: .62rem 1rem;
  background: var(--header-input-bg);
  color: var(--header-input-fg);
  font-size: .95rem;
}
.search-form .form-control::placeholder { color: var(--header-muted); }
.search-form .form-control:focus { background: var(--header-input-hover); box-shadow: 0 0 0 .22rem var(--header-focus-ring); }

.header-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--header-fg);
  text-decoration: none;
  padding: .45rem .85rem;
  border-radius: 50rem;
  border: 1px solid var(--header-chip-border);
  background: var(--header-chip-bg);
  font-weight: 600;
  font-size: .92rem;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.header-action:hover { background: var(--header-chip-hover); color: var(--header-fg); }
.header-action .ico { width: 20px; height: 20px; }
.cart-count-badge {
  background: linear-gradient(135deg, #ff5a3c, #f43f5e);
  color: #fff;
  border-radius: 50rem;
  font-size: .72rem;
  font-weight: 700;
  min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 .35rem;
}

.store-bar {
  border-top: 1px solid var(--header-border);
  font-size: .85rem;
}
.store-bar label { color: var(--header-fg); }
.store-bar .form-select {
  background-color: var(--header-input-bg);
  color: var(--header-input-fg);
  border: 1px solid var(--header-chip-border);
  border-radius: 50rem;
  padding-top: .3rem; padding-bottom: .3rem;
}
.store-bar .form-select option { color: var(--ink); background: var(--card); }
.store-bar .form-select:focus { box-shadow: 0 0 0 .2rem var(--header-focus-ring); }
.store-bar .btn-outline-light {
  color: var(--header-fg);
  border-color: var(--header-chip-border);
  background: var(--header-chip-bg);
}
.store-bar .btn-outline-light:hover {
  background: var(--header-chip-hover);
  border-color: var(--header-chip-border);
  color: var(--header-fg);
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--header-chip-bg);
  border: 1px solid var(--header-chip-border);
  color: var(--header-fg);
  border-radius: 50rem;
  padding: .5rem .8rem;
  font-weight: 600;
  font-size: .85rem;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.mobile-menu-btn:hover { background: var(--header-chip-hover); color: var(--header-fg); }
.mobile-menu-btn .ico { width: 18px; height: 18px; }

.mobile-store-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .6rem .8rem;
}
.mobile-store-form .form-select option { color: var(--ink); background: var(--card); }

/* ===== Мобильное меню ===== */
#mobileCats {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.theme-toggle { cursor: pointer; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ===== Герой ===== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(700px 380px at 85% 10%, rgba(77, 124, 255, .38), transparent 62%),
    radial-gradient(520px 300px at 8% 120%, rgba(139, 92, 246, .28), transparent 60%),
    linear-gradient(135deg, #111117, #0d1024);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 220px at 88% 20%, rgba(255, 255, 255, .1), transparent 60%),
    radial-gradient(300px 200px at 12% 110%, rgba(255, 255, 255, .07), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50rem;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.hero h1 { font-weight: 800; letter-spacing: -.3px; }
.hero p { color: rgba(255, 255, 255, .82); }
.hero .btn-light {
  background: #fff;
  color: #101018;
  border: none;
  border-radius: 50rem;
  font-weight: 700;
  padding: .6rem 1.4rem;
}
.hero .btn-light:hover { background: #e8e8ee; }
.hero .btn-outline-light { border-radius: 50rem; border-width: 1.5px; }

/* ===== Секции ===== */
.section-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
}
.section-head::before {
  content: "";
  width: 5px; height: 24px;
  border-radius: 4px;
  background: var(--brand-grad);
}
.section-head h2 { font-weight: 800; letter-spacing: -.2px; margin: 0; }
.section-head .section-link {
  margin-left: auto;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}
.section-head .section-link:hover { text-decoration: underline; }

/* ===== Сайдбар ===== */
.catalog-sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .7rem .45rem;
}
.sidebar-title {
  font-weight: 800;
  font-size: 1rem;
  padding: .3rem .8rem .7rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar-title svg { width: 18px; height: 18px; color: var(--brand); }
.cat-group + .cat-group { border-top: 1px solid var(--sep); padding-top: .45rem; margin-top: .45rem; }
.cat-group-name {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--cat-name);
  font-weight: 700;
  padding: .35rem .8rem .25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.cat-group-name svg { flex-shrink: 0; opacity: .65; }
.cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .8rem;
  color: var(--cat-fg);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-radius: .6rem;
  transition: background .12s ease, color .12s ease;
}
.cat-link:hover { background: var(--brand-soft); color: var(--brand); }
.cat-link.active { background: var(--brand); color: #fff; font-weight: 600; }
.cat-link .cat-cnt {
  font-size: .72rem;
  font-weight: 600;
  color: var(--cat-cnt-fg);
  background: var(--cat-cnt-bg);
  border-radius: 50rem;
  padding: 0 .45rem;
  line-height: 1.4;
}
.cat-link.active .cat-cnt { background: rgba(255, 255, 255, .25); color: #fff; }

/* ===== Карточки товаров ===== */
.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
  animation: fadeUp .5s cubic-bezier(.2, .7, .3, 1) both;
}
.product-card:nth-child(2) { animation-delay: .04s; }
.product-card:nth-child(3) { animation-delay: .08s; }
.product-card:nth-child(4) { animation-delay: .12s; }
.product-card:nth-child(5) { animation-delay: .16s; }
.product-card:nth-child(6) { animation-delay: .2s; }
.product-card:nth-child(7) { animation-delay: .24s; }
.product-card:nth-child(8) { animation-delay: .28s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(77, 124, 255, .45);
}
.thumb-link {
  display: block;
  height: 160px;
  overflow: hidden;
  background: var(--photo-bg);
  text-align: center;
  position: relative;
}
.thumb-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  mix-blend-mode: multiply;
  transition: transform .25s ease;
}
.thumb-link.thumb-dark {
  background: var(--photo-dark-bg);
}
.thumb-link.thumb-dark img {
  mix-blend-mode: normal;
}
.product-card:hover .thumb-link img { transform: scale(1.05); }
.card-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-radius: 50rem;
  padding: .18rem .55rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.card-badge.hit { background: linear-gradient(135deg, #ff5a3c, #f43f5e); }
.card-badge.new { background: var(--brand-grad); }
.product-card .card-body { padding: .8rem .9rem 1rem; }
.product-card .card-title {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  font-size: .86rem;
}
.product-card .card-title:hover { color: var(--brand); }
.product-card .price {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -.2px;
}
.product-card .price .grn { font-size: .72rem; font-weight: 600; color: var(--muted); }
.stock-line { font-size: .74rem; }
.stock-line .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: .35rem;
}
.stock-line.in { color: var(--green); }
.stock-line.in .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.stock-line.out { color: var(--out-fg); }
.stock-line.out .dot { background: var(--out-dot); }
.product-card .add-to-cart {
  border-radius: 50rem;
  padding: .4rem .9rem;
  font-size: .85rem;
  white-space: nowrap;
}

/* ===== Плашки/инфо ===== */
.breadcrumb { font-size: .85rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ===== Фильтры и бренды ===== */
.filter-bar { border-radius: var(--radius-sm); }
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem;
  border-radius: 50rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  margin: .15rem .15rem;
}
.brand-chip:hover { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }
.brand-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.brand-chip .brand-cnt {
  font-size: .68rem;
  opacity: .7;
  background: rgba(127,127,127,.15);
  border-radius: 50rem;
  padding: 0 .35rem;
  line-height: 1.4;
}
.brand-chip.active .brand-cnt { background: rgba(255,255,255,.22); }

/* ===== Карусель брендов ===== */
.brand-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: .3rem 0 .8rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}
.brand-carousel::-webkit-scrollbar { display: none; }
.brand-carousel-item {
  scroll-snap-align: start;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  min-width: 68px;
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease;
}
.brand-carousel-item:hover { opacity: 1; transform: translateY(-2px); }
.brand-carousel-icon {
  width: 38px; height: 38px;
  object-fit: contain;
  transition: transform .2s ease;
}
.brand-carousel-item:hover .brand-carousel-icon { transform: scale(1.12); }
.brand-carousel-name {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

/* ===== Карточки брендов на главной ===== */
.brand-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .65rem;
}
.brand-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
}
.brand-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.brand-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(77,124,255,.4);
}
.brand-card .brand-name { font-weight: 700; font-size: .95rem; color: var(--ink); }
.brand-card .brand-total { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.brand-card:nth-child(5n+1)::before { background: #4d7cff; }
.brand-card:nth-child(5n+2)::before { background: #8b5cf6; }
.brand-card:nth-child(5n+3)::before { background: #f43f5e; }
.brand-card:nth-child(5n+4)::before { background: #34c759; }
.brand-card:nth-child(5n+0)::before { background: #f59e0b; }
.page-count-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 50rem;
  padding: .25rem .85rem;
  font-size: .82rem;
  font-weight: 600;
}

/* ===== Страница товара ===== */
.product-page .gallery {
  background: var(--photo-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-align: center;
  overflow: hidden;
}
.product-page .gallery img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  margin-inline: auto;
  mix-blend-mode: multiply;
}
.product-page .gallery.gallery-dark {
  background: var(--photo-dark-bg);
}
.product-page .gallery.gallery-dark img {
  mix-blend-mode: normal;
}
.product-page h1 { font-weight: 800; letter-spacing: -.3px; }
.buy-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
.buy-box .price { color: var(--ink); font-weight: 800; letter-spacing: -.5px; }
.buy-box .price .grn { font-size: 1rem; color: var(--muted); font-weight: 600; }
.qty-input { width: 92px; text-align: center; }
.avail-table td { vertical-align: middle; padding: .55rem .7rem; }
.store-chip { font-weight: 600; }
.store-phone { color: var(--muted); text-decoration: none; }
.store-phone:hover { color: var(--brand); }

/* ===== Таблицы (тёмные) ===== */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  color: var(--ink);
}
.table thead th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom-color: var(--line);
}
.table td, .table th { border-color: var(--line); }

/* ===== Подвал ===== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  margin-top: 3rem;
  border-top: 1px solid var(--footer-border);
}
.site-footer h6 { color: var(--footer-h); font-weight: 700; letter-spacing: .3px; text-transform: uppercase; font-size: .78rem; }
.site-footer a { color: var(--footer-link); text-decoration: none; font-size: .9rem; }
.site-footer a:hover { color: var(--footer-link-hover); }
.site-footer .brand { font-size: 1.1rem; color: var(--footer-h); }
.footer-bottom {
  border-top: 1px solid var(--footer-border);
  font-size: .82rem;
  color: var(--footer-fg);
}

/* ===== Корзина/чекаут ===== */
.cart-table td, .cart-table th { vertical-align: middle; }
.qty-control { width: 110px; }

/* ===== Пагинация ===== */
.pagination .page-link {
  color: var(--brand);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  margin: 0 .15rem;
  background: var(--card);
}
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .page-link:focus { box-shadow: none; }

/* ===== Алерты ===== */
.alert { border-radius: var(--radius-sm); }
.alert-light { background: var(--alert-light-bg); color: var(--ink); border-color: var(--alert-light-brd); }
.alert-secondary { background: var(--alert-secondary-bg); color: var(--muted); border-color: var(--alert-secondary-brd); }
.alert-info { background: rgba(77, 124, 255, .16); color: var(--alert-info-fg); border-color: var(--alert-info-brd); }
.alert-danger { background: rgba(255, 69, 58, .14); color: var(--alert-danger-fg); border-color: var(--alert-danger-brd); }
.alert-warning { background: rgba(255, 214, 10, .12); color: var(--alert-warning-fg); border-color: var(--alert-warning-brd); }

/* ===== Тост ===== */
.toast {
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.toast-body { color: var(--ink); }

/* ===== Доставка (чек-аут) ===== */
.delivery-option {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.delivery-option:hover { border-color: var(--line-strong); }
.delivery-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 .18rem rgba(77, 124, 255, .18);
}

/* ===== Адаптив ===== */
@media (max-width: 991.98px) {
  .brand { font-size: 1.15rem; }
  .hero { border-radius: 18px; }
  .thumb-link { height: 130px; }
  .thumb-link img { padding: 8px; }
}
@media (max-width: 767.98px) {
  .site-header .container { padding-top: .55rem; padding-bottom: .55rem; }
  .brand { font-size: 1.05rem; gap: .5rem; }
  .brand-logo { width: 34px; height: 34px; border-radius: 10px; }
  .brand-logo svg { width: 20px; height: 20px; }
  .search-form .form-control { padding: .45rem .9rem; font-size: .88rem; }
}
@media (max-width: 575.98px) {
  .hero h1 { font-size: 1.35rem; }
  .product-card .price { font-size: .88rem; letter-spacing: -.3px; }
  .product-card .price .grn { font-size: .65rem; }
  .product-card .mt-auto { flex-direction: column; gap: .5rem; }
  .product-card .add-to-cart { width: 100%; font-size: .78rem; padding: .35rem .5rem; }
  .product-card .stock-line { font-size: .7rem; }
  .search-form { width: 100%; max-width: 100%; flex: none; order: 3; margin-top: .3rem; }
  .brand-text { display: none; }
  .mobile-menu-btn { padding: .5rem .6rem; }
  .search-form .form-control::placeholder { font-size: .8rem; }
}
