@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Playfair+Display:wght@500;600;700;800&display=swap');

/* ==========================================================================
   Lolool — Web App Dinh dưỡng Mẹ bầu
   Design System: "Editorial Macro" (kem giấy · navy · terracotta · sage · gold)
   Lấy cảm hứng từ bộ Cẩm nang Thực đơn 7 ngày chuẩn Macro.
   ========================================================================== */

/* ==========================================================================
   1. Root Variables & Theme Tokens
   ========================================================================== */
:root {
  /* Nền & surface */
  --bg-main: hsl(43, 33%, 95%);          /* kem giấy #F3EFE6 */
  --bg-soft: hsl(40, 34%, 92%);          /* kem đậm hơn cho khối phụ */
  --surface: #FFFFFF;
  --surface-warm: hsl(43, 42%, 98%);

  /* Mực & chữ */
  --ink: hsl(208, 42%, 22%);             /* navy mực #21384E — tiêu đề */
  --text-primary: hsl(210, 24%, 26%);    /* #33414E */
  --text-secondary: hsl(208, 12%, 45%);  /* #667581 */
  --text-light: hsl(208, 10%, 60%);

  /* Navy = Primary (đạm/hành động) */
  --primary: hsl(208, 60%, 30%);         /* #1F4E79 */
  --primary-hover: hsl(208, 64%, 24%);
  --primary-dark: hsl(208, 55%, 19%);
  --primary-light: hsl(208, 46%, 92%);

  /* Terracotta = Carb / accent ấm */
  --carb: hsl(18, 55%, 46%);             /* #B85A33 */
  --carb-dark: hsl(16, 55%, 37%);
  --carb-light: hsl(22, 52%, 93%);

  /* Protein alias = navy */
  --protein: var(--primary);
  --protein-light: var(--primary-light);

  /* Sage green */
  --success: hsl(104, 23%, 47%);         /* #6E9466 */
  --success-dark: hsl(104, 28%, 31%);
  --success-light: hsl(96, 34%, 92%);

  /* Gold accent */
  --gold: hsl(39, 46%, 58%);             /* #C3A468 */
  --gold-dark: hsl(36, 45%, 44%);
  --gold-light: hsl(43, 52%, 91%);

  /* Trạng thái */
  --warning: hsl(38, 76%, 52%);
  --warning-dark: hsl(32, 60%, 38%);
  --warning-light: hsl(40, 72%, 92%);
  --danger: hsl(2, 60%, 55%);
  --danger-dark: hsl(2, 52%, 42%);
  --danger-light: hsl(4, 62%, 95%);

  /* Viền */
  --border: hsl(40, 22%, 83%);
  --border-light: hsl(40, 22%, 89%);

  /* Bóng dịu ám tông ấm */
  --shadow-sm: 0 1px 2px rgba(34, 45, 58, 0.05), 0 1px 3px rgba(34, 45, 58, 0.04);
  --shadow: 0 6px 22px rgba(34, 45, 58, 0.07), 0 2px 6px rgba(34, 45, 58, 0.04);
  --shadow-hover: 0 14px 34px rgba(31, 78, 121, 0.14);

  /* Bo góc */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Alias tương thích code cũ */
  --accent: var(--carb);
  --accent-dark: var(--carb-dark);
  --accent-light: var(--carb-light);
  --background: var(--bg-main);
}

/* ==========================================================================
   2. Reset & Typography
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

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

::selection { background: var(--gold-light); color: var(--carb-dark); }

/* ==========================================================================
   3. Header & Navigation
   ========================================================================== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(250, 248, 243, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  box-shadow: 0 2px 14px rgba(34, 45, 58, 0.04);
}

.header-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.logo-icon { width: 30px; height: 30px; }
.logo-text span { color: var(--carb); }

.nav-menu { display: flex; gap: 2px; }

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover { color: var(--primary); background-color: var(--primary-light); }

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-toggle .bar {
  height: 2px; width: 100%;
  background-color: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================================================
   4. Main Structure & Sections
   ========================================================================== */
.main-content {
  margin-top: 70px;
  padding: 44px 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - 200px);
}

.app-section { display: none; }
.app-section.active { display: block; animation: sectionIn 0.45s ease-out; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 760px;
}

/* Cards & controls */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  padding: 28px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.glass-card:hover { border-color: var(--gold); box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(31, 78, 121, 0.22);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(31, 78, 121, 0.3);
}

.btn-block { width: 100%; }

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-primary);
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
select.form-control { cursor: pointer; }

/* ==========================================================================
   5. Reveal & number-count animation
   ========================================================================== */
.js-enabled .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js-enabled .reveal.in-view { opacity: 1; transform: none; }

