* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #222222;
  --accent-red: #bd234a;
  --accent-hover: #d82b57;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;
  --text-dark: #1a1a1a;
  --line: #2e2e2e;
  --green: #4caf50;
  --font-title: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', Arial, sans-serif;
}

html {
  height: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   Страница набора
   ========================================================= */

.set-page {
  max-width: 2200px;
  margin: 0 auto;
  padding: 0 35px 56px;
}

/* ---------- Верхний блок: фото / описание / состав ---------- */
.set-hero {
  /* Один отступ между всеми колонками; линия перед составом — посередине отступа */
  --hero-gap: clamp(28px, 2.6vw, 52px);
  display: grid;
  grid-template-columns: minmax(280px, 26%) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--hero-gap);
  align-items: stretch;
}

/* Каждая колонка — flex-колонка: нижний элемент прижимается к низу,
   так что низ галереи, ряда покупки и карточки вкусов на одной линии */
.set-gallery,
.set-info,
.set-contents {
  display: flex;
  flex-direction: column;
}

/* ---------- Галерея ---------- */
.set-gallery { container-type: inline-size; }
.set-gallery__main {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(100cqw / 1.14);
  max-height: calc(100cqw * 1.3);
  border-radius: 10px;
  overflow: hidden;
  background: #fff; /* края фото наборов белые — свободное место с ними сливается */
}
.set-gallery__main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* коробка видна целиком, без обрезки по бокам */
}

/* ---------- Описание и покупка ---------- */
.set-info__title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.15;
}
.set-info__price {
  margin-top: 14px;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent-red);
}
.set-info__desc {
  max-width: 680px;
  margin-top: 22px;
  font-size: 16.5px;
  line-height: 1.7;
  color: #cfcfcf;
}

.set-features {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 0;
  /* Свободное место делится поровну сверху и снизу — блок стоит посередине
     между описанием и "В наличии"; padding — минимальный отступ */
  margin: auto 0;
  padding: 28px 0;
  list-style: none;
}
.set-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}
.set-feature:first-child { padding-left: 0; }
.set-feature + .set-feature { border-left: 1px solid var(--line); }
.set-feature__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  font-size: 33px;
  line-height: 38px;
  text-align: center;
  color: #e6e6e6;
}
.set-feature__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.set-feature__value {
  font-family: var(--font-title);
  font-size: 20px;
}
.set-feature__value--wrap { max-width: 135px; }
.set-feature__label {
  font-size: 13px;
  color: #8a8a8a;
}

.set-info__stock {
  font-size: 17px;
  font-weight: 600;
  color: var(--green);
}
.set-info__stock--out { color: #8a8a8a; }

.set-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.qty-picker {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a1a;
}
.qty-picker__btn {
  width: 30px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.qty-picker__btn:hover { color: var(--accent-red); }
.qty-picker__input {
  width: 28px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty-picker__input::-webkit-outer-spin-button,
.qty-picker__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  background: var(--accent-red);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-cart:hover { background: var(--accent-hover); }
.btn-cart:disabled { opacity: .5; cursor: not-allowed; }
.btn-cart--done,
.btn-cart--done:hover { background: #2e7d32; }

.btn-fav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  background: transparent;
  color: #cfcfcf;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-fav:hover {
  border-color: var(--accent-red);
  color: #fff;
}

/* ---------- Состав набора ---------- */
.set-contents {
  margin-left: calc(var(--hero-gap) / -2);
  padding: 4px 0 0 calc(var(--hero-gap) / 2);
  border-left: 1px solid var(--line);
}
.set-contents__title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 32px;
}
.set-contents__list {
  margin: 20px 0 36px;
  padding-left: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #cfcfcf;
}
/* Номера пунктов рисуются в левом отступе списка, а прокручиваемый список
   обрезает всё, что в него не влезло: под двузначные "10." нужен отступ шире */
.set-contents__list--2digit { padding-left: 2.2em; }
.set-contents__list li + li { margin-top: 6px; }
.set-contents__list li::marker { color: #cfcfcf; }
/* Длинный состав прокручивается: видно ~10 чаёв, блок не вытягивает строку вниз */
.set-contents__list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: #4b4b4b transparent;
}
/* Больше 10 чаёв: блок состава не влияет на высоту строки (её задают фото и описание),
   а список занимает всё оставшееся место и прокручивается */
.set-contents--long {
  height: 0;
  min-height: 100%;
}
.set-contents--long .set-contents__list {
  flex: 1 1 0;
  min-height: 200px;
  max-height: none;
}
.set-contents__list::-webkit-scrollbar { width: 4px; }
.set-contents__list::-webkit-scrollbar-thumb {
  background: #4b4b4b;
  border-radius: 4px;
}
.set-contents__list a { transition: color .2s; }
.set-contents__list a:hover { color: var(--accent-red); }

/* Карточка "Вкусы и характеры" */
.taste-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: auto;
  padding: 16px 22px;
  border: 1px solid rgba(189, 35, 74, 0.25);
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 70%, rgba(189, 35, 74, 0.18), transparent 45%),
    linear-gradient(120deg, #2a1117 0%, #3a141e 100%);
  overflow: hidden;
}
.taste-card__icon {
  flex-shrink: 0;
  padding-right: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 30px;
  color: #e6e6e6;
}
.taste-card__title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 18px;
}
.taste-card__text {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #bdbdbd;
}

