/* Cosa Cena v2 — shared component styles
 *
 * Styles used by two or more screens (home, plan, saved, list, detail).
 * Split from home.css when the planner screen was built (Chat 7).
 * home.css retains only home-specific styles.
 * Loaded via index.html before any screen CSS.
 */

/* ── App header ───────────────────────────────────────────────────────────── */
.header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sand);
}

.header-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cream);
  cursor: pointer;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
}

.wordmark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.beta-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--sand);
  border: 1px solid var(--sand-mid);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
  position: relative;
  cursor: default;
  flex-shrink: 0;
}

.beta-badge::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown);
  color: var(--cream);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
}

.beta-badge:hover::after,
.beta-badge:focus::after {
  opacity: 1;
}

.wordmark-sub {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: -0.02em;
  text-transform: none;
}

.wordmark-sub .wm-accent {
  color: var(--olive);
  font-style: italic;
  letter-spacing: 0;
}

/* ── Recipe cards ─────────────────────────────────────────────────────────── */
.cards {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

.card-wrap {
  margin-bottom: 10px;
}

.card-wrap:last-child {
  margin-bottom: 4px;
}

.card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(46,31,18,0.07), 0 0 0 1px rgba(46,31,18,0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:active { transform: scale(0.985); }

.card-main {
  display: flex;
  align-items: stretch;
}

.card-not-tonight {
  border-top: 1px solid var(--sand);\
  text-align: center;
  padding: 0;
}

.card-not-tonight-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 12px;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.card-not-tonight-btn:active { color: var(--brown-mid); }

.swatch {
  width: 5px;
  flex-shrink: 0;
}

.card-body {
  padding: 14px 12px 14px 16px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  min-height: 100px;
}

.card-name {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 4px;
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
}

.card-name-text {
  flex: 1;
  min-width: 0;
}

.kid-tag {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--olive);
  background: var(--olive-pale);
  border-radius: 4px;
  padding: 2px 5px;
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-desc {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--brown-light);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-ready-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #3A5028;
  background: var(--olive-pale);
  border: 0.5px solid var(--olive);
  border-radius: 20px;
  padding: 2px 7px;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Card actions column ──────────────────────────────────────────────────── */
.card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  width: 44px;
  padding: 8px 0;
}

.card-heart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.card-heart svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--sand-mid);
  stroke-width: 1.75;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.card-heart.saved svg {
  fill: var(--terracotta);
  stroke: var(--terracotta);
}

.card-heart:active svg { transform: scale(0.88); }

.card-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--sand);
  border: none;
  cursor: pointer;
  color: var(--brown-mid);
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 0;
}

.card-plan svg {
  width: 20px;
  height: 20px;
}

.card-plan.in-plan { color: var(--white); background: var(--olive); }
.card-plan:active { opacity: 0.7; }

/* ── Zero states ──────────────────────────────────────────────────────────── */
.zero-state {
  text-align: center;
  padding: 40px 20px;
}

.zero-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.zero-title {
  font-family: 'Lora', serif;
  font-size: 19px;
  color: var(--brown);
  margin-bottom: 8px;
}

.zero-body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Bottom sheets ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(46,31,18,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 20px));
  width: 100%;
  max-width: 430px;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  z-index: 201;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 75vh;
  overflow-y: auto;
  padding-bottom: max(env(safe-area-inset-bottom), 20px);
  visibility: hidden;
}

.sheet.active {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--sand-mid);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-head {
  padding: 16px 20px 12px;
}

.sheet-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.sheet-opts {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  background: var(--white);
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  min-height: 52px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--brown);
  user-select: none;
}

.opt.selected {
  border-color: var(--terracotta);
  background: var(--terracotta-pale);
}

.opt-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.opt-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--terracotta);
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.opt.selected .opt-check { display: flex; }

.opt-check svg {
  width: 12px;
  height: 12px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
}