/* Đĩa ăn xoay hiện vào */
.js-enabled .reveal .plate-photo {
  transform: scale(0.85) rotate(-14deg);
  opacity: 0.5;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s, opacity 0.7s ease 0.15s;
}
.js-enabled .reveal.in-view .plate-photo { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js-enabled .reveal,
  .js-enabled .reveal .plate-photo { opacity: 1 !important; transform: none !important; transition: none; }
  .app-section.active { animation: none; }
  html { scroll-behavior: auto; }
  /* Tắt mọi hiệu ứng động (heroFloat, fadeInUp...) để tránh chóng mặt cho mẹ bầu */
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ==========================================================================
   6. Home Section (Hero & Stats)
   ========================================================================== */
.hero-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  background: linear-gradient(140deg, #FFFFFF 0%, var(--bg-soft) 52%, var(--gold-light) 100%);
  border-radius: 28px;
  padding: 60px 52px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  overflow: hidden;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.badge-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--carb-dark);
  background-color: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  color: var(--ink);
  line-height: 1.15;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
}

.quick-selector-box {
  background: var(--surface);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 500px;
}
.quick-selector-box label { font-weight: 600; margin-bottom: 8px; display: block; color: var(--text-primary); }
.select-btn-group { display: flex; gap: 12px; }
.select-btn-group select { flex: 1; }

.hero-image { display: flex; justify-content: center; position: relative; z-index: 1; }
.hero-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 16px 30px rgba(31, 78, 121, 0.18));
  animation: heroFloat 6s ease-in-out infinite;
}
.hero-photo {
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 5px solid #FFFFFF;
  box-shadow: 0 20px 44px rgba(31, 78, 121, 0.2);
  animation: heroFloat 6s ease-in-out infinite;
}
.hero-photo img { width: 100%; height: auto; display: block; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-card:nth-child(2) { border-top-color: var(--carb); }
.stat-card:nth-child(3) { border-top-color: var(--success); }
.stat-card:nth-child(4) { border-top-color: var(--gold); }

.stat-card h3 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.stat-card:nth-child(2) h3 { color: var(--carb); }
.stat-card:nth-child(3) h3 { color: var(--success-dark); }
.stat-card:nth-child(4) h3 { color: var(--gold-dark); }

.stat-card p { color: var(--text-secondary); font-weight: 500; font-size: 0.95rem; }

/* Philosophy */
.philosophy-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 44px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}
.philosophy-box h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 36px;
  color: var(--ink);
}
.philosophy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.phil-item { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phil-icon {
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--primary-light), var(--gold-light));
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: 8px;
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.phil-item h4 { font-size: 1.15rem; color: var(--text-primary); }
.phil-item p { color: var(--text-secondary); font-size: 0.95rem; }

/* ==========================================================================
   7. Meal Plan Section
   ========================================================================== */
.inline-select { width: 150px; }

.trimester-info-box {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--gold-light) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  margin-bottom: 32px;
  border-left: 6px solid var(--primary);
}
.trimester-info-box h3 { margin-bottom: 6px; font-size: 1.35rem; color: var(--ink); }
.trimester-info-box p { color: var(--text-secondary); font-weight: 500; }

.meal-plan-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.day-tabs { display: flex; flex-direction: column; gap: 8px; }

.day-tab-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.day-tab-btn:hover { color: var(--primary); background-color: var(--primary-light); }
.day-tab-btn.active {
  color: #FFFFFF;
  background-color: var(--primary);
  box-shadow: 0 6px 16px rgba(31, 78, 121, 0.25);
  border-color: var(--primary);
}

.meals-content-wrapper { display: flex; flex-direction: column; gap: 20px; }

/* Chủ đề của ngày */
.day-theme-label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.theme-eyebrow {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--carb);
}
.theme-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.55rem; color: var(--ink);
}

.meals-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.meal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease-out both;
}
.meal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.meal-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-light); padding-bottom: 10px;
}
.meal-name {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  color: var(--primary); background-color: var(--primary-light);
  padding: 4px 10px; border-radius: 20px;
}
.meal-cal { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }
.meal-food { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); min-height: 48px; }

.meal-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.meal-badge {
  font-size: 0.75rem; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; white-space: nowrap; color: #FFFFFF;
}
.meal-badge.carb { background-color: var(--carb); }
.meal-badge.protein { background-color: var(--primary); }

.meal-note {
  font-size: 0.9rem; color: var(--text-secondary);
  background-color: var(--success-light);
  padding: 12px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--success); margin-top: auto;
}

/* Day total bar */
.day-total-summary-bar {
  background-color: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.day-total-summary-bar .total-text { font-size: 1rem; color: var(--text-primary); margin-bottom: 10px; }
.day-total-summary-bar .total-text strong { color: var(--primary); }
.total-progress-track {
  height: 12px; background-color: var(--bg-soft);
  border-radius: 6px; overflow: hidden; border: 1px solid var(--border-light);
}
.total-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--carb) 0%, var(--primary) 100%);
  border-radius: 6px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mẹo đầu bếp của ngày */
.day-tip-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--gold-light);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.day-tip-icon { font-size: 1.6rem; line-height: 1; }
.day-tip-content { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6; }
.day-tip-content strong { color: var(--carb-dark); }

.nutrient-highlights-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 28px;
  box-shadow: var(--shadow);
}
.nutrient-highlights-box h3 { font-size: 1.15rem; margin-bottom: 16px; color: var(--ink); }
.highlight-pills { display: flex; flex-wrap: wrap; gap: 12px; }
.nutrient-pill {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.9rem; font-weight: 600;
  padding: 8px 16px; border-radius: 30px;
  border: 1px solid rgba(31, 78, 121, 0.15);
}