/* ---------- Нижний блок: чаи в наборе ---------- */
.set-teas {
  margin-top: 44px;
}
.set-teas__head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.set-teas__count {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-red);
}

.teas-grid {
  --per-row: 10;
  --tea-gap: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--tea-gap);
}

.tea-card {
  flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--tea-gap)) / var(--per-row));
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #222;
  border-radius: 10px;
  overflow: hidden;
  background: #141414;
  transition: transform .2s, border-color .2s;
}
.tea-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-hover);
}
.tea-card__img {
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: #f4f2ef;
}
.tea-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tea-card__info {
  flex-grow: 1;
  padding: 10px 8px 12px;
  text-align: center;
}
.tea-card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  /* Имя — не больше 2 строк */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tea-card__category {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: #888;
}

/* ---------- Адаптивность ---------- */
/* Ноутбуки: компактнее, чтобы преимущества и ряд покупки помещались в одну строку */
@media (max-width: 1500px) {
  /* На узких колонках строки состава переносятся и вытягивают весь блок,
     поэтому здесь состав всегда прокручивается и не задаёт высоту строки */
  .set-contents { height: 0; min-height: 100%; }
  .set-contents .set-contents__list { flex: 1 1 0; min-height: 160px; max-height: none; }
  .set-gallery__main { max-height: calc(100cqw * 1.5); }
  .set-info__title { font-size: 38px; }
  .set-info__desc { font-size: 15px; }
  .teas-grid { --per-row: 8; }
  .set-feature { gap: 10px; padding: 0 12px; }
  .set-feature__icon { width: 30px; height: 30px; font-size: 26px; line-height: 30px; }
  .set-feature__value { font-size: 15px; }
  .set-feature__value--wrap { max-width: 100px; }
  .set-feature__label { font-size: 11px; }
  .set-buy { gap: 8px; }
  .qty-picker,
  .btn-cart,
  .btn-fav { height: 36px; }
  .qty-picker__btn { width: 24px; }
  .qty-picker__input { width: 22px; font-size: 14px; }
  .btn-cart { padding: 0 12px; font-size: 11.5px; }
  .btn-fav { padding: 0 10px; font-size: 10.5px; }
}

@media (max-width: 1200px) {
  .set-hero { grid-template-columns: minmax(280px, 38%) minmax(0, 1fr); }
  .teas-grid { --per-row: 6; }
  /* Состав переносится под фото и описание на всю ширину */
  .set-contents {
    grid-column: 1 / -1;
    margin-left: 0;
    padding: 28px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  /* Состав в отдельной строке — снова обычная высота и прокрутка по max-height */
  .set-contents,
  .set-contents--long { height: auto; min-height: 0; }
  .set-contents .set-contents__list { flex: none; min-height: 0; max-height: 300px; }
}

@media (max-width: 768px) {
  .set-page { padding: 0 16px 40px; }
  .set-contents__title { font-size: 28px; }
  .set-hero { grid-template-columns: 1fr; }
  .set-gallery { max-width: 420px; width: 100%; margin: 0 auto; }
  .set-info__title { font-size: 30px; }
  .set-features { padding: 24px 0; }
  .set-feature { padding: 0 12px; }
  .teas-grid { --per-row: 4; --tea-gap: 10px; }
}

@media (max-width: 480px) {
  .teas-grid { --per-row: 3; }

  /* Три преимущества ("7 видов", "70 г", "Для себя или в подарок") — в одну строку */
  .set-features { flex-wrap: nowrap; justify-content: space-between; }
  .set-feature { gap: 7px; padding: 0 8px; }
  .set-feature:first-child { padding-left: 0; }
  .set-feature:last-child { padding-right: 0; }
  .set-feature__icon { width: 24px; height: 24px; font-size: 21px; line-height: 24px; }
  .set-feature__value { font-size: 14px; }
  .set-feature__value--wrap { font-size: 13px; max-width: 86px; }
  .set-feature__label { font-size: 10.5px; }
}
