/* ============================================================
    GOURMET RECIPE TEMPLATE - ULTRA PROFESSIONAL DESIGN
    Version: 5.0 - Premium Natural Food Theme
    ============================================================ */

/* ============ CSS Variables - Natural Food Palette ============ */
:root {
  /* Base Colors - Natural & Elegant */
  --bg: #fefdfb;
  --bg-gradient-start: #fefdfb;
  --bg-gradient-end: #f9f7f4;
  --text: #2d2925;
  --text-light: #5c524a;
  --text-lighter: #8b7e73;
  --card: #ffffff;
  --card-hover: #fffefa;
  
  /* Borders - Subtle & Natural */
  --border: #e9e4de;
  --border-strong: #ddd5cb;
  --border-light: rgba(221, 213, 203, 0.35);
  
  /* Primary Accents - Fresh Food Colors */
  --accent: #6b8e23;         /* Olive Green - Fresh Herbs */
  --accent2: #ff6347;         /* Tomato Red - Fresh Produce */
  --accent3: #ffa500;         /* Orange - Citrus */
  --accent-light: #98d048;     /* Light Green - Lettuce */
  --accent-dark: #556b2f;      /* Dark Olive */
  
  /* Secondary Colors - Complementary Food Tones */
  --secondary: #cd853f;       /* Peru - Bread/Grain */
  --secondary-light: #f4e4c1; /* Cream - Dairy */
  --tertiary: #8b4513;        /* Saddle Brown - Coffee */
  --tertiary-light: #deb887;  /* Burlywood - Pastry */
  
  /* Semantic Colors */
  --success: #7cb342;
  --warning: #ffa726;
  --danger: #ef5350;
  --info: #42a5f5;
  
  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;
  --gap-2xl: 32px;
  --gap-3xl: 48px;
  
  /* Border Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 999px;
  
  /* Shadows - Soft & Natural */
  --shadow-xs: 0 2px 8px rgba(45, 41, 37, 0.04);
  --shadow-sm: 0 4px 16px rgba(45, 41, 37, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 41, 37, 0.08);
  --shadow-lg: 0 12px 32px rgba(45, 41, 37, 0.1);
  --shadow-xl: 0 20px 48px rgba(45, 41, 37, 0.12);
  --shadow-2xl: 0 28px 64px rgba(45, 41, 37, 0.14);
  --shadow-inner: inset 0 2px 4px rgba(45, 41, 37, 0.06);
  --shadow-colored: 0 8px 32px rgba(107, 142, 35, 0.15);
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', sans-serif;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --line-height-tight: 1.3;
  --line-height-base: 1.6;
  --line-height-loose: 1.8;
}

/* Dark Mode - Elegant Dark Theme */
body.dark-mode {
  --bg: #1a1815;
  --bg-gradient-start: #1a1815;
  --bg-gradient-end: #24211d;
  --text: #f4f1ed;
  --text-light: #c8c2ba;
  --text-lighter: #9a9289;
  --card: #282520;
  --card-hover: #2f2b26;
  
  --border: #3d3833;
  --border-strong: #4a453e;
  --border-light: rgba(61, 56, 51, 0.35);
  
  /* Dark Mode Accents - Vibrant for contrast */
  --accent: #8fbc3f;         /* Bright Olive */
  --accent2: #ff7f66;         /* Coral */
  --accent3: #ffb347;         /* Light Orange */
  --accent-light: #a4d65e;
  --accent-dark: #6b8e23;
  
  --secondary: #daa520;       /* Goldenrod */
  --secondary-light: #4a453e;
  --tertiary: #cd853f;
  --tertiary-light: #8b7355;
  
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.4);
  --shadow-2xl: 0 28px 64px rgba(0, 0, 0, 0.45);
  --shadow-colored: 0 8px 32px rgba(143, 188, 63, 0.2);
}

/* ============ Base Styles ============ */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { 
  background: var(--bg) !important; 
  color: var(--text); 
  font-family: var(--font-base);
  line-height: var(--line-height-base);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

/* ============ Layout ============ */
.recipe-main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--gap-2xl) var(--gap-lg);
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  position: relative;
}

.recipe-main-wrapper::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(107, 142, 35, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.recipe-main-wrapper::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 99, 71, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 100%;
  background: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--gap-2xl);
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--accent) 0%, 
    var(--accent2) 25%, 
    var(--accent3) 50%, 
    var(--secondary) 75%, 
    var(--accent) 100%);
  background-size: 200% 100%;
  animation: gradientSlide 8s linear infinite;
}