/* ==========================================================================
   7B. Cẩm nang trực quan (Visual Guide)
   ========================================================================== */
.guide-stack { display: flex; flex-direction: column; gap: 24px; }
.guide-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.guide-block {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
}

.block-head { margin-bottom: 10px; }
.block-head.center { text-align: center; }
.block-head h3 { font-size: 1.4rem; color: var(--ink); }
.block-sub { color: var(--text-secondary); margin-top: 4px; font-size: 0.98rem; }

/* Đĩa ăn hoàn hảo */
.plate-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: center;
  margin-top: 16px;
}
.plate-visual-wrap { display: flex; justify-content: center; }
.plate-photo {
  width: 260px; height: 260px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  box-shadow: 0 14px 32px rgba(34, 45, 58, 0.18), inset 0 0 0 6px #FFFFFF;
}
.plate-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plate-ring {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(110, 148, 102, 0.55);
  pointer-events: none;
}
.plate-visual {
  width: 240px; height: 240px; border-radius: 50%;
  background: conic-gradient(var(--success) 0 50%, var(--carb) 50% 75%, var(--primary) 75% 100%);
  position: relative;
  box-shadow: 0 12px 30px rgba(34, 45, 58, 0.16), inset 0 0 0 6px #FFFFFF;
}
.plate-visual::after {
  content: "";
  position: absolute; inset: 33%;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(34, 45, 58, 0.14);
}
.plate-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.plate-center strong { font-family: var(--font-display); color: var(--ink); font-size: 1.2rem; }
.plate-center small { color: var(--text-secondary); font-size: 0.72rem; }

.plate-legend { display: flex; flex-direction: column; gap: 18px; }
.plate-seg-item { display: flex; gap: 14px; align-items: flex-start; }
.seg-dot { width: 16px; height: 16px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.seg-veg .seg-dot { background: var(--success); }
.seg-carb .seg-dot { background: var(--carb); }
.seg-protein .seg-dot { background: var(--primary); }
.seg-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; flex-wrap: wrap; }
.seg-portion { font-family: var(--font-heading); font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.seg-body h4 { display: inline; font-size: 1rem; color: var(--text-primary); }
.plate-seg-item p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

/* Ma trận quy đổi */
#carbExchangeBlock { border-top: 4px solid var(--carb); }
#proteinExchangeBlock { border-top: 4px solid var(--primary); }

.ex-target {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800; font-size: 1.05rem;
  color: #FFFFFF; padding: 8px 22px; border-radius: 30px;
  margin-top: 8px;
}
.ex-target-carb { background: var(--carb); }
.ex-target-protein { background: var(--primary); }

.ex-items {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 10px; justify-content: center;
  margin: 22px 0;
}
.ex-item {
  flex: 1; min-width: 110px;
  background: var(--surface-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 12px 14px;
  text-align: center;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  transition: var(--transition);
}
.ex-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ex-thumb {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-icon { font-size: 2.2rem; }
.ex-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.ex-eq { display: flex; align-items: center; font-size: 1.4rem; font-weight: 800; color: var(--text-light); }

.ex-fact {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 0.9rem; line-height: 1.6;
}
.ex-fact-ic { font-size: 1.15rem; line-height: 1.4; }
.ex-fact-carb { background: var(--carb-light); color: var(--carb-dark); }
.ex-fact-protein { background: var(--primary-light); color: var(--primary-dark); }

/* Tủ thuốc tự nhiên - danh sách xanh */
.shelf-rows { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.shelf-row {
  display: flex; gap: 16px; align-items: center;
  background: var(--surface-warm);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: var(--transition);
}
.shelf-row:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.shelf-emoji {
  width: 68px; height: 68px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
  font-size: 2rem;
}
.shelf-emoji img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-info h4 { color: var(--ink); font-size: 1.05rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shelf-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--carb-dark); background: var(--carb-light); padding: 3px 10px; border-radius: 20px;
}
.shelf-info p { color: var(--text-secondary); font-size: 0.92rem; margin-top: 3px; }
.shelf-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--success-light);
  border: 1px solid rgba(110, 148, 102, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px; color: var(--success-dark);
  font-size: 0.9rem; line-height: 1.6;
}
.shelf-note-ic { font-size: 1.15rem; }

/* 3 Quy tắc vàng */
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rule-item {
  position: relative;
  background: var(--surface-warm);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: var(--transition);
}
.rule-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.rule-icon { width: 56px; height: 56px; margin: 0 auto 8px; color: var(--primary); }
.rule-icon svg { width: 100%; height: 100%; }
.rule-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--carb); line-height: 1; }
.rule-item h4 { color: var(--ink); font-size: 1.15rem; margin: 8px 0; }
.rule-item p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }

/* ==========================================================================
   8. Nutrition Calculator Section
   ========================================================================== */
