:root {
  --bg: #fbf7f2;
  --bg-alt: #f3ece3;
  --surface: #ffffff;
  --text: #2a211b;
  --muted: #7a6d63;
  --line: #e8ded3;
  --brand: #d9541e;
  --brand-dark: #b4410f;
  --brand-soft: #fde7dc;
  --accent: #2f6b4f;
  --star: #e8a317;
  --shadow: 0 1px 2px rgba(42, 33, 27, .06), 0 8px 24px rgba(42, 33, 27, .08);
  --shadow-lg: 0 24px 60px rgba(42, 33, 27, .18);
  --radius: 18px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #17130f;
  --bg-alt: #1e1914;
  --surface: #241e18;
  --text: #f3ebe2;
  --muted: #a8998b;
  --line: #3a3028;
  --brand: #f0703a;
  --brand-dark: #ff8a55;
  --brand-soft: #3d2418;
  --accent: #6cc19a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
input, select, textarea, button { font-size: max(16px, 1em); } /* evita el zoom automático de iOS al enfocar */
.card, .cat, .chip, .btn, .icon-btn, .fav-btn { touch-action: manipulation; }
.card, .tip { content-visibility: auto; contain-intrinsic-size: 0 380px; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .6rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 999px;
  padding: .8rem 1.4rem; font-weight: 600;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--light { background: #fff; color: #2a211b; }
.btn--light:hover { background: #fde7dc; }
.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 2rem; height: 70px; }
.logo { display: flex; align-items: center; gap: .55rem; }
.logo__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  transform: rotate(-6deg);
}
.logo__text { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; }
.logo__text small { font-size: .72rem; font-weight: 700; color: var(--brand); letter-spacing: .12em; text-transform: uppercase; margin-left: .15rem; font-family: var(--sans); }
.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a { font-weight: 500; color: var(--muted); transition: color .2s; display: inline-flex; align-items: center; gap: .4rem; }
.nav a:hover, .nav a.is-active { color: var(--text); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700;
  display: inline-grid; place-items: center;
}
.topbar__actions { display: flex; gap: .5rem; }
.menu-btn { display: none; }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 4rem; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); font-weight: 700; }
.hero h1 em { font-style: italic; color: var(--brand); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin: 1.2rem 0 2rem; }
.search {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .4rem .4rem 1.2rem;
  box-shadow: var(--shadow); max-width: 36rem;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search svg { color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--text); padding: .5rem 0;
}
.search input::placeholder { color: var(--muted); }
.hero__stats { display: flex; gap: 2.5rem; margin-top: 2.2rem; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { font-family: var(--serif); font-size: 1.7rem; }
.hero__stats span { color: var(--muted); font-size: .9rem; }

.hero__visual { position: relative; }
.feature {
  position: relative; border-radius: 28px; overflow: hidden;
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-lg); cursor: pointer;
  background: var(--bg-alt);
}
.feature img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.feature:hover img { transform: scale(1.04); }
.feature__card {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 18px; padding: 1rem 1.2rem;
}
.feature__card h3 { font-size: 1.3rem; margin: .2rem 0 .4rem; }
.feature__tag {
  position: absolute; top: 16px; left: 16px;
  background: var(--brand); color: #fff; font-size: .78rem; font-weight: 600;
  padding: .35rem .8rem; border-radius: 999px;
}
.hero__visual::before {
  content: ""; position: absolute; inset: -30px -40px auto auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: var(--brand-soft); z-index: -1;
}

/* ---------- Secciones ---------- */
.section { padding: 4.5rem 0; }
.section--alt { background: var(--bg-alt); }
.section__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.2rem;
}
.section__head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

/* Categorías */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.4rem .8rem; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--line);
  color: var(--text); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat.is-active { border-color: var(--brand); background: var(--brand-soft); }
.cat__emoji {
  font-size: 2rem; width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-alt);
}
.cat.is-active .cat__emoji { background: var(--surface); }
.cat__name { font-weight: 600; font-size: .95rem; text-align: center; line-height: 1.3; }
.cat__count { font-size: .8rem; color: var(--muted); }