/* ── Chips (used in ingredient sheet) ─────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--sand);
  border-radius: 20px;
  padding: 7px 10px 7px 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--brown);
}

.chip-x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sand-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  padding: 0;
}

.chip-x svg {
  width: 9px;
  height: 9px;
  stroke: var(--brown-light);
  stroke-width: 2;
  fill: none;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.toggle-switch {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--sand-mid);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-switch.on { background: var(--olive); }

.toggle-knob {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.on .toggle-knob { transform: translateX(16px); }

/* ── Kids toggle row (home + plan) ───────────────────────────────────────── */
.kids-row {
  padding: 10px 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kids-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.kids-toggle-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--brown);
}

.kids-tonight-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Header search button (home screen top-right) ─────────────────────────── */
.header-search-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--sand-mid);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-mid);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.header-search-btn:active {
  background: var(--sand);
}

.header-search-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Header action bar (appears below .header on plan, list) ──────────────── */
/* Keeps the wordmark row clean on narrow phones. */
.header-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px;
  border-bottom: 1px solid var(--sand);
  background: var(--cream);
}

.hdr-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1.5px solid var(--terracotta);
  border-radius: 50%;
  color: var(--terracotta);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hdr-icon-btn:active { background: var(--terracotta-pale); }

/* Ghost variant: no border, just the icon — for action bars where a circle looks floating */
.hdr-icon-btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--brown-mid);
}

.hdr-icon-btn-ghost:active { background: var(--sand); }

.hdr-text-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 30px;
  border: 1.5px solid transparent;
}

.hdr-text-btn-muted {
  color: var(--brown-mid);
  background: var(--sand-mid);
  border-color: transparent;
}

.hdr-text-btn-muted:active { background: var(--sand-dark); color: var(--white); }

.hdr-text-btn-danger {
  color: #8A2020;
  background: var(--white);
  border-color: rgba(138,32,32,0.5);
}

.hdr-text-btn-danger:active { background: #FCF0F0; }
.sentence-wrap {
  padding: 12px 16px 0;
}

.sentence-card {
  background: var(--white);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 0 0 1px rgba(46,31,18,0.06);
}

.sentence-label {
  font-family: 'Lora', serif;
  font-size: 17px;
  color: var(--brown-mid);
  font-weight: 600;
  margin-bottom: 10px;
}

.filter-pill-row {
  display: flex;
  gap: 6px;
}

.filter-pill {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: opacity 0.1s;
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
  overflow: hidden;
}

.filter-pill:active { opacity: 0.7; }

.filter-pill.unset {
  background: var(--sand-mid) !important;
  color: var(--brown-mid);
  font-style: italic;
  font-weight: 400;
  border: none;
}

.filter-pill.set {
  background: var(--sand-mid) !important;
  color: var(--terracotta);
  border: 1.5px solid var(--terracotta);
  font-weight: 600;
}

.filter-pill.relaxed {
  background: var(--sand-mid) !important;
  color: var(--sand-dark);
  text-decoration: line-through;
  opacity: 0.6;
  border: none;
}

.pill-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-chevron {
  width: 7px;
  height: 4px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  margin-top: 1px;
}

/* ── Dietary badges (§6 visibility rule) ──────────────────────────────────── */
.dietary-badges-row {
  padding: 6px 16px 8px;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.dietary-badges-prefix {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.dietary-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--brown-mid);
  background: var(--sand);
  border-radius: 20px;
  padding: 3px 9px;
  letter-spacing: 0.02em;
  border: 1px solid var(--sand-mid);
}

.dietary-note {
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.dietary-settings-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--terracotta);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--sand);
  margin: 10px 20px;
}

/* ── Tab bar spacer ───────────────────────────────────────────────────────── */
.tab-bar-spacer {
  height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom) + 8px);
}

/* ── Sheet spacer ─────────────────────────────────────────────────────────── */
.spacer { height: 32px; }