.calculator-layout { display: grid; grid-template-columns: 420px 1fr; gap: 32px; align-items: start; }
.calc-form-container h3 { color: var(--ink); margin-bottom: 20px; }
.form-group-row { display: flex; gap: 16px; }
.form-group-row .form-group { flex: 1; }
.form-group { margin-bottom: 20px; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; display: block; }

.calc-results-container { min-height: 480px; }
.waiting-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  padding: 40px; text-align: center;
}
.waiting-icon { width: 60px; height: 60px; margin-bottom: 16px; stroke: var(--primary); opacity: 0.65; }
.waiting-state p { color: var(--text-secondary); font-weight: 500; }

.results-content { animation: sectionIn 0.4s ease-out; }
.summary-cards-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  box-shadow: var(--shadow);
}
.main-calorie-card { border-top: 6px solid var(--primary); }
.bmi-card { border-top: 6px solid var(--success); }
.card-label {
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase;
  color: var(--text-secondary); letter-spacing: 0.5px; margin-bottom: 8px; display: block;
}
.main-value { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.main-value .unit { font-size: 1.15rem; font-weight: 500; color: var(--text-secondary); font-family: var(--font-body); }
.main-value .bmi-cat {
  font-family: var(--font-body); font-size: 1rem; font-weight: 600; vertical-align: middle;
  background-color: var(--success-light); color: var(--success-dark);
  padding: 4px 10px; border-radius: 20px; margin-left: 8px;
}
.sub-detail { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

.macros-section { margin-bottom: 24px; }
.macros-section h3 { font-size: 1.25rem; margin-bottom: 6px; color: var(--ink); }
.macro-subtitle { color: var(--text-secondary); margin-bottom: 20px; font-size: 0.95rem; }
.macro-item { margin-bottom: 20px; }
.macro-meta { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.macro-name { font-weight: 600; font-size: 0.95rem; }
.macro-target { font-size: 0.95rem; color: var(--text-secondary); }
.macro-target strong { font-size: 1.15rem; color: var(--ink); }
.progress-bar-container {
  height: 10px; background-color: var(--bg-soft);
  border-radius: 20px; overflow: hidden; margin-bottom: 6px; border: 1px solid var(--border-light);
}
.progress-bar { height: 100%; border-radius: 20px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.carbs-bar { background-color: var(--carb); }
.protein-bar { background-color: var(--primary); }
.fat-bar { background-color: var(--gold); }
.macro-desc { font-size: 0.85rem; color: var(--text-light); }

.micros-section h3 { color: var(--ink); margin-bottom: 8px; }
.micros-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 16px; }
.micro-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  transition: var(--transition);
}
.micro-card:hover { box-shadow: var(--shadow); border-color: var(--primary-light); }
.micro-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-light); padding-bottom: 8px; }
.micro-name { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.micro-val { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.micro-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* ==========================================================================
   9. Foods Section
   ========================================================================== */
.food-tabs-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.food-switch-btn {
  background-color: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 1.05rem; font-weight: 700; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.food-switch-btn:hover { background-color: var(--bg-soft); }
.food-switch-btn.active#btnShowEat {
  background-color: var(--success); color: #FFFFFF; border-color: var(--success);
  box-shadow: 0 6px 20px rgba(110, 148, 102, 0.3);
}
.food-switch-btn.active#btnShowAvoid {
  background-color: var(--danger); color: #FFFFFF; border-color: var(--danger);
  box-shadow: 0 6px 20px rgba(217, 83, 79, 0.26);
}

.filter-bar { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 18px; border-radius: 30px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.filter-btn:hover { background-color: var(--primary-light); color: var(--primary); border-color: rgba(31, 78, 121, 0.25); }
.filter-btn.active {
  background-color: var(--primary); color: #FFFFFF; border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(31, 78, 121, 0.2);
}

.foods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.food-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  animation: fadeInUp 0.35s ease-out both;
  transition: var(--transition);
}
.food-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.food-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.food-card-header h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.food-badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.food-badge.eat { background-color: var(--success-light); color: var(--success-dark); border: 1px solid rgba(110, 148, 102, 0.3); }
.food-badge.avoid-high { background-color: var(--danger-light); color: var(--danger-dark); border: 1px solid rgba(217, 83, 79, 0.25); }
.food-badge.avoid-medium { background-color: var(--warning-light); color: var(--warning-dark); border: 1px solid rgba(232, 169, 60, 0.35); }
.food-detail-box { font-size: 0.9rem; color: var(--text-secondary); padding: 14px; border-radius: var(--radius-sm); line-height: 1.6; }
.food-detail-box strong { color: var(--text-primary); }
.food-detail-box.eat-detail { background-color: var(--success-light); border-left: 3px solid var(--success); }
.food-detail-box.avoid-detail-high { background-color: var(--danger-light); border-left: 3px solid var(--danger); }
.food-detail-box.avoid-detail-medium { background-color: var(--warning-light); border-left: 3px solid var(--warning); }
.food-recommend { font-size: 0.9rem; color: var(--text-primary); line-height: 1.5; }
.food-recommend strong { color: var(--success-dark); }

/* ==========================================================================
   10. Special Diets Section
   ========================================================================== */
.special-diets-container { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.diet-vertical-tabs { display: flex; flex-direction: column; gap: 10px; }
.diet-tab-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px; text-align: left;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm); line-height: 1.4;
}
.diet-tab-btn:hover { color: var(--primary); background-color: var(--primary-light); }
.diet-tab-btn.active {
  color: #FFFFFF; background-color: var(--primary-dark); border-color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(20, 55, 85, 0.28);
}