@keyframes gradientSlide {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ============ Typography ============ */
.page-title {
  margin: 0 0 var(--gap-2xl);
  font-size: clamp(2.2em, 5vw, 3.5em);
  color: var(--text);
  font-weight: 800;
  text-align: center;
  line-height: var(--line-height-tight);
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: var(--gap-xl);
  font-family: var(--font-display);
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: var(--radius-full);
}

/* ============ Hero Image - Professional ============ */
.hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin-bottom: var(--gap-2xl);
  position: relative;
  background: var(--card);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero:hover::after {
  opacity: 1;
}

.hero img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slower);
}

.hero:hover img {
  transform: scale(1.05);
}

/* ============ Buttons - Ultra Professional ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.3px;
  font-family: var(--font-base);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.btn:hover::before {
  opacity: 0.08;
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-colored);
}

.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 12px 40px rgba(107, 142, 35, 0.25);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}

/* ============ Action Bar - Clean Design ============ */
.hero-actions,
.action-bar {
  display: flex;
  gap: var(--gap-md);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: var(--gap-2xl) 0;
  padding: var(--gap-xl);
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.03) 0%, rgba(255, 99, 71, 0.02) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

/* ============ Info Chips - Modern ============ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-md);
  margin: var(--gap-xl) 0;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.05) 0%, var(--card) 100%);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 20px;
  background: var(--accent2);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  font-size: 1.1rem;
}

/* ============ Cards - Premium Design ============ */
.card,
.section .box {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-top: var(--gap-2xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-h,
.section .title {
  text-align: center;
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.04) 0%, rgba(255, 99, 71, 0.02) 100%);
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--gap-xl);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.3px;
  position: relative;
  font-family: var(--font-display);
}

.card-h::before,
.section .title::before {
  content: '';
  position: absolute;
  bottom: -1px; /* Aligns with the border */
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: var(--radius-full);
}

.card-b,
.section .box {
  padding: var(--gap-2xl);
}

/* ============ Rating System - Professional ============ */
.info {
  margin: var(--gap-2xl) 0;
  padding: var(--gap-2xl);
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.02) 0%, transparent 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
}

.stars {
  display: inline-flex;
  gap: 8px;
  cursor: pointer;
}

.star {
  font-size: 32px;
  line-height: 1;
  transition: all var(--transition-fast);
  user-select: none;
  color: #ddd;
}

body.dark-mode .star {
  color: var(--border-strong);
}

.star.active {
  color: var(--accent3);
}

.star:hover {
  transform: scale(1.15);
}

.rcount {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
}

.rating-breakdown {
  width: 100%;
  max-width: 400px;
  margin-top: var(--gap-xl);
}

.rating-breakdown .rb-row {
  display: grid;
  grid-template-columns: 40px 1fr 60px;
  align-items: center;
  gap: var(--gap-md);
  margin: var(--gap-sm) 0;
}

.rating-breakdown .rb-label {
  text-align: right;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
}

.rating-breakdown .rb-bar {
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 8px;
  position: relative;
}

.rating-breakdown .rb-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent3), var(--accent2));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-breakdown .rb-n {
  text-align: left;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ============ Nutrition Facts - Ultra Professional ============ */
/* This design uses .nutri.cards-style as requested */
.nutri-serving-size {
  text-align:center; 
  font-size: 1.1rem; 
  margin-bottom: var(--gap-lg); 
  color: var(--text-light);
}

.nutri-note {
  margin-top: var(--gap-xl); 
  font-size: 0.9rem; 
  color: var(--text-light); 
  text-align: center; 
  line-height: 1.6;
}

.nutri.cards-style .list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap-lg);
  padding: 0; /* No padding needed if .box handles it */
}

.nutri.cards-style .row {
  background: linear-gradient(135deg, var(--card) 0%, rgba(107, 142, 35, 0.02) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.nutri.cards-style .row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.nutri.cards-style .row:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
  background: var(--card);
}

.nutri.cards-style .row:hover::before {
  transform: scaleX(1);
}

.nutri.cards-style .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-lighter);
  margin-bottom: var(--gap-sm);
  font-weight: 600;
}

