:root {
  --ink: #12151c;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #6d28d9;
  --accent-dark: #5b21b6;
  --accent-soft: #f1ebfd;
  --green: #1fbf6a;
  --green-dark: #15803d;
  --ok: #12804a;
  --bad: #c62828;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .6em 0 .5em; }
h2 { font-size: 1.3rem; margin: 1.6em 0 .7em; }
h3 { font-size: 1rem; margin: 1.2em 0 .5em; }
small { font-weight: 400; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.is-hidden { display: none !important; }
.inline { display: inline; margin: 0; }

/* Шапка */
.topbar { background: #fff; border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); font-size: .85rem; }
.topbar__row { display: flex; overflow-x: auto; padding-top: 7px; padding-bottom: 7px; scrollbar-width: none; }
.topbar__nav { display: flex; gap: 22px; white-space: nowrap; }
.topbar__acc { margin-left: auto; padding-left: 22px; display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.topbar a { text-decoration: none; color: var(--muted); }
.topbar a:hover, .topbar a[aria-current] { color: var(--accent); }
.phone { margin-left: auto; display: flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.phone__icon { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.phone__text { display: flex; flex-direction: column; line-height: 1.25; }
.phone__text b { font-size: 1.05rem; }
.phone__text small { color: var(--muted); font-size: .78rem; }
.phone:hover b { color: var(--accent); }
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top__row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 40px; width: auto; }
.search { flex: 1; display: flex; gap: 8px; max-width: 560px; position: relative; }
.sugg { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(16, 24, 40, .18); max-height: 70vh; overflow-y: auto; }
.sugg[hidden] { display: none; }
.sugg li { border-radius: 8px; }
.sugg li.is-active { background: var(--accent-soft); }
.sugg a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 6px 8px; text-decoration: none; }
.sugg img { width: 40px; height: 40px; object-fit: contain; background: #f4f1fb; border-radius: 8px; }
.sugg__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sugg__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg__name b { color: var(--accent-dark); font-weight: 700; }
.sugg small { color: var(--muted); }
.sugg__price { font-weight: 700; white-space: nowrap; font-size: .92rem; }
.sugg__all a { display: block; grid-template-columns: none; text-align: center; color: var(--accent); font-weight: 600; padding: 10px; }
.sugg__empty { padding: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .sugg a { grid-template-columns: 40px 1fr; row-gap: 0; }
  .sugg__price { grid-column: 2; font-size: .85rem; }
}
.search input { flex: 1; min-width: 0; }
.top__links { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.top__links a { text-decoration: none; }
.top__links a:hover, .linklike:hover { color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 700; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; }
.cats a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--bg); white-space: nowrap; font-size: .95rem; }
.cats a:hover { background: var(--accent-soft); }

/* Формы и кнопки */
input, select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid #cfd4dc; border-radius: 8px; padding: 9px 12px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--accent-dark); }
.btn--lg { padding: 13px 24px; font-size: 1.05rem; }
.btn--sm { padding: 5px 10px; font-size: .85rem; }
.btn--block { display: block; width: 100%; }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid #cfd4dc; }
.btn--ghost:hover { background: var(--bg); }
.btn--danger { background: #fff; color: var(--bad); border: 1px solid #f1b5b5; }
.btn--danger:hover { background: #fdecec; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.field--err input, .field--err select { border-color: var(--bad); }
.err { color: var(--bad); display: block; margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: center; }
.qty { width: 80px; text-align: center; }

.flash { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; background: #eef4ff; border: 1px solid #c9dafc; }
.flash--ok { background: #e8f7ee; border-color: #b5e2c6; }
.flash--error { background: #fdecec; border-color: #f1b5b5; }

/* Главная */
.hero {
  background: linear-gradient(135deg, #150f2b, #2f1b66); color: #fff; border-radius: 16px;
  padding: 40px 36px; margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.hero h1 { font-size: 2rem; max-width: 18ch; margin-top: 0; }
.hero p { color: #cfd4dc; max-width: 46ch; }
.hero__icons { font-size: 3rem; letter-spacing: .3em; opacity: .9; }
.hero .btn { background: var(--green); color: #07240f; }
.hero .btn:hover { background: #34d77a; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px; text-decoration: none; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; }
.tile span { font-size: 1.6rem; }
.tile:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .12); }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1500px) { .grid:not(.grid--3) { grid-template-columns: repeat(5, 1fr); } .grid--3 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.card__img, .line__img { text-decoration: none; }
.card__img { position: relative; aspect-ratio: 1 / 1; background: #f0f2f5; display: grid; place-items: center; }
.card__img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph { font-size: 4rem; filter: grayscale(.2); }
.ph--lg { font-size: 8rem; }
.ph-img { width: 100%; height: 100%; object-fit: cover; background: #f4f1fb; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--green-dark); color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: .85rem; }
.tag--inline { position: static; margin-left: 8px; vertical-align: middle; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card__name { text-decoration: none; font-weight: 600; line-height: 1.3; flex: 1; }
.card__name:hover { color: var(--accent); }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.price b { font-size: 1.2rem; }
.price s { color: var(--muted); font-size: .9rem; }
.price--lg b { font-size: 2rem; }

/* Каталог */
.crumbs { margin-top: 16px; font-size: .9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.layout--cart { grid-template-columns: 1fr 340px; }
.filters, .panel, .summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.filters h3:first-child { margin-top: 0; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.checks label { display: flex; gap: 8px; align-items: center; }
.filters .btn { margin-top: 14px; }
.fbox > label.checks { margin-top: 12px; }
.reset { display: block; text-align: center; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.fbox > summary { display: none; list-style: none; cursor: pointer; font-weight: 700; }
.fbox > summary::-webkit-details-marker { display: none; }
.fbox > summary::after { content: " ▾"; color: var(--muted); }
.fbox:not([open]) > summary::after { content: " ▸"; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pager a, .pager__cur { min-width: 38px; padding: 7px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-align: center; text-decoration: none; }
.pager__cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; padding: 56px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 16px; }

/* Страница товара */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 16px; background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pdp__img { background: #f0f2f5; border-radius: var(--radius); display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; }
.pdp__img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pdp h1 { margin-top: 4px; }
.buy { display: flex; gap: 12px; margin: 16px 0; }
.stock--ok { color: var(--ok); font-weight: 600; }
.stock--no { color: var(--bad); font-weight: 600; }
.perks { list-style: none; padding: 0; margin: 16px 0 0; color: var(--muted); display: grid; gap: 4px; }
.prose { max-width: 70ch; }
.specs { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.specs th, .specs td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { width: 42%; font-weight: 500; color: var(--muted); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* Корзина и заказ */
.line { display: grid; grid-template-columns: 72px 1fr auto 120px 32px; gap: 14px; align-items: center; background: var(--card); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.line__img { width: 72px; height: 72px; background: #f0f2f5; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.line__img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.line__img .ph { font-size: 2rem; }
.line__name a { font-weight: 600; text-decoration: none; }
.line__sum { text-align: right; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.x:hover { color: var(--bad); }
.summary { position: sticky; top: 130px; }
.summary h3 { margin-top: 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.row--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 1.2rem; }
.options { display: grid; gap: 8px; margin-bottom: 14px; }
.opt { display: flex; gap: 10px; align-items: center; border: 1px solid #cfd4dc; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.opt span { flex: 1; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.narrow { max-width: 440px; margin: 28px auto; }
.done { max-width: 620px; margin: 28px auto; text-align: center; }
.done__icon { font-size: 3rem; }
.done .specs { text-align: left; margin: 18px 0; }
.order { margin-bottom: 12px; }
.order__head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.order__sum { margin-left: auto; }
.order ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }

/* Статусы */
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #e8eefc; color: #1d3f9c; }
.status--confirmed { background: #fff3d6; color: #8a5a00; }
.status--shipped { background: #e6f0ff; color: #1d4fa8; }
.status--delivered { background: #e3f6ea; color: #12804a; }
.status--cancelled { background: #eceef2; color: #667085; }

/* Админка */
.subnav { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: 10px 16px; text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); white-space: nowrap; }
.subnav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat b { font-size: 1.6rem; }
.stat--hot b { color: var(--accent); }
.two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 140px; }
.toolbar input.w-xs { flex: 0 0 90px; min-width: 70px; }
.w-xs { width: 90px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .total td { background: #fafbfc; }
.tbl td input { min-width: 120px; }
.tbl td input.w-xs { min-width: 60px; }
.actions { display: flex; gap: 8px; white-space: nowrap; }
td.actions { display: table-cell; }
.bad { color: var(--bad); font-weight: 700; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field--wide { grid-column: 1 / -1; }
.thumb { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.thumb img { width: 90px; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

/* Подвал */
.foot { background: #fff; border-top: 1px solid var(--line); padding: 24px 0; margin-top: 32px; }
.foot__row { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.foot__links { display: flex; gap: 8px 18px; flex-wrap: wrap; align-content: flex-start; max-width: 340px; }
.foot__links a, .foot a { color: var(--muted); text-decoration: none; }
.foot__links a:hover, .foot a:hover { color: var(--accent); }

/* Информационные страницы */
.page { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-top: 16px; align-items: start; }
.sidenav { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; }
.sidenav a { padding: 9px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.sidenav a:hover { background: var(--accent-soft); }
.sidenav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.article { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; }
.article h1 { margin-top: 0; }
.article h2 { font-size: 1.15rem; margin: 1.5em 0 .5em; }
.article p, .article li { max-width: 72ch; }
.article a { color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 18px 0; }
.fact { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.fact b { display: block; margin-bottom: 2px; }
.news-item { border-top: 1px solid var(--line); padding: 16px 0; }
.news-item:first-of-type { border-top: 0; padding-top: 0; }
.news-item h2 { margin: .2em 0 .3em; }
.news-item time { color: var(--muted); font-size: .85rem; }

/* Адаптивность */
@media (max-width: 960px) {
  .grid, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .layout, .layout--cart, .two, .pdp { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero__icons { display: none; }
  .page { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; overflow-x: auto; }
  .fbox > summary { display: block; }
  .fbox[open] > summary { margin-bottom: 4px; }
}
@media (max-width: 640px) {
  .top__row { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero { padding: 26px 20px; }
  .logo img { height: 34px; }
  .phone__text, .cart-label { display: none; }
  .phone__icon { width: 34px; height: 34px; }
  .top__links { gap: 12px; }
  .topbar__nav { gap: 16px; }
  .hero h1 { font-size: 1.5rem; }
  .line { grid-template-columns: 56px 1fr 32px; }
  .line__img { width: 56px; height: 56px; }
  .line__qty { grid-column: 2; }
  .line__sum { grid-column: 2; text-align: left; }
  .formgrid { grid-template-columns: 1fr; }
  .pdp { padding: 14px; }
  .buy { flex-direction: column; }
  .qty { width: 100%; }
}

/* бренды и типы устройств */
.cats__more { color: var(--accent); font-weight: 600; }
.tiles--tight { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: 10px 0 18px; }
.tiles--tight .tile { padding: 12px 14px; font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chips a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); font-size: .92rem; }
.chips a small { opacity: .65; }
.chips a:hover { outline: 2px solid var(--accent); }
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.brandbox { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.brandbox h3 { margin: 0 0 8px; }
.brandbox .chips { margin: 0; }
.filters div.checks { max-height: 280px; overflow-y: auto; }

/* выбор варианта на странице товара */
.vopt { margin: 16px 0 0; }
.vopt__label { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.vopt__label b { color: var(--text, #111); font-weight: 600; }
.vopt__list { display: flex; flex-wrap: wrap; gap: 8px; }
.vopt__btn { font: inherit; cursor: pointer; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: inherit; }
.vopt__btn:hover { border-color: var(--accent); }
.vopt__btn.is-on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.vopt__btn.is-out { color: var(--muted); }
.vopt__btn.is-none { color: #a3a9b8; border-style: dashed; }
.vopt__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pricebox { margin-top: 20px; padding: 16px 18px; background: var(--bg); border-radius: var(--radius); }
.pricebox .buy { margin-bottom: 0; }
.pdp__sku { margin: 4px 0 8px; font-size: .85rem; }
.card__vars { font-size: .85rem; margin: -2px 0 8px; }
[hidden] { display: none !important; }

/* характеристики по разделам */
.specs .spec-title th { width: auto; background: #eef0f4; color: var(--text, #111); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.specs td { font-weight: 600; white-space: pre-line; }
.spec-yes { color: #2e9e3a; font-weight: 700; margin-right: 2px; }
.spec-no { color: #a3a9b8; font-weight: 700; }


/* ===== шапка: каталог, поиск, сравнение / избранное / корзина ===== */
.ic { display: block; flex-shrink: 0; }
.catbtn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; padding: 10px 16px; border-radius: 10px; white-space: nowrap; }
.catbtn:hover, .catbtn[aria-expanded="true"] { background: var(--accent-dark); }
.catbtn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.search { max-width: none; }
.search input { background: var(--bg); border-color: transparent; border-radius: 10px 0 0 10px; }
.search input:focus { background: #fff; border-color: var(--accent); }
.search { gap: 0; }
.search__btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 0 10px 10px 0; padding: 0 18px; }
.search__btn .ic { width: 20px; height: 20px; }
.acts { display: flex; align-items: stretch; gap: 4px; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .8rem; line-height: 1.2; white-space: nowrap; }
.act:hover { color: var(--accent); background: var(--accent-soft); }
.act__ic { position: relative; display: block; }
.act__ic .ic { width: 26px; height: 26px; }
.act .badge { position: absolute; top: -6px; right: -10px; min-width: 18px; padding: 0 5px; text-align: center; font-size: .72rem; line-height: 18px; }
.top__row { gap: 12px; }
.phone { margin-left: 0; }
.top__row .search { flex: 1 1 260px; }

/* выпадающее дерево каталога */
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(16, 24, 40, .16); }
.mega[hidden] { display: none !important; }
.mega__in { display: grid; grid-template-columns: 290px 1fr; gap: 0; padding-top: 0; padding-bottom: 0; height: min(620px, calc(100vh - 170px)); }
.mega__cats { list-style: none; margin: 0; padding: 12px 12px 12px 0; border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.mega__cat { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; text-decoration: none; }
.mega__cat span:not(.mega__ico) { flex: 1; font-weight: 600; }
.mega__cat small { color: var(--muted); }
.mega__cat .ic { width: 16px; height: 16px; color: var(--muted); }
.mega__ico { width: 24px; text-align: center; }
.mega__cat:hover, .mega__cat.is-on { background: var(--accent-soft); color: var(--accent-dark); }
.mega__cat--all { color: var(--accent); font-weight: 600; padding-top: 6px; padding-bottom: 6px; }
.mega__panes { padding: 16px 6px 18px 26px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.mega__pane { display: none; }
.mega__pane.is-on { display: block; }
.mega__back { display: none; }
.mega__title { display: inline-block; font-size: 1.2rem; font-weight: 700; text-decoration: none; margin-bottom: 12px; }
.mega__title small { color: var(--accent); font-size: .9rem; font-weight: 600; }
.mega__title:hover { color: var(--accent); }
.mega__brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 22px; }
.mega__brand ul { list-style: none; margin: 4px 0 0; padding: 0; }
.mega__bname { font-weight: 700; text-decoration: none; display: inline-block; margin-bottom: 2px; }
.mega__bname small { color: var(--muted); font-weight: 400; }
.mega__bname:hover, .mega__brand li a:hover { color: var(--accent); }
.mega__brand li a { display: block; padding: 2px 0; font-size: .92rem; text-decoration: none; color: #3d4452; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega__brand li a.mega__all { color: var(--accent); font-weight: 600; }
.mega__morelink { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 600; text-decoration: none; }

/* кнопки «в избранное» и «сравнить» */
.card { position: relative; }
.card__tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.tool { margin: 0; display: block; }
.tool__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .94); color: #5b6272; cursor: pointer; font: inherit; }
.tool__btn .ic { width: 20px; height: 20px; }
.tool__btn:hover { color: var(--accent); border-color: var(--accent); }
.tool__btn.is-on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tool__btn.is-on .ic { fill: currentColor; fill-opacity: .18; }
.tool__btn[data-off="В избранное"].is-on .ic { fill-opacity: 1; }
.tool__btn--text { width: auto; height: auto; border-radius: 10px; padding: 8px 14px; font-weight: 600; background: #fff; }
.pdp__tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 8px; }
.tool__txt { font-size: .92rem; }
.empty-state { text-align: center; background: var(--card); border-radius: var(--radius); padding: 48px 20px; box-shadow: var(--shadow); }
.empty-state .btn { margin-top: 8px; }

/* сообщение под шапкой после нажатия кнопок */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 520px); background: #12151c; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: .95rem; }
.toast[hidden] { display: none; }

/* сравнение */
.cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.cmp-bar .is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.cmp-bar__note { font-size: .85rem; margin-left: 6px; }
.cmp-bar__clear { margin-left: auto; }
.cmp-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.cmp { border-collapse: collapse; width: 100%; min-width: 640px; table-layout: fixed; }
.cmp th, .cmp td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.cmp thead th { vertical-align: top; border-bottom: 2px solid var(--line); background: #fff; }
.cmp__k { width: 210px; color: var(--muted); font-weight: 500; font-size: .92rem; }
.cmp td { font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.cmp__head { text-align: center !important; }
.cmp__img { display: block; height: 130px; margin-bottom: 8px; }
.cmp__img img { height: 100%; width: 100%; object-fit: contain; }
.cmp__name { display: block; font-weight: 700; text-decoration: none; line-height: 1.25; }
.cmp__name:hover { color: var(--accent); }
.cmp__price { font-weight: 700; margin-top: 4px; }
.cmp__ver { font-size: .82rem; margin-top: 2px; }
.cmp__acts { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; }
.cmp__acts .tool__btn { width: 32px; height: 32px; }
.cmp__add { text-align: center !important; vertical-align: middle !important; }
.cmp__add a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--accent); }
.cmp__add b { font-size: 2rem; line-height: 1; }
.cmp__sec th { background: #eef0f4; color: var(--ink); font-weight: 700; padding: 9px 14px; }
.cmp tr.is-diff td { background: #fffbea; }
.cmp thead th:first-child, .cmp tbody th.cmp__k { position: sticky; left: 0; background: #fff; z-index: 1; }

@media (max-width: 960px) {
  .mega__in { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .mega__cats { border-right: 0; padding: 10px 0; }
  .mega__panes { padding: 8px 0 14px; }
  .mega.is-sub .mega__cats { display: none; }
  .mega:not(.is-sub) .mega__panes { display: none; }
  .mega__back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 0; margin-bottom: 4px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
  .mega__back .ic { width: 18px; height: 18px; }
  .mega__cat .ic { display: block; }
  .acts .act__t { display: none; }
}
@media (max-width: 640px) {
  .top__row { flex-wrap: wrap; }
  .top__row .logo { order: 1; }
  .top__row .acts { order: 2; margin-left: auto; }
  .top__row .phone { order: 2; }
  .top__row::before { content: ""; order: 3; flex-basis: 100%; height: 0; }   /* перенос: логотип и значки в первой строке, каталог и поиск во второй */
  .top__row .catbtn { order: 4; padding: 9px 12px; }
  .top__row .catbtn span { display: none; }
  .top__row .search { order: 5; flex: 1 1 0; min-width: 0; }
  .search__btn span { display: none; }
  .search__btn { padding: 0 12px; }
  .topbar__acc { padding-left: 14px; gap: 14px; }
  .cmp__k { width: 120px; }
  .cmp th, .cmp td { padding: 8px 10px; }
}

.mega__loading { padding: 28px 16px; color: var(--muted); }

@media (max-width: 480px) {
  .top__row { gap: 8px; }
  .logo img { height: 28px; }
  .phone__icon { width: 30px; height: 30px; }
  .acts { gap: 0; }
  .act { padding: 2px 5px; }
  .act__ic .ic { width: 24px; height: 24px; }
}