.diet-details-content { min-height: 400px; }
.diet-details-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem; color: var(--ink);
  margin-bottom: 12px; border-bottom: 2px solid var(--gold-light); padding-bottom: 10px;
}
.diet-intro { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 24px; font-style: italic; }
.diet-section-title { font-size: 1.1rem; font-weight: 700; color: var(--carb); margin-bottom: 12px; margin-top: 24px; }
.diet-principles-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.diet-principles-list li { position: relative; padding-left: 28px; font-size: 0.95rem; color: var(--text-primary); }
.diet-principles-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 800; font-size: 1.1rem; }
.diet-limit-box { background-color: var(--danger-light); border-left: 4px solid var(--danger); padding: 16px 20px; border-radius: var(--radius-sm); color: var(--danger-dark); font-size: 0.95rem; line-height: 1.6; }
.diet-sample-menu { background-color: var(--primary-light); border-left: 4px solid var(--primary); padding: 18px 22px; border-radius: var(--radius-sm); color: var(--primary-dark); font-size: 0.95rem; line-height: 1.6; }

/* ==========================================================================
   11. Tips Section
   ========================================================================== */
.tips-grid { display: flex; flex-direction: column; gap: 16px; }
.tips-cat-header {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  margin-top: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-light);
}
.tips-cat-header:first-child { margin-top: 0; }
.tips-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 8px; }
.tip-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: var(--transition);
  animation: fadeInUp 0.35s ease-out both;
}
.tip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.tip-header { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
.tip-icon {
  font-size: 1.9rem; width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary-light), var(--gold-light));
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tip-header h3 { font-size: 1.15rem; color: var(--ink); }
.tip-content { font-size: 0.95rem; color: var(--text-secondary); white-space: pre-line; line-height: 1.6; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.app-footer { background-color: var(--ink); color: #D7E2ED; padding: 44px 24px; margin-top: 60px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.footer-info h3 { font-family: var(--font-display); color: #FFFFFF; font-size: 1.5rem; margin-bottom: 12px; }
.footer-info p { font-size: 0.95rem; margin-bottom: 8px; }
.copyright { font-size: 0.85rem; opacity: 0.75; margin-top: 16px; }
.footer-disclaimer {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px; font-size: 0.85rem; line-height: 1.6;
  border-left: 4px solid var(--gold);
}
.footer-disclaimer strong { color: #FFFFFF; }

/* ==========================================================================
   13. Media Queries
   ========================================================================== */
@media (max-width: 992px) {
  .hero-banner { grid-template-columns: 1fr; padding: 44px 34px; }
  .hero-image { order: -1; }
  .hero-svg { max-width: 240px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .meal-plan-container { grid-template-columns: 1fr; }
  .day-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .day-tab-btn { white-space: nowrap; padding: 12px 18px; }
  .special-diets-container { grid-template-columns: 1fr; }
  .diet-vertical-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .diet-tab-btn { white-space: nowrap; padding: 12px 16px; }
  .plate-layout { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .main-content { padding: 32px 18px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-header h2 { font-size: 1.8rem; }
  .inline-select { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .philosophy-grid { grid-template-columns: 1fr; gap: 24px; }
  .meals-grid { grid-template-columns: 1fr; }
  .foods-grid { grid-template-columns: 1fr; }
  .micros-grid { grid-template-columns: 1fr; }
  .tips-cat-grid { grid-template-columns: 1fr; }
  .guide-grid-2 { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .footer-container { grid-template-columns: 1fr; gap: 30px; }

  .menu-toggle { display: flex; }
  .nav-menu {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background-color: var(--surface); flex-direction: column;
    padding: 16px 24px; box-shadow: 0 8px 16px rgba(34, 45, 58, 0.08);
    border-bottom: 1px solid var(--border); gap: 6px;
  }
  .nav-menu.open { display: flex; }
  .nav-link { width: 100%; padding: 12px 16px; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 2.3rem; }
  .hero-banner { padding: 36px 24px; }
  .select-btn-group { flex-direction: column; gap: 8px; }
  .summary-cards-row { grid-template-columns: 1fr; }
  .food-tabs-switch { grid-template-columns: 1fr; gap: 10px; }
  .ex-items { flex-direction: column; }
  .ex-eq { justify-content: center; }
}

/* Helpers */
.hidden { display: none !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success-dark) !important; }
.text-warning { color: var(--warning-dark) !important; }
.text-danger { color: var(--danger-dark) !important; }

/* ==========================================================================
   Banner ảnh Foods / Tips, ảnh chế độ ăn, và mục Cơ sở khoa học
   ========================================================================== */
.foods-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin: 0 0 22px;
  border: 4px solid #FFFFFF;
  box-shadow: 0 12px 30px rgba(34, 45, 58, 0.14);
}
.foods-banner img { display: block; width: 100%; height: 220px; object-fit: cover; }
.foods-banner .foods-banner-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 18px;
  font-size: 0.95rem; font-weight: 600; color: #FFFFFF;
  background: linear-gradient(0deg, rgba(33,56,78,0.86) 0%, rgba(33,56,78,0) 100%);
}
/* Tab "Cần tránh": phủ lớp cảnh báo để ảnh KHÔNG trông hấp dẫn */
.foods-banner.banner-avoid img { filter: grayscale(35%) contrast(0.95) brightness(0.9); }
.foods-banner.banner-avoid::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(184, 60, 60, 0.16); pointer-events: none;
}
.foods-banner .cap-avoid {
  background: linear-gradient(0deg, rgba(150,40,40,0.92) 0%, rgba(150,40,40,0) 100%);
}

.tips-banner {
  border-radius: 18px; overflow: hidden; margin: 0 0 24px;
  border: 4px solid #FFFFFF; box-shadow: 0 12px 30px rgba(34, 45, 58, 0.12);
}
.tips-banner img { display: block; width: 100%; height: 200px; object-fit: cover; }

.diet-header-img {
  border-radius: 14px; overflow: hidden; margin: -4px 0 18px;
  border: 3px solid #FFFFFF; box-shadow: 0 10px 24px rgba(34, 45, 58, 0.12);
}
.diet-header-img img { display: block; width: 100%; height: 200px; object-fit: cover; }

/* Cơ sở khoa học */
.science-intro {
  max-width: 820px; color: var(--text-secondary);
  font-size: 1.02rem; line-height: 1.7; margin-bottom: 26px;
}
.science-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px;
}
.science-card {
  background: var(--surface); border-radius: 16px; padding: 22px 22px 18px;
  border: 1px solid var(--border, #E7E1D4); border-top: 4px solid var(--gold);
  box-shadow: 0 8px 22px rgba(34, 45, 58, 0.07);
}
.science-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.science-card-head .science-ic { font-size: 1.5rem; line-height: 1; }
.science-card-head h3 { font-size: 1.1rem; color: var(--ink); margin: 0; }
.science-claim { color: var(--text-primary); line-height: 1.65; margin-bottom: 14px; font-size: 0.98rem; }
.science-refs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.science-refs li { position: relative; padding-left: 22px; font-size: 0.88rem; line-height: 1.55; }
.science-refs li::before { content: "🔗"; position: absolute; left: 0; top: 1px; font-size: 0.78rem; }
.science-refs a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; }
.science-refs a:hover { border-bottom-color: var(--primary); }
.science-note {
  margin-top: 26px; padding: 14px 18px; background: var(--gold-light);
  border-radius: 12px; color: var(--carb-dark); font-size: 0.92rem; line-height: 1.6;
}

@media (max-width: 480px) {
  .foods-banner img, .tips-banner img, .diet-header-img img { height: 160px; }
  .science-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   14. Design refresh v2 — nâng chuẩn top nutrition app (GIỮ NGUYÊN palette)
   Pattern: ZOE warm-editorial · Noom tiết chế · Cronometer data-viz ·
   shadow mềm nhiều lớp · type scale rõ · badge/nút bo pill.
   ========================================================================== */
:root {
  --shadow-sm: 0 1px 2px rgba(33,56,78,.05), 0 2px 8px rgba(33,56,78,.04);
  --shadow: 0 4px 14px rgba(33,56,78,.06), 0 16px 32px rgba(33,56,78,.05);
  --shadow-hover: 0 10px 24px rgba(33,56,78,.09), 0 28px 54px rgba(31,78,121,.11);
  --radius-xl: 26px;
  --radius-pill: 999px;
  --border-hair: 1px solid rgba(33,56,78,.08);
}

/* Nhịp thở rộng hơn */
.main-content { max-width: 1160px; padding-top: 52px; padding-bottom: 52px; }

/* Header tinh tế + gạch chân active terracotta */
.app-header { background: rgba(243,239,230,.82); border-bottom: var(--border-hair); }
.nav-link.active { position: relative; }
.nav-link.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; border-radius: 999px; background: var(--carb);
}

/* Nút bo tròn pill + bóng mềm */
.btn { border-radius: var(--radius-pill); padding: 14px 30px; }
.btn-primary { box-shadow: 0 6px 18px rgba(31,78,121,.20); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(31,78,121,.26); }
.filter-btn, .food-switch-btn { border-radius: var(--radius-pill); }

/* Section header: gạch accent gradient + h2 lớn, thoáng */
.section-header { margin-bottom: 40px; }
.section-header h2 { font-size: 2.5rem; letter-spacing: -0.02em; line-height: 1.12; }
.section-header h2::before {
  content: ""; display: block; width: 48px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--carb), var(--gold)); margin-bottom: 16px;
}
.section-header p { font-size: 1.12rem; line-height: 1.7; max-width: 680px; }

/* Hero: heading lớn hơn, ảnh sâu hơn */
.hero-banner { border-radius: var(--radius-xl); padding: 68px 60px; }
.hero-content { gap: 22px; }
.hero-content h1 { font-size: 3.4rem; letter-spacing: -0.025em; line-height: 1.08; }
.hero-content p { font-size: 1.18rem; line-height: 1.65; }
.hero-photo { border-width: 6px; box-shadow: 0 26px 54px rgba(31,78,121,.22); }
.badge-tag { background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); letter-spacing: 0.08em; }

