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

:root {
  /* ── Base palette ── */
  --bg:          #080C14;
  --bg-2:        #0D1321;
  --card:        #0F1520;
  --card-hover:  #141C2E;
  --card-border: rgba(255,255,255,0.07);
  --card-border-hover: rgba(255,255,255,0.14);
  --text:        #E8EDF5;
  --text-light:  #64748B;
  --text-muted:  #2A3547;
  --border:      rgba(255,255,255,0.08);

  /* ── Header ── */
  --header-bg: rgba(8,12,20,0.92);

  /* ── Accent ── */
  --accent:      #22C55E;
  --accent-dim:  rgba(34,197,94,0.15);
  --accent-glow: 0 0 24px rgba(34,197,94,0.3);

  /* ── Category colors ── */
  --batido:  #FF7A3D;
  --smoothie:#22C55E;
  --bebida:  #38BDF8;
  --coctel:  #E879F9;

  /* ── Shadows ── */
  --shadow:       0 1px 3px rgba(0,0,0,0.5), 0 4px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 2px 6px rgba(0,0,0,0.5), 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--card-border-hover);

  /* ── Shape ── */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* ── Motion ── */
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --spring:     0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light mode overrides kept minimal — app defaults dark */
[data-theme="light"] {
  --bg:          #F0F4FA;
  --bg-2:        #FFFFFF;
  --card:        #FFFFFF;
  --card-hover:  #F8FAFF;
  --card-border: rgba(0,0,0,0.07);
  --card-border-hover: rgba(0,0,0,0.14);
  --text:        #0F172A;
  --text-light:  #64748B;
  --text-muted:  #CBD5E1;
  --border:      rgba(0,0,0,0.08);
  --header-bg:   rgba(8,12,20,0.96);
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ── Atmospheric background glow orbs ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70vw 60vh at 0% 0%,   rgba(34,197,94,0.07)  0%, transparent 60%),
    radial-gradient(ellipse 60vw 50vh at 100% 10%, rgba(56,189,248,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 80vw 70vh at 50% 100%, rgba(232,121,249,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body::before { opacity: 0.4; }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }

.logo-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(34,197,94,0.6));
}

.logo h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
  line-height: 1;
}

.logo p {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}

.search-bar {
  flex: 1;
  min-width: 200px;
  position: relative;
  max-width: 420px;
  margin-left: auto;
}

.search-bar input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
.search-bar input::placeholder { color: rgba(255,255,255,0.35); }
.search-bar input:focus {
  background: rgba(255,255,255,0.1);
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
  font-size: 0.9rem;
}

/* ─── Main ──────────────────────────────────────────────────────────────────── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 90px;
  position: relative;
  z-index: 1;
}

/* ─── Filters ───────────────────────────────────────────────────────────────── */
.filters-section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 14px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active {
  background: var(--accent);
  border-color: transparent;
  color: #022c16;
  box-shadow: 0 4px 16px rgba(34,197,94,0.35), 0 0 0 1px rgba(34,197,94,0.2);
  font-weight: 700;
}

.sub-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.sub-filters select {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.sub-filters select:focus { border-color: var(--accent); }
[data-theme="light"] .sub-filters select { background: white; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}
.toggle-label input { accent-color: var(--accent); cursor: pointer; }

/* ─── Pantry ────────────────────────────────────────────────────────────────── */
.pantry-section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.pantry-toggle {
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
}
.pantry-toggle:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .pantry-toggle:hover { background: rgba(0,0,0,0.03); }

.pantry-toggle-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.25s ease;
  line-height: 1;
}
.pantry-toggle-arrow.open { transform: rotate(180deg); }

.pantry-body { padding: 0 20px 18px; border-top: 1px solid var(--border); }

.pantry-input-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 12px;
  position: relative;
}

.pantry-input-row input {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.pantry-input-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
[data-theme="light"] .pantry-input-row input { background: white; }

.pantry-input-row button,
#pantryAddBtn {
  padding: 9px 18px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--accent);
  color: #022c16;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
