/* Сброс и базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Golos Text лежит на сервере (css/fonts), внешние шрифтовые сервисы не подключаются */
@font-face { font-family: 'Golos Text'; font-weight: 400; font-display: swap; src: url(fonts/golos-text-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 400; font-display: swap; src: url(fonts/golos-text-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-weight: 500; font-display: swap; src: url(fonts/golos-text-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 500; font-display: swap; src: url(fonts/golos-text-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-weight: 600; font-display: swap; src: url(fonts/golos-text-cyrillic-600.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 600; font-display: swap; src: url(fonts/golos-text-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Палитра: чёрное на белом, тёплый песочный акцент (ориентир — wohldesign.ru) */
:root {
  --primary: #0e1316;        /* основной цвет кнопок: контраст с белым 18:1 */
  --primary-dark: #3a3f42;
  --accent: #d9ae82;         /* песочный: линии, иконки и ссылки на тёмном */
  --accent-on-dark: #d9ae82;
  --focus: #1b6ec2;
  --dark: #0e1316;
  --light: #fff;
  --gray: #f4f2ef;           /* тёплый серый под фото и блоки */
  --text: #404040;
  --muted: #5f6468;          /* контраст с белым 6:1 */
  --line: #d9d6d2;
  --shadow: none;
}

body {
  font-family: 'Golos Text', 'Segoe UI', Arial, sans-serif;
  background-color: var(--light);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Иконки (SVG-спрайт в начале index.html, tools/build_icons.py): размер и цвет — от текста вокруг */
.icon {
  width: 1.25em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

h1, h2, h3 {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--dark);
}

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

.hero :focus-visible,
footer :focus-visible {
  outline-color: #fff;
}

/* Якоря не прячутся под липкой шапкой */
section[id] {
  scroll-margin-top: 80px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Шапка как на wohldesign.ru: слева ссылки, по центру логотип, справа телефон и значки; ниже строка разделов на всю ширину */
header {
  background-color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 0.9rem;
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-actions {
  justify-content: flex-end;
}

.logo {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--dark);
  text-decoration: none;
}

.hd-link {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.hd-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Строка разделов: пункты разнесены на всю ширину, как у образца */
.nav-row ul {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0.9rem 1.5rem 1rem;
}

.nav-row a {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
  white-space: nowrap;
}

.nav-row a:hover,
.nav-row a[aria-current="page"] {
  border-bottom-color: var(--dark);
}

.telegram-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.3s;
}

.telegram-btn:hover {
  opacity: 0.6;
}

/* В шапке Telegram — значок без подписи */
.header-actions .telegram-btn span {
  display: none;
}

.header-actions .telegram-btn .icon {
  width: 1.5rem;
  height: 1.2rem;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--dark);
  background: none;
  border: none;
  padding: 4px;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent);
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Бургер-меню */
.burger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  z-index: 1001;
}

.burger-menu span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--dark);
  transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

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

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Мобильное меню */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(14,19,22,0.5);
  z-index: 1100; /* выше шапки: панель закрывает её целиком */
  opacity: 0;
  visibility: hidden; /* закрытое меню не получает фокус и не читается скринридером */
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

.mobile-nav-inner {
  position: relative;
  background: #fff;
  width: 80%;
  max-width: 350px;
  height: 100%;
  padding: 2rem 1.5rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-nav.open .mobile-nav-inner {
  transform: translateX(0);
}

.mobile-nav-inner .logo {
  display: block;
  margin-bottom: 2rem;
}

.mobile-nav-inner ul {
  list-style: none;
}

.mobile-nav-inner ul li {
  margin-bottom: 1.5rem;
}

.mobile-nav-inner ul a {
  text-decoration: none;
  color: var(--dark);
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: opacity 0.3s;
}

.mobile-nav-inner ul a:hover {
  opacity: 0.6;
}

.mobile-nav-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  line-height: 1;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}

/* Первый экран: фото на всю ширину, огромный заголовок по центру (как название модели у образца) */
.hero {
  position: relative;
  min-height: calc(100vh - 110px);
  min-height: calc(100svh - 110px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(14,19,22,0.25) 0%, rgba(14,19,22,0.35) 60%, rgba(14,19,22,0.6) 100%);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  color: #fff;
}

.hero-content p {
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 2.25rem;
  color: rgba(255,255,255,0.95);
  line-height: 1.6;
}

/* Общая кнопка (корзина и др.); в герое переопределяется ниже */
.btn {
  background-color: var(--primary);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 0;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: inherit;
  transition: background-color 0.3s, color 0.3s;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  background-color: var(--primary-dark);
}

.btn:disabled {
  background-color: #8c8c8c;
  cursor: not-allowed;
}

.hero-content .btn {
  background-color: #fff;
  color: var(--dark);
  padding: 1.1rem 3rem;
}

.hero-content .btn:hover {
  background-color: var(--accent);
  color: var(--dark);
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 1rem 2.5rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.hero-features span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.8);
  color: #fff;
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-features .icon {
  color: var(--accent-on-dark);
  font-size: 1.1rem;
}

/* Каталог */
.section {
  padding: 7rem 0;
}

/* Каталог шире основного контейнера: крупные фото, как у образца */
#products .container {
  width: 100%;
  max-width: 1680px;
  padding: 0 1.5rem;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 4rem;
  color: var(--dark);
}

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

.product-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  background: #fff;
}

/* Карточки чередуются: нечётная — описание слева, фото справа; чётная — фото слева, описание справа */
.product-card:nth-child(odd) .product-img,
.product-card:nth-child(odd) .product-media {
  order: 2;
}

.product-img {
  flex-shrink: 0;
  aspect-ratio: 1 / 1; /* фото подготовлены квадратными (tools/build_images.py) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray);
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.product-card:hover .product-img img {
  transform: scale(1.04);
}

/* Видео товара: кнопка поверх фото; по нажатию вместо фото играет ролик (чёрные поля сверху и снизу — часть кадра) */
.product-img {
  position: relative;
}

.video-toggle {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.video-toggle:hover,
.video-toggle:focus-visible {
  background: #000;
}

.video-toggle .icon {
  width: 0.8em;
  height: 0.8em;
}

.product-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.product-video[hidden] {
  display: none;
}

.product-img.is-video img {
  display: none;
}

/* Галерея товара: фото со стрелками, под ним ряд миниатюр. На телефоне фото листается свайпом */
.product-media {
  min-width: 0;
}

.product-media .product-img {
  touch-action: pan-y; /* вертикальная прокрутка страницы остаётся, горизонтальный жест — наш (js/app.js) */
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0 0 0.2rem;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  background: #000;
}

.gallery-prev {
  left: 0.75rem;
}

.gallery-next {
  right: 0.75rem;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap; /* много цветов уходят во второй ряд */
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.gallery-thumb {
  flex: 0 0 4.6rem;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.6;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none;
}

.product-card:hover .gallery-thumb img {
  transform: none; /* увеличение фото при наведении не должно задевать миниатюры */
}

@media (max-width: 860px) {
  .gallery-thumbs {
    gap: 0.35rem;
  }

  .gallery-thumb {
    flex-basis: calc((100% - 4 * 0.35rem) / 5); /* пять в ряд на телефоне */
  }

  .gallery-arrow {
    width: 2.2rem;
    height: 2.2rem;
  }
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible,
.gallery-thumb[aria-pressed="true"] {
  opacity: 1;
  border-color: var(--dark);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

.product-info h3 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--dark);
}

.product-info p {
  color: var(--muted);
  margin-bottom: 1rem;
  min-height: 60px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Текст и характеристики занимают всё свободное место, цена и кнопка прижаты к низу карточки */
.product-body {
  flex: 1 1 auto;
}

/* Характеристики изделия (data/products.json, поле specs) */
.specs {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.specs div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line);
}

.specs dt {
  flex-shrink: 0;
  max-width: 45%;
  color: var(--muted);
}

.specs dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  color: var(--dark);
}

.price {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--dark);
  display: block;
}

.add-to-cart {
  width: 100%;
  padding: 0.95rem;
  background: transparent;
  border: 1px solid var(--dark);
  border-radius: 0;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dark);
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.add-to-cart:hover {
  background: var(--dark);
  color: #fff;
}

/* Модалка корзины */
.cart-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14,19,22,0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.cart-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 0;
  padding: 2rem;
  max-height: 80vh;
  overflow-y: auto;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--dark);
}

.cart-items {
  margin-bottom: 2rem;
}

.cart-close {
  width: 44px;
  height: 44px;
  line-height: 1;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--dark);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info h4 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.cart-item-info p {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--dark);
  border-radius: 0;
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
}

.qty-btn:disabled {
  color: #aaa;
  cursor: default;
}

.qty-value {
  min-width: 2ch;
  text-align: center;
  font-weight: 600;
}

.cart-item-sum {
  font-weight: 600;
}

.remove-item {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cart-total {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: right;
  margin: 1.5rem 0;
  color: var(--dark);
}

.empty-cart {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

/* Форма заказа */
.order-form {
  background: white;
  padding: 2.5rem;
  border: 1px solid var(--dark);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label,
.form-group .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--dark);
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--dark);
  box-shadow: 0 0 0 1px var(--dark);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

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

.submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1.1rem;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
  margin-top: 1rem;
}

.submit-btn:hover {
  background: var(--primary-dark);
}

.success-message {
  text-align: center;
  padding: 2rem;
  color: #187a40;
  font-size: 1.2rem;
  display: none;
}

/* Уведомление «товар добавлен». На компьютере — снизу слева от кнопок мессенджеров, на телефоне — сверху под шапкой,
   чтобы не перекрывать кнопки мессенджеров */
.notification {
  position: fixed;
  bottom: 20px;
  right: 90px;
  max-width: calc(100vw - 110px);
  background: var(--dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0;
  border-left: 4px solid var(--accent);
  z-index: 9999;
  animation: notification-in 0.3s, notification-out 0.5s 2.5s forwards;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification .icon {
  font-size: 1.2rem;
}

@keyframes notification-in {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes notification-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 768px) {
  .notification {
    top: 80px;
    bottom: auto;
    left: 16px;
    right: 16px;
    max-width: none;
    justify-content: center;
    animation: notification-in-top 0.3s, notification-out 0.5s 2.5s forwards;
  }
}

@keyframes notification-in-top {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.success-again {
  display: block;
  margin: 1.25rem auto 0;
  background: none;
  border: none;
  color: var(--dark);
  font-family: inherit;
  font-size: 1rem;
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e74c3c;
  border-radius: 0;
  background: #fdecea;
  color: #922b21;
  font-size: 0.95rem;
}

.form-error a {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
}

/* Скрытое поле-ловушка для ботов (display:none боты обходят, поэтому уводим за экран) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Согласие на обработку данных */
.consent {
  margin-top: 0.5rem;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
}

.consent-label input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.order-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

.order-note a,
.consent-label a {
  color: var(--primary);
}

/* Юридические страницы (оферта, политика, согласие) */
.legal {
  max-width: 820px;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.legal h1 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.legal h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--dark);
}

.legal p,
.legal li {
  margin-bottom: 0.75rem;
}

.legal ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal a {
  color: var(--primary);
}

.legal-date {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-back {
  color: var(--dark);
  font-weight: 500;
  text-decoration: none;
}

.legal-back:hover {
  text-decoration: underline;
}

/* Страницы «Услуги» и «Контакты» (pages/*.html, tools/build_pages.py) */
.page {
  max-width: 960px;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.page h1 {
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

@media (max-width: 480px) {
  .page h1 {
    font-size: 1.6rem;
  }
}

.page .lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.page-subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  color: var(--dark);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.info-card {
  background: #fff;
  border-top: 1px solid var(--dark);
  padding: 1.5rem 0 0.5rem;
}

.info-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.info-card p {
  margin-bottom: 0.6rem;
}

.info-card a,
.steps a,
.visit a {
  color: var(--dark);
  text-underline-offset: 3px;
}

.steps {
  padding-left: 1.5rem;
}

.steps li {
  margin-bottom: 0.6rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-outline {
  background-color: transparent;
  color: var(--dark);
  border: 1px solid var(--dark);
}

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

.page-photo {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.5rem 0 0;
}

.photo-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 2.5rem;
}

.photo-trio .page-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

@media (max-width: 700px) {
  .photo-trio {
    grid-template-columns: 1fr;
  }
}

.page-photo-square {
  max-width: 520px;
}

.page-figure {
  margin: 0;
}

.page-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.visit .order-form {
  margin: 1.25rem 0 0;
}

.visit .success-message {
  background: #fff;
  border: 1px solid var(--dark);
}

/* Страница «О компании» */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--gray);
  padding: 1.5rem 1rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--dark);
}

.stat span {
  color: var(--muted);
  font-size: 0.95rem;
}

.about-block p {
  margin-bottom: 0.75rem;
}

.owner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.owner-photo {
  width: 160px;
  height: 200px;
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
}

.owner-name {
  font-size: 1.15rem;
  margin: 0;
}

/* Футер */
footer {
  background-color: var(--dark);
  color: #e8e6e3;
  text-align: center;
  padding: 3.5rem 0;
  margin-top: 0;
}

footer p {
  margin: 0.5rem 0;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  font-size: 0.85rem;
  opacity: 0.9;
}

.telegram-footer {
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  justify-content: center;
}

.contact-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 1.5rem auto 0;
  display: block;
}

/* Плавающие иконки WhatsApp и Telegram */
.messenger-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 900; /* ниже корзины (2000) и мобильного меню (1100) */
}

/* Кнопки мессенджеров: скруглённые плитки в фирменных цветах, крупный белый знак, подпись при наведении */
.messenger-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.messenger-btn .icon {
  width: 30px;
  height: 30px;
  vertical-align: 0;
}

.messenger-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.messenger-tg { background: linear-gradient(160deg, #37aee2, #1e96c8); }
.messenger-wa { background: linear-gradient(160deg, #3be07b, #1ca950); }
.messenger-max { background: linear-gradient(135deg, #00bfff 0%, #471aff 55%, #9500ff 100%); } /* цвета из брендбука MAX */

.messenger-logo {
  width: 32px;
  height: 32px;
}

.messenger-wordmark {
  font: 800 15px/1 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.03em;
}

@media (min-width: 769px) {
  .messenger-btn::after {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 0;
    background: rgba(14, 19, 22, 0.92);
    color: #fff;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .messenger-btn:hover::after,
  .messenger-btn:focus-visible::after {
    opacity: 1;
  }
}

@media (min-width: 769px) {
  .messenger-float {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  }
  .messenger-float.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* На узком экране главной разделы уходят в боковое меню (бургер); на внутренних страницах строка разделов прокручивается */
@media (max-width: 960px) {
  .burger-menu {
    display: flex;
  }

  .header-left:has(.burger-menu) .hd-link,
  .hd-phone {
    display: none;
  }

  .header-top {
    padding: 0.8rem 1rem;
  }

  .logo {
    font-size: 1.4rem;
  }

  .nav-row:not(.nav-row-always) {
    display: none;
  }

  .nav-row-always {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-row-always ul {
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 0.5rem 1rem 0.8rem;
  }

}



@media (max-width: 768px) {
  .messenger-float {
    right: 14px;
    bottom: 14px;
  }
  .messenger-btn {
    width: 58px;
    height: 58px;
  }

  .messenger-btn .icon {
    width: 32px;
    height: 32px;
  }
  
  
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
    .cart-content {
    width: 95%;
    padding: 1.5rem;
  }
  
    .product-info p {
    min-height: 40px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
    .header-actions,
  .header-left {
    gap: 0.9rem;
  }

  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin-top: 2.5rem;
  }
}

/* Главная: в index.html блоки «Оформить заказ» и «Контакты» стилизованы inline — приводим к общему стилю */
#order {
  background-color: var(--gray) !important;
}

#contact .container > div {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid var(--dark);
}

#cart-items {
  border-radius: 0 !important;
  background: #fff !important;
}

@media (max-width: 768px) {
  .section-title {
    margin-bottom: 2.5rem;
  }

  .logo {
    letter-spacing: 0.1em;
  }
}

@media (max-width: 860px) {
  .product-grid {
    gap: 4rem;
  }

  .product-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-card:nth-child(odd) .product-img,
  .product-card:nth-child(odd) .product-media {
    order: 0;
  }

  .section {
    padding: 4rem 0;
  }

  #products .container {
    padding: 0 1rem;
  }

  .hero {
    min-height: calc(100svh - 60px);
  }
}