/* Card đồng nhất: viền tóc + hover-lift mượt */
.card, .glass-card, .stat-card, .meal-card, .food-card, .tip-card, .guide-block,
.result-card, .micro-card, .nutrient-highlights-box, .science-card, .rule-item {
  border: var(--border-hair);
}
.stat-card, .meal-card, .food-card, .tip-card, .guide-block, .science-card, .rule-item {
  transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s;
}
.stat-card:hover, .meal-card:hover, .food-card:hover, .tip-card:hover,
.guide-block:hover, .science-card:hover, .rule-item:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-hover);
}

/* Food switch "Cần tránh": terracotta ấm thay vì đỏ bão hoà */
.food-switch-btn { border-width: 1.5px; }
.food-switch-btn.active#btnShowAvoid {
  background-color: var(--carb); border-color: var(--carb);
  box-shadow: 0 6px 18px rgba(184,90,51,.26);
}

/* Data-viz: thanh macro dày, bo tròn hẳn, nền dịu */
.progress-bar-container, .total-progress-track {
  height: 12px; border: none; border-radius: var(--radius-pill);
  background: rgba(33,56,78,.08);
}
.progress-bar, .total-progress-fill { border-radius: var(--radius-pill); }

/* Số liệu to hơn (Cronometer/MFP) */
.main-value { font-size: 2.85rem; font-variant-numeric: tabular-nums; }
.stat-card h3 { font-size: 2.7rem; letter-spacing: -0.02em; }

