@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,900&family=Nobile:wght@400;500;700&display=swap');

:root {
  --orange: #FD6F2F;
  --orange-dark: #E85A1C;
  --cream: #FFEAD1;
  --pastel-green: #DCE4B8;
  --olive: #515739;
  --olive-soft: #6b7248;
  --white: #FFFFFF;
  --text: #3a3d2c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 14px rgba(81,87,57,0.12);
  --font-heading: 'Fraunces', serif;
  --font-body: 'Nobile', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--olive);
  margin: 0 0 8px;
  line-height: 1.15;
}

p { margin: 0 0 12px; line-height: 1.5; }

button { font-family: var(--font-body); cursor: pointer; }

img { max-width: 100%; display: block; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  position: relative;
  padding-bottom: 78px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  color: var(--olive);
}

.topbar .logo span { color: var(--orange); }

.ig-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.ig-badge .ig-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-badge .ig-icon svg { width: 14px; height: 14px; fill: #fff; }

/* ---------- Views ---------- */
.view { display: none; padding: 4px 18px 24px; animation: fadeIn .2s ease; }
.view.active { display: block; }

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

/* ---------- Hero / Inicio ---------- */
.hero {
  background: linear-gradient(160deg, var(--olive) 0%, #454a30 100%);
  border-radius: var(--radius);
  padding: 26px 22px;
  color: var(--cream);
  margin-bottom: 18px;
}
.hero h1 { color: #fff; font-size: 26px; margin-bottom: 10px; }
.hero p { color: var(--pastel-green); font-size: 14px; margin-bottom: 16px; }

.verified-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
}
.verified-banner .check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.quick-stats { display: flex; gap: 10px; margin: 16px 0; }
.stat-card {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num { font-family: var(--font-heading); font-weight: 900; font-size: 22px; color: var(--orange); }
.stat-card .label { font-size: 11px; color: var(--olive); font-weight: 700; }

.section-title { font-size: 19px; margin: 22px 0 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(253,111,47,0.35);
  width: 100%;
}
.btn.secondary {
  background: var(--white);
  color: var(--olive);
  box-shadow: var(--shadow);
}

/* ---------- Ingredient chips ---------- */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  background: var(--white);
  border: 1.5px solid var(--pastel-green);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--olive);
  transition: all .15s ease;
}
.chip.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.selected-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--olive-soft);
}
.selected-bar button { background: none; border: none; color: var(--orange); font-weight: 700; font-size: 13px; }

/* ---------- Recipe cards ---------- */
.recipe-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.recipe-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.recipe-card .rc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--pastel-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.recipe-card .rc-body { flex: 1; min-width: 0; }
.recipe-card .rc-title { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--olive); margin-bottom: 3px; }
.recipe-card .rc-meta { font-size: 12px; color: var(--olive-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.recipe-card .match-badge {
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; flex-shrink: 0;
}
.freezer-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.freezer-dot.apta { background: #4a9d5e; }
.freezer-dot.con_recomendaciones { background: #d9a441; }
.freezer-dot.no_recomendada { background: #d9534f; }

.fav-btn {
  background: none; border: none; font-size: 20px; color: var(--pastel-green); flex-shrink: 0;
}
.fav-btn.active { color: var(--orange); }

/* ---------- Category pills ---------- */
.cat-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.cat-pill {
  flex-shrink: 0;
  background: var(--white);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--olive);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.cat-pill.active { background: var(--olive); color: var(--cream); }

.search-box {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  gap: 8px;
}
.search-box input {
  border: none; outline: none; flex: 1; font-size: 14px; font-family: var(--font-body); background: transparent;
}

/* ---------- Recipe detail ---------- */
.detail-back {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--olive); font-weight: 700; font-size: 14px; padding: 10px 0;
}
.detail-header { margin-bottom: 14px; }
.detail-header .badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--pastel-green); color: var(--olive);
}
.pill.freezer-apta { background: #e3f3e6; color: #2f7a41; }
.pill.freezer-con_recomendaciones { background: #fbeecb; color: #96721d; }
.pill.freezer-no_recomendada { background: #fbe3e2; color: #b23b37; }

.detail-block {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.detail-block h3 { font-size: 15px; margin-bottom: 8px; color: var(--orange-dark); }
.detail-block ul { margin: 0; padding-left: 18px; }
.detail-block li { margin-bottom: 5px; font-size: 14.5px; }
.detail-block .tip-box {
  margin-top: 10px; background: var(--cream); border-left: 3px solid var(--orange);
  padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-style: italic;
}

/* ---------- Bonos ---------- */
.bono-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.bono-card .bono-emoji { font-size: 28px; }
.bono-card h4 { font-size: 15.5px; margin-bottom: 4px; }
.bono-card p { font-size: 13px; margin-bottom: 6px; color: var(--olive-soft); }
.bono-tag { font-size: 11px; font-weight: 700; color: var(--orange-dark); }

.verify-purchase-card {
  background: var(--olive);
  color: var(--cream);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.verify-purchase-card h4 { color: #fff; font-size: 15px; }
.verify-purchase-card p { color: var(--pastel-green); font-size: 13px; margin-bottom: 10px; }
.verify-purchase-card a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
}

.watermark {
  text-align: center;
  font-size: 11px;
  color: var(--olive-soft);
  opacity: 0.7;
  margin-top: 24px;
  line-height: 1.6;
}

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 14px rgba(81,87,57,0.14);
  z-index: 30;
}
.tab-btn {
  background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--olive-soft); font-size: 10.5px; font-weight: 700; padding: 4px 8px; flex: 1;
}
.tab-btn .tab-icon { font-size: 20px; }
.tab-btn.active { color: var(--orange); }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--olive-soft); }
.empty-state .emoji { font-size: 40px; margin-bottom: 10px; }

/* install toast */
.install-toast {
  position: fixed; bottom: 90px; left: 16px; right: 16px; max-width: 448px; margin: 0 auto;
  background: var(--olive); color: #fff; border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow); display: none; z-index: 40;
  align-items: center; gap: 10px; justify-content: space-between;
}
.install-toast.show { display: flex; }
.install-toast button { background: var(--orange); color: #fff; border: none; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
