/* ============================================
   ЕДИНЫЙ СТИЛЬ ДЛЯ САЙТА "Медленно, но верно"
   Медицинские/аптечные зелёные оттенки
   ============================================ */
/* ---------- БАЗОВЫЕ ПЕРЕМЕННЫЕ ---------- */ :root {
  --primary: #1a6b3c; /* насыщенный аптечный зелёный */
  --primary-dark: #0f4a2a; /* тёмно-зелёный для акцентов */
  --primary-light: #4a9e6e; /* светлый зелёный для элементов */
  --primary-pale: #e8f5ec; /* очень светлый фон */
  --primary-muted: #d4e8db; /* приглушённый зелёный для рамок */
  --accent: #2d8f4e; /* акцентный зелёный */
  --accent-soft: #c3e0cd; /* мягкий акцент */
  --text-dark: #1e2e24; /* тёмно-зелёно-серый для текста */
  --text-muted: #4a6b55; /* приглушённый текст */
  --text-light: #6e8a79; /* светлый текст */
  --white: #ffffff;
  --bg-body: #f5faf7; /* общий фон страницы */
  --bg-card: #ffffff;
  --shadow-sm: 0 2px 8px rgba(26, 107, 60, 0.08);
  --shadow-md: 0 6px 20px rgba(26, 107, 60, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
}
/* ---------- ГЛОБАЛЬНЫЕ СТИЛИ ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.7;
}
h1, h2, h3, h4, .serif-font {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--primary-dark);
}
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}
a:hover {
  color: var(--primary-dark);
}
strong, b, em {
  color: var(--primary-dark);
  font-weight: 600;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', Times, serif;
}
blockquote, q {
  width: 85%;
  margin: 1% auto;
  line-height: 1.5;
  font-style: italic;
  padding: 0 10px;
  background: #EFEAEA;
}
p {
  margin: 0 5px;
  text-indent: 20px;
  padding: 0 2px;
  color: var(--text-muted);
  line-height: 1.7;
}
li {
  color: var(--text-muted);
  line-height: 1.7;
}
ul, ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1.5rem;
}
ul li, ol li {
  margin-bottom: 0.4rem;
}
/* ---------- НАВИГАЦИЯ ---------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(26, 107, 60, 0.08);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 5%;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo i {
  color: var(--primary-light);
  font-size: 1.8rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s, border-bottom 0.2s;
}
.nav-links a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary-light);
}
.nav-links a.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
/* ---------- ОСНОВНЫЕ СТРАНИЦЫ ---------- */
.page {
  min-height: 100vh;
  padding: 7rem 5% 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.page:nth-child(odd) {
  background: var(--white);
}
.page:nth-child(even) {
  background: var(--bg-body);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  color: var(--primary-dark);
  text-align: center;
}
.section-title:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 70px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 4px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  max-width: 650px;
}
/* ---------- ГЛАВНАЯ (HERO, ПИЛЛЯРЫ, СОВЕТЫ) ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3rem;
  margin-bottom: 3rem;
}
.hero-text {
  flex: 1 1 400px;
}
.hero-text h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin: 1.6rem 0;
}
.hero-text p {
  font-size: 1.3rem;
  margin: 1.5rem 0;
  color: #4a5b47;
}
.hero-image {
  flex: 1 1 300px;
  text-align: center;
}
.hero-image i {
  font-size: 10rem;
  color: #6fa87b;
  opacity: 0.7;
}
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin: 2rem 0 3rem;
}
.pillar-card {
  background: white;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #d9e5d6;
  transition: transform 0.25s ease, box-shadow 0.3s;
  text-align: center;
}
.pillar-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
.pillar-card i {
  font-size: 2.8rem;
  color: #3a6b4c;
  margin-bottom: 1rem;
}
.pillar-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #1e3b1e;
}
.pillar-card p {
  color: #4a5b5b;
  line-height: 1.6;
}
.tips-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.tip-item {
  background: white;
  padding: 1.2rem 1.5rem;
  border-radius: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #e3eee0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.tip-item i {
  color: #2e7d64;
  font-size: 1.5rem;
  margin-top: 0.2rem;
}
.tip-item p {
  margin: 0;
  color: #3d4f3c;
}
/* ---------- КАРТОЧКИ ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s;
  text-align: center;
  border: 1px solid var(--primary-muted);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.card i {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}
.card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--primary-dark);
}
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.8rem 2.2rem;
  border-radius: 40px;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
}
.btn:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
  color: white;
}
.btn-recipe {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  font-weight: 600;
  padding: 0.7rem 2rem;
  border-radius: 40px;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  margin-top: 0.5rem;
}
.btn-recipe:hover {
  background: var(--primary);
  transform: scale(1.02);
  color: white;
}
/* ---------- ВЫДЕЛЕННЫЕ БЛОКИ ---------- */
.highlight-box {
  background: var(--primary-pale);
  border-left: 6px solid var(--primary);
  padding: 1.2rem 1.8rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.highlight-box strong {
  color: var(--primary-dark);
}
/* ---------- СТРАНИЦА РЕЦЕПТОВ ---------- */
.category-section {
  margin-bottom: 5rem;
}
.category-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--primary-dark);
  border-left: 6px solid var(--primary);
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
}
.category-title:hover {
  color: var(--primary-dark);
}
.category-title .toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--primary);
}
.category-title .toggle-icon.rotated {
  transform: rotate(180deg);
}
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.2rem;
  transition: opacity 0.3s ease, max-height 0.5s ease;
  overflow: hidden;
  max-height: 0; /* по умолчанию скрыта, но мы добавим класс open для показа */
  opacity: 0;
  pointer-events: none;
}
.recipe-grid.open {
  max-height: 10000px; /* достаточно большое значение, чтобы все карточки поместились */
  opacity: 1;
  pointer-events: auto;
  margin-top: 1.2rem;
}
.recipe-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s;
  border: 1px solid var(--primary-muted);
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
/* Чекбокс выбора блюда (для калькулятора) */
.recipe-card .select-checkbox {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--primary);
  background: white;
  border-radius: 6px;
  border: 2px solid var(--primary);
}
.recipe-img {
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.recipe-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recipe-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(26, 107, 60, 0.3);
}
.recipe-content {
  padding: 1.5rem;
}
.recipe-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.recipe-content p {
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}
.recipe-content .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.recipe-content .meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: 500;
}
/* ---------- ОБЁРТКА ДЛЯ РЕЦЕПТОВ + САЙДБАР ---------- */
.recipes-wrapper {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  align-items: flex-start;
}
.recipes-main {
  flex: 2.5;
  min-width: 0; /* предотвращает переполнение */
}
/* ---------- САЙДБАР (КАЛЬКУЛЯТОР) ---------- */
.sidebar {
  flex: 1;
  position: sticky;
  top: 100px; /* отступ под навигацию */
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--primary-muted);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sidebar h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar .totals {
  margin: 1rem 0;
}
.sidebar .totals p {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--primary-muted);
  font-size: 0.95rem;
  color: var(--text-dark);
}
.sidebar .totals .total-value {
  font-weight: 700;
  color: var(--primary);
}
.sidebar .empty-message {
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
  margin: 1rem 0;
}
.sidebar .reset-btn {
  background: var(--primary-pale);
  border: none;
  border-radius: 40px;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  margin-top: 0.5rem;
  border: 1px solid var(--primary-muted);
}
.sidebar .reset-btn:hover {
  background: var(--primary-muted);
}
/* ---------- ДЕТАЛЬНЫЕ СТРАНИЦЫ (рецепты + тренировки) ---------- */
.recipe-detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
  border: 1px solid var(--primary-muted);
}
.recipe-header {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.recipe-header-img {
  flex: 1;
  min-width: 250px;
  height: 300px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  border: 3px solid var(--primary-muted);
  overflow: hidden;
}
.recipe-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recipe-header-info {
  flex: 2;
}
.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
  color: var(--text-muted);
}
.recipe-meta span {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title-small {
  font-size: 1.5rem;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  font-family: 'Playfair Display', serif;
  color: var(--primary-dark);
  text-align: center;
}
.ingredients-list, .steps-list, .nutrition-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.ingredients-list li, .steps-list li, .nutrition-list li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.ingredients-list li::marker, .steps-list li::marker {
  color: var(--primary);
}
.nutrition-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--primary-pale);
  padding: 1rem 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary-muted);
}
.nutrition-list li span {
  font-weight: 700;
  color: var(--primary-dark);
}
.back-link {
  display: inline-block;
  margin-top: 2rem;
  background: var(--primary-pale);
  color: var(--primary-dark);
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
  border: 1px solid var(--primary-muted);
}
.back-link:hover {
  background: var(--primary);
  color: white;
}
.back-link i {
  margin-right: 0.5rem;
}
/* ---------- СТРАНИЦА ПИТАНИЯ ---------- */
.principle-list {
  list-style: none;
  padding: 0;
}
.principle-list li {
  background: var(--bg-card);
  padding: 0.8rem 1.5rem;
  margin-bottom: 0.6rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
  color: var(--text-dark);
  line-height: 1.6;
}
.principle-list li strong {
  color: var(--primary-dark);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.info-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary-muted);
  box-shadow: var(--shadow-sm);
}
.info-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.8rem;
}
.info-card h4 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.info-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.quote {
  background: var(--primary-pale);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary-muted);
  margin: 1.5rem 0;
  color: var(--text-dark);
  line-height: 1.8;
}
.quote strong {
  color: var(--primary-dark);
}
.micro-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.micro-table th {
  background: var(--primary);
  color: white;
  padding: 0.8rem 1.2rem;
  text-align: left;
  font-weight: 600;
}
.micro-table td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--primary-muted);
  color: var(--text-dark);
}
.micro-table tr:nth-child(even) td {
  background: var(--primary-pale);
}
.micro-table tr:hover td {
  background: var(--accent-soft);
}
/* ---------- СТРАНИЦА АКТИВНОСТИ ---------- */
.fitness-section {
  margin: 2.5rem 0;
}
.fitness-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.fitness-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin: 1.5rem 0 0.5rem;
}
.fitness-section p, .fitness-section li {
  color: var(--text-muted);
  line-height: 1.7;
}
.fitness-section ul, .fitness-section ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1.5rem;
}
.fitness-section ul li, .fitness-section ol li {
  margin-bottom: 0.4rem;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin: 1rem 0;
}
.program-item {
  background: var(--bg-card);
  padding: 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--primary-muted);
  text-align: center;
  transition: transform 0.3s;
}
.program-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.program-item .day {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.3rem;
}
.program-item .activity {
  font-size: 0.9rem;
  color: var(--text-muted);
}
a.workout-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.workout-card .card {
  transition: transform 0.3s ease, box-shadow 0.3s;
  cursor: pointer;
}
a.workout-card:hover .card {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
/* ---------- СТРАНИЦА ПСИХОЛОГИЯ ---------- */
.mind-section {
  margin: 2rem 0;
}
.mind-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--primary-dark);
  margin-bottom: 0.8rem;
}
.mind-section p {
  color: var(--text-muted);
  line-height: 1.7;
}
/* ---------- ПОДВАЛ ---------- */
footer {
  background: var(--primary-dark);
  color: var(--primary-pale);
  padding: 2.5rem 5%;
  text-align: center;
}
footer p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}
/* ---------- АДАПТИВНОСТЬ ---------- */
@media (max-width: 1024px) {
  .navbar {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.05rem 1%;
  }
  .two-column {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .recipe-header {
    flex-direction: column;
  }
  .recipe-header-img {
    height: 220px;
    min-width: 100%;
  }
  .recipes-wrapper {
    flex-direction: column;
  }
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    margin-bottom: 2rem;
  }
}
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.05rem 1%;
  }
  .nav-links {
    gap: 0.8rem;
    justify-content: center;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
  .section-title {
    font-size: 1.5rem;
    margin-top: 0.4rem;
  }
  .page {
    padding: 6rem 4% 3rem;
  }
  .recipe-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .program-grid {
    grid-template-columns: 1fr 1fr;
  }
  .recipe-detail {
    padding: 1.5rem;
  }
  .logo {
    font-size: 1.2rem;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .micro-table {
    font-size: 0.75rem;
  }
  .micro-table th, .micro-table td {
    padding: 0.4rem 0.01rem;
  }
  .nutrition-list {
    flex-direction: column;
    gap: 0.4rem;
  }
  .tips-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .navbar {
    gap: 0.01rem;
    padding: 0 0.5%;
    height: 10%;
  }
  .logo {
    font-size: 1rem;
  }
  .recipe-grid {
    grid-template-columns: 1fr;
  }
  .program-grid {
    grid-template-columns: 1fr;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .nav-links {
    gap: 0.5rem;
  }
  .nav-links a {
    font-size: 0.75rem;
  }
  .recipe-detail {
    padding: 1rem;
  }
  .recipe-header-img {
    height: 180px;
  }
  .card {
    padding: 1.2rem;
  }
  .btn, .btn-recipe, .back-link {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  .sidebar {
    padding: 1rem;
  }
}
/* ========== КАЛЬКУЛЯТОР (sidebar) ========== */
.recipes-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.recipes-main {
  flex: 1;
  min-width: 0; /* чтобы не вылезало */
}
.recipes-sidebar {
  position: sticky;
  top: 100px;
  flex: 0 0 320px;
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  border: 1px solid #e3eee0;
  align-self: flex-start;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.recipes-sidebar h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #1e3b1e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.recipes-sidebar .selected-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.recipes-sidebar .selected-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eef5ec;
  font-size: 0.9rem;
  color: #2d3a2c;
}
.recipes-sidebar .selected-list li .remove-btn {
  background: none;
  border: none;
  color: #b35a5a;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
  transition: color 0.2s;
}
.recipes-sidebar .selected-list li .remove-btn:hover {
  color: #a03a3a;
}
.recipes-sidebar .total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #d9e5d6;
}
.recipes-sidebar .total p {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  margin: 0.2rem 0;
  font-size: 0.95rem;
}
.recipes-sidebar .total .total-cal {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2e7d64;
}
.recipes-sidebar .clear-btn {
  background: #e5a44c;
  color: #2d3a2c;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 0.8rem;
  transition: background 0.3s;
}
.recipes-sidebar .clear-btn:hover {
  background: #d4913a;
}
/* Кнопка добавления на карточке */
.add-btn {
  background: #2e7d64;
  color: white;
  border: none;
  border-radius: 40px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.add-btn:hover {
  background: #1e5f4a;
}
.add-btn:active {
  transform: scale(0.95);
}
.add-btn.added {
  background: #b0c9b8;
  color: #1e3b1e;
  cursor: default;
}
@media (max-width: 1024px) {
  .recipes-sidebar {
    flex: 0 0 260px;
    padding: 1rem;
  }
}
@media (max-width: 768px) {
  .recipes-wrapper {
    flex-direction: column;
  }
  .recipes-sidebar {
    position: static;
    width: 100%;
    flex: 1 1 auto;
    max-height: none;
    margin-top: 2rem;
  }
} /* Кнопки управления в списке калькулятора */
.item-controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.item-controls button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 30px;
  transition: background 0.2s, color 0.2s;
  color: #5a6e6e;
}
.item-controls .decrease-btn:hover {
  background: #e3eee0;
  color: #2e7d64;
}
.item-controls .remove-btn:hover {
  background: #f5e0e0;
  color: #b35a5a;
}