/* ==========================================================================
   Nova-x — дизайн-система v2
   Палитра и композиция по референсу Access Medical Clinic.

   Одно отступление от референса: бирюзовый #36B0C9 как цвет текста даёт
   2.56:1 при норме 4.5. Он остаётся заливкой, текст на нём — чёрный (6.37:1),
   а для бирюзовых надписей введён более глубокий #1D6878.

   Мобильный экран — база, десктоп добавляется через min-width.
   ========================================================================== */

:root {
  /* палитра референса */
  --ink:        #101A3A;   /* тёмно-синий, от логотипа */
  --muted:      #545B70;
  --white:      #FFFFFF;
  --navy:       #021D6A;   /* фирменный синий из логотипа */
  --on-navy:    #FFFFFF;
  --blue:       #1A92A7;   /* фирменный бирюзовый из логотипа */
  --blue-soft:  #7FC4D2;
  --red:        #CA3829;   /* Read          */
  --stroke:     #C2CFDB;   /* Light gray    */
  --bg:         #F2F4FA;   /* BG light gray */
  --bg-blue:    #CCE1F4;   /* BG light blue */
  --footer:     #04123A;   /* тёмно-синий подвал */

  /* производные — ради читаемости */
  --blue-ink:   #146B7A;   /* бирюзовый, пригодный для текста */
  --blue-plate: #E2F1F4;   /* плашка под иконку */
  --stroke-soft:#E1E7EF;
  --ok:         #14654C;
  --warn:       #8A4A12;
  --on-blue:    #05122E;
  --panel-ink:  #101A3A;            /* текст на голубой панели */
  --panel-mute: #31405C;            /* второстепенный текст там же */
  --chip-bg:    rgba(255,255,255,.82);

  --shadow:   0 1px 2px rgba(35, 31, 32, .04);
  --shadow-2: 0 12px 48px rgba(14, 27, 38, .16);

  --f-serif: "Literata", Georgia, "Times New Roman", serif;
  --f-sans:  "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tap: 46px;
  --r-panel: 22px;
  --r: 14px;
  --r-sm: 10px;
  --pill: 999px;
  --gutter: 1.1rem;
  --maxw: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:        #E8ECF5;
    --muted:      #9BA4BC;
    --white:      #10182E;
    --navy:       #93A8F0;
    --on-navy:    #06122E;
    --blue:       #45B6CC;
    --blue-soft:  #2C6472;
    --red:        #E8705F;
    --stroke:     #26304A;
    --bg:         #080D1C;
    --bg-blue:    #12244A;
    --footer:     #030B22;
    --blue-ink:   #7FD2E5;
    --blue-plate: #123039;
    --stroke-soft:#1A2238;
    --ok:         #5CC49F;
    --warn:       #DDA063;
    --on-blue:    #08202A;
    --panel-ink:  #E9F0F4;
    --panel-mute: #A9B7D2;
    --chip-bg:    rgba(255,255,255,.08);
    --shadow:   0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 12px 48px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --ink:        #E8ECF5;
  --muted:      #9BA4BC;
  --white:      #10182E;
  --navy:       #93A8F0;
    --on-navy:    #06122E;
    --blue:       #45B6CC;
  --blue-soft:  #2C6472;
  --red:        #E8705F;
  --stroke:     #26304A;
  --bg:         #080D1C;
  --bg-blue:    #12244A;
  --footer:     #030B22;
  --blue-ink:   #7FD2E5;
  --blue-plate: #123039;
  --stroke-soft:#1A2238;
  --ok:         #5CC49F;
  --warn:       #DDA063;
  --on-blue:    #08202A;
  --panel-ink:  #E9F0F4;
  --panel-mute: #A9B7D2;
  --chip-bg:    rgba(255,255,255,.08);
  --shadow:   0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 12px 48px rgba(0, 0, 0, .6);
}

/* -------------------------------------------------------------- сброс -- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* clip, не hidden: overflow-x:hidden на body заставляет браузер считать
     body отдельным скролл-контейнером (спека требует overflow-y:auto,
     раз задан один из осей не visible) — из-за этого position:sticky
     внутри страницы перестаёт надёжно прилипать при глубокой прокрутке.
     clip не создаёт скролл-контекст и не тянет этот побочный эффект. */
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: .75rem 1.15rem;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------- типографика -- */

h1, h2, h3, .serif {
  font-family: var(--f-serif);
  color: var(--navy);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -.005em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 8.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 6.5vw, 2.6rem); }
