/* Главная e-peptidi.ru (front-page.php). Токены и кнопки — ep-base.css, плитка товара — ep-catalog.css.
   Вид как у 1peptidmos: белый фон, тёмный текст, волосяные линии, без теней и плашек-карточек; цвет только у кнопки Telegram. */

.ep-home { overflow-x: clip; }
.ep-home-sec { padding: 72px 0; }
.ep-home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.ep-home-head__h { margin: 0; font-size: 30px; line-height: 1.15; }
.ep-home-head__meta { margin: 0; color: var(--ep-muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ===== Первый экран ===== */
.ep-hero { padding: 48px 0 24px; }
.ep-hero__in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.ep-hero__h1 { margin: 0 0 20px; font-size: 44px; line-height: 1.1; letter-spacing: -.01em; max-width: 15em; }
.ep-hero__lead { margin: 0 0 32px; max-width: 34em; font-size: 19px; line-height: 1.5; color: var(--ep-ink-2); }
.ep-hero__cta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 32px; }
.ep-hero__note { margin: 14px 0 0; font-size: 15px; color: var(--ep-muted); }

/* Флаконы из каталога лесенкой: в центре крупнее и впереди, к краям меньше и выше. Каждый — ссылка на свой товар. */
.ep-hero__media { background: var(--ep-soft); aspect-ratio: 6 / 5; display: flex; align-items: flex-end; justify-content: center; padding: 0 6% 9%; }
.ep-hero__shelf { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.ep-hero__vial { position: relative; flex: 0 0 auto; width: 25%; margin: 0 -1.5%; transition: transform .25s var(--ep-ease); }
.ep-hero__vial img { width: 100%; height: auto; }
.ep-hero__shelf--5 .ep-hero__vial { width: 19%; margin: 0 -1.2%; }
.ep-hero__shelf--5 .ep-hero__vial:nth-child(3) { width: 25%; z-index: 2; }
.ep-hero__shelf--5 .ep-hero__vial:nth-child(2), .ep-hero__shelf--5 .ep-hero__vial:nth-child(4) { width: 22%; z-index: 1; margin-bottom: 3%; }
.ep-hero__shelf--5 .ep-hero__vial:nth-child(1), .ep-hero__shelf--5 .ep-hero__vial:nth-child(5) { margin-bottom: 6%; }
.ep-hero__shelf--4 .ep-hero__vial { width: 25%; }
.ep-hero__shelf--3 .ep-hero__vial { width: 28%; }
.ep-hero__vial:focus-visible { outline-offset: 4px; }

/* ===== Каталог ===== */
.ep-home-cat { padding-top: 64px; }
.ep-home-terms { margin: 0 0 28px; }
.ep-home-terms ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.ep-home-terms a {
  display: inline-block; padding: 4px 0; font-size: 15px; color: var(--ep-ink-2);
  text-decoration: underline; text-decoration-color: var(--ep-line); text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color .2s var(--ep-ease), text-decoration-color .2s var(--ep-ease);
}
.ep-home-terms a:hover { color: var(--ep-ink); text-decoration-color: currentColor; }
.ep-home-cat__more { margin: 32px 0 0; }

/* ===== Почему у нас: одна строка, волосяные линии, без плиток ===== */
.ep-home-why { padding: 8px 0 0; }
/* Колонки по содержимому: заголовок узкий, у пунктов заголовок и подпись в одну строку на ПК, свободное место делится поровну. */
.ep-why { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; }
.ep-why__h { margin: 0; padding: 24px 24px 24px 0; font-size: 20px; line-height: 1.3; border-block: 1px solid var(--ep-line); }
.ep-why__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, auto); border-block: 1px solid var(--ep-line); }
.ep-why__item { display: flex; gap: 12px; align-items: flex-start; padding: 24px; border-left: 1px solid var(--ep-line); }
.ep-why__item .ep-ico { margin-top: 2px; color: var(--ep-ink); }
.ep-why__item p { margin: 0; }
.ep-why__t { display: block; font-weight: 700; line-height: 1.35; color: var(--ep-ink); }
a.ep-why__t { text-decoration: underline; text-decoration-color: var(--ep-line); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .2s var(--ep-ease); }
a.ep-why__t:hover { text-decoration-color: currentColor; }
.ep-why__d { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--ep-muted); }

/* ===== Как заказать ===== */
.ep-home-how .ep-home-head__h { margin-bottom: 32px; }
.ep-steps { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 40px; }
.ep-steps__item { display: flex; gap: 16px; align-items: flex-start; }
.ep-steps__n {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--ep-ink); border-radius: 50%;
  font-size: 20px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.ep-steps__item p { margin: 0; padding-top: 2px; }
.ep-steps__t { display: block; font-weight: 700; font-size: 18px; line-height: 1.3; }
.ep-steps__d { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--ep-muted); }
.ep-steps__d a { color: inherit; text-underline-offset: 3px; }
.ep-steps__d a:hover { color: var(--ep-ink); }

