/* ─── Variables ───────────────────────────────────────────────────────── */
:root {
  --green-900: #1a4731;
  --green-700: #2c7a4b;
  --green-500: #4a9e6b;
  --green-200: #b7dfc8;
  --green-50:  #eef7f2;
  --amber:     #f5a623;
  --amber-lt:  #ffd166;
  --bg:        #f3f6f3;
  --card:      #ffffff;
  --text:      #1a2332;
  --muted:     #6b7a8d;
  --border:    #dde5dd;
  --radius:    18px;
  --radius-sm: 10px;
  --shadow:    0 4px 28px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.13);
  --transition: 0.22s ease;

  /* Meal accent colors */
  --c-desayuno:  #ff9f43;
  --c-almuerzo:  #54a0ff;
  --c-comida:    #9c59b6;
  --c-merienda:  #ff6b81;
  --c-cena:      #2c3e50;
}

/* ─── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(145deg, #1a4731 0%, #2c7a4b 45%, #4a9e6b 100%);
  padding: 72px 24px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-circles .circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  background: white;
}
.hero-bg-circles .c1 { width: 350px; height: 350px; top: -120px; left: -100px; }
.hero-bg-circles .c2 { width: 240px; height: 240px; top: 20px; right: -60px; }
.hero-bg-circles .c3 { width: 180px; height: 180px; bottom: -80px; left: 40%; }

.hero-content { position: relative; z-index: 1; }

.hero-icon {
  font-size: 3.8rem;
  display: block;
  margin-bottom: 18px;
  animation: float 3.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  color: rgba(255,255,255,0.82);
  max-width: 520px;
  margin: 0 auto;
}

.hero-info-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.hero-info-link:hover { opacity: 1; }

.hero-photo-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.hero-photo-btn:hover { background: rgba(255,255,255,0.32); }

.hero-photo-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 10px auto 0;
}

.hero-photo-change {
  background: none;
  border: none;
  padding: 4px 2px;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}

.hero-photo-change:hover { color: #fff; }

.hero-photo-remove {
  background: none;
  border: none;
  padding: 4px 2px;
  color: #ff8177;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}

.hero-photo-remove:hover { color: #ffa39a; }

/* ─── Hero: modo foto personalizada (deja el centro despejado) ─────────── */
.hero--photo { min-height: 320px; }

.hero--photo .hero-icon,
.hero--photo .hero-subtitle {
  display: none;
}

.hero--photo .hero-content {
  position: absolute;
  inset: 0;
}

.hero--photo .hero-title {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  font-size: 1.4rem;
  margin-bottom: 0;
  text-align: center;
}

.hero--photo .hero-info-link {
  position: absolute;
  top: 66px;
  right: 18px;
  margin-top: 0;
}

.hero--photo .hero-photo-controls {
  position: absolute;
  bottom: 16px;
  right: 18px;
  margin: 0;
}

/* ─── Container ───────────────────────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 44px 20px 80px;
}

/* ─── Form card ───────────────────────────────────────────────────────── */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 44px 48px;
  box-shadow: var(--shadow);
}

/* ─── Info page (Cómo funciona) ───────────────────────────────────────── */
.info-container { max-width: 760px; }

.info-card { padding: 40px; }

.info-section { margin-bottom: 36px; }
.info-section:last-of-type { margin-bottom: 28px; }

.info-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--green-900);
  margin-bottom: 12px;
}

.info-section p { margin-bottom: 10px; color: var(--text); }
.info-section p:last-child { margin-bottom: 0; }

