/* ============================================================
   Анастасия Русакова — эфирные масла doTERRA
   Единый файл стилей. Подход mobile-first:
   базовые правила описаны для смартфона, ниже — медиазапросы.
   ============================================================ */

/* ------------------------------------------------------------
   1. ПЕРЕМЕННЫЕ
   Меняя значения в :root, вы меняете палитру всего сайта.
   ------------------------------------------------------------ */
:root {
  /* Природная палитра */
  --color-forest:      #24382B;  /* хвойный тёмно-зелёный — основной */
  --color-forest-dark: #1A291F;  /* затемнение для наведения */
  --color-olive:       #4A6B4F;  /* оливковый — вторичный зелёный */
  --color-wood:        #8A6A4B;  /* древесный коричневый — линии, подписи */
  --color-wood-dark:   #5A432E;  /* тёмное дерево */
  --color-paper:       #EFEDE4;  /* льняной фон страницы */
  --color-paper-warm:  #E4E1D4;  /* затенённая подложка секций */
  --color-surface:     #F8F7F2;  /* поверхность карточек */
  --color-ink:         #2B2B28;  /* основной текст, тёмно-серый */
  --color-muted:       #6E6E63;  /* второстепенный текст */
  --color-line:        #D5D1C2;  /* границы и разделители */

  /* Типографика */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Масштаб размеров */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* Отступы и геометрия */
  --space-section: 3.5rem;
  --container: 1180px;
  --radius: 4px;         /* строгий, почти прямой угол */
  --border: 1px solid var(--color-line);
  --header-height: 66px;
}

/* ------------------------------------------------------------
   2. БАЗОВЫЙ СБРОС И ТИПОГРАФИКА
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* компенсируем высоту прилипшей шапки при переходе по якорю */
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.65;
}

/* Блокировка прокрутки при открытом мобильном меню */
body.is-locked { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-forest);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-forest); text-decoration-color: var(--color-wood); }
a:hover { color: var(--color-wood-dark); }

img, svg { max-width: 100%; }

/* Видимый фокус для клавиатурной навигации */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-wood);
  outline-offset: 3px;
}

/* Скрытый SVG-спрайт */
.sprite { display: none; }

/* Ссылка «пропустить меню» для скринридеров */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-forest);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ------------------------------------------------------------
   3. СЕТКА И СЕКЦИИ
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: var(--space-section) 0; }
.section--tinted {
  background-color: var(--color-paper-warm);
  border-top: var(--border);
  border-bottom: var(--border);
}

.section__head {
  max-width: 62ch;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-forest);
}
.section__title {
  font-size: var(--text-2xl);
  margin-bottom: 0.35em;
}
.section__note {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin: 0;
}

/* ------------------------------------------------------------
   4. КНОПКИ
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn--primary {
  background-color: var(--color-forest);
  color: #fff;
  border-color: var(--color-forest);
}
.btn--primary:hover {
  background-color: var(--color-forest-dark);
  border-color: var(--color-forest-dark);
  color: #fff;
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-forest);
  border-color: var(--color-line);
}
.btn--ghost:hover {
  border-color: var(--color-forest);
  background-color: rgba(36, 56, 43, .05);
}

.btn--light {
  background-color: var(--color-paper);
  color: var(--color-forest);
  border-color: var(--color-paper);
}
.btn--light:hover { background-color: #fff; color: var(--color-forest-dark); }

.btn--outline-light {
  background-color: transparent;
  color: var(--color-paper);
  border-color: rgba(239, 237, 228, .45);
}
.btn--outline-light:hover {
  border-color: var(--color-paper);
  color: #fff;
}

.btn--small { padding: 10px 16px; font-size: var(--text-sm); }
.btn--large { padding: 16px 32px; font-size: var(--text-lg); width: 100%; }

/* ------------------------------------------------------------
   5. ШАПКА И МОБИЛЬНОЕ МЕНЮ
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.logo {
  display: block;
  text-decoration: none;
  line-height: 1.15;
}
.logo__name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-forest);
}
.logo__role {
  display: block;
  font-size: 0.72rem;
  color: var(--color-wood);
  letter-spacing: 0.04em;
}

/* Бургер */
.burger {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  cursor: pointer;
}
.burger__line {
  display: block;
  height: 2px;
  background-color: var(--color-forest);
  transition: transform .2s ease, opacity .2s ease;
}
/* Крестик при открытом меню */
.burger.is-active .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active .burger__line:nth-child(2) { opacity: 0; }
.burger.is-active .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Мобильная навигация — выпадающая панель */
.nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
  padding: 8px 20px 24px;
  box-shadow: 0 12px 24px rgba(36, 56, 43, .08);
}
.nav.is-open { display: block; }

.nav__list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.nav__link {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: var(--text-lg);
  text-decoration: none;
  color: var(--color-ink);
}
.nav__link:hover { color: var(--color-forest); }

