/* ===== Переменные ===== */
:root {
  --color-primary: #1a3a5c;
  --color-secondary: #2d5016;
  --color-accent: #e67e22;
  --color-bg: #f5f0e1;
  --color-text: #2c2c2c;
  --color-white: #ffffff;
  --color-border: #e0d9c5;
  --shadow-sm: 0 2px 6px rgba(26, 58, 92, 0.08);
  --shadow-md: 0 6px 18px rgba(26, 58, 92, 0.14);
  --shadow-lg: 0 14px 32px rgba(26, 58, 92, 0.2);
  --radius: 8px;
  --transition: 0.3s ease;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);        /* сильный ease-out для UI */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* для перемещения на экране */
  --duration-fast: 160ms;                             /* hover / цвет / пресс */
  --duration-base: 200ms;                             /* подъём, тень, раскрытие */
}

/* ===== Сброс стилей ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Атрибут hidden должен работать даже у элементов с display:flex/grid */
[hidden] {
  display: none !important;
}

input,
textarea,
select {
  font: inherit;
}

/* ===== Утилиты ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 70px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-title--left {
  text-align: left;
}

.section-title--left::after {
  left: 0;
  transform: none;
}

/* ===== Кнопки ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  border: 2px solid var(--color-accent);
  transition: background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  background-color: #c96a12;
  border-color: #c96a12;
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #b25a0f;
  border-color: #b25a0f;
}

.btn:active {
  transform: translateY(0);
}

.btn--outline {
  background-color: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background-color: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-primary);
}

.btn--lg {
  padding: 16px 34px;
  font-size: 1.1rem;
}

.btn--block {
  display: block;
  width: 100%;
}

/* ===== Шапка ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.logo {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.logo:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

.logo span {
  color: var(--color-accent);
}

.logo--footer {
  color: var(--color-white);
  display: inline-block;
  margin-bottom: 12px;
}

/* Меню */
.nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.nav__link {
  display: inline-block;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--duration-base) var(--ease-out);
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link--active,
.nav__link.is-active {
  color: var(--color-primary);
}

.nav__link:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

.nav__link:hover::after,
.nav__link--active::after,
.nav__link.is-active::after {
  width: 100%;
}

.header__contacts {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__phones {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  line-height: 1.2;
}

.header__phones .header__phone {
  font-size: 0.95rem;
}

.header__phone {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.header__phone:hover,
.header__phone:focus-visible {
  color: var(--color-accent);
}

.header__phone:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Иконки контактов (только на мобильных) */
.header__contacts-mobile {
  display: none;
  gap: 12px;
  align-items: center;
  margin-left: auto;
  margin-right: 16px;
}

.header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f0e1;
  color: #1a3a5c;
  transition: all 0.2s ease;
}

.header__icon:hover {
  background: #e67e22;
  color: #ffffff;
  transform: scale(1.05);
}

.header__icon--whatsapp {
  color: #25d366;
}

.header__icon--telegram {
  color: #0088cc;
}

/* Бургер */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
}

.burger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-base) var(--ease-out);
}

.burger:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

.burger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.is-active span:nth-child(2) {
  opacity: 0;
}

.burger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  margin-top: 72px; /* высота шапки */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 58, 92, 0.72) 0%,
    rgba(26, 58, 92, 0.58) 100%
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero__content {
  max-width: 820px;
  margin: 0 auto;
  padding: 60px 0;
}

.hero__title {
  font-size: 3rem;
  color: var(--color-white);
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hero__subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 34px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* ===== Преимущества ===== */
.features {
  padding: 80px 0;
}

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

.feature {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--color-accent);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.feature:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.feature__icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 14px;
}