/* Toolbar */
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .45rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500;
  transition: all .2s;
}
.chip:hover { border-color: var(--brand); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.select {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .5rem 2.2rem .5rem 1rem; border-radius: 999px; font: inherit; font-size: .9rem;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%237a6d63' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}

/* Grid de tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.6rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  animation: rise .45s both;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card__media img { transform: scale(1.06); }
.img-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 4rem;
  background: linear-gradient(135deg, var(--brand-soft), var(--bg-alt));
}
.card__cat {
  position: absolute; left: 12px; top: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px);
  font-size: .75rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px;
}
.fav-btn {
  position: absolute; right: 12px; top: 12px;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px);
  color: var(--text); transition: transform .2s, color .2s;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.is-fav { color: #e0384f; }
.fav-btn.is-fav svg path { fill: currentColor; }
.fav-btn.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.35); } }
.card__body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card__title { font-size: 1.22rem; }
.card__region { font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.card__desc { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }
.rating { color: var(--star); font-weight: 600; }
.rating small { color: var(--muted); font-weight: 400; }
.diff { font-weight: 600; }
.diff--Fácil { color: var(--accent); }
.diff--Media { color: var(--star); }
.diff--Avanzada { color: var(--brand); }

.empty { text-align: center; padding: 3rem 1rem; }
.empty__icon { font-size: 3rem; }
.empty h3 { font-size: 1.5rem; margin: .5rem 0; }
.empty p { color: var(--muted); margin: 0 0 1.2rem; }

/* Tips */
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.tip { padding: 2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.tip__icon { font-size: 1.8rem; margin-bottom: .8rem; }
.tip h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.tip p { color: var(--muted); margin: 0; }

/* CTA */
.cta {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
  padding: 3rem; border-radius: 28px; color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(135deg, #d9541e, #a63a0d);
}
.cta h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.cta p { margin: .5rem 0 0; opacity: .9; }
.cta__form { display: flex; gap: .5rem; background: rgba(255,255,255,.15); padding: .4rem; border-radius: 999px; }
.cta__form input {
  border: 0; outline: 0; background: transparent; color: #fff; font: inherit;
  padding: .6rem 1rem; min-width: 240px;
}
.cta__form input::placeholder { color: rgba(255,255,255,.75); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer__inner p { margin: .4rem 0 0; }
.footer__links { display: flex; gap: 1.5rem; color: var(--muted); }
.footer__links a:hover { color: var(--brand); }

/* ---------- Modal ---------- */
.modal {
  width: min(920px, 100% - 32px); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: 24px; overflow: hidden;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(20, 14, 10, .6); backdrop-filter: blur(4px); }
.modal[open] { animation: modalIn .3s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal__body { max-height: calc(100vh - 48px); overflow-y: auto; }
.r-hero { position: relative; height: 340px; background: var(--bg-alt); }
.r-hero img, .r-hero .img-fallback { width: 100%; height: 100%; object-fit: cover; }
.r-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent 55%);
}
.r-hero__text { position: absolute; left: 2rem; right: 2rem; bottom: 1.6rem; color: #fff; z-index: 1; }
.r-hero__text .eyebrow { color: #ffd2bd; }
.r-hero__text h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.r-close, .r-fav {
  position: absolute; top: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #2a211b;
}
.r-close { right: 16px; }
.r-fav { right: 66px; }
.r-fav.is-fav { color: #e0384f; }
.r-fav.is-fav svg path { fill: currentColor; }
.r-content { padding: 2rem; }
.r-summary { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.r-facts {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin-bottom: 2rem;
}
.fact { background: var(--bg-alt); border-radius: 14px; padding: .8rem; text-align: center; }
.fact strong { display: block; font-family: var(--serif); font-size: 1.25rem; }
.fact span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.r-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tag { font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.r-cols { display: grid; grid-template-columns: .85fr 1.15fr; gap: 2.5rem; }
.r-cols h3 { font-size: 1.4rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.servings { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--sans); font-size: .85rem; font-weight: 500; }
.servings button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 700;
}
.servings button:hover { border-color: var(--brand); color: var(--brand); }
.servings output { min-width: 4.5rem; text-align: center; }
.ing-list, .step-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { border-bottom: 1px dashed var(--line); }
.ing-list label { display: flex; gap: .7rem; align-items: baseline; padding: .6rem 0; cursor: pointer; }
.ing-list input { accent-color: var(--brand); transform: translateY(2px); }
.ing-list b { white-space: nowrap; }
.ing-list input:checked ~ span { text-decoration: line-through; color: var(--muted); }
.step-list { counter-reset: step; }
.step-list li {
  counter-increment: step; position: relative;
  padding: 0 0 1.2rem 3.2rem; cursor: pointer; transition: opacity .2s;
}
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); font-weight: 700;
}
.step-list li.is-done { opacity: .45; }
.step-list li.is-done::before { content: "✓"; background: var(--accent); color: #fff; }
.r-tip {
  margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 14px;
  background: var(--brand-soft); border-left: 4px solid var(--brand);
}
.r-tip strong { color: var(--brand-dark); }
.r-actions { display: flex; gap: .6rem; margin-top: 2rem; flex-wrap: wrap; }
#rWake.is-on { background: var(--accent); }
.r-tabs { display: none; }
.tabbar { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 140%);
  background: var(--text); color: var(--bg);
  padding: .8rem 1.3rem; border-radius: 999px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.toast.is-visible { transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { max-width: 460px; }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .tips { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; padding: 2rem; }
  .r-cols { grid-template-columns: 1fr; }
  .r-facts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem 16px 1rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .topbar__actions { margin-left: auto; }
  .hero { padding-top: 2rem; }
  .hero__stats { gap: 1.5rem; }
  .search { padding-left: 1rem; }
  .search .btn { padding: .7rem 1rem; }
  .section { padding: 3rem 0; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cta__form { flex-direction: column; border-radius: 20px; }
  .cta__form input { min-width: 0; }
  .grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .card__media { aspect-ratio: 16 / 10; }
  .toolbar { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: -16px; padding-inline: 16px; scroll-snap-type: x proximity; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; scroll-snap-align: start; min-height: 44px; }
  .select { min-height: 44px; }
  .hero__stats strong { font-size: 1.4rem; }
  .feature { aspect-ratio: 4 / 3; border-radius: 22px; }

  /* Categorías deslizables */
  .cats { display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: -16px; padding: 4px 16px 10px; }
  .cats::-webkit-scrollbar { display: none; }
  .cat { flex: 0 0 120px; scroll-snap-align: start; padding: 1rem .6rem; }
  .cat__emoji { width: 52px; height: 52px; font-size: 1.6rem; }
  .cat__name { font-size: .85rem; }

  /* Espacio para la barra inferior */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar__item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 60px; border: 0; background: none; color: var(--muted); font-size: .7rem; font-weight: 600;
    transition: color .2s; cursor: pointer;
  }
  .tabbar__item.is-active { color: var(--brand); }
  .tabbar__item.is-active svg { transform: translateY(-1px) scale(1.08); }
  .tabbar__item svg { transition: transform .2s; }
  .tabbar__badge {
    position: absolute; top: 8px; left: calc(50% + 6px);
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: .65rem; display: grid; place-items: center;
  }

  /* Ficha de receta a pantalla completa */
  .modal { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .modal__body { max-height: 100dvh; height: 100%; overscroll-behavior: contain; }
  .modal[open] { animation: sheetIn .35s cubic-bezier(.2,.9,.3,1); }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .r-hero { height: 46vw; min-height: 200px; max-height: 280px; }
  .r-hero__text { left: 1rem; right: 1rem; bottom: 1rem; }
  .r-hero__text h2 { font-size: 1.7rem; }
  .r-close, .r-fav { top: calc(12px + env(safe-area-inset-top)); width: 44px; height: 44px; }
  .r-content { padding: 1.1rem 1rem 2rem; }
  .r-summary { font-size: 1rem; }
  .r-facts { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .fact { padding: .6rem .3rem; }
  .fact strong { font-size: 1.05rem; }
  .fact span { font-size: .66rem; }

  .r-tabs {
    position: sticky; top: 0; z-index: 3;
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--surface); margin: 0 -1rem 1rem; padding: .4rem 1rem 0;
    border-bottom: 1px solid var(--line);
  }
  .r-tab {
    border: 0; background: none; color: var(--muted); font-weight: 600; padding: .8rem 0;
    border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: .95rem;
  }
  .r-tab small { color: var(--muted); font-weight: 500; }
  .r-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
  .r-cols > section { display: none; }
  .r-cols > section.is-active { display: block; }
  .r-cols h3 { font-size: 1.2rem; }
  .ing-list label { padding: .8rem 0; font-size: 1.02rem; }
  .ing-list input { width: 22px; height: 22px; }
  .step-list li { padding-left: 3rem; padding-bottom: 1.3rem; font-size: 1.02rem; line-height: 1.55; }
  .step-list li::before { width: 32px; height: 32px; }
  .servings button { width: 36px; height: 36px; }
  .r-actions { flex-direction: column; }
  .r-actions .btn { width: 100%; min-height: 48px; }
}
/* Pantallas muy pequeñas */
@media (max-width: 380px) {
  .container { width: calc(100% - 24px); }
  .hero h1 { font-size: 2.1rem; }
  .hero__stats { gap: 1rem; }
  .search .btn { padding: .7rem .8rem; font-size: .9rem; }
}
/* Móvil en horizontal: menos altura de foto */
@media (max-height: 500px) and (max-width: 960px) {
  .r-hero { height: 150px; min-height: 0; }
  .hero { padding-top: 1rem; }
}
/* Dispositivos táctiles: sin efectos de hover y botones más grandes */
@media (hover: none) {
  .card:hover, .cat:hover { transform: none; }
  .card:hover .card__media img, .feature:hover img { transform: none; }
  .fav-btn, .icon-btn { width: 44px; height: 44px; }
}
/* Instalada como app: respetar el notch */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .topbar, .footer, .r-close, .r-fav, .r-actions, .r-tabs, .tabbar, main { display: none !important; }
  .r-cols > section { display: block !important; }
  .modal { position: static; box-shadow: none; max-height: none; width: 100%; }
  .modal__body { max-height: none; overflow: visible; }
}