.nav__contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone {
  font-weight: 600;
  font-size: var(--text-lg);
  text-decoration: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   6. HERO
   ------------------------------------------------------------ */
.hero {
  padding: 2.5rem 0 3rem;
  border-bottom: 1px solid var(--color-line);
}
.hero__title {
  font-size: var(--text-3xl);
  max-width: 18ch;
}
.hero__lead {
  max-width: 56ch;
  color: var(--color-muted);
  font-size: var(--text-lg);
}
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 1.75rem 0;
}

/* Короткие факты под кнопками */
.facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--color-line);
}
.facts__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}
.facts__term {
  font-size: var(--text-sm);
  color: var(--color-wood);
  margin-bottom: 2px;
}
.facts__desc {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}

.hero__figure {
  margin: 2.5rem 0 0;
  padding: 2rem 1rem 1.25rem;
  background-color: var(--color-forest);
  border-radius: var(--radius);
  text-align: center;
}
.hero__figure .bottle { height: 240px; }
.hero__caption {
  margin-top: 1rem;
  color: rgba(239, 237, 228, .75);
  font-size: var(--text-sm);
}

/* Флакон: цвет стекла задаётся через color */
.bottle { display: block; margin: 0 auto; height: 180px; width: auto; }
.bottle--frankincense { color: #7A5C3A; }  /* янтарное стекло — ладан */
.bottle--mint         { color: #3F6B57; }  /* зелёное — мята */
.bottle--lavender     { color: #6B6480; }  /* лавандово-серое */
.bottle--lemon        { color: #9C8330; }  /* оливково-золотое — лимон */

/* ------------------------------------------------------------
   7. КАРТОЧКИ ТОВАРОВ
   ------------------------------------------------------------ */
.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card__visual {
  padding: 24px 0 18px;
  background-color: var(--color-paper-warm);
  border-bottom: 1px solid var(--color-line);
}
.card__visual .bottle { height: 150px; }

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
}
.card__title {
  font-size: var(--text-xl);
  margin-bottom: 0.4em;
}
.card__desc {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: 1.1em;
}
.card__price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  margin: auto 0 1rem;   /* прижимает цену к низу карточки */
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-line);
}
.card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ------------------------------------------------------------
   8. БЛОК О КАЧЕСТВЕ
   ------------------------------------------------------------ */
.quality__text { max-width: 62ch; }
.quality__text p { color: var(--color-muted); }

.quality__list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.quality__item {
  padding: 18px 0;
  border-top: 2px solid var(--color-wood);
}
.quality__term {
  font-size: var(--text-lg);
  margin-bottom: 0.3em;
}
.quality__item p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ------------------------------------------------------------
   9. ШАГИ ЗАКАЗА (нумерация уместна — это последовательность)
   ------------------------------------------------------------ */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}
.steps__item {
  counter-increment: step;
  padding-left: 52px;
  position: relative;
}
.steps__item::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-wood);
  border-radius: 50%;
  font-family: var(--font-display);
  color: var(--color-wood-dark);
}
.steps__title {
  font-size: var(--text-lg);
  margin-bottom: 0.25em;
}
.steps__item p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ------------------------------------------------------------
   10. ПОЛОСА ПРИЗЫВА К ДЕЙСТВИЮ
   ------------------------------------------------------------ */
.cta {
  background-color: var(--color-forest);
  color: var(--color-paper);
  padding: 2.75rem 0;
}
.cta__title {
  color: #fff;
  font-size: var(--text-2xl);
  margin-bottom: 0.3em;
}
.cta__text {
  color: rgba(239, 237, 228, .75);
  margin: 0;
}
.cta__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------
   11. ФУТЕР
   ------------------------------------------------------------ */
.site-footer {
  background-color: var(--color-paper-warm);
  border-top: 1px solid var(--color-line);
  padding: 2.5rem 0 1.5rem;
}
.footer-inner {
  display: grid;
  gap: 24px;
  padding-bottom: 24px;
}
.footer__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-forest);
  margin: 0;
}
.footer__muted {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin: 0;
}
.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: var(--text-sm);
}
.footer__contact {
  display: block;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 6px;
}
.footer-bottom {
  border-top: 1px solid var(--color-line);
  padding-top: 18px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.footer-bottom p { margin: 0 0 8px; }

/* ------------------------------------------------------------
   12. СТРАНИЦА ТОВАРА
   ------------------------------------------------------------ */
.breadcrumbs {
  border-bottom: 1px solid var(--color-line);
  padding: 12px 0;
  font-size: var(--text-sm);
}
.breadcrumbs__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--color-muted);
}
.breadcrumbs__list li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--color-line);
}

.product { padding: 2rem 0 3rem; }