h3 { font-size: 1.15rem; line-height: 1.25; }

.lead { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.kicker {
  font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .8rem;
}

/* ---------------------------------------------------------- кнопки --- */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: var(--tap); padding: 0 .45rem 0 1.15rem;
  border: 1px solid transparent; border-radius: var(--pill);
  background: var(--navy); color: var(--on-navy);
  font-size: .92rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .86; }

/* белый кружок со стрелкой — узнаваемая деталь референса */
.btn__ic {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--on-navy); color: var(--navy);
}
.btn__ic svg { width: 13px; height: 13px; }
.btn__t { min-width: 0; }  /* даёт подписи сжаться и перенестись, а не вытолкнуть кружок за край */

/* На тёмных панелях: светлая таблетка + синий кружок — обратная сторона
   того же приёма, что и на светлом фоне. Панель тёмная в обеих темах,
   поэтому цвета здесь фиксированные, а не из переключаемых токенов. */
.btn--ondark { background: #FFFFFF; color: #021D6A; border-color: #FFFFFF; }
.btn--ondark .btn__ic { background: #021D6A; color: #FFFFFF; }
.btn--ondark:hover { opacity: 1; background: #E8EDF7; }
.btn--light { background: var(--white); color: var(--ink); border-color: var(--stroke); }
.btn--light .btn__ic { background: var(--ink); color: var(--white); }
.btn--wide { flex: 1; min-width: 0; justify-content: space-between; }
.btn[data-done] { background: var(--ok); color: #fff; }
.btn[data-done] .btn__ic { background: #fff; color: var(--ok); }

.arrow {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--blue-ink); font-size: .84rem; font-weight: 600;
  text-decoration: none; min-height: 34px;
}
.arrow svg { width: 11px; height: 11px; }
.arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- панели --- */

.panel { background: var(--white); border-radius: var(--r-panel); padding: 1.5rem 1.15rem; }
.panel--blue { background: var(--bg-blue); }
.panel--dark { background: var(--footer); color: #EDF1F5; }
.panel--dark .lead { color: #AEBECA; }
.panel--dark h2, .panel--dark h3 { color: #fff; }

/* ------------------------------------------------------------- шапка -- */

.hdr { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.hdr__in { display: flex; align-items: center; gap: .7rem; min-height: 66px; }

.logo {
  display: flex; align-items: center; gap: .45rem; margin-right: auto;
  text-decoration: none; color: inherit;
  --logo-a: #021D6A;   /* фирменный синий */
  --logo-b: #1A92A7;   /* фирменный бирюзовый */
}
.logo__img { width: auto; height: 26px; display: block; }

.logo__sub {
  font-family: var(--f-sans); font-size: .56rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}

.hdr__nav { display: none; }

.hdr__cart {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: var(--tap); padding: 0 1.05rem;
  border: 1px solid var(--stroke); border-radius: var(--pill);
  background: var(--white); color: var(--ink);
  font-size: .9rem; font-weight: 500; cursor: pointer;
}
.hdr__cart:hover { border-color: var(--ink); }
.hdr__count {
  display: none; min-width: 21px; height: 21px; padding: 0 6px; border-radius: var(--pill);
  background: var(--blue); color: var(--on-blue);
  font-size: .72rem; font-weight: 700; line-height: 21px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.hdr__count[data-on] { display: block; }

/* --------------------------------------------------------------- hero -- */

.hero { padding-bottom: .8rem; }
.hero__grid { display: grid; gap: .7rem; }

/* «Выбор недели» — только на десктопе, по прямой просьбе.
   Двойной селектор — иначе .hero__pick{display:flex} ниже по файлу
   выигрывает: у обоих правил одинаковая специфичность, решает порядок. */
.hero__pick.hero__pick--week { display: none; }

.hero__main { min-width: 0; background: var(--bg-blue); border-radius: var(--r-panel); padding: 1.7rem 1.2rem 1.5rem; color: var(--panel-ink); }
.hero__main h1 { margin-bottom: .7rem; color: var(--panel-ink); }
.hero__main .lead { color: var(--panel-mute); max-width: 40ch; }

/* кнопка первого экрана прижата к тексту, а не растянута колонкой */
.trust { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }

.hero__cta { display: flex; width: 100%; justify-content: center; margin-top: .9rem; }
.trust li {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .8rem; background: var(--chip-bg);
  border-radius: var(--pill); font-size: .78rem; color: var(--panel-mute);
}
/* «Документы на партию» — с мобильного убрано, текст об этом уже нигде
   выше на первом экране не звучит; на десктопе, где панель просторнее,
   чип остаётся. Двойной селектор — тот же урок, что и с .hero__pick--week:
   при одинаковой специфичности решает порядок в файле, а не желаемый смысл. */
.trust li.trust__docs { display: none; }
.trust svg { flex: none; width: 15px; height: 15px; color: var(--blue-ink); }
.trust b { color: var(--panel-ink); font-weight: 600; }

.hero__pick {
  background: var(--footer); color: #EDF1F5; border-radius: var(--r-panel);
  padding: 1.3rem 1.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: .85rem;
  min-width: 0;
}
.hero__pick h2 { color: #fff; font-size: 1.6rem; }
.hero__pick .kicker { color: var(--blue-soft); }
.hero__pick h2 em { font-style: normal; color: var(--blue); }
.hero__pick figure { margin: 0; align-self: stretch; background: #E9EDF0; border-radius: var(--r); padding: .9rem; display: grid; place-items: center; }
.hero__pick figure img { width: 100%; max-width: 170px; height: auto; margin-inline: auto; mix-blend-mode: multiply; }
.hero__pick p { margin: 0; color: #AEBECA; font-size: .87rem; }
/* цена и действие в одной строке: сумма слева, кнопка справа */
.hero__buy {
  align-self: stretch;
  display: flex; align-items: center;
  flex-wrap: wrap; gap: .7rem .9rem;
  margin-top: .15rem;
}
/* кнопка держится правого края и когда строка переносится на узком экране */
.hero__buy .btn { margin-left: auto; }
/* карточка консультанта: лицо рядом с кнопками, а не в конце страницы */
.mgr {
  align-self: stretch;
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem; margin-top: .1rem;
  background: rgba(255, 255, 255, .07);
  border-radius: var(--r);
}
.mgr__ph {
  width: 74px; height: 96px; flex: none;
  object-fit: cover; object-position: center top;
  border-radius: 10px;
}
.mgr__who b { display: block; color: #fff; font-weight: 600; font-size: .95rem; }
.mgr__who span { display: block; margin-top: .15rem; color: #AEBECA; font-size: .82rem; line-height: 1.4; }

.hero__price { display: flex; align-items: baseline; gap: .4rem; }
.hero__price b { font-family: var(--f-serif); font-size: 2rem; color: #fff; font-variant-numeric: tabular-nums; }
.hero__price span { color: #AEBECA; font-size: .85rem; }

/* ------------------------------------------------------------ секции -- */

.sec { padding-block: 1.6rem; }
.sec__head { margin-bottom: 1.1rem; }
.sec__head .lead { margin-top: .6rem; max-width: 56ch; }

/* --------------------------------------------------- плитки разделов -- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.tile { min-width: 0; }

.tile {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--white); border: 1px solid var(--stroke-soft);
  border-radius: var(--r); padding: .85rem .8rem;
  text-decoration: none; color: inherit; transition: border-color .15s;
}
.tile:hover { border-color: var(--blue); }
.tile__ic {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-sm); background: var(--blue-plate); color: var(--blue-ink);
}
.tile__ic svg { width: 19px; height: 19px; }
.tile h3 { font-size: 1rem; margin-top: .25rem; }
.tile p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; flex: 1; }

/* ---------------------------------------------------------- цифры ---- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.stat { background: var(--bg-blue); border-radius: var(--r); padding: 1rem .9rem; }
.stat { min-width: 0; }
.stat b {
  display: block; font-family: var(--f-serif); font-size: 2.4rem; line-height: 1;
  color: var(--blue-ink); font-variant-numeric: tabular-nums;
}
.stat strong { display: block; margin: .5rem 0 .2rem; font-size: .92rem; font-weight: 600; color: var(--panel-ink); }
.stat p { margin: 0; color: var(--panel-mute); font-size: .78rem; line-height: 1.45; }

/* ============================================== фильтр каталога === */

/* Липнет под шапкой: на мобильном не нужно скроллить вверх, чтобы
   поменять категорию, пока листаешь карточки — это была прямая просьба
   по юзабилити фильтра именно на телефоне. */
.filters {
  position: sticky; top: 66px; z-index: 40;
  background: var(--bg);
  padding-block: .7rem .8rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--stroke-soft);
}

.filters__search { position: relative; min-width: 0; margin-bottom: .55rem; }
.filters__search svg {
  position: absolute; left: .95rem; top: 50%; translate: 0 -50%;
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.filters__search input {
  width: 100%; min-width: 0; min-height: 44px;
  padding: 0 2.6rem 0 2.6rem;
  border: 1px solid var(--stroke); border-radius: var(--pill);
  background: var(--white); color: var(--ink);
  font-size: .93rem; font-family: inherit;
}
.filters__search input::placeholder { color: var(--muted); }
.filters__search input::-webkit-search-cancel-button { display: none; }
.filters__search input:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }

#searchClear {
  position: absolute; right: .5rem; top: 50%; translate: 0 -50%;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}
#searchClear:hover { background: var(--stroke-soft); color: var(--ink); }

.filters__chips {
  display: flex; gap: .4rem; min-width: 0;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) .1rem;
}
.filters__chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  min-height: 40px; padding: 0 .95rem;
  border: 1px solid var(--stroke); border-radius: var(--pill);
  background: var(--white); color: var(--ink);
  font-size: .84rem; font-weight: 500; font-family: inherit;
  white-space: nowrap; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }

.filters__empty {
  display: none; margin: 0 0 .9rem;
  padding: 2.4rem 1.2rem; text-align: center;
  background: var(--white); border: 1px solid var(--stroke-soft); border-radius: var(--r);
  color: var(--muted); font-size: .92rem; line-height: 1.6;
}
.filters__empty[data-show] { display: block; }
.filters__empty a { display: inline-block; margin-top: .3rem; color: var(--blue-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.card.is-hidden { display: none; }

/* ------------------------------------------------------ товары ------- */

.grid { display: grid; grid-template-columns: 1fr; gap: .55rem; }

.card {
  --media-w: 118px;
  min-width: 0;
  display: flex; flex-direction: row;
  background: var(--white); border: 1px solid var(--stroke-soft);
  border-radius: var(--r); transition: border-color .15s;
}
.card:hover { border-color: var(--blue); }

.card__media {
  position: relative; width: var(--media-w); flex: none; align-self: stretch;
  display: grid; place-items: center; padding: .35rem;
  background: var(--blue-plate); border-right: 1px solid var(--stroke-soft);
  border-radius: calc(var(--r) - 1px) 0 0 calc(var(--r) - 1px); overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.tag {
  position: absolute; top: .4rem; left: .4rem;
  font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: .24rem .5rem; border-radius: var(--pill);
  background: var(--blue); color: var(--on-blue);
}
.tag--hit { background: var(--red); color: #fff; }

.card__body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: .75rem .7rem .8rem; }
.card__name { font-size: 1.02rem; overflow-wrap: anywhere; }
.card__what {
  margin: .3rem 0 .65rem; color: var(--muted); font-size: .8rem; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.card__foot { margin-top: auto; }
.card__meta { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .55rem; }

.price { display: flex; align-items: baseline; gap: .3rem; }
.price b { font-family: var(--f-serif); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.price span { font-size: .78rem; color: var(--muted); }

.stock { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; margin: 0; color: var(--ok); font-weight: 600; }
.stock::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stock[data-low] { color: var(--warn); }

.buy { display: flex; flex-wrap: nowrap; gap: .5rem; min-width: 0; }
.buy .btn { flex: 1 1 auto; justify-content: center; }
.qty { display: flex; align-items: center; border: 1px solid var(--stroke); border-radius: var(--pill); flex: none; justify-content: center; }
.qty button { width: 34px; height: 42px; border: 0; background: none; font-size: 1.05rem; cursor: pointer; color: var(--muted); border-radius: var(--pill); }
.qty button:hover { color: var(--ink); }
.qty output { min-width: 20px; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; font-weight: 600; }

.card .btn { min-height: 42px; padding: 0 .9rem; font-size: .85rem; }
.card .btn__t { white-space: nowrap; }
.card .btn__ic { display: none; }

/* ------------------------------------------------- выбор дозировки --- */

.sel { position: relative; min-width: 0; margin-bottom: .6rem; }
.sel__btn {
  width: 100%; display: flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: 0 .8rem; min-width: 0;
  border: 1px solid var(--stroke); border-radius: var(--pill);
  background: var(--white); color: var(--ink);
  cursor: pointer; text-align: left; transition: border-color .14s;
}
.sel__btn:hover { border-color: var(--ink); }
.sel__btn[aria-expanded="true"] { border-color: var(--blue); }
.sel__lbl {
  flex: 0 1 auto; min-width: 0; overflow: hidden;
  font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.sel__cur { margin-left: auto; font-size: .88rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sel__chev { flex: none; width: 11px; height: 8px; color: var(--muted); transition: transform .16s; }
.sel__btn[aria-expanded="true"] .sel__chev { transform: rotate(180deg); }

.sel__list {
  position: absolute; z-index: 30; top: calc(100% + .3rem);
  left: calc(-1 * (var(--media-w) + .4rem)); right: -.4rem;
  margin: 0; padding: .25rem; list-style: none;
  background: var(--white); border: 1px solid var(--stroke); border-radius: var(--r);
  box-shadow: var(--shadow-2); max-height: 15rem; overflow-y: auto;
}
.sel__list[hidden] { display: none; }
.sel__list li {
  display: flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .3rem .5rem; border-radius: var(--r-sm); cursor: pointer;
}
.sel__list li:hover, .sel__list li:focus-visible { background: var(--bg); outline: none; }
.sel__list li[aria-selected="true"] { background: var(--blue-plate); }
.sel__list li[data-stock="0"] { opacity: .62; }
.sel__list img {
  width: 30px; height: 30px; flex: none; object-fit: contain;
  background: var(--blue-plate); border-radius: 6px; mix-blend-mode: multiply;
}
.sel__mg { font-size: .87rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sel__pr { margin-left: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ================================================= страница товара ==== */

.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding-block: .9rem 0; font-size: .82rem; color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }

.pdp { display: grid; grid-template-columns: 1fr; gap: .8rem; padding-top: .9rem; }
.pdp > * { min-width: 0; }

.pdp__media {
  margin: 0; display: grid; place-items: center;
  background: var(--blue-plate); border-radius: var(--r-panel);
  padding: 1rem; aspect-ratio: 4 / 3; min-width: 0; overflow: hidden;
}
.pdp__media img { width: 100%; max-width: min(230px, 55vw); height: auto; mix-blend-mode: multiply; }

.pdp__buy {
  background: var(--white); border: 1px solid var(--stroke-soft);
  border-radius: var(--r-panel); padding: 1.3rem 1.15rem;
  display: flex; flex-direction: column; min-width: 0;
}
.pdp__buy h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin-bottom: .5rem; }
.pdp__buy .lead { margin-bottom: 1.1rem; font-size: .96rem; }
.pdp__buy .sel { margin-bottom: .8rem; }
.pdp__buy .sel__list { left: 0; right: 0; }

.pdp__meta { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .8rem; }
.pdp__meta .price b { font-size: 1.9rem; }

.trust--pdp { flex-direction: column; align-items: stretch; gap: .3rem; margin-top: 1.1rem; }
.trust--pdp li { background: var(--bg); color: var(--muted); border-radius: var(--r-sm); }
.trust--pdp b { color: var(--ink); }

/* сопутствующий товар: без воды лиофилизат не развести */
.addon {
  display: grid; grid-template-columns: 64px 1fr; gap: .7rem .85rem;
  align-items: center; margin-top: 2rem;
  background: var(--white); border: 1px dashed var(--stroke);
  border-radius: var(--r); padding: .85rem;
}
.addon__ph { width: 64px; height: 64px; object-fit: contain; background: var(--blue-plate); border-radius: var(--r-sm); mix-blend-mode: multiply; }
.addon__txt b { display: block; font-size: .97rem; font-weight: 600; }
.addon__txt span { display: block; margin-top: .1rem; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.addon__act { grid-column: 1 / -1; display: grid; gap: .5rem; min-width: 0; }
.addon__act .sel { margin: 0; }
.addon__act .sel__list { left: 0; right: 0; }
.addon__act .pdp__meta { margin: 0; }

.uses { display: grid; grid-template-columns: 1fr; gap: .55rem; }
.use { background: var(--white); border: 1px solid var(--stroke-soft); border-radius: var(--r); padding: 1rem .95rem; }
.use h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.use p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ================================================ консультация ==== */
/* Без фото — версия с портретом заняла вдвое больше места и не подошла.
   Центрированная колонка, невысокая панель. */

.consult {
  background: var(--footer);
  border-radius: var(--r-panel);
  padding: 1.7rem 1.3rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.consult h2 { color: #fff; font-size: clamp(1.5rem, 6vw, 2rem); margin: .3rem 0 .6rem; }
.consult > p { color: #AEBECA; font-size: .95rem; line-height: 1.55; margin: 0 0 1.1rem; max-width: 42ch; }
.consult__hours { margin: 1rem 0 0 !important; font-size: .85rem; opacity: .8; }

@media (min-width: 900px) {
  .trust li.trust__docs { display: flex; }
  .hero__cta { display: none; }  /* только на мобильном, по прямой просьбе */
  .consult { padding: 2.2rem 2rem; }
  .consult h2 { font-size: clamp(1.7rem, 2.6vw, 2.1rem); }
}

.pdp__docs { align-items: flex-start; }
.pdp__docs h2 { font-size: clamp(1.4rem, 5.5vw, 2rem); }

.spec { margin: 0; display: grid; gap: 0; }
.spec__row { min-width: 0; }  /* иначе строка не сжимается ниже значения в 2-колоночной сетке */
.spec__row {
  display: grid; grid-template-columns: 1fr; gap: .15rem;
  padding: .8rem 0; border-bottom: 1px solid var(--stroke-soft);
}
.spec__row:last-child { border-bottom: none; }
.spec dt { color: var(--muted); font-size: .84rem; }
.spec dd { margin: 0; font-size: .95rem; overflow-wrap: break-word; }

.card__name a { color: inherit; text-decoration: none; }
.card__name a:hover { color: var(--blue-ink); }
a.card__media { display: grid; }

/* --------------------------------------------------------- отзывы ---- */

.says { display: grid; grid-template-columns: 1fr; gap: .55rem; }
.say { background: var(--white); border: 1px solid var(--stroke-soft); border-radius: var(--r); padding: .95rem .9rem; }
.say__who { margin-bottom: .5rem; }
.say__who b { display: block; font-size: .95rem; font-weight: 600; }
.say__who span { font-size: .72rem; color: var(--muted); }
.say p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.say time { display: block; margin-top: .7rem; font-size: .72rem; color: var(--muted); }

/* ------------------------------------------------------ как заказать -- */

.steps { display: grid; gap: 0; grid-template-columns: 1fr; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; padding: 1rem 0; border-top: 1px solid var(--stroke-soft); }
.steps li::before {
  content: "0" counter(s);
  display: block; margin-bottom: .4rem;
  font-family: var(--f-serif); font-size: 1.35rem; color: var(--blue-ink);
}
.steps b { display: block; margin-bottom: .2rem; font-family: var(--f-serif); font-weight: 400; font-size: 1.15rem; }
.steps p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; max-width: 42ch; }

/* ---------------------------------------------------------- контроль -- */

.qc { display: grid; gap: .55rem; grid-template-columns: 1fr; }

/* --------------------------------------------------------------- faq -- */

.faq details { border-top: 1px solid var(--stroke-soft); }
.faq details:last-child { border-bottom: 1px solid var(--stroke-soft); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--tap); padding: .95rem 0; cursor: pointer;
  font-family: var(--f-serif); font-size: 1.1rem; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-plate); color: var(--blue-ink);
}
.faq summary i svg { width: 11px; height: 11px; }
.faq details[open] summary i .v { display: none; }
.faq p { margin: -.2rem 0 1.1rem; color: var(--muted); font-size: .9rem; line-height: 1.6; max-width: 62ch; }
.faq p a { color: var(--blue-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ подвал -- */

.ftr {
  background: var(--footer); color: #C6D3DC;
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  margin-top: 1.6rem; padding: 1.8rem 0 6.5rem; font-size: .88rem;
}
.ftr__top { display: grid; gap: 1.3rem; margin-bottom: 1.6rem; }
.ftr .logo { --logo-a: #FFFFFF; }   /* обратная версия знака на тёмном */
.ftr .logo__sub { color: #8FA2AF; }
.ftr__grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr 1fr; }
.ftr h4 { margin: 0 0 .5rem; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #8FA2AF; font-weight: 600; }
.ftr a { color: #C6D3DC; text-decoration: none; display: block; min-height: 32px; line-height: 32px; }
.ftr a:hover { color: var(--blue); }
.ftr__legal { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid #1D2E3A; color: #97A8B4; font-size: .76rem; line-height: 1.55; max-width: 70ch; }

/* ------------------------------------------------- нижняя панель ----- */

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; align-items: center; gap: .7rem;
  padding: .6rem var(--gutter); padding-bottom: calc(.6rem + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--stroke);
  box-shadow: 0 -6px 28px rgba(14, 27, 38, .12);
}
.bar[data-on] { display: flex; }
.bar__sum { margin-right: auto; line-height: 1.25; }
.bar__sum small { display: block; color: var(--muted); font-size: .72rem; }
.bar__sum b { font-family: var(--f-serif); font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- корзина --- */

.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(14, 27, 38, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim[data-on] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; z-index: 100; inset: auto 0 0 0; max-height: 88vh;
  display: flex; flex-direction: column; background: var(--bg);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  transform: translateY(101%); transition: transform .24s ease; box-shadow: var(--shadow-2);
}
.drawer[data-on] { transform: translateY(0); }
.drawer__hd {
  display: flex; align-items: center; gap: .6rem; padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--stroke-soft); background: var(--white);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
}
.drawer__hd h2 { font-size: 1.3rem; margin-right: auto; }
.x { width: var(--tap); height: var(--tap); border: 1px solid var(--stroke); border-radius: 50%; background: var(--white); cursor: pointer; font-size: 1rem; line-height: 1; }
.x:hover { border-color: var(--ink); }
.drawer__body { overflow-y: auto; padding: .5rem var(--gutter); flex: 1; }

.line { display: grid; grid-template-columns: 52px 1fr auto; gap: .5rem .75rem; padding: .85rem 0; border-bottom: 1px solid var(--stroke-soft); align-items: start; }
.line__img { width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--blue-plate); object-fit: contain; padding: 3px; mix-blend-mode: multiply; }
.line__n { font-weight: 600; font-size: .95rem; }
.line__d { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
.line__p { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.line__ctl { grid-column: 2 / -1; display: flex; align-items: center; gap: .5rem; margin-top: .1rem; }
.rm { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .82rem; min-height: 36px; text-decoration: underline; text-underline-offset: 3px; }
.rm:hover { color: var(--red); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .95rem; }

.drawer__ft {
  border-top: 1px solid var(--stroke-soft); background: var(--white);
  padding: 1rem var(--gutter); padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  display: grid; gap: .5rem;
}
.total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .2rem; }
.total b { font-family: var(--f-serif); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.drawer__ft .btn,
.hero__pick .btn--full { justify-content: space-between; align-self: stretch; }
.btn--wa { background: #1A7E36; color: #fff; }
.btn--wa .btn__ic { background: #fff; color: #146A2D; }
.btn--tg { background: #2472A6; color: #fff; }
.btn--tg .btn__ic { background: #fff; color: #1F6795; }
.drawer__hint { margin: .1rem 0 0; font-size: .77rem; color: var(--muted); line-height: 1.45; text-align: center; }

/* ======================================================= ≤ 340px ===== */
/* Логотип и кнопка корзины не ужимались, и вдвоём переставали влезать
   в строку ниже 308px — горизонтальный скролл на всех страницах сразу.
   Подпись «пептиды» под знаком декоративная (aria-hidden), на самых узких
   экранах её убираем: освобождает ~60px, знак и корзина остаются целыми. */

@media (max-width: 340px) {
  .hdr__in .logo__sub { display: none; }
  .hdr__cart { padding: 0 .8rem; }
}

/* ======================================================= ≤ 319px ===== */
/* Счётчик и кнопка в карточке стоят в один ряд по просьбе — но ниже 320px
   ряд физически не помещается, и nowrap-подпись кнопки распирала сетку.
   Здесь и только здесь возвращаем перенос: кнопка уходит под счётчик.
   Порог выбран по замеру — на 320px ряд ещё влезает без переполнения. */

@media (max-width: 319px) {
  .card .buy { flex-wrap: wrap; }
  .card .buy .btn { flex: 1 1 100%; }
  .card .qty { flex: 1 1 auto; }
  .card .btn__t { white-space: normal; }
}

/* ======================================================= ≤ 359px ===== */

@media (max-width: 374px) {
  :root { --gutter: .8rem; }
  .card { --media-w: 88px; }
  .card__body { padding: .65rem .6rem .7rem; }
  .pdp__media { padding: .7rem; }
  .addon { grid-template-columns: 52px 1fr; }
  .addon__ph { width: 52px; height: 52px; }
  .sel__lbl { display: none; }
  .sel__cur { margin-left: 0; }
  .tiles { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  /* на узком экране кнопка первого экрана во всю ширину: так она не переполняет
     панель и в неё проще попасть пальцем */
  .hero__main h1 { font-size: 1.85rem; overflow-wrap: anywhere; }
  .hero__main { padding: 1.3rem .9rem 1.2rem; }
}

/* ======================================================= ≥ 560px ===== */

@media (min-width: 560px) {
  :root { --gutter: 1.5rem; --r-panel: 26px; }
  .panel { padding: 1.9rem 1.6rem; }
  .hero__main { padding: 2.4rem 1.9rem 2rem; }
  .hero__pick { padding: 1.6rem 1.5rem; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: .8rem; }
  .filters__chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .card { flex-direction: column; }
  .card__media {
    width: auto; aspect-ratio: 1; padding: .5rem;
    border-right: none; border-bottom: 1px solid var(--stroke-soft);
    border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  }
  .tag { top: .55rem; left: .55rem; }
  .card__body { padding: .9rem .85rem 1rem; }
  .card__what { -webkit-line-clamp: 3; }
  .sel__list { left: 0; right: 0; }
  .sel__list img { width: 34px; height: 34px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .says { grid-template-columns: repeat(2, 1fr); }
  .qc { grid-template-columns: repeat(3, 1fr); }
  .uses { grid-template-columns: repeat(3, 1fr); }
  .addon { grid-template-columns: 64px 1fr auto; align-items: center; margin-top: 2.6rem; }
  .addon__act { grid-column: auto; grid-template-columns: minmax(9rem,1fr) auto; align-items: center; gap: .6rem; }
  .addon__act .pdp__meta { margin: 0; }
  .addon__act .buy { grid-column: 1 / -1; }
  .spec { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
  .spec__row { grid-template-columns: 1fr minmax(0, auto); align-items: baseline; gap: 1rem; }
  .spec dd { text-align: right; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .ftr__grid { grid-template-columns: repeat(4, 1fr); }
  .sec { padding-block: 2.2rem; }
}

/* ======================================================= ≥ 900px ===== */

@media (min-width: 900px) {
  .addon__act { grid-template-columns: minmax(9rem,1fr) auto auto; }
  .addon__act .buy { grid-column: auto; }

  :root { --gutter: 2rem; --r-panel: 30px; }
  body { font-size: 17px; }

  .logo__img { height: 30px; }
  .hdr__nav { display: flex; gap: .1rem; margin-right: .5rem; }
  .hdr__nav a {
    display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .85rem;
    border-radius: var(--pill); text-decoration: none; color: var(--ink); font-size: .93rem;
  }
  .hdr__nav a:hover { background: var(--white); }

  .hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .hero__pick.hero__pick--week { display: flex; }
  .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; padding-top: 1.2rem; }
  .pdp__media { aspect-ratio: 1; padding: 2.5rem; }
  .pdp__media img { max-width: 300px; }
  .pdp__buy { padding: 2.2rem 2rem; justify-content: center; }
  .pdp__buy .sel, .pdp__buy .buy { max-width: 26rem; }
  .trust--pdp { flex-direction: row; flex-wrap: wrap; }
  .trust--pdp li { background: var(--bg); }
  .hero__main { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
  .hero__main { padding: 3rem 2.6rem 2.6rem; }
  .hero__main .lead { font-size: 1.08rem; }

  .panel { padding: 2.6rem 2.4rem; }
  .sec { padding-block: 2.8rem; }
  .sec__head { margin-bottom: 1.6rem; }
  .sec--split .sec__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.5rem; align-items: end; }
  .sec--split .sec__head .lead { margin-top: 0; }

  .grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .says { grid-template-columns: repeat(4, 1fr); }
  .tile { padding: 1.1rem 1rem; }
  .stat { padding: 1.4rem 1.2rem; }
  .stat b { font-size: 3.1rem; }

  .ftr { padding-bottom: 2.4rem; margin-top: 2.4rem; }
  .ftr__top { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 3rem; }
  .bar { display: none !important; }

  .drawer { inset: 0 0 0 auto; width: min(28rem, 100%); max-height: none; border-radius: 0; transform: translateX(101%); }
  .drawer[data-on] { transform: translateX(0); }
  .drawer__hd { border-radius: 0; }
}

/* в тёмной теме — обратная версия знака, бирюзовый остаётся фирменным */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo { --logo-a: #FFFFFF; }
}
:root[data-theme="dark"] .logo { --logo-a: #FFFFFF; }

/* фотографии сняты на белом — в тёмной теме подложка остаётся светлой */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card__media,
  :root:not([data-theme="light"]) .sel__list img,
  :root:not([data-theme="light"]) .line__img { background: #E9EDF0; }
}
:root[data-theme="dark"] .card__media,
:root[data-theme="dark"] .sel__list img,
:root[data-theme="dark"] .line__img { background: #E9EDF0; }

/* в тёмной теме красный светлеет — белый текст на нём уже не читается */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag--hit { color: #2A1008; }
}
:root[data-theme="dark"] .tag--hit { color: #2A1008; }