.nutri.cards-style .val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.nutri.cards-style .percent {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: var(--gap-xs);
}

/* ============ Ingredients & Tools - Professional ============ */
.ing-photo {
  margin-bottom: var(--gap-2xl); /* Changed from margin */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-slow);
}

.ing-photo:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.ing-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.ing-list,
.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ing-item,
.tool-item {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  padding: var(--gap-lg);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  position: relative;
}

.ing-item:hover,
.tool-item:hover {
  background: linear-gradient(90deg, rgba(107, 142, 35, 0.03) 0%, transparent 100%);
  padding-left: calc(var(--gap-lg) + 8px);
  margin-left: -8px; /* Smooth hover effect */
  border-radius: var(--radius-md);
}

.ing-item:last-child,
.tool-item:last-child {
  border-bottom: none;
}

/* Custom Checkbox Design */
.ing-item input[type="checkbox"],
.tool-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.ing-item input[type="checkbox"]:hover,
.tool-item input[type="checkbox"]:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(107, 142, 35, 0.1);
}

.ing-item input[type="checkbox"]:checked,
.tool-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.ing-item input[type="checkbox"]:checked::after,
.tool-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: 700;
}

.ing-item label,
.tool-item label {
  flex: 1;
  color: var(--text);
  cursor: pointer;
  line-height: var(--line-height-base);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.ing-item input:checked + label.ing-line,
.tool-item input:checked + label.tool-line {
  text-decoration: line-through;
  opacity: 0.6;
  color: var(--text-lighter);
}

.group-title {
  font-weight: 700;
  color: var(--accent);
  margin: var(--gap-2xl) 0 var(--gap-lg);
  padding-bottom: var(--gap-sm);
  border-bottom: 2px solid var(--accent-light);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============ Steps - Clean Professional ============ */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step-counter;
}

li.step-group-title {
  list-style-type: none; /* Ensure group titles don't get step numbers */
  margin: var(--gap-xl) 0;
}
li.step-group-title .group-title {
  margin: 0; /* Reset margin for group title inside list */
}

.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl);
  margin: var(--gap-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  transition: all var(--transition-base);
}

.step:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(4px);
  border-color: var(--accent-light);
}

.step-content {
  position: relative;
  padding-left: 60px;
  min-height: 48px;
  display: flex; /* Added for alignment */
  align-items: center; /* Added for alignment */
}

.step .num {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-base);
}

.step:hover .num {
  background: var(--accent-dark);
}

.step .txt {
  flex: 1;
  line-height: var(--line-height-loose);
  font-size: 1rem;
  color: var(--text);
}

.step .step-timer-btn {
  align-self: flex-start;
  margin-top: 0; /* Changed from var(--gap-md) */
  margin-left: 60px; /* Aligns with text */
}

/* ============ Categories & Tags - Modern ============ */
.categories,
.post-tags {
  margin: var(--gap-2xl) 0;
  padding: var(--gap-xl);
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.02) 0%, transparent 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.categories::before {
  content: 'Categories';
  display: block;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: var(--gap-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
}

.post-tags .label {
  display: inline-block;
  font-weight: 600;
  color: var(--text-light);
  margin-right: var(--gap-md);
  margin-bottom: var(--gap-md);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
}

.cat-chip,
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  margin: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.cat-chip:hover,
.tag-chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============ Servings Scaler - Professional ============ */
.servings.scaler-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-2xl); /* Removed top margin */
  padding: var(--gap-xl);
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.02) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.servings-label {
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.scaler-btns {
  display: flex;
  gap: var(--gap-xs);
  background: var(--border-light);
  padding: 4px;
  border-radius: var(--radius-md);
}

.scale-btn {
  min-width: 60px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  font-weight: 600;
  color: var(--text-light);
}

.scale-btn.current {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ============ Video Section ============ */
.video-section {
  margin: var(--gap-2xl) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--text);
}

.video-section iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

/* ============ Description ============ */
.desc {
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.03) 0%, transparent 100%);
  border-left: 4px solid var(--accent);
  padding: var(--gap-xl);
  margin: var(--gap-2xl) 0;
  color: var(--text);
  border-radius: var(--radius-sm);
  line-height: var(--line-height-loose);
  font-size: 1.05rem;
}

.desc p {
  margin-bottom: 1em;
}

.desc p:last-child {
  margin-bottom: 0;
}