/* ===== Справочник и статьи (индексатор): текстовые ссылки, без плиток ===== */
.ep-home-idx { padding-top: 24px; }
.ep-home-idx .ep-home-head__h { margin-bottom: 24px; }
.ep-idx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px 56px; padding-top: 24px; border-top: 1px solid var(--ep-line); }
.ep-idx__h { margin: 0 0 12px; font-size: 17px; line-height: 1.3; }
.ep-idx__h a { color: var(--ep-ink); text-decoration: none; }
.ep-idx__h a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ep-idx__chips, .ep-idx__list { list-style: none; margin: 0; padding: 0; }
.ep-idx__chips { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ep-idx__list { columns: 2; column-gap: 40px; }
.ep-idx__list li { break-inside: avoid; }
.ep-idx__chips a, .ep-idx__list a, .ep-idx__razd a {
  display: inline-block; padding: 4px 0; font-size: 15px; line-height: 1.4; color: var(--ep-ink-2);
  text-decoration: underline; text-decoration-color: var(--ep-line); text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color .2s var(--ep-ease), text-decoration-color .2s var(--ep-ease);
}
.ep-idx__chips a:hover, .ep-idx__list a:hover, .ep-idx__razd a:hover { color: var(--ep-ink); text-decoration-color: currentColor; }
.ep-idx__razd { margin: 16px 0 0; font-size: 15px; color: var(--ep-muted); }

/* ===== Цены по рубрикам ===== */
/* Строка на рубрику: название, товары с объёмом, цена от. Линии вместо карточек — как в таблицах каталога. */
.ep-price { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ep-line); }
.ep-price__row {
  display: grid; grid-template-columns: minmax(170px, 3fr) minmax(0, 7fr) auto;
  gap: 6px 32px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--ep-line);
}
.ep-price__term { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--ep-ink); text-decoration: none; }
.ep-price__term:hover { text-decoration: underline; text-underline-offset: 4px; }
.ep-price__items { margin: 0; color: var(--ep-ink-2); font-size: 15px; line-height: 1.6; }
.ep-price__items a {
  color: var(--ep-ink-2); text-decoration: underline;
  text-decoration-color: var(--ep-soft); text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s var(--ep-ease);
}
.ep-price__items a:hover { color: var(--ep-ink); text-decoration-color: currentColor; }
.ep-price__pack { color: var(--ep-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ep-price__sep { color: var(--ep-soft); }
.ep-price__from { margin: 0; justify-self: end; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Что почитать до заказа ===== */
.ep-read {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ep-line);
}
.ep-read__item { padding: 24px 24px 0 0; }
.ep-read__item + .ep-read__item { padding-left: 24px; border-left: 1px solid var(--ep-line); }
.ep-read__t {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ep-ink); text-decoration: none;
}
.ep-read__t:hover { text-decoration: underline; text-underline-offset: 4px; }
.ep-read__t .ep-ico { color: var(--ep-muted); }
.ep-read__n { margin: 6px 0 0; color: var(--ep-muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.ep-read__d { margin: 10px 0 0; color: var(--ep-ink-2); font-size: 15px; line-height: 1.5; }

/* ===== Вопросы и ответы ===== */
.ep-home-faq { padding-top: 24px; }
.ep-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 56px; align-items: start; }
.ep-faq__ask { margin: 16px 0 0; color: var(--ep-muted); font-size: 15px; }
.ep-faq__ask .ep-link-more { margin-top: 4px; font-size: 16px; }

/* ===== Остались вопросы: полоса между вопросами и текстом о магазине ===== */
.ep-home-ask { padding: 0; }
.ep-ask {
  display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap;
  padding: 28px 0; border-block: 1px solid var(--ep-line);
}
.ep-ask__text { flex: 1 1 420px; max-width: 72ch; }
.ep-ask__h { margin: 0; font-size: 24px; line-height: 1.25; }
.ep-ask__d { margin: 8px 0 0; color: var(--ep-ink-2); font-size: 16px; line-height: 1.5; }

/* ===== Планшет ===== */
@media (max-width: 1199px) {
  /* «Почему у нас»: заголовок над строкой, пунктам вся ширина — заголовки пунктов остаются в одну строку */
  .ep-why { grid-template-columns: 1fr; }
  .ep-why__h { border: 0; padding: 0 0 16px; }
  .ep-why__item:nth-child(1) { border-left: 0; padding-left: 0; }
}

@media (max-width: 1099px) {
  .ep-hero__h1 { font-size: 38px; }
  .ep-hero__in { gap: 40px; }
}

@media (max-width: 1023px) {
  .ep-hero__h1 { font-size: 32px; }
  .ep-hero__lead { font-size: 17px; }
  /* на узком планшете три колонки уже не помещаются в строку — пункты друг под другом, как на телефоне */
  .ep-why__list { grid-template-columns: 1fr; border-bottom: 0; }
  .ep-why__item { border-left: 0; border-bottom: 1px solid var(--ep-line); padding: 16px 0; }
  /* «Что почитать»: три колонки сужают строки до двух слов — ставим в столбик */
  .ep-read { grid-template-columns: 1fr; }
  .ep-read__item { padding: 20px 0; }
  .ep-read__item + .ep-read__item { padding-left: 0; border-left: 0; border-top: 1px solid var(--ep-line); }
}

/* ===== Телефон ===== */
@media (max-width: 767px) {
  .ep-home-sec { padding: 48px 0; }
  .ep-home-head__h { font-size: 24px; }
  .ep-hero { padding: 28px 0 8px; }
  .ep-hero__in { grid-template-columns: 1fr; }
  .ep-hero__media { display: none; } /* как у референса: на телефоне сразу текст, кнопка и каталог */
  .ep-hero__h1 { font-size: 27px; line-height: 1.18; margin-bottom: 14px; }
  .ep-hero__lead { font-size: 16px; margin-bottom: 24px; }
  /* Подпись «Менеджер ответит…» — сразу под кнопкой, которую она поясняет; «Каталог →» — после неё. */
  .ep-hero__text { display: flex; flex-direction: column; align-items: flex-start; }
  .ep-hero__cta { display: contents; }
  .ep-hero__cta .ep-btn-tg { width: 100%; order: 1; }
  .ep-hero__note { order: 2; margin-top: 10px; font-size: 14px; }
  .ep-hero__cta .ep-link-more { order: 3; margin-top: 18px; }
  .ep-home-cat { padding-top: 40px; }
  /* Рубрики на телефоне — кнопки в три ряда, как вкладки каталога на телефоне: видны все, без прокрутки. */
  .ep-home-terms { margin-bottom: 24px; }
  .ep-home-terms ul { gap: 8px; }
  .ep-home-terms a {
    display: flex; align-items: center; min-height: 40px; padding: 8px 12px;
    border: 1px solid var(--ep-line); border-radius: var(--ep-radius);
    font-size: 15px; line-height: 1.3; color: var(--ep-ink); text-decoration: none; white-space: nowrap;
  }
  .ep-home-how .ep-home-head__h { margin-bottom: 24px; }
  .ep-steps { grid-template-columns: 1fr; gap: 20px; margin-bottom: 28px; }
  .ep-home-how__cta .ep-btn-tg { width: 100%; }
  .ep-idx { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; }
  .ep-idx__list { columns: 1; }
  .ep-idx__chips { gap: 8px; }
  .ep-idx__chips a {
    display: flex; align-items: center; min-height: 40px; padding: 8px 12px;
    border: 1px solid var(--ep-line); border-radius: var(--ep-radius); color: var(--ep-ink); text-decoration: none;
  }
  .ep-idx__list a { padding: 8px 0; }
  .ep-faq { grid-template-columns: 1fr; gap: 20px; }
  .ep-faq__side { display: contents; }
  .ep-faq__ask { order: 2; margin-top: 4px; }
  /* Цены: рубрика и «от N ₽» в одну строку, перечень товаров — под ними во всю ширину */
  .ep-price__row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; }
  .ep-price__from { order: 2; }
  .ep-price__items { order: 3; grid-column: 1 / -1; margin-top: 2px; }
  .ep-price__term { font-size: 16px; }
  .ep-ask { padding: 24px 0; }
  .ep-ask__h { font-size: 21px; }
  .ep-ask__d { font-size: 15px; }
  .ep-ask .ep-btn-tg { width: 100%; }
}

@media (max-width: 374px) {
  .ep-home-terms a { padding: 6px 10px; font-size: 14px; }
}

@media (hover: hover) and (pointer: fine) {
  .ep-hero__vial:hover { transform: translateY(-4px); }
}

/* Нижний текст главной: та же типографика, что .ep-prose в ep-pages.css, но без загрузки всего файла. */
.ep-home-seo__text { max-width: 70ch; }
.ep-home-seo__text > :first-child { margin-top: 0; }
.ep-home-seo__text > :last-child { margin-bottom: 0; }
.ep-home-seo__text h3 { margin: 1.5em 0 .5em; font-size: 19px; }
.ep-home-seo__text p { margin: 0 0 1em; }
.ep-home-seo__text ul { margin: 0 0 1em; padding-left: 1.3em; }
.ep-home-seo__text li + li { margin-top: .35em; }
.ep-home-seo__text li::marker { color: var(--ep-muted); }
.ep-home-seo__text a {
  color: var(--ep-ink); text-decoration: underline; text-decoration-color: var(--ep-tg);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s var(--ep-ease);
}
.ep-home-seo__text a:hover { color: var(--ep-tg-hover); }
