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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: #121212;
}

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

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

a {
  text-decoration: none;
  color: #c41e3a;
}

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

/* Хедер */
.header {
  background-color: #1e1e1e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #333;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #c41e3a;
}

.wordmark {
  font-family: 'Cormorant', Georgia, 'Times New Roman', serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  transform: scaleX(0.9);
  transform-origin: left center;
}

/* В шапке (десктоп, тёмная тема) текст бренда — белый, а не унаследованный
   красный от .logo. Точки между словами (.wordmark-dot) остаются красными —
   это фирменный акцент, а не основной текст. */
.logo .wordmark {
  color: #fff;
}

.wordmark-dot {
  display: inline-block;
  width: 0.28em;
  height: 0.28em;
  margin: 0 0.14em;
  border-radius: 50%;
  background: #c41e3a;
  /* vertical-align: middle центрирует точку по x-height, а текст —
     КАПИТЕЛЬ (text-transform: uppercase у .wordmark), у которой заглавные
     заметно выше x-height, из-за чего точка съезжала вниз относительно
     букв. Фиксированное смещение поднимает её к оптическому центру
     заглавных (см. static/styles.css). Значение 0.18em измерено
     напрямую на живой странице — 0.08em было мало. */
  vertical-align: 0.18em;
}

.logo-img {
  height: 40px;
  filter: brightness(1.1);
}

.nav {
  display: flex;
  align-items: center;
}

.nav a {
  margin-left: 20px;
  color: #ccc;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
  color: #fff;
}

/* Красная линия под меню */
.nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #c41e3a;
  border-radius: 3px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  display: block;
  z-index: -1;
}

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.auth-button,
.cart-button {
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid #444;
}

.auth-button {
  background-color: #2a2a2a;
  color: #ccc;
}

.auth-button:hover {
  background-color: #333;
  color: #fff;
  border-color: #555;
}

.cart-button {
  background-color: #c41e3a;
  color: white;
  border-color: #a0182e;
}

.cart-button:hover {
  background-color: #a0182e;
  border-color: #8a1428;
}

/* Секции */
.section {
  padding: 60px 0;
}

.home h1 {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 15px;
}

.home p {
  font-size: 1.2rem;
  color: #bbb;
  margin-bottom: 30px;
}

/* Заголовки секций — КРАСНЫЕ */
.shop h2,
.delivery h2,
.cooperation h2,
.gallery h2,
.constructor h2 {
  text-align: center;
  color: #c41e3a;
  margin-bottom: 30px;
  font-size: 2rem;
}