/* ============ Toast Notifications ============ */
.toast {
  position: fixed;
  bottom: var(--gap-2xl);
  right: var(--gap-2xl);
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--gap-lg) var(--gap-xl);
  box-shadow: var(--shadow-2xl);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  max-width: 400px;
  font-weight: 600;
  font-size: 0.95rem;
}

body.dark-mode .toast {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent-dark);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Modal Styles ============ */
.timer-modal,
.shopping-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: var(--gap-xl);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.timer-modal.active,
.shopping-modal.active {
  display: flex;
}

.timer-content,
.shopping-content {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-xl);
  padding: var(--gap-2xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  border-top: 4px solid var(--accent);
  animation: modalSlideUp 0.3s ease;
}

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

.timer-content h3,
.shopping-header h3 {
  text-align: center;
  margin: 0 0 var(--gap-xl);
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.shopping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--border);
}

.shopping-list {
  list-style: none;
  margin: var(--gap-xl) 0;
  padding: 0;
  max-height: 40vh;
  overflow-y: auto;
}

.shopping-list li {
  padding: var(--gap-md) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 1rem;
}

.shopping-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
  margin-top: var(--gap-xl);
}

/* Timer Specific */
.timer-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  margin: var(--gap-xl) 0;
}
.timer-input input {
  width: 80px;
  padding: var(--gap-sm);
  font-size: 1.2rem;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.timer-display {
  font-size: 4rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
  margin-bottom: var(--gap-xl);
  font-family: var(--font-display);
}
.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
}
.timer-controls .btn-accent {
  grid-column: 1 / -1; /* Start button spans full width */
}
.timer-controls .timer-close {
  grid-column: 1 / -1; /* Close button spans full width */
  background: var(--card);
  color: var(--text-light);
  border-color: var(--border);
}
.timer-controls .timer-close:hover {
  background: var(--bg-gradient-end);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ============ Cooking Mode Modal ============ */
.cooking-mode {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.85); /* خلفية داكنة شفافة فوق صفحة الوصفة */
  z-index: 9999;
  overflow-y: auto;
  padding: var(--gap-xl);
  backdrop-filter: blur(8px);
  /* ترتيب المحتوى عموديًا (الهيدر فوق، والمحتوى تحته) */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.cooking-mode.active {
  display: flex;
}

/* يمكنك استعمال هذه الكلاسات في الـ HTML إن كانت موجودة لديك */
.cooking-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap-md);
  padding: var(--gap-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #0e140e;
  position: sticky;
  top: 10px;
  z-index: 10;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
/* الكارد التي تحتوي على الخطوات داخل المودال */
.cooking-mode .container {
  max-width: 960px;
  width: 100%;
  margin-top: var(--gap-xl);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.cooking-mode-title {
  font-size: 1.6em;
  font-weight: 800;
  color: #0e140e;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cooking-mode-actions {
  display: flex;
  gap: var(--gap-sm);
}

.cooking-mode-body {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  max-width: 960px;
  width: 100%;
  margin-top: var(--gap-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cooking-mode-content {
  padding: var(--gap-2xl);
}

.cooking-mode-nav {
  display: flex;
  gap: var(--gap-md);
  justify-content: center;
  margin: var(--gap-xl) 0;
  position: sticky;
  bottom: 20px;
  z-index: 10;
}

.cooking-mode-nav .btn {
  min-width: 140px;
  box-shadow: var(--shadow-xl);
}

/* ============ Related Recipes ============ */
.related .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap-xl);
}

.rel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.rel-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--accent-light);
}

.rel-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  transition: transform var(--transition-slow);
}

.rel-card:hover .rel-thumb {
  transform: scale(1.05);
}

.rel-body {
  padding: var(--gap-lg);
}

.rel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: var(--line-height-base);
}

.rel-title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.rel-title a:hover {
  color: var(--accent);
}

/* ============ Keyword Chips ============ */
.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  margin: var(--gap-xl) 0;
  justify-content: center;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--text-light);
  transition: all var(--transition-fast);
}

.kw-chip::before {
  content: '#';
  margin-right: 4px;
  color: var(--accent);
  font-weight: 700;
}