.product__figure {
  margin: 0 0 1.75rem;
  padding: 2rem 1rem 1.25rem;
  background-color: var(--color-paper-warm);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  text-align: center;
}
.product__figure .bottle { height: 230px; }
.product__figcaption {
  margin-top: 1rem;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.product__title { font-size: var(--text-3xl); margin-bottom: 0.2em; }
.product__latin {
  color: var(--color-wood);
  font-style: italic;
  margin-bottom: 1.25em;
}
.product__lead { max-width: 60ch; color: var(--color-muted); }

.price-box {
  display: grid;
  gap: 10px;
  margin: 1.75rem 0;
  padding: 18px 20px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-forest);
  border-radius: var(--radius);
}
.price-box__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-forest);
  margin: 0;
}
.price-box__unit,
.price-box__stock {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.price-box__stock { color: var(--color-olive); font-weight: 600; }

.product__hint {
  margin-top: 12px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Адаптивный контейнер видео 16:9.
   Работает и с заглушкой, и с реальным <iframe> / <video>. */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-forest);
  border-radius: var(--radius);
  overflow: hidden;
}
/* Запасной вариант для браузеров без aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-frame { height: 0; padding-bottom: 56.25%; }
}
.video-frame iframe,
.video-frame video,
.video-frame__placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-frame__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: rgba(239, 237, 228, .85);
}
.video-frame__icon { color: rgba(239, 237, 228, .5); }
.video-frame__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: #fff;
  margin: 8px 0 0;
}
.video-frame__note { font-size: var(--text-sm); margin: 0; }

/* Характеристики и состав */
.specs { display: grid; gap: 2.5rem; }
.specs__title {
  font-size: var(--text-xl);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-forest);
}
.specs__intro { color: var(--color-muted); font-size: var(--text-sm); }

.spec-list { margin: 0; }
.spec-list__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-line);
}
.spec-list__row dt {
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.spec-list__row dd {
  margin: 0;
  font-weight: 600;
}

/* Строгий список с древесным маркером */
.marked-list {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}
.marked-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  border-bottom: 1px solid var(--color-line);
}
.marked-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 8px;
  height: 2px;
  background-color: var(--color-wood);
}

.usage { display: grid; gap: 2rem; }
.usage__title {
  font-size: var(--text-lg);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-wood);
}

/* ------------------------------------------------------------
   13. ПЛАНШЕТ — от 700px
   ------------------------------------------------------------ */
@media (min-width: 700px) {
  :root { --space-section: 4.5rem; }

  .hero__actions { flex-direction: row; }
  .btn--large { width: auto; }

  .facts { grid-template-columns: repeat(3, 1fr); gap: 0 24px; }

  .products { grid-template-columns: repeat(2, 1fr); }

  .quality__list { grid-template-columns: repeat(3, 1fr); gap: 0 24px; }

  .steps { grid-template-columns: repeat(2, 1fr); gap: 28px 32px; }

  .cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
  .cta__actions { flex-direction: row; margin-top: 0; }

  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }

  .price-box {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 24px;
  }
  .price-box__stock { text-align: right; }

  .spec-list__row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .spec-list__row dd { text-align: right; }

  .usage { grid-template-columns: repeat(3, 1fr); gap: 32px; }

  .specs { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* ------------------------------------------------------------
   14. ДЕСКТОП — от 1000px
   ------------------------------------------------------------ */
@media (min-width: 1000px) {
  :root { --text-3xl: 3rem; --text-2xl: 2rem; }

  /* Навигация всегда видна, бургер скрыт */
  .burger { display: none; }
  .nav,
  .nav.is-open {
    display: flex;
    align-items: center;
    gap: 32px;
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }
  .nav__list {
    display: flex;
    gap: 26px;
    margin: 0;
  }
  .nav__link {
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    font-size: var(--text-base);
  }
  .nav__link:hover { border-bottom-color: var(--color-wood); }
  .nav__contacts { flex-direction: row; align-items: center; gap: 16px; }

  /* Асимметричный hero: текст шире визуала */
  .hero { padding: 4rem 0 4.5rem; }
  .hero__inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 56px;
    align-items: center;
  }
  .hero__figure { margin: 0; padding: 3rem 2rem 1.5rem; }
  .hero__figure .bottle { height: 300px; }

  .products { grid-template-columns: repeat(4, 1fr); }

  .steps { grid-template-columns: repeat(4, 1fr); }

  .quality {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 56px;
    align-items: start;
  }
  .quality__list { grid-template-columns: 1fr; margin-top: 0; }

  /* Страница товара: изображение слева, покупка справа */
  .product__inner {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 56px;
    align-items: start;
  }
  .product__figure { margin: 0; padding: 3rem 2rem 1.5rem; }
  .product__figure .bottle { height: 300px; }
}

/* ------------------------------------------------------------
   15. ДОСТУПНОСТЬ: уважаем отключённую анимацию
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------
   16. ПЕЧАТЬ
   ------------------------------------------------------------ */
@media print {
  .site-header, .cta, .burger, .video-frame { display: none; }
  body { background: #fff; color: #000; }
}
