/* === БАЗОВЫЕ СТИЛИ === */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: #f8f1e8;
  color: #333;
}

/* === ХЕДЕР === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
  background: linear-gradient(to right, #d7000f 0%, #fffaf6 100%);
  color: white;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
}

.header-left,
.header-center,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-left   { justify-content: flex-start; }
.header-right  { justify-content: flex-end; }

.main-logo-receptures {
  max-height: 50px;
  height: 50px;
  transform: scale(2.1);
  object-fit: contain;
}

.foodmix-logo {
  max-height: 40px;
}

.logo {
  height: 40px;
  margin-right: 15px;
}

.company-name {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 0;
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.main-content {
  padding: 100px 20px 20px;
  max-width: 1000px;
  /*width: 100%;*/
  margin: auto;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
  color: #d7000f;
}

/* === КАРТОЧКИ РЕЦЕПТОВ === */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 30px;
}
.carousel {
  position: relative;
  overflow: hidden;
  max-width: 300px;
}
.carousel-track {
  display: block;
}
.carousel-item {
  display: none;
}
.carousel-item.active {
  display: block;
}
.carousel-item img,
.carousel-item video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0 10px;
  z-index: 1;
}
.carousel-btn.prev { left: 5px; }
.carousel-btn.next { right: 5px; }


.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  padding: 32px;
}

.product-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: scale(1.03);
}

.product-image {
  width: 100%;   /* или %, или max-width */
  height: 200px;  /* фиксированная высота */
  overflow: hidden; /* чтобы ничего не вылезало */
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-NEW {
  position: absolute;
  top: 12px;
  left: 12px;
  background: green;
  color: white;
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 12px;
}
.badge-TOP {
  position: absolute;
  top: 12px;
  left: 12px;
  background: yellow;
  color: black;
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 12px;
}

.product-title {
  text-align: center;
  font-weight: bold;
  padding: 12px;
  font-size: 16px;
}

.product-hover {
  display: none;
  position: absolute;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
}

.product-card:hover .product-hover {
  display: block;
}

.more-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #e53935;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, +5%); /* Центрируем по середине экрана */

  /* вот эти строки */
  max-height: 80vh;   /* ограничиваем высоту по высоте окна */
  margin: auto;       /* центрируем вертикально и горизонтально */
  top: 0; bottom: 0;
  overflow-y: auto;   /* прокрутка при переполнении */
}



.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
}
.extra-info {
  display: none;
}

/* === РАЗНЫЙ ФОН ДЛЯ ПРОИЗВОДИТЕЛЕЙ === */
.manufacturer-foodmix {
  /*background-color: #fff3e0; /* светло-оранжевый */
  border-left: 6px solid #f28c00;
}

.manufacturer-dilight {
  /*background-color: #e8f5e9; /* светло-зелёный */
  border-left: 6px solid #689F38;
}

.manufacturer-backaldrin {
  /*background-color: #f3e5f5; /* светло-фиолетовый */
  border-left: 6px solid #d7000f;
}
.manufacturer-foodmix .more-btn {
  background-color: #f28c00;
}

.manufacturer-dilight .more-btn {
  background-color: #689F38;
}

.manufacturer-backaldrin .more-btn {
  background-color: #d7000f;
}


/* Полная карточка */
.recipe-card-full {
  background: #fffaf6;
  padding: 20px;
  border-left: 5px solid #d7000f;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.recipe-title {
  margin-top: 0;
  color: #d7000f;
  font-size: 1.6rem;
  margin-bottom: 15px;
}

.recipe-body {
  display: flex;
  gap: 20px;
  align-items: stretch;
}


.recipe-left {
  flex: 1 1 50%;
}

.recipe-left .desc {
  font-size: 1rem;
  margin-bottom: 10px;
}

.recipe-left .benefits {
  padding-left: 20px;
  margin: 0;
}

.recipe-left .benefits li {
  margin-bottom: 6px;
}

/* Правая часть: карусель */
.recipe-right {
  flex: 1 1 50%;
  overflow: hidden;
  max-width: 100%;
}

.carousel-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.carousel-track img,
.carousel-track video {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  scroll-snap-align: start;
}


/* Выравнивание последней карточки при нечетном числе */
.recipe-grid > .recipe-card-full:last-child:nth-child(odd) {
  grid-column: span 2;
  justify-self: center;
  max-width: 600px;
}

/* === КНОПКИ === */
.button-group {
  display: flex;
  margin-top: 15px;
  gap: 10px;
}

.button-group button {
  flex: 1;
  background-color: #d7000f;
  color: white;
  border: none;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.button-group button-foodmix {
  flex: 1;
  background-color: #f28c00;
  color: white;
  border: none;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}
.button-group button-foodmix:hover {
  background-color: #a5000c;
}
.button-group button-dilight {
  flex: 1;
  background-color: #689F38;
  color: white;
  border: none;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}
.button-group button-dilight:hover {
  background-color: #a5000c;
}
.button-group button:hover {
  background-color: #a5000c;
}

/* === АККОРДЕОН === */
.toggle-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
  padding: 0 1rem;
}

.toggle-section.open {
  max-height: 1500px;
  padding: 1rem;
}

/* === МЕДИА-РЯД === */
.media-row {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.media-row img,
.media-row video {
  width: 100%;
  max-width: 30%;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* === БОКОВОЕ НАВИГАЦИОННОЕ МЕНЮ === */
.side-nav {
  position: fixed;
  top: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  height: auto;
  z-index: 999;
  width: 180px; /* одинаковая ширина */
}

.left-nav  { left: 10px; }
.right-nav { right: 10px; }

.side-nav a {
  background-color: #f0e6dd;
  color: #333;
  text-decoration: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
  white-space: normal;
  word-break: break-word;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-nav a:hover {
  background-color: #e0d7ce;
}


/* === СПЕЦИАЛЬНЫЙ СТИЛЬ ДЛЯ ЛОГОТИПА === */
.footer-logos img[src*="foodmix-logo.png"] {
  background-color: #fffaf6;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  .side-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
  }

  .side-nav.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    background: #f0e6dd;
    border: none;
    padding: 10px 15px;
    z-index: 1000;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  }
}

@media (max-width: 800px) {
  .side-nav {
    display: none;
  }

  .header {
    flex-direction: column;
    align-items: center;
    padding: 10px;
    text-align: center;
  }

  .header-left,
  .header-right {
    display: none;
  }

  .header-center {
    display: flex; /* убедимся, что центр отображается */
    justify-content: center;
    align-items: center;
  }

  .header img {
    max-width: 120px;
    height: auto;
  }

  .company-name {
    margin-top: 5px;
  }

  .main-content {
    padding: 80px 10px 20px;
  }

  .media-row img,
  .media-row video {
    max-width: 100%;
  }
}