.kw-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Print Styles ============ */
@media print {
  body * {
    visibility: hidden;
  }
  
  .recipe-main-wrapper {
    display: block !important;
  }
  
  #print-root,
  #print-root *,
  .page-title,
  .page-title * {
    visibility: visible !important;
  }
  
  #print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0 10mm;
  }
  
  .no-print,
  .adsbygoogle,
  .ad-container,
  .hero,
  .desc,
  .video-section,
  .comments-area,
  .related,
  .hero-actions,
  .action-bar,
  .chips-top,
  .rating,
  .info,
  .btn,
  .ing-photo,
  .variations_photo,
  .categories,
  .post-tags,
  .kw-chips,
  #nutrition-section, /* إخفاء القيم الغذائية */
  .step-timer-btn {
    display: none !important;
  }
  
  .container {
    padding: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .card,
  .section .box {
    box-shadow: none !important;
    border-color: #333 !important;
    page-break-inside: avoid;
    margin-top: 20px;
    padding: 0 !important; /* إزالة الحشو الداخلي */
  }

  /* إعدادات الطباعة للصفحة الواحدة */
  .page-title {
    font-size: 20pt !important;
    color: #000 !important;
    margin: 8mm 0 5mm !important;
    text-align: left !important;
    padding-bottom: 5mm !important;
  }
  .page-title::after {
    display: none;
  }
  
  .card-h,
  .section .title {
    font-size: 14pt !important;
    padding: 10px 0 !important;
    background: transparent !important;
    color: #000 !important;
    border-bottom: 2px solid #000 !important;
    text-align: left !important;
    border-radius: 0 !important;
  }
  .card-h::before,
  .section .title::before {
    display: none;
  }

  .ing-list, .tool-list, .steps {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .ing-item, .tool-item {
    padding: 4px 0 !important;
    border: none !important;
  }
  .ing-item input, .tool-item input {
    display: none; /* إخفاء مربعات الاختيار */
  }
  .ing-item label, .tool-item label {
    font-size: 10pt !important;
  }

  .step {
    page-break-inside: avoid;
    padding: 8px 0 !important;
    margin: 8px 0;
    border: none !important;
    box-shadow: none !important;
  }
  .step-content {
    padding-left: 0 !important; /* إزالة المسافة البادئة للرقم */
    align-items: flex-start !important;
  }
  .step .num {
     /* إظهار الرقم بجانب النص */
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    color: #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    font-size: 10pt !important;
    margin-right: 8px;
  }
  .step .num::after {
    content: "."; /* إضافة نقطة بعد الرقم */
  }
  .step .txt {
    font-size: 10pt !important;
  }
  
  @page {
    margin: 10mm;
    size: A4;
  }
}

/* ============ Responsive Design ============ */
@media (max-width: 768px) {
  :root {
    --gap-2xl: 24px;
    --gap-3xl: 32px;
  }
  
  .recipe-main-wrapper {
    padding: var(--gap-xl) var(--gap-md);
  }
  
  .container {
    padding: var(--gap-xl);
    border-radius: var(--radius-xl);
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .nutri.cards-style .list {
    grid-template-columns: repeat(2, 1fr);
  }

  .step .step-timer-btn {
    width: 100%;
    margin-left: 0; /* Full width on mobile */
  }
  
  .related .cards {
    grid-template-columns: 1fr;
  }
  
  .hero-actions, .action-bar {
    padding: var(--gap-lg);
  }
  .btn {
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--gap-lg);
  }
  .page-title {
    font-size: 1.75rem;
  }
  
  .nutri.cards-style .list {
    grid-template-columns: 1fr;
  }
  
  .step-content {
    padding-left: 55px; /* إعادة المسافة للهاتف */
    min-height: 40px;
  }
  
  .step .num {
    position: absolute !important; /* إعادة الرقم لمكانه في الهاتف */
    display: inline-flex !important;
    width: 40px !important;
    height: 40px !important;
    background: var(--accent) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    font-size: 1rem !important;
    margin-right: 0 !important;
  }
  .step .num::after {
    content: none !important;
  }
  
  .chip {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  .star {
    font-size: 28px;
  }

  .shopping-actions {
    grid-template-columns: 1fr;
  }
  .timer-controls {
    grid-template-columns: 1fr;
  }
}

/* ============ Accessibility ============ */
.btn:focus-visible,
input:focus-visible,
.star:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Selection Color ============ */
::selection {
  background: var(--accent);
  color: white;
}

::-moz-selection {
  background: var(--accent);
  color: white;
}

/* ============ Scrollbar ============ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--border);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}