.shop-intro {
  text-align: center;
  color: #aaa;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

/* Категории */
.categories {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.category {
  padding: 10px 20px;
  background-color: #2a2a2a;
  color: #c41e3a;
  border: 1px solid #444;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s;
}

.category:hover,
.category.active {
  background-color: #c41e3a;
  color: white;
  border-color: #c41e3a;
}

/* Карточки товаров */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  border: 1px solid #333;
  /* см. styles.css — flex-column, чтобы кнопка/уведомление внизу всегда
     сидели на одном уровне у всех карточек ряда сетки. */
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.product-images {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.product-images img {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.alt-image {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s;
  object-fit: cover;
}

.product-card:hover .alt-image {
  display: block;
  opacity: 1;
}

.product-card h3 {
  padding: 15px 15px 5px;
  font-size: 1.2rem;
  color: #fff;
}

/* Настоящая ссылка на постоянный адрес товара — см. styles.css (структурное
   правило то же самое, здесь только на случай, если файл когда-то станет
   независимым: styles.css/styles-dark.css переключаются подменой href
   одного <link>, а не накладываются друг на друга). */
.product-name-link {
  color: inherit;
  text-decoration: none;
}

.product-desc-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 15px;
  margin-bottom: 10px;
}

.product-card .product-desc {
  font-size: 0.9rem;
  color: #aaa;
  line-height: 1.4;
  white-space: pre-line;
  padding: 0;
  margin: 0;
  /* см. styles.css — то же обрезание до 4 строк, та же логика, что и в
     мобильной версии. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-desc.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.product-desc-toggle {
  align-self: flex-start;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #c41e3a;
  cursor: pointer;
}

.product-desc-toggle:hover {
  text-decoration: underline;
}

.product-card p {
  font-size: 0.95rem;
  color: #ccc;
  padding: 0 15px;
  margin-bottom: 5px;
}

.price span {
  font-weight: bold;
  color: #c41e3a;
}

.price.bulk span {
  color: #ff6b6b;
  font-size: 0.9rem;
}

.availability-out-of-stock {
  color: #f44336;
  font-weight: bold;
}

.availability-in-stock {
  color: #4caf50;
  font-weight: bold;
}

.availability-coming-soon {
  color: #ff9800;
  font-weight: bold;
}

.availability-reserved {
  color: #b0b0b0;
  font-weight: bold;
}

.soon-badge {
  background-color: #ff9800;
  color: #000;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 8px;
}

.add-to-cart {
  display: block;
  width: calc(100% - 30px);
  margin: 15px auto;
  padding: 10px;
  background-color: #c41e3a;
  color: white;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  border: 1px solid #a0182e;
}

.add-to-cart:hover {
  background-color: #a0182e;
}

/* Кнопка "Хочу такой" — для карточек в статусах "Забронировано"/"Продано"
   (см. templates/index.html), где раньше отображалось только пустое
   .availability-notice. Открывает форму заявки (static/js/product-
   interest.js) — сообщение уходит в ту же воронку и с теми же
   уведомлениями менеджеру, что и обычный заказ (см. orders/serializers.py:
   ProductInterestSerializer). Цвет — тот же акцент, что у .add-to-cart. */
.want-similar-btn {
  display: block;
  width: calc(100% - 30px);
  margin: 15px auto;
  padding: 10px;
  background-color: #c41e3a;
  color: white;
  border: none;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #a0182e;
}

.want-similar-btn:hover {
  background-color: #a0182e;
}

.product-card .add-to-cart,
.product-card .want-similar-btn,
.product-card .availability-notice {
  margin-top: auto;
}

/* Модальное окно заявки "Хочу такой" — тёмный вариант, см. styles.css для
   структуры/комментариев (значения захардкожены отдельно, как и остальные
   стили каталога в этом файле). */
.rhf-interest-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rhf-interest-overlay[hidden] { display: none; }

.rhf-interest-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
  background: #1e1e1e;
  color: #e0e0e0;
  border-radius: 16px;
  padding: 24px 20px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
}

.rhf-interest-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.rhf-interest-title {
  margin: 0 0 8px;
  padding-right: 28px;
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  color: #e0e0e0;
}

.rhf-interest-product {
  margin: 0 0 12px;
  font-size: 13px;
  color: #aaa;
}
.rhf-interest-product[hidden] { display: none; }

.rhf-interest-note {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(196, 30, 58, 0.12);
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
}

.rhf-interest-field { margin-bottom: 14px; }
.rhf-interest-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #e0e0e0;
}
.rhf-interest-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 15px;
  background: #2a2a2a;
  color: #e0e0e0;
  box-sizing: border-box;
}

.rhf-interest-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 400;
  color: #ccc;
  cursor: pointer;
}
.rhf-interest-consent input { margin-top: 2px; flex-shrink: 0; }
.rhf-interest-consent a { color: #e35a71; }

.rhf-interest-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.rhf-interest-submit {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  background: #c41e3a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.rhf-interest-submit:hover { background: #a0182e; }
.rhf-interest-submit:disabled { opacity: 0.6; cursor: default; }

.rhf-interest-status {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
}
.rhf-interest-status.success { color: #6fbf73; }
.rhf-interest-status.error { color: #f44336; }

/* Доставка и сотрудничество */
.delivery-content,
.cooperation-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  justify-content: space-between;
}

.delivery-image,
.cooperation-image {
  flex: 1;
  min-width: 300px;
}

.delivery-text,
.cooperation-text {
  flex: 1;
  min-width: 300px;
}

.delivery-text h3,
.cooperation-text h3 {
  color: #c41e3a;
  margin: 20px 0 10px;
  font-size: 1.3rem;
}

.delivery-text p,
.cooperation-text p {
  color: #ccc;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Конструктор букета — промо-блок на главной, между "Магазин" и "Оплата
   и доставка" (см. settings.is_constructor в rhf/views.py: index()).
   Та же двухколоночная раскладка, что и у .delivery-content выше, только
   текст и видео меняются местами (текст слева, видео справа). */
.constructor-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  justify-content: space-between;
}

.constructor-text {
  flex: 1;
  min-width: 300px;
}

.constructor-text p {
  color: #ccc;
  margin-bottom: 16px;
  line-height: 1.6;
}

.constructor-video-wrap {
  flex: 1;
  min-width: 300px;
}

.constructor-video {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Тот же красный "пилюльный" стиль, что и у .telegram-button ниже — своя
   копия, а не переиспользование класса (см. комментарий в styles.css). */
.constructor-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: #c41e3a;
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.constructor-cta:hover {
  background-color: #a0182e;
  transform: scale(1.05);
}

/* Футер */
.footer {
  background-color: #0f0f0f;
  color: #aaa;
  padding: 40px 0 20px;
  border-top: 1px solid #333;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-column h4 {
  color: #c41e3a;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.footer-column p,
.footer-column a {
  color: #bbb;
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: block;
}

/* См. тот же комментарий в static/styles.css — ссылка внутри строки
   контактов (<p>Тел.: <a>...</a></p>) не должна быть блочной, иначе
   переносится на новую строку под "Тел.:"/"Email:". */
.footer-column p a {
  display: inline;
}

.social-links a {
  margin-right: 15px;
  color: #c41e3a;
}

.social-links a:hover {
  opacity: 0.8;
}

.copyright {
  text-align: center;
  color: #777;
  font-size: 0.9rem;
  border-top: 1px solid #333;
  padding-top: 20px;
}

/* Строка с указанием разработчика/фотографа — по аналогии с
   templates/index_mobile.html (та же ссылка на t.me/maximzar_pbase). */
.footer-credit {
  text-align: center;
  color: #777;
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 10px;
}

.footer-credit a {
  color: inherit;
}

/* Отзывы клиентов — та же разметка/масонри-раскладка, что и в styles.css.
   Раньше здесь были только цвета тёмной темы (в расчёте на то, что
   styles.css останется подключён параллельно) — но темы переключаются
   ПОДМЕНОЙ href одного <link> (см. applyTheme() выше), а не наложением
   одного файла на другой, так что без структурных правил ниже
   (раскладка колонками, отступы, попап-фото и т.д.) блок отзывов в
   тёмной теме показывался бы вообще без вёрстки. Добавлено вместе с
   попап-галереей/каруселью фото отзыва (см. .review-card-photo-count,
   openReviewGallery() в templates/index.html). */
.reviews h2 {
  color: #c41e3a;
}

.reviews-grid {
  columns: 3 320px;
  column-gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.review-card {
  break-inside: avoid;
  margin-bottom: 20px;
  background: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.review-card-photo {
  position: relative;
}

.review-card-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.review-card-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 12px;
  pointer-events: none;
}

.review-card-body {
  padding: 16px 18px;
}

.review-card-stars {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.review-card-stars .star-filled { color: #c41e3a; }
.review-card-stars .star-empty { color: #444; }

.review-card-comment {
  color: #ccc;
}

.review-card-name {
  color: #e0e0e0;
}

/* Галерея */
.gallery h2 {
  color: #c41e3a;
}

.carousel {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  width: 100%;
}

.carousel-image {
  min-width: 100%;
  width: 100%;
  height: 500px;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(30, 30, 30, 0.7);
  color: white;
  border: none;
  padding: 16px;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.indicator.active {
  background-color: white;
}

/* === Модальные окна === */

/* Общий стиль для всех оверлеев */
.cart-modal-overlay,
#product-gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center; /* ← ЦЕНТРИРОВАНИЕ */
  z-index: 1000;
}

/* Модальное окно галереи товара — чёрный фон */
#product-gallery-modal {
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  /* 100dvh учитывает скрывающуюся адресную строку мобильного браузера —
     без этого 100vh на телефоне больше видимой области экрана, и часть
     попапа (включая крестик закрытия) оказывается за пределами экрана. */
  height: 100dvh;
}

.cart-modal,
.modal {
  background: #1e1e1e;
  color: #e0e0e0;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid #444;
}

/* Модальное окно галереи товара — внутренний контент */
#product-gallery-modal .product-gallery-modal-content {
  background: #121212;
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  height: 90dvh;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 12px;
  overflow-y: auto;
  border: 1px solid #333;
}

#product-gallery-modal .carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

#product-gallery-modal .carousel-inner {
  height: 100%;
  display: flex;
  transition: transform 0.5s ease;
}

#product-gallery-modal .carousel-image {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  object-fit: contain;
}

#product-gallery-modal .carousel-btn {
  background-color: rgba(255, 255, 255, 0.2);
}

#product-gallery-modal .carousel-btn:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

#product-gallery-modal .carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

#product-gallery-modal .indicator {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

#product-gallery-modal .indicator.active {
  background-color: white;
}

/* Кнопка закрытия */
.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
}

.close:hover {
  color: #c41e3a;
}

/* Элементы корзины */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  background: #252525;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
}

.cart-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-name {
  color: #fff;
  font-weight: bold;
  font-size: 15px;
}

.cart-item-price {
  color: #bbb;
  font-size: 14px;
}

.cart-item-remove {
  background: #f44336;
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.cart-item-remove:hover {
  background: #d32f2f;
}

.cart-footer {
  margin-top: 20px;
  border-top: 1px solid #444;
  padding-top: 15px;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cart-total {
  text-align: left;
  font-weight: bold;
  color: #fff;
}

#checkout-btn {
  background: #4CAF50;
  color: white;
  border: 1px solid #3d8b40;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

#checkout-btn:hover:not(:disabled) {
  background: #45a049;
}

#checkout-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

.empty-message {
  text-align: center;
  color: #888;
  font-style: italic;
}

/* Кнопки форм авторизации */
.auth-button-style {
  background-color: #c41e3a;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #a0182e;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

.auth-button-style:hover {
  background-color: #a0182e;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: #c41e3a;
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(196, 30, 58, 0.3);
  border: 1px solid #a0182e;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.telegram-button:hover {
  background-color: #a0182e;
  transform: scale(1.05);
}

/* Адаптив */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 15px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav a {
    margin: 0 10px;
  }

  .home h1 {
    font-size: 2rem;
  }

  .delivery-content,
  .cooperation-content,
  .constructor-content {
    flex-direction: column;
  }

  .delivery-image,
  .cooperation-image {
    max-width: 100%;
  }

  .cart-modal,
  .modal {
    padding: 20px;
    width: 95%;
    max-height: 90vh;
  }

  /* Попап галереи товара на телефоне — во всю ширину/высоту экрана
     (с учётом динамической панели браузера через dvh) и с явным
     внутренним скроллом, чтобы контент не обрезался без возможности
     его увидеть. */
  #product-gallery-modal .product-gallery-modal-content {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  /* Крестик закрытия попапа галереи — фиксируем относительно экрана,
     а не относительно прокручиваемого контента попапа, чтобы он
     всегда оставался на виду и не "уезжал" за пределы экрана. */
  #product-gallery-modal .close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2100;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    color: #fff;
  }
}

/* Видео и изображения главной страницы */
.farm-video,
.farm-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}

.video-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}