#pantryAddBtn:hover { filter: brightness(1.1); box-shadow: var(--accent-glow); }

.pantry-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 90px;
  background: var(--card-hover);
  border: 1px solid var(--card-border-hover);
  border-radius: var(--radius-xs);
  overflow: hidden;
  z-index: 50;
  box-shadow: var(--shadow-hover);
}
[data-theme="light"] .pantry-suggestions { background: white; }

.suggestion-item {
  padding: 9px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}
.suggestion-item:hover { background: var(--accent-dim); color: var(--accent); }

.pantry-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 10px; }

.pantry-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}
.pantry-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.7rem;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
  transition: opacity var(--transition);
}
.pantry-chip button:hover { opacity: 1; }

.pantry-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
#pantryCount { font-size: 0.78rem; color: var(--text-light); }
.pantry-footer-actions { display: flex; align-items: center; gap: 12px; }
.pantry-clear {
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.pantry-clear:hover { border-color: #EF4444; color: #EF4444; }

/* ─── Stats Bar ─────────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  font-size: 0.78rem;
  color: var(--text-light);
  box-shadow: var(--shadow);
  font-weight: 500;
}
#recipeCount {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

/* ─── Recipe Grid ───────────────────────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease backwards;
}

.card:nth-child(1)  { animation-delay: 0.02s; }
.card:nth-child(2)  { animation-delay: 0.06s; }
.card:nth-child(3)  { animation-delay: 0.10s; }
.card:nth-child(4)  { animation-delay: 0.14s; }
.card:nth-child(5)  { animation-delay: 0.18s; }
.card:nth-child(6)  { animation-delay: 0.22s; }
.card:nth-child(7)  { animation-delay: 0.26s; }
.card:nth-child(8)  { animation-delay: 0.30s; }
.card:nth-child(n+9){ animation-delay: 0.30s; }

.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--cat-color) 35%, transparent);
  box-shadow: var(--shadow-hover), 0 0 24px color-mix(in srgb, var(--cat-color) 15%, transparent);
}

/* Top accent line */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cat-color), transparent 80%);
  opacity: 0.8;
}

.card-accent {
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top right, var(--cat-color) 0%, transparent 70%);
  opacity: 0.05;
  transition: opacity var(--transition);
}
.card:hover .card-accent { opacity: 0.09; }

.card-fav {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1rem;
  cursor: pointer;
  padding: 5px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}
.card-fav:hover { transform: scale(1.2); background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); }
.card-fav.active { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.25); }

.cocktail-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.card-emoji {
  font-size: 2.2rem;
  margin-bottom: 10px;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.card-name {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 13px;
  line-height: 1.55;
}

.card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }

.badge {
  padding: 2px 9px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-alcohol {
  background: rgba(251,146,60,0.12);
  color: #FB923C;
  border: 1px solid rgba(251,146,60,0.25);
}
.badge-custom {
  background: rgba(232,121,249,0.12);
  color: #E879F9;
  border: 1px solid rgba(232,121,249,0.25);
}
.badge-api {
  background: rgba(56,189,248,0.1);
  color: #38BDF8;
  border: 1px solid rgba(56,189,248,0.2);
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.73rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

.card-match {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
}

/* ─── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
  grid-column: 1/-1;
}
.empty-state span { font-size: 3rem; display: block; margin-bottom: 14px; opacity: 0.5; }
.empty-state p { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.empty-state small { font-size: 0.82rem; opacity: 0.7; }
.hidden { display: none !important; }

/* ─── FAB ───────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  font-size: 1.7rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34,197,94,0.45), 0 0 0 1px rgba(34,197,94,0.2);
  transition: transform var(--spring), box-shadow var(--transition);
  z-index: 99;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.fab:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 30px rgba(34,197,94,0.55), 0 0 0 1px rgba(34,197,94,0.3);
}

/* ─── Modal Overlay ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,6,12,0.8);
  backdrop-filter: blur(8px) saturate(100%);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

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

.modal {
  background: var(--card);
  border: 1px solid var(--card-border-hover);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  margin: auto;
  position: relative;
  animation: modalIn 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4), 0 24px 80px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.05);
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: all var(--transition);
}
.modal-close:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #EF4444;
}

/* ─── Modal Content ─────────────────────────────────────────────────────────── */
.modal-content { padding: 24px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px; height: 2px;
  background: var(--cat-color, var(--accent));
}

.modal-emoji { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.modal-title-block { flex: 1; }

.modal-title-block h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.modal-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.fav-btn-modal {
  border: 1px solid var(--card-border);
  background: transparent;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}
.fav-btn-modal:hover { border-color: #EF4444; color: #EF4444; }
.fav-btn-modal.active {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.35);
  color: #EF4444;
}

.modal-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.stat-pill {
  padding: 6px 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  font-size: 0.77rem;
  color: var(--text-light);
}
.stat-pill strong { color: var(--text); font-weight: 700; }
[data-theme="light"] .stat-pill { background: var(--bg); }

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  margin-bottom: 14px;
  font-weight: 500;
  border-left: 3px solid;
}
.alert-warn   { background: rgba(251,146,60,0.1);   color: #FB923C; border-color: #FB923C; }
.alert-danger { background: rgba(239,68,68,0.1);    color: #F87171; border-color: #EF4444; }

/* ─── Capacity ───────────────────────────────────────────────────────────────── */
.capacity-block {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
[data-theme="light"] .capacity-block { background: var(--bg); }

.capacity-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.78rem; color: var(--text-light); }
.capacity-value { font-weight: 700; }
.capacity-track {
  height: 8px;
  background: var(--text-muted);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 6px;
  opacity: 0.6;
}
[data-theme="light"] .capacity-track { background: var(--border); opacity: 1; }
.capacity-fill { height: 100%; border-radius: 50px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.capacity-meta { display: flex; justify-content: space-between; font-size: 0.73rem; color: var(--text-light); }
.capacity-label { font-weight: 700; }

/* ─── Scale ──────────────────────────────────────────────────────────────────── */
.scale-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.scale-label { font-size: 0.8rem; color: var(--text-light); font-weight: 600; }
.scale-btns  { display: flex; gap: 5px; }
.scale-btn {
  padding: 5px 15px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.scale-btn:hover { border-color: var(--accent); color: var(--accent); }
.scale-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #022c16;
  box-shadow: 0 2px 10px rgba(34,197,94,0.3);
}

/* ─── Modal Sections ─────────────────────────────────────────────────────────── */
.modal-section { margin-bottom: 22px; }
.modal-section h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.ingredients-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xs);
  font-size: 0.84rem;
  transition: border-color var(--transition);
}
.ingredient-item:hover { border-color: var(--card-border-hover); }
[data-theme="light"] .ingredient-item { background: var(--bg); }

.ingredient-name { font-weight: 600; color: var(--text); }
.ingredient-amount { color: var(--text-light); text-align: right; font-size: 0.8rem; }
.ingredient-amount em { font-size: 0.72rem; color: var(--text-light); opacity: 0.7; }
.medida-ojo {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  color: #A78BFA;
  background: rgba(167,139,250,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.temporada-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  color: #4ADE80;
  background: rgba(74,222,128,0.12);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid rgba(74,222,128,0.25);
}

/* Ingredient state badges */
.ing-state {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
}
.ing-state.frozen  { background: rgba(56,189,248,0.12); color: #38BDF8; }
.ing-state.fresh   { background: rgba(34,197,94,0.12);  color: #22C55E; }
.ing-state.dry     { background: rgba(251,146,60,0.12); color: #FB923C; }
.ing-state.canned  { background: rgba(168,85,247,0.12); color: #C084FC; }

.steps-list { display: flex; flex-direction: column; gap: 10px; }

.step-item { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  min-width: 24px; height: 24px;
  border-radius: 50%;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-item p { font-size: 0.85rem; line-height: 1.65; color: var(--text); }

.tip-box {
  display: flex;
  gap: 10px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 0.83rem;
  color: var(--accent);
}
.tip-icon { font-size: 1.1rem; flex-shrink: 0; }
.tip-box p { color: var(--text); }
.tip-box strong { color: var(--accent); }

/* ─── Timer ──────────────────────────────────────────────────────────────────── */
.timer-block {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.timer-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 110%, rgba(34,197,94,0.08), transparent);
  pointer-events: none;
}

.timer-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 600;
}

.timer-display {
  font-family: 'Syne', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  margin-bottom: 16px;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(34,197,94,0.4);
  line-height: 1;
}
.timer-display.timer-done {
  color: #86EFAC;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  text-shadow: 0 0 20px rgba(134,239,172,0.5);
}

.timer-progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 18px;
  border: none;
  appearance: none;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.timer-progress::-webkit-progress-bar { background: rgba(255,255,255,0.08); border-radius: 2px; }
.timer-progress::-webkit-progress-value { background: var(--accent); border-radius: 2px; transition: width 0.95s linear; }
.timer-progress::-moz-progress-bar { background: var(--accent); border-radius: 2px; }

.timer-controls { display: flex; justify-content: center; gap: 8px; }
.timer-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.timer-btn:hover { background: var(--accent-dim); border-color: rgba(34,197,94,0.3); color: var(--accent); }
.timer-pause { color: var(--text-light); }
.timer-reset  { color: var(--text-light); }

/* ─── Modal Actions ──────────────────────────────────────────────────────────── */
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.action-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ─── Create Modal ───────────────────────────────────────────────────────────── */
.modal-create { padding: 28px; }
.modal-create h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 22px;
  letter-spacing: -0.3px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea { background: white; }
.form-group textarea { resize: vertical; min-height: 64px; }

.ing-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ing-section-header span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-ing-btn {
  padding: 5px 14px;
  border-radius: 50px;
  border: none;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid rgba(34,197,94,0.25);
}
.add-ing-btn:hover { background: rgba(34,197,94,0.2); }

.ing-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ing-row input {
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.ing-row input:focus { border-color: var(--accent); }
[data-theme="light"] .ing-row input { background: var(--bg); }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-light);
  margin: 10px 0;
  font-weight: 500;
}
.check-row input { accent-color: var(--accent); }

.create-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.btn-primary {
  padding: 10px 24px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(34,197,94,0.4); }

.btn-secondary {
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--card-border-hover); color: var(--text); }

/* ─── Ingredient state badges (light overrides) ──────────────────────────────── */
[data-theme="light"] .ing-state.frozen { background: #E0F2FE; color: #0284C7; }
[data-theme="light"] .ing-state.fresh  { background: #DCFCE7; color: #16A34A; }
[data-theme="light"] .ing-state.dry    { background: #FEF3C7; color: #D97706; }
[data-theme="light"] .ing-state.canned { background: #F3E8FF; color: #9333EA; }

/* ─── API Loader ─────────────────────────────────────────────────────────────── */
.api-loader {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
}
.api-loader-bar {
  margin-top: 10px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50px;
  overflow: hidden;
}
@keyframes loadPulse {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.api-loader-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loadPulse 1.4s ease-in-out infinite;
}

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--card-border-hover);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.toast-show { opacity: 1; transform: translateY(0); }
[data-theme="light"] .toast { background: white; }

/* ─── Supermarket Comparison ────────────────────────────────────────────────── */
.super-block {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
[data-theme="light"] .super-block { background: var(--bg); }

.super-block-title {
  padding: 11px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.1px;
}

.super-ing-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.super-ing-row:last-child { border-bottom: none; }

.super-ing-name {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
  text-transform: capitalize;
}

.super-list { display: flex; flex-direction: column; gap: 4px; }

.super-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.73rem;
}

.super-name {
  width: 66px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.71rem;
}

.super-stars {
  color: #F5A623;
  letter-spacing: -1px;
  flex-shrink: 0;
  font-size: 0.68rem;
}

.super-price {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.71rem;
  min-width: 76px;
  transition: color 0.3s;
}

.super-note {
  color: var(--text-light);
  font-size: 0.67rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.super-link {
  margin-left: auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.67rem;
  padding: 2px 8px;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}
.super-link:hover {
  background: var(--accent-dim);
  border-color: rgba(34,197,94,0.5);
}

/* ─── Print ──────────────────────────────────────────────────────────────────── */
@media print {
  .header, .filters-section, .pantry-section, .stats-bar,
  .recipe-grid, .fab, .modal-overlay, #toastContainer { display: none !important; }
  .modal { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; color: black; }
  .modal-content { padding: 20px; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header: 2-row layout — logo+icons on top, search full-width below */
  .header-content {
    padding: 10px 16px;
    gap: 6px 10px;
    flex-wrap: wrap;
    align-items: center;
  }
  .logo     { order: 1; flex: 1; min-width: 0; }
  .logo p   { display: none; }
  .logo h1  { font-size: 1.2rem; }
  .logo-icon { font-size: 1.5rem; }
  .header-actions { order: 2; flex-shrink: 0; }
  .search-bar {
    order: 3;
    flex: 0 0 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
  }

  /* Stats bar: hide verbose detail on small screens */
  .stats-dot    { display: none; }
  .stats-detail { display: none; }
  .stats-bar    { gap: 8px; padding: 8px 14px; flex-wrap: wrap; }
  .random-btn   { margin-left: auto; padding: 4px 12px; font-size: 0.78rem; }

  /* Main */
  .main { padding: 16px 14px 90px; }

  /* Recipe grid */
  .recipe-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .recipe-grid > .card { padding: 14px; }
  .card-emoji { font-size: 1.8rem; }
  .card-name  { font-size: 0.88rem; }
  .card-desc  { display: none; }

  /* Modals */
  .modal-overlay { padding: 10px; }
  .modal-content { padding: 16px; }
  .modal-header  { gap: 12px; margin-bottom: 16px; }
  .modal-emoji   { font-size: 2.2rem; }
  .form-grid     { grid-template-columns: 1fr; }
  .ing-row       { grid-template-columns: 1fr 1fr; }
  .ing-row input:last-child { grid-column: 1 / -1; }
  .modal-create  { padding: 18px; }
  .modal-shopping { padding: 18px; }

  /* FAB: clear iPhone home indicator */
  .fab { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: 20px; }
}

@media (max-width: 380px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .logo h1 { font-size: 1.1rem; }
}

/* ─── Header Actions ─────────────────────────────────────────────────────────── */
.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  position: relative;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  color: white;
}
.icon-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.shopping-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #EF4444;
  color: white;
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ─── Random Button ──────────────────────────────────────────────────────────── */
.random-btn {
  margin-left: auto;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-light);
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.random-btn:hover {
  border-color: rgba(232,121,249,0.4);
  color: #E879F9;
  background: rgba(232,121,249,0.06);
  box-shadow: 0 0 14px rgba(232,121,249,0.15);
}

/* ─── Stars / Rating ─────────────────────────────────────────────────────────── */
.stars-display {
  color: #FBBF24;
  font-size: 0.78rem;
  letter-spacing: 1px;
  margin-top: 6px;
  display: block;
}

.rating-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
[data-theme="light"] .rating-block { background: var(--bg); }
.rating-label { font-size: 0.8rem; color: var(--text-light); font-weight: 600; white-space: nowrap; }

.stars-widget { display: flex; gap: 2px; }
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: color 0.12s, transform 0.15s var(--spring);
  padding: 0 1px;
  line-height: 1;
}
.star-btn.active { color: #FBBF24; }
.star-btn:hover  { color: #FBBF24; transform: scale(1.25); }

/* ─── Shopping List Modal ────────────────────────────────────────────────────── */
.modal-shopping {
  padding: 28px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.shopping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.shopping-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.shopping-header span {
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 50px;
  font-weight: 600;
}

#shoppingListItems {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 55vh;
  padding-right: 2px;
}

.shopping-item {
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}
[data-theme="light"] .shopping-item { background: var(--bg); }
.shopping-item.checked { opacity: 0.38; }
.shopping-item.checked .shopping-name { text-decoration: line-through; }

.shopping-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.shopping-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.shopping-name   { font-weight: 600; font-size: 0.875rem; flex: 1; }
.shopping-amount { font-size: 0.78rem; color: var(--text-light); white-space: nowrap; }
.shopping-source { font-size: 0.7rem; color: var(--text-light); margin-top: 3px; padding-left: 26px; opacity: 0.7; }

.shopping-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 0.84rem;
  padding: 40px 20px;
  line-height: 1.7;
}

.shopping-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.btn-danger { color: #F87171 !important; }
.btn-danger:hover { border-color: #EF4444 !important; background: rgba(239,68,68,0.08) !important; }

/* ─── Health / Nutrition Section ─────────────────────────────────────────────── */
.health-section {
  margin-bottom: 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}
.health-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #38BDF8, transparent);
  opacity: 0.6;
}
[data-theme="light"] .health-section { background: var(--bg); }

.health-section h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.health-section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.health-overview {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}

/* Yuka-style score circle */
.health-score-circle {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--sc-color, #22C55E) calc(var(--sc, 80) * 1%), rgba(255,255,255,0.07) 0);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.health-score-circle::before {
  content: '';
  position: absolute;
  width: 66px; height: 66px;
  background: var(--bg-2);
  border-radius: 50%;
}
[data-theme="light"] .health-score-circle {
  background: conic-gradient(var(--sc-color, #22C55E) calc(var(--sc, 80) * 1%), #E5E7EB 0);
}
[data-theme="light"] .health-score-circle::before { background: var(--bg); }

.hsc-num {
  position: relative; z-index: 1;
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.hsc-label {
  position: relative; z-index: 1;
  font-size: 0.55rem; font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.nutrition-macros { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.macro-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.macro-row:last-child { border-bottom: none; }
.macro-row span { color: var(--text-light); }
.macro-row strong { color: var(--text); font-weight: 700; }

.health-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.health-pro {
  padding: 3px 10px; border-radius: 50px;
  background: rgba(34,197,94,0.1);
  color: #4ADE80;
  border: 1px solid rgba(34,197,94,0.2);
  font-size: 0.7rem; font-weight: 600;
}
.health-con {
  padding: 3px 10px; border-radius: 50px;
  background: rgba(251,146,60,0.1);
  color: #FB923C;
  border: 1px solid rgba(251,146,60,0.2);
  font-size: 0.7rem; font-weight: 600;
}
[data-theme="light"] .health-pro { background: #DCFCE7; color: #16A34A; border-color: #BBF7D0; }
[data-theme="light"] .health-con { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }

.additives-block {
  font-size: 0.78rem;
  color: var(--text-light);
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
}
[data-theme="light"] .additives-block { background: var(--bg); }

.consume-limit {
  font-size: 0.8rem;
  background: rgba(251,146,60,0.08);
  color: #FB923C;
  border: 1px solid rgba(251,146,60,0.2);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 8px;
}
[data-theme="light"] .consume-limit { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }

.fitness-note {
  display: flex; gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid currentColor;
  border-radius: var(--radius-xs);
  margin-top: 8px;
  opacity: 0.9;
}
[data-theme="light"] .fitness-note { background: var(--bg); }
.fitness-note .fitness-icon { font-size: 1.2rem; flex-shrink: 0; }
.fitness-note strong { font-size: 0.8rem; display: block; margin-bottom: 3px; }
.fitness-note p { font-size: 0.8rem; color: var(--text); line-height: 1.55; margin: 0; }

/* Grade badges on cards */
.badge-grade { font-weight: 800 !important; padding: 2px 8px !important; }
.grade-A { background: rgba(34,197,94,0.15)  !important; color: #4ADE80 !important; border: 1px solid rgba(34,197,94,0.25) !important; }
.grade-B { background: rgba(234,179,8,0.12)  !important; color: #FACC15 !important; border: 1px solid rgba(234,179,8,0.25) !important; }
.grade-C { background: rgba(251,146,60,0.12) !important; color: #FB923C !important; border: 1px solid rgba(251,146,60,0.25) !important; }
.grade-D { background: rgba(239,68,68,0.12)  !important; color: #F87171 !important; border: 1px solid rgba(239,68,68,0.25) !important; }

[data-theme="light"] .grade-A { background: #DCFCE7 !important; color: #16A34A !important; border-color: #BBF7D0 !important; }
[data-theme="light"] .grade-B { background: #FEF9C3 !important; color: #854D0E !important; border-color: #FDE047 !important; }
[data-theme="light"] .grade-C { background: #FFEDD5 !important; color: #9A3412 !important; border-color: #FED7AA !important; }
[data-theme="light"] .grade-D { background: #FEE2E2 !important; color: #991B1B !important; border-color: #FECACA !important; }

/* ─── Brands / Dónde Comprar Section ────────────────────────────────────────── */
.brands-section {
  margin-bottom: 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
[data-theme="light"] .brands-section { background: var(--bg); }

.brands-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  transition: background var(--transition);
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.brands-toggle:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .brands-toggle:hover { background: rgba(0,0,0,0.03); }

.brands-count {
  font-size: 0.68rem;
  background: rgba(232,121,249,0.12);
  color: #E879F9;
  border: 1px solid rgba(232,121,249,0.2);
  padding: 2px 9px;
  border-radius: 50px;
  font-weight: 700;
}

.brands-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.25s;
}
.brands-arrow.open { transform: rotate(180deg); }

.brands-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border);
}

.brand-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.brand-card {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xs);
  transition: border-color var(--transition);
}
[data-theme="light"] .brand-card { background: white; }
.brand-card:hover { border-color: var(--card-border-hover); }
.brand-group { display: flex; flex-direction: column; gap: 6px; }

.brand-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.brand-name { font-size: 0.85rem; font-weight: 700; color: var(--text); flex: 1; min-width: 0; }
.brand-stars { color: #FBBF24; font-size: 0.75rem; white-space: nowrap; }
.brand-price { font-size: 0.78rem; font-weight: 700; color: var(--accent); white-space: nowrap; }

.brand-stores { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.store-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(56,189,248,0.08);
  color: #38BDF8;
  border: 1px solid rgba(56,189,248,0.2);
  font-weight: 600;
}
[data-theme="light"] .store-tag { background: #E0F2FE; color: #0284C7; border-color: #BAE6FD; }

.brand-reason { font-size: 0.76rem; color: var(--text-light); line-height: 1.5; margin: 0; }

.tx-badge {
  font-size: 0.65rem;
  background: rgba(56,189,248,0.1);
  color: #38BDF8;
  border: 1px solid rgba(56,189,248,0.2);
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  animation: txPulse 1.2s ease-in-out infinite;
}
@keyframes txPulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.brands-footer {
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  opacity: 0.7;
}

/* ─── Dark Mode (legacy dark variable — now base is dark, light is override) ── */
/* The app defaults to dark. Toggle applies [data-theme="light"] or removes it. */
/* All dark-specific overrides are in the base rules above.                     */

/* ─── Cocktail thumbnail in modal ───────────────────────────────────────────── */
.modal-thumb {
  width: calc(100% + 48px);
  max-height: 220px;
  object-fit: cover;
  display: block;
  margin: -24px -24px 20px;
}