/* Vi chất: accent gold trên đầu card */
.micro-card { border-top: 3px solid var(--gold); }
.micro-val { font-size: 1.2rem; }

/* Footer: chữ kem ấm trên navy */
.app-footer { color: rgba(243,239,230,.74); }

/* Reveal nhẹ nhàng hơn */
.js-enabled .reveal { transform: translateY(16px); }

/* Responsive tinh chỉnh */
@media (max-width: 768px) {
  .section-header h2 { font-size: 2rem; }
  .hero-banner { padding: 48px 32px; }
}
@media (max-width: 480px) {
  .hero-content h1 { font-size: 2.4rem; }
  .hero-banner { padding: 40px 24px; }
  .main-content { padding-top: 36px; }
}

/* Vòng tròn phân bổ năng lượng (macro donut) — chất Cronometer/MFP */
.macro-donut-wrap {
  display: flex; align-items: center; gap: 28px;
  margin: 6px 0 24px; flex-wrap: wrap;
}
.macro-donut {
  width: 152px; height: 152px; border-radius: 50%;
  position: relative; flex-shrink: 0;
  box-shadow: 0 10px 26px rgba(33,56,78,.12);
  background: conic-gradient(var(--carb) 0 50%, var(--primary) 50% 75%, var(--gold) 75% 100%);
}
.macro-donut::before {
  content: ""; position: absolute; inset: 27px; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 2px 8px rgba(33,56,78,.10);
}
.macro-donut-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.macro-donut-center strong {
  font-family: var(--font-display); font-size: 1.55rem; color: var(--ink);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.macro-donut-center small { font-size: 0.7rem; color: var(--text-secondary); margin-top: 3px; }
.macro-donut-legend { display: flex; flex-direction: column; gap: 11px; min-width: 160px; }
.mdl-row { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--text-primary); }
.mdl-row strong { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.mdl-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.dot-carb { background: var(--carb); }
.dot-protein { background: var(--primary); }
.dot-fat { background: var(--gold); }

/* Thumbnail ảnh cho meal-card (thực đơn) */
.meal-thumb {
  margin: -24px -24px 8px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
.meal-thumb img { display: block; width: 100%; height: 148px; object-fit: cover; }

/* Tab Mẹo — banner ảnh theo nhóm (bento) */
.tips-category { margin-bottom: 28px; }
.tips-cat-banner {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 18px; border: 4px solid #FFFFFF; box-shadow: var(--shadow);
}
.tips-cat-banner img { display: block; width: 100%; height: 152px; object-fit: cover; }
.tips-cat-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 22px; font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700; color: #FFFFFF;
  background: linear-gradient(0deg, rgba(33,56,78,.82) 0%, rgba(33,56,78,0) 100%);
}
@media (max-width: 480px) {
  .meal-thumb img, .tips-cat-banner img { height: 130px; }
  .tips-cat-title { font-size: 1.2rem; }
}

/* ==========================================================================
   Công cụ tính cân nặng thai (EFW)
   ========================================================================== */
.efw-tool { margin: 0 0 40px; }
.efw-head { text-align: center; margin-bottom: 24px; }
.efw-head h2 { font-family: var(--font-display); font-size: 1.9rem; color: var(--ink); }
.efw-head p { color: var(--text-secondary); max-width: 640px; margin: 8px auto 0; font-size: 1rem; }
.efw-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
.efw-form { display: flex; flex-direction: column; gap: 6px; }
.efw-label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-top: 8px; }
.efw-row2 { display: flex; gap: 10px; }
.efw-row2 .form-control { flex: 1; }
.efw-form .btn { margin-top: 14px; }
.efw-btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); margin-top: 8px; }
.efw-btn-ghost:hover { background: var(--primary-light); }
.efw-output { min-height: 100px; }
.efw-result:not(:empty) { padding: 18px 20px; border-radius: var(--radius-md); }
.efw-result.state-normal { background: var(--success-light); color: var(--success-dark); }
.efw-result.state-warn { background: var(--warning-light); color: var(--warning-dark); }
.efw-result.state-danger { background: var(--danger-light); color: var(--danger-dark); }
.efw-res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
.efw-res-k { display: block; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
.efw-res-v { font-size: 1.12rem; font-weight: 700; }
.efw-res-v.efw-centile { font-family: var(--font-display); font-size: 1.45rem; }
.efw-std { font-family: var(--font-body); font-size: 0.68rem; font-weight: 600; background: rgba(33,56,78,.12); color: var(--ink); padding: 2px 8px; border-radius: 999px; margin-left: 4px; font-style: normal; }
.efw-res-verdict { margin-top: 12px; font-weight: 700; font-size: 1.05rem; }
.efw-advice-inner { background: var(--surface); border: var(--border-hair); border-radius: var(--radius-md); padding: 16px 18px; margin-top: 12px; box-shadow: var(--shadow-sm); }
.efw-advice-inner h4 { color: var(--carb-dark); font-size: 1.02rem; margin-bottom: 8px; }
.efw-advice-inner p { font-size: 0.92rem; line-height: 1.65; color: var(--text-secondary); }
.efw-cta { margin-top: 14px; width: 100%; }
.efw-chart-wrap { margin-top: 14px; background: var(--surface); border: var(--border-hair); border-radius: var(--radius-md); padding: 12px; }
#efwCompare { margin-top: 14px; }
.efw-cmp-title { font-size: 0.98rem; color: var(--ink); margin-bottom: 10px; }
.efw-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.efw-table th { background: var(--primary-light); color: var(--primary-dark); padding: 8px 6px; text-align: center; font-weight: 700; }
.efw-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--border-light); }
.efw-row-last td { background: var(--gold-light); font-weight: 700; color: var(--ink); }
.efw-up { color: var(--success-dark); font-weight: 700; }
.efw-down { color: var(--danger-dark); font-weight: 700; }
.efw-flat { color: var(--text-light); }
.efw-cmp-note { font-size: 0.8rem; color: var(--text-light); margin-top: 8px; }
.efw-disclaimer { margin-top: 18px; font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.efw-src-link { color: var(--primary); border-bottom: 1px solid transparent; }
.efw-src-link:hover { border-bottom-color: var(--primary); }
@media (max-width: 768px) { .efw-grid { grid-template-columns: 1fr; } .efw-head h2 { font-size: 1.6rem; } }

/* ==========================================================================
   15. Nav gọn 1 hàng + thẻ CTA công cụ cân nặng thai (trang chủ)
   ========================================================================== */
/* Nav: chữ ngắn + sát hơn; thu về hamburger sớm (≤1024px) để KHÔNG xuống 2 hàng */
.nav-menu { gap: 0; }
.nav-link { font-size: 0.85rem; padding: 8px 10px; }
@media (max-width: 1024px) {
  .menu-toggle { display: flex; }
  .nav-menu {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: var(--surface); flex-direction: column;
    padding: 16px 24px; box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border); gap: 6px;
  }
  .nav-menu.open { display: flex; }
  .nav-link { width: 100%; padding: 12px 16px; font-size: 0.95rem; }
  .nav-link.active::after { display: none; }
}

/* Thẻ CTA công cụ cân nặng thai */
.home-tool-cta {
  display: flex; align-items: center; gap: 20px;
  margin: 0 0 40px; padding: 24px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--gold-light) 100%);
  border: var(--border-hair); box-shadow: var(--shadow);
  color: var(--ink); transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s;
}
.home-tool-cta:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.htc-icon { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.htc-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.htc-body strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.htc-body span { color: var(--text-secondary); font-size: 0.98rem; line-height: 1.55; }
.htc-btn {
  flex-shrink: 0; white-space: nowrap;
  background: var(--primary); color: #FFFFFF;
  padding: 12px 24px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem; box-shadow: 0 6px 16px rgba(31,78,121,.22);
}
.home-tool-cta:hover .htc-btn { background: var(--primary-hover); }
@media (max-width: 640px) {
  .home-tool-cta { flex-direction: column; text-align: center; }
  .htc-btn { width: 100%; text-align: center; }
}