.feature__title {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature__text {
  font-size: 0.95rem;
  color: #555;
}

/* ===== Популярные товары ===== */
.popular {
  padding: 80px 0;
  background-color: #efe9d7;
}

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

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-card__image {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4/3;
  height: auto;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.product-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.product-card__title {
  font-size: 1.05rem;
}

.product-card__price {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-top: auto;
}

/* ===== О производстве ===== */
.about {
  padding: 80px 0;
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about__image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.about__content p {
  margin-bottom: 16px;
  color: #444;
}

.about__content .btn {
  margin-top: 10px;
}

/* ===== Шаги заказа ===== */
.steps {
  padding: 80px 0;
  background-color: #efe9d7;
}

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

.step {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.step__number {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-white);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 50%;
}

.step__title {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.step__text {
  font-size: 0.95rem;
  color: #555;
}

/* ===== Отзывы ===== */
.reviews {
  padding: 80px 0;
}

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

.review {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-secondary);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.review:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.review__author {
  font-family: Georgia, serif;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.review__stars {
  color: var(--color-accent);
  letter-spacing: 3px;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.review__text {
  font-size: 0.95rem;
  color: #555;
}

/* ===== Подвал ===== */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding-top: 56px;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
}

.footer__heading {
  font-size: 1.1rem;
  color: var(--color-white);
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.footer__heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
}

.footer__text {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
}

.footer__links li,
.footer__contacts li {
  margin-bottom: 10px;
}

.footer__links a,
.footer__contacts a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  transition: color var(--duration-fast) ease,
              padding-left var(--duration-fast) ease;
}

.footer__links a:hover,
.footer__links a:focus-visible,
.footer__contacts a:hover,
.footer__contacts a:focus-visible {
  color: var(--color-accent);
  padding-left: 4px;
}

.footer__links a:focus-visible,
.footer__contacts a:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 18px 0;
}

.footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer__bottom-inner a {
  color: rgba(255, 255, 255, 0.7);
}

.footer__bottom-inner a:hover,
.footer__bottom-inner a:focus-visible {
  color: var(--color-accent);
}

.footer__bottom-inner a:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Адаптивность ===== */

/* Планшет и меньше */
@media (max-width: 1024px) {
  .nav__list {
    gap: 4px 12px;
  }

  .nav__link {
    font-size: 0.88rem;
  }

  .header__contacts .btn {
    display: none;
  }

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

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

  .about__inner {
    gap: 32px;
  }

  .hero__title {
    font-size: 2.4rem;
  }

  .hero__subtitle {
    font-size: 1.05rem;
  }

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

/* Мобильные */
@media (max-width: 768px) {
  .burger {
    display: flex;
  }

  /* Выпадающее меню */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                visibility 0s linear var(--duration-base);
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                visibility 0s;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 20px;
  }

  .nav__link {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__link::after {
    display: none;
  }

  .header__contacts {
    display: none;
  }

  .header__contacts-mobile {
    display: flex;
  }

  .header__phone {
    display: none;
  }

  .hero {
    min-height: 70vh;
  }

  .hero__title {
    font-size: 1.9rem;
  }

  .hero__subtitle {
    font-size: 1rem;
    margin-bottom: 26px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn--lg {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.55rem;
    margin-bottom: 30px;
  }

  .features,
  .popular,
  .about,
  .steps,
  .reviews {
    padding: 56px 0;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .about__inner {
    grid-template-columns: 1fr;
  }

  .about__image {
    order: -1;
  }

  .steps__grid {
    grid-template-columns: 1fr;
  }

  .reviews__grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer__bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== Уважение к prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Убираем смещения и подъёмы, оставляем цвет/прозрачность */
  .btn:hover,
  .btn:active,
  .feature:hover,
  .product-card:hover,
  .step:hover,
  .review:hover {
    transform: none;
  }

  /* План 003 добавляет сдвиг меню — здесь он нейтрализуется */
  .nav {
    transform: none;
  }

  /* Сдвиг ссылок подвала убираем, цветовую подсветку оставляем */
  .footer__links a,
  .footer__contacts a {
    transition: color var(--duration-fast) ease;
  }

  .footer__links a:hover,
  .footer__contacts a:hover {
    padding-left: 0;
  }

  /* Подчёркивание навигации показываем без роста (мгновенно) */
  .nav__link::after {
    transition: none;
  }
}