.info-steps { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.info-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.info-step-badge {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-step p { margin: 0; padding-top: 4px; }

.info-back-link {
  display: inline-block;
  text-decoration: none;
  margin-top: 24px;
}

.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  color: var(--green-900);
  text-align: center;
  margin-bottom: 36px;
}

.form-group { margin-bottom: 34px; }

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.label-icon { font-size: 1.15rem; }

.badge-optional {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  background: #f0f4f0;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

/* ─── Stepper ─────────────────────────────────────────────────────────── */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  background: var(--card);
}

.stepper-btn {
  width: 50px;
  height: 50px;
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--green-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.stepper-btn:hover { background: var(--green-700); color: #fff; }
.stepper-btn:active { background: var(--green-900); color: #fff; }

.stepper-value {
  min-width: 64px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--green-700);
  user-select: none;
}

/* ─── Chips ───────────────────────────────────────────────────────────── */
.chips-group { display: flex; flex-wrap: wrap; gap: 12px; }

.chip { cursor: pointer; }
.chip input { display: none; }

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.chip span:hover { border-color: var(--green-500); color: var(--green-700); }

.chip input:checked + span {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(44,122,75,0.35);
}

/* ─── Alergias: añadir personalizada ─────────────────────────────────── */
.alergia-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.alergia-add-row .extra-input { flex: 1; width: auto; min-width: 200px; }

.btn-add-chip {
  padding: 11px 20px;
  border: 2px solid var(--green-700);
  border-radius: var(--radius-sm);
  background: var(--green-700);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-add-chip:hover { background: var(--green-800, #1f5a37); }

.btn-toggle-more {
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
  margin-top: 4px;
  border: none;
  background: none;
  color: var(--green-700);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-toggle-more:hover { color: var(--green-900); }

.chip-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px 11px 22px;
  border: 2px solid var(--green-700);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: var(--green-700);
  box-shadow: 0 4px 14px rgba(44,122,75,0.35);
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.85;
  transition: all var(--transition);
}

.chip-remove:hover { opacity: 1; background: rgba(255,255,255,0.4); }

/* ─── Option cards ────────────────────────────────────────────────────── */
.option-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cuisine-grid  { grid-template-columns: repeat(4, 1fr); }
.profile-grid  { grid-template-columns: repeat(5, 1fr); }

.option-card { cursor: pointer; }
.option-card input { display: none; }

.option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.option-inner:hover {
  border-color: var(--green-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(74,158,107,0.15);
}

.option-card input:checked + .option-inner {
  border-color: var(--green-700);
  background: linear-gradient(135deg, #e8f5ee 0%, #d0eadb 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44,122,75,0.22);
}

.opt-icon { font-size: 1.9rem; }
.opt-name { font-weight: 700; font-size: 0.96rem; color: var(--text); }
.opt-desc { font-size: 0.78rem; color: var(--muted); }

/* ─── Field errors ────────────────────────────────────────────────────── */
.field-error {
  color: #e74c3c;
  font-size: 0.83rem;
  margin-top: 8px;
  font-weight: 500;
}

/* ─── Textarea ────────────────────────────────────────────────────────── */
.textarea-field {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  resize: vertical;
  transition: border-color var(--transition);
  outline: none;
  line-height: 1.55;
}

.textarea-field:focus { border-color: var(--green-500); }
.textarea-field::placeholder { color: #a0aab4; }

/* ─── Primary button ──────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.08rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 6px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 22px rgba(44,122,75,0.42);
  font-family: inherit;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(44,122,75,0.52); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ─── Loading ─────────────────────────────────────────────────────────── */
.loading-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 64px 40px;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

/* Spinner ring */
.loading-ring {
  display: inline-block;
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 28px;
}

.loading-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 56px;
  height: 56px;
  margin: 7px;
  border: 5px solid transparent;
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-ring div:nth-child(1) { animation-delay: -0.45s; }
.loading-ring div:nth-child(2) { animation-delay: -0.3s; border-top-color: var(--green-500); }
.loading-ring div:nth-child(3) { animation-delay: -0.15s; border-top-color: var(--green-200); }
.loading-ring div:nth-child(4) { animation-delay: 0s; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-card h3 { font-size: 1.25rem; color: var(--green-900); margin-bottom: 8px; }
.loading-card > p { color: var(--muted); font-size: 0.92rem; margin-bottom: 28px; }

.loading-tip-box {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: 50px;
  padding: 12px 22px;
  font-size: 0.9rem;
  color: var(--green-700);
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}

/* ─── Result header ───────────────────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.result-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-tag {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-back {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-700);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-back:hover {
  background: var(--green-50);
  border-color: var(--green-500);
  transform: translateY(-1px);
}

/* ─── Regenerate card ─────────────────────────────────────────────────── */
.regen-card {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 32px;
  color: #fff;
}

.regen-top { margin-bottom: 18px; }
.regen-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.regen-card p { opacity: 0.8; font-size: 0.9rem; }

.regen-bottom {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.textarea-regen {
  flex: 1;
  padding: 13px 17px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: #fff;
  background: rgba(255,255,255,0.14);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: background var(--transition);
}

.textarea-regen::placeholder { color: rgba(255,255,255,0.55); }
.textarea-regen:focus { background: rgba(255,255,255,0.22); }

.btn-regen {
  padding: 13px 24px;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.38);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-regen:hover { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.7); }
.btn-regen:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Menu grid ───────────────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

/* ─── Day card ────────────────────────────────────────────────────────── */
.day-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.5s ease both;
}

.day-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

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

/* Day header gradients */
.day-card:nth-child(1) .day-header { background: linear-gradient(135deg, #667eea, #764ba2); }
.day-card:nth-child(2) .day-header { background: linear-gradient(135deg, #f093fb, #f5576c); }
.day-card:nth-child(3) .day-header { background: linear-gradient(135deg, #0099f7, #00c6fb); }
.day-card:nth-child(4) .day-header { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.day-card:nth-child(5) .day-header { background: linear-gradient(135deg, #fa709a, #fee140); }
.day-card:nth-child(6) .day-header { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.day-card:nth-child(7) .day-header { background: linear-gradient(135deg, #fd7442, #fecc72); }

.day-header {
  padding: 16px 22px;
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.day-meals { padding: 14px 16px; }

/* ─── Meal item ───────────────────────────────────────────────────────── */
.meal-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  transition: background var(--transition);
  cursor: pointer;
}

.meal-item:last-child { margin-bottom: 0; }
.meal-item:hover { background: var(--green-50); }

.meal-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Meal badge backgrounds */
.meal-desayuno  .meal-badge { background: rgba(255,159, 67,0.15); }
.meal-almuerzo  .meal-badge { background: rgba( 84,160,255,0.15); }
.meal-comida    .meal-badge { background: rgba(156, 89,182,0.15); }
.meal-merienda  .meal-badge { background: rgba(255,107,129,0.15); }
.meal-cena      .meal-badge { background: rgba( 44, 62, 80,0.10); }

.meal-body { flex: 1; min-width: 0; }

.meal-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 3px;
}

.meal-desayuno  .meal-label { color: var(--c-desayuno); }
.meal-almuerzo  .meal-label { color: var(--c-almuerzo); }
.meal-comida    .meal-label { color: var(--c-comida); }
.meal-merienda  .meal-label { color: var(--c-merienda); }
.meal-cena      .meal-label { color: var(--c-cena); }

.meal-desc {
  font-size: 0.87rem;
  color: var(--text);
  line-height: 1.45;
}

/* ─── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  z-index: 9999;
  max-width: 340px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}

.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.error   { background: #e74c3c; }
.toast.success { background: var(--green-700); }
.toast.info    { background: #2980b9; }

/* ─── Helpers ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Health notice (near results) ───────────────────────────────────── */
.health-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fdf6e3;
  border: 1px solid #f5e0a0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.health-notice-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.health-notice p {
  font-size: 0.82rem;
  color: #7a5c00;
  line-height: 1.55;
}

/* ─── Footer ──────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px 32px 28px;
  color: var(--muted);
  background: var(--card);
  border-top: 1px solid var(--border);
}

.footer-main {
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--muted);
}

.footer-disclaimer {
  font-size: 0.76rem;
  color: #a0aab4;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

.btn-share {
  display: block;
  margin: 18px auto 0;
  background: #fdf6e3;
  border: 2px solid var(--amber);
  border-radius: 50px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a6d1a;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-share:hover { background: var(--amber-lt); border-color: var(--amber); color: #6b5314; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cuisine-grid  { grid-template-columns: repeat(2, 1fr); }
  .profile-grid  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .form-card { padding: 28px 22px; }

  .regen-bottom { flex-direction: column; }
  .btn-regen { width: 100%; text-align: center; }

  .result-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .option-cards { grid-template-columns: 1fr; }
  .cuisine-grid  { grid-template-columns: 1fr 1fr; }
  .profile-grid  { grid-template-columns: 1fr 1fr; }
  .menu-grid     { grid-template-columns: 1fr; }
}

/* ─── Chip "sin restricciones" variant ───────────────────────────────────── */
.chip-all input:checked + span {
  background: linear-gradient(135deg, #2980b9, #54a0ff);
  border-color: #2980b9;
  box-shadow: 0 4px 14px rgba(41,128,185,0.35);
}

/* ─── Meal item: clickable arrow ──────────────────────────────────────────── */
.meal-arrow {
  margin-left: auto;
  color: var(--border);
  font-size: 1.15rem;
  flex-shrink: 0;
  align-self: center;
  transition: all var(--transition);
  line-height: 1;
}

.meal-item:hover .meal-arrow {
  color: var(--green-500);
  transform: translateX(4px);
}

/* ─── Click hint ──────────────────────────────────────────────────────────── */
.click-hint {
  font-size: 0.88rem;
  color: var(--green-900);
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid var(--green-200);
  border-radius: 50px;
  padding: 11px 24px;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ─── Modal overlay ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,15,0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}

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

.modal {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  animation: modalIn 0.32s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition);
  font-family: inherit;
}

.modal-close:hover { background: rgba(255,255,255,0.4); }

.modal-header {
  padding: 28px 28px 22px;
  color: #fff;
}

.modal-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.modal-icon { font-size: 2.1rem; line-height: 1; }

.modal-meal-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.78;
  margin-bottom: 3px;
}

.modal-day-label {
  font-size: 0.88rem;
  opacity: 0.88;
  font-weight: 500;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.modal-body { padding: 24px 28px 28px; }

.modal-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal-loading .loading-ring {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
}

.modal-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.stat-badge {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  text-align: center;
}

.stat-icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }

.stat-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--green-700);
  line-height: 1.1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.modal-section { margin-bottom: 24px; }
.modal-section:last-child { margin-bottom: 0; }

.modal-section-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.ingredients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ingredients-table thead tr { background: var(--bg); }

.ingredients-table th {
  text-align: left;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.ingredients-table th:last-child { text-align: right; }

.ingredients-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.ingredients-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--green-700);
  white-space: nowrap;
}

.ingredients-table tr:last-child td { border-bottom: none; }
.ingredients-table tbody tr:nth-child(even) { background: var(--bg); }

.total-cost {
  text-align: right;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 10px 4px 0;
  border-top: 1px solid var(--border);
}

.total-cost strong { color: var(--green-700); font-size: 1rem; }

.steps-list {
  list-style: none;
  counter-reset: steps-counter;
}

.steps-list li {
  counter-increment: steps-counter;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.steps-list li:last-child { border-bottom: none; }

.steps-list li::before {
  content: counter(steps-counter);
  min-width: 26px;
  height: 26px;
  background: var(--green-700);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .modal-stats { flex-direction: column; }
  .modal { max-height: 95vh; }
  .modal-header { padding: 22px 20px 18px; }
  .modal-body { padding: 20px; }
}

/* ─── Profile extra fields ────────────────────────────────────────────────── */
.profile-extra {
  margin-top: 16px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--green-50), #e4f4eb);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.3s ease;
}

.extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.extra-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 8px;
}

.extra-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color var(--transition);
}

.extra-input:focus { border-color: var(--green-500); }
.extra-input::placeholder { color: #a0aab4; }

@media (max-width: 560px) {
  .extra-grid { grid-template-columns: 1fr; }
}

/* ─── Save bar ────────────────────────────────────────────────────────────── */
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #fff8ee 0%, #fff0d4 100%);
  border: 1px solid #f5c882;
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.save-bar-text {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.save-bar-icon { font-size: 1.8rem; }

.save-bar-text strong { display: block; font-size: 0.96rem; color: var(--text); }
.save-bar-text span   { font-size: 0.83rem; color: var(--muted); }

.btn-save {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--amber), #e08e00);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(245,166,35,0.4);
}

.btn-save:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.5); }

/* ─── FAB ─────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(44,122,75,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: all var(--transition);
}

.fab:hover { transform: scale(1.1); box-shadow: 0 10px 32px rgba(44,122,75,0.55); }

.fab-home { bottom: 104px; }

.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ─── Save name modal ─────────────────────────────────────────────────────── */
.save-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}

.save-modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  text-align: center;
}

.save-modal h3 { font-size: 1.3rem; color: var(--green-900); margin-bottom: 8px; }
.save-modal p  { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }

.save-modal-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  margin-bottom: 20px;
  transition: border-color var(--transition);
  text-align: center;
}

.save-modal-input:focus { border-color: var(--green-500); }

.save-modal-actions { display: flex; gap: 12px; justify-content: center; }

.sm-btn-cancel {
  padding: 11px 24px;
  background: none;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.sm-btn-cancel:hover { border-color: var(--text); color: var(--text); }

.sm-btn-confirm {
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(44,122,75,0.35);
}
.sm-btn-confirm:hover { transform: translateY(-2px); }

/* ─── Progress modal ──────────────────────────────────────────────────────── */
.progress-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.progress-modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.progress-modal h3 { font-size: 1.2rem; color: var(--green-900); margin-bottom: 8px; }
.progress-modal p  { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.progress-bar-wrap {
  background: var(--bg);
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--green-500));
  border-radius: 50px;
  transition: width 0.3s ease;
}

.progress-text { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

/* ─── Drawer (saved menus panel) ─────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 1500;
  animation: overlayIn 0.2s ease;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 100vw;
  background: var(--card);
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.3s cubic-bezier(0.34,1.3,0.64,1);
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 20px;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h3 { font-size: 1.1rem; color: var(--green-900); }

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
}
.drawer-close:hover { background: var(--bg); color: var(--text); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.drawer-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.drawer-empty p     { font-size: 1rem; margin: 12px 0 6px; font-weight: 500; }
.drawer-empty small { font-size: 0.83rem; }

/* ─── Saved menu card ─────────────────────────────────────────────────────── */
.saved-menu-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.saved-menu-card:hover { border-color: var(--green-500); }

.saved-menu-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.saved-menu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sm-tag {
  font-size: 0.74rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--muted);
  font-weight: 500;
}

.saved-date { font-size: 0.78rem; color: var(--muted); display: block; margin-bottom: 14px; }

.saved-menu-actions { display: flex; gap: 8px; }

.sma-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
  text-align: center;
}

.sma-load     { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
.sma-load:hover { background: var(--green-200); }

.sma-download { background: #eaf2ff; color: #2980b9; border: 1px solid #b3d4f5; }
.sma-download:hover { background: #b3d4f5; }
.sma-download:disabled { opacity: 0.45; cursor: not-allowed; }

.sma-delete { flex: 0; padding: 9px 13px; background: #fdecea; color: #e74c3c; border: 1px solid #f5c6cb; }
.sma-delete:hover { background: #f5c6cb; }
