:root {
  --bg: #f6f6f9;
  --surface: #fff;
  --text: #1d1d24;
  --muted: #6b6b78;
  --accent: #7b2ff7;
  --accent-dark: #5f17d6;
  --accent-text: #fff;
  --border: #e4e4ea;
  --ok: #138a36;
  --warn: #b3261e;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(30, 20, 60, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; height: auto; }
h1 { font-size: 28px; margin: 0 0 12px; line-height: 1.2; }
h2 { font-size: 22px; margin: 24px 0 12px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
main { padding: 16px; min-height: 60vh; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }

/* Шапка */
.site-header { background: linear-gradient(90deg, #7b2ff7, #c42ff7); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-weight: 800; font-size: 22px; text-decoration: none; }
.catalog-btn { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.search { flex: 1; display: flex; min-width: 220px; position: relative; }
.search input { flex: 1; min-width: 0; padding: 10px 14px; border: 0; border-radius: var(--radius) 0 0 var(--radius); font-size: 15px; }
.search button { padding: 0 16px; border: 0; border-radius: 0 var(--radius) var(--radius) 0; background: #1d1d24; color: #fff; cursor: pointer; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow: auto; z-index: 30; }
.suggest h5 { margin: 0; padding: 8px 12px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; text-decoration: none; }
.suggest a:hover, .suggest a.on { background: var(--bg); }
.suggest img { width: 36px; height: 36px; object-fit: contain; }
.suggest .sp { margin-left: auto; font-weight: 700; white-space: nowrap; }
.header-icons { display: flex; gap: 16px; }
.header-icons a { text-decoration: none; white-space: nowrap; }
.badge:empty { display: none; }
.badge { background: #fff; color: var(--accent); border-radius: 10px; padding: 0 6px; font-size: 12px; font-weight: 700; }
.catstrip { background: rgba(0,0,0,.12); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.catstrip .wrap { display: flex; gap: 18px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.catstrip a { text-decoration: none; opacity: .95; }
.megamenu { background: var(--surface); color: var(--text); box-shadow: var(--shadow); max-height: calc(100vh - 110px); overflow: auto; }
.mm-row { display: flex; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
.mm-l1 { list-style: none; margin: 0; padding: 0; min-width: 220px; border-right: 1px solid var(--border); }
.mm-l1 a { display: block; padding: 7px 10px; text-decoration: none; border-radius: 8px; }
.mm-l1 a:hover, .mm-l1 a.on { background: var(--bg); color: var(--accent); }
.mm-l2 { flex: 1; }
.mm-panel { columns: 3 200px; }
.mm-panel a { display: block; padding: 4px 0; text-decoration: none; break-inside: avoid; }
.mm-panel a:hover { color: var(--accent); }
.mm-title { font-weight: 700; column-span: all; margin-bottom: 6px; }

/* Общие элементы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: #efe9fe; color: var(--accent-dark); }
.btn.wide { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .6; cursor: default; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { text-decoration: none; }
.crumbs .sep { margin: 0 2px; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-head .count { color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; text-decoration: none; font-size: 14px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip small { color: var(--muted); }
.text { line-height: 1.65; }
.empty { background: var(--surface); padding: 24px; border-radius: var(--radius); }

/* Каталог */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.filters { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow: auto; }
.filters h3 { font-size: 14px; margin: 10px 0 6px; }
.facet { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; text-decoration: none; font-size: 14px; border-radius: 6px; }
.facet small { color: var(--muted); }
.facet.on { background: #efe9fe; color: var(--accent-dark); font-weight: 600; }
.facet.on::before { content: "✓"; }
.price-filter { display: flex; gap: 6px; }
.price-filter input { width: 70px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
.reset { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--warn); }
.sortbar { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.sort { text-decoration: none; color: var(--muted); }
.sort.on { color: var(--text); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 14px; border-bottom: 1px solid var(--border); }
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.card:hover .card-img img { transform: scale(1.03); }
.noimg { font-size: 56px; font-weight: 800; color: #d9cffb; }
.card-body { padding: 10px 12px 4px; flex: 1; }
.price { font-size: 20px; font-weight: 800; }
.per-dose { font-size: 13px; color: var(--muted); }
.card-title { display: block; font-size: 14px; text-decoration: none; margin: 4px 0; line-height: 1.35; }
.stock { font-size: 13px; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--muted); }
.card-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }
.card-actions .primary { flex: 1; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; text-align: center; padding: 7px 10px; border-radius: 8px; background: var(--surface); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; }
.intro, .faq { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; margin-top: 24px; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

/* Карточка товара */
.product { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 24px; background: var(--surface); border-radius: var(--radius); padding: 20px; }
.gallery .main { aspect-ratio: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery .thumbs button { width: 64px; height: 64px; border: 2px solid var(--border); border-radius: 8px; background: #fff; padding: 2px; cursor: pointer; }
.gallery .thumbs button.on { border-color: var(--accent); }
.buybox .brand { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.buybox h1 { font-size: 24px; margin: 4px 0 12px; }
.buybox .price { font-size: 32px; }
.buybox .old { text-decoration: line-through; color: var(--muted); margin-left: 8px; font-size: 18px; }
.variants { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.variants a { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; text-decoration: none; font-size: 14px; }
.variants a.on { border-color: var(--accent); background: #efe9fe; font-weight: 600; }
.variants small { display: block; color: var(--muted); }
.buy-row { display: flex; gap: 8px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.stepper { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; border: 0; background: var(--bg); font-size: 18px; cursor: pointer; }
.stepper input { width: 44px; border: 0; text-align: center; font: inherit; }
.benefits { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.social-proof { color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.tabs { margin-top: 20px; background: var(--surface); border-radius: var(--radius); padding: 8px 20px 20px; }
.tabs section { border-top: 1px solid var(--border); }
.tabs section:first-child { border-top: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr.muted td { color: var(--muted); }
.claims { padding-left: 18px; }
.disclaimer-box { background: #fff8e6; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-top: 12px; }
.related { margin-top: 24px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Корзина и заказ */
.cart { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.cart-items, .cart-form, .box { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-line img { width: 64px; height: 64px; object-fit: contain; }
.cart-total { font-size: 20px; font-weight: 800; margin: 12px 0; }
.order-form label { display: block; margin: 10px 0; font-size: 14px; }
.order-form input[type=text], .order-form input[type=tel], .order-form input[type=number] { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; margin-top: 4px; }
.order-form .consent { display: flex; gap: 8px; align-items: flex-start; }
.order-form .consent input { margin-top: 4px; }
.form-error { color: var(--warn); font-weight: 600; }
.note { color: var(--muted); font-size: 13px; }
.order-modal { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.order-modal::backdrop { background: rgba(20, 10, 40, .45); }
.order-modal form { padding: 20px 22px; position: relative; }
.order-modal h2 { margin-top: 0; }
.order-modal .close { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 28px; cursor: pointer; }
.thanks { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 720px; }

/* Главная */
.hero { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 16px; text-decoration: none; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.tile:hover { box-shadow: var(--shadow); color: var(--accent); }
.tile small { color: var(--muted); font-weight: 400; }
.brand-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* Футер */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 24px 0 8px; color: var(--muted); font-size: 14px; margin-top: 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-grid h4 { color: var(--text); margin: 0 0 8px; }
.footer-grid a, .footer-grid .linklike { display: block; padding: 2px 0; text-decoration: none; }
.anpc a { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; margin: 4px 4px 0 0; }
.disclaimer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: #1d1d24; color: #fff; padding: 12px 0; z-index: 40; font-size: 14px; }
.cookie-banner .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cookie-banner p { flex: 1 1 320px; margin: 0; }
.error-page { text-align: center; padding: 48px 0; }
.static-page { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; max-width: 900px; }

@media (max-width: 900px) {
  .catalog, .product, .cart { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .mm-row { flex-direction: column; }
  .mm-l1 { border-right: 0; }
  .mm-l2 { display: none; }
}
@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .header-icons span:not(.badge) { display: none; }
  .search { order: 3; flex-basis: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-actions { flex-direction: column; }
  .cart-line { grid-template-columns: 48px 1fr; }
}
