* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #fef9f0;
  color: #2c241a;
  line-height: 1.5;
  padding: 2rem 1.5rem;
}

.container {
  margin: 0 auto;
}

/* header */
.header {
  text-align: center;
  margin-bottom: 3rem;
}
.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c9772b, #e09d4a);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}
.header p {
  color: #6b4e2e;
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

/* cards */
.card {
  background: white;
  border-radius: 28px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.02);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.card-content {
  padding: 1.8rem;
}
.card-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 5px solid #e09d4a;
  padding-left: 1rem;
}

/* recipe hero */
.recipe-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}
.hero-img {
  flex: 1;
  min-width: 240px;
}
.hero-img img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}
.hero-info {
  flex: 1.5;
}
.badge {
  background: #f3e1be;
  color: #a45f28;
  display: inline-block;
  padding: 0.25rem 0.9rem;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.kcal-info {
  background: #fff2e2;
  border-radius: 20px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
}
.kcal-number {
  font-size: 2rem;
  font-weight: 800;
  color: #c1641e;
}
.serving-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f9f3ea;
  padding: 0.8rem 1rem;
  border-radius: 60px;
}
.serving-control label {
  font-weight: 600;
}
.serving-control input {
  width: 90px;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 40px;
  border: 1px solid #e2cfb5;
  background: white;
  text-align: center;
  font-weight: 600;
}
.hint {
  font-size: 0.85rem;
  color: #785a36;
}
.total-kcal {
  font-weight: 700;
  background: white;
  border-radius: 40px;
  padding: 0.4rem 1.2rem;
  display: inline-block;
}

/* ингредиенты */
.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.ingredient-item {
  background: #fef7ef;
  border-radius: 20px;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  border: 1px solid #faebd2;
}
.ingredient-name {
  color: #563d24;
}
.ingredient-amount {
  font-weight: 700;
  color: #b4632e;
}
.small-note {
  font-size: 0.85rem;
  margin-top: 10px;
  color: #8b694a;
}

/* статичный пошаговый рецепт */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.step-item {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: #fefbf6;
  border-radius: 24px;
  padding: 1rem;
}
.step-img {
  flex: 1;
  min-width: 140px;
}
.step-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.step-text {
  flex: 3;
}
.step-number {
  font-weight: 800;
  font-size: 1.3rem;
  color: #e09d4a;
  margin-bottom: 0.5rem;
}
.step-text strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: #3e2e1f;
}
.step-text p {
  color: #4a3924;
}

/* калькулятор продуктов */
.product-calc {
  background: #fff8f0;
  border-radius: 24px;
  padding: 1.5rem;
}
.calc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1rem;
}
.calc-field {
  flex: 1;
  min-width: 150px;
}
.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #785a36;
}
select, input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 48px;
  border: 1px solid #e2cfb5;
  background: white;
  font-family: inherit;
  font-size: 0.95rem;
}
button {
  background: #e09d4a;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 48px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
button:hover {
  background: #c9772b;
}
.calc-result {
  margin-top: 1rem;
  background: #e9e1d4;
  padding: 0.7rem 1.2rem;
  border-radius: 60px;
  font-weight: 500;
  display: inline-block;
}

hr {
  margin: 1rem 0;
  border-color: #f0e2d0;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: #a0886c;
  font-size: 0.85rem;
}

@media (max-width: 780px) {
  body {
    padding: 1rem;
  }
  .card-content {
    padding: 1.2rem;
  }
  .step-item {
    flex-direction: column;
  }
}
/* Блок похожих рецептов */
.similar-recipes {
  background: white;
  border-radius: 28px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  margin: 2rem 0 1rem;
  padding: 1.5rem;
}

.similar-recipes h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-left: 5px solid #e09d4a;
  padding-left: 1rem;
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.similar-item {
  background: #fefbf6;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: #2c241a;
}

.similar-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.similar-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.similar-info {
  padding: 0.8rem 1rem;
}

.similar-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.similar-desc {
  font-size: 0.8rem;
  color: #8b694a;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .similar-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .similar-item img {
    height: 110px;
  }
  .similar-title {
    font-size: 0.9rem;
  }
}

/* Блок похожих рецептов – сетка для 9 карточек */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* На десктопе показываем 3 колонки (3 ряда по 3 карточки = 9) */
@media (min-width: 1024px) {
  .similar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Планшеты: 2 колонки */
@media (min-width: 768px) and (max-width: 1023px) {
  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Телефоны: 1 колонка, карточки адаптируются */
@media (max-width: 767px) {
  .similar-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Стили для каждой карточки (уже были, но на всякий случай) */
.similar-item {
  background: #fefbf6;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: #2c241a;
}
.similar-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.similar-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.similar-info {
  padding: 0.8rem 1rem;
}
.similar-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.similar-desc {
  font-size: 0.8rem;
  color: #8b694a;
  line-height: 1.3;
}