/* YAO · app de pedidos. Mobile first: la base es el teléfono, los @media solo añaden. */

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-var.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --red: #d92128;
  --red-dark: #b5161c;
  --red-tint: #fdecec;
  --cream: #ffecc1;
  --cream-soft: #fff7e6;
  --ink: #1b1716;
  --ink-2: #625b58;
  --ink-3: #6f6865;
  --line: #ece7e3;
  --surface: #ffffff;
  --bg: #f6f3f0;
  --green: #14804a;
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --shadow-1: 0 1px 2px rgba(27, 23, 22, .06), 0 2px 8px rgba(27, 23, 22, .06);
  --shadow-2: 0 -1px 0 rgba(27, 23, 22, .05), 0 -8px 28px rgba(27, 23, 22, .1);
  --ease: cubic-bezier(.22, .9, .3, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
  --head-h: calc(60px + var(--sat));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--surface); }
html.locked { overflow: hidden; }
body {
  margin: 0;
  font: 500 14px/1.4 Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Estructura ---------- */
.shell { min-height: 100dvh; }
.main { padding-bottom: calc(var(--tab-h) + var(--sab) + 16px); min-width: 0; }
body.has-cart .main { padding-bottom: calc(var(--tab-h) + var(--sab) + 84px); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--sab);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbtn {
  position: relative; height: var(--tab-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  transition: transform .12s;
}
.tabbtn:active { transform: scale(.92); }
.tabbtn[aria-current="page"] { color: var(--red); font-weight: 700; }
.tabbtn[aria-current="page"] .icon { stroke-width: 2.4; }
.tabbtn__dot {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--head-h);
  padding: var(--sat) 8px 0 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--red); color: #fff;
}
.topbar :focus-visible, .apphead__red :focus-visible { outline-color: #fff; }
.topbar__logo { flex: none; width: 46px; height: 46px; border-radius: 50%; transition: transform .12s; }
.topbar__logo:active { transform: scale(.94); }
.topbar__logo img { width: 100%; height: 100%; }
/* En móvil va el isotipo; desde tableta, el logo completo */
.logo-full { display: none; }
/* Solo en escritorio */
.topbar__search, .deskcart { display: none; }
.topbar__logo .logo-iso { object-fit: contain; }
.citybtn {
  flex: 0 1 auto; min-width: 0; height: 40px; padding: 0 10px 0 9px; border-radius: 99px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0, 0, 0, .16); color: #fff; font-size: 14px; font-weight: 700;
  transition: background .15s, transform .12s;
}
.citybtn:active { background: rgba(0, 0, 0, .28); transform: scale(.97); }
.citybtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citybtn .icon { width: 17px; height: 17px; }
.citybtn .icon:last-child { width: 15px; height: 15px; stroke-width: 3; }
.cartbtn { position: relative; flex: none; margin-left: auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; transition: background .15s, transform .12s; }
.cartbtn:active { background: var(--red-dark); transform: scale(.94); }
.cartbtn .icon { width: 26px; height: 26px; }
.cartbtn__n {
  position: absolute; top: 3px; right: 1px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; color: var(--red-dark); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--red);
}
.cartbtn__n.bump { animation: bump .36s var(--ease); }

.apphead__red { padding: 0 16px 14px; background: var(--red); }
.apphead { padding: 12px 16px 12px; background: var(--surface); }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: var(--bg); border-radius: 12px;
}
.segmented button {
  height: 38px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .18s, color .18s;
}
.segmented button .icon { width: 18px; height: 18px; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-1); }

.searchbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px;
  background: #fff; border-radius: 12px; color: var(--ink-2); font-size: 14px; text-align: left;
}
.searchbtn .icon { width: 20px; height: 20px; }

.statusline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.statusline b { font-weight: 700; color: var(--green); }
.statusline b.closed { color: var(--red); }
.statusline i { width: 3px; height: 3px; border-radius: 50%; background: #b9b2ae; }

/* ---------- Carriles horizontales ---------- */
.rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* Promos */
.promos { padding-block: 4px 2px; scroll-snap-type: x mandatory; }
.promo {
  position: relative; width: min(86vw, 340px); height: 148px; overflow: hidden;
  border-radius: var(--r-l); color: #fff; background: var(--ink); text-align: left;
  transition: transform .15s var(--ease);
}
.promo:active { transform: scale(.98); }
.promo img { position: absolute; inset: 0 0 0 auto; width: 62%; height: 100%; object-fit: cover; }
.promo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--promo, #1b1716) 38%, transparent 76%);
}
.promo__txt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; height: 100%; width: 66%; padding: 15px; }
.promo__kicker { font-size: 11px; font-weight: 700; color: var(--cream); }
.promo__title { margin-top: 2px; font-size: 21px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.promo__cta { margin-top: auto; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: #fff; color: var(--ink); }

/* Secciones de inicio */
.block { padding-top: 22px; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 16px 10px; }
.block__head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; }

/* Tarjetas de categoría */
.catcard { width: 76px; text-align: center; font-size: 12px; font-weight: 600; transition: transform .12s; }
.catcard:active { transform: scale(.94); }
.catcard img, .catcard .noimg { width: 68px; height: 68px; margin: 0 auto 6px; border-radius: 50%; object-fit: cover; background: var(--bg); }

/* Tarjetas destacadas */
.featured { padding-bottom: 4px; }
.fcard { position: relative; width: 150px; text-align: left; }
.fcard__open { display: block; width: 100%; text-align: left; transition: transform .12s; }
.fcard__open:active { transform: scale(.98); }
.fcard__img { width: 150px; height: 150px; border-radius: var(--r-m); object-fit: cover; background: var(--bg); }
.fcard h3 { margin-top: 8px; font-size: 13px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard .price { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Botón + / cantidad sobre la foto */
.addbtn {
  position: absolute; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--red); box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
  font-weight: 800; font-size: 14px;
  transition: transform .14s var(--ease), background .15s;
}
.addbtn::before { content: ''; position: absolute; inset: -5px; }
.addbtn:active { transform: scale(.86); }
.addbtn .icon { width: 20px; height: 20px; stroke-width: 2.8; }
.addbtn.has { background: var(--red); color: #fff; }
.addbtn:disabled { display: none; }
.fcard .addbtn { top: 106px; right: 8px; }

/* Filtro de categorías fijo */
.chipsbar {
  position: sticky; top: var(--head-h); z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.chips { padding-block: 9px; gap: 6px; scroll-snap-type: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
  background: var(--bg); transition: background .15s, color .15s, transform .12s;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--red); color: #fff; font-weight: 700; }

/* Lista del menú */
.section { padding-top: 22px; }
.section__head { padding: 0 16px 4px; }
.section__head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.section__head p { margin-top: 1px; font-size: 13px; color: var(--ink-2); }
.items { padding: 0 16px; }

.item { position: relative; display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.items > .item:last-child { border-bottom: 0; }
.item__open { position: absolute; inset: 0; z-index: 1; border-radius: var(--r-s); transition: background .15s; }
.item__open:active { background: rgba(27, 23, 22, .04); }
.item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.item h3 { font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; }
.item__desc { margin-top: 3px; font-size: 13px; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__foot { margin-top: auto; padding-top: 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; font-weight: 700; }
.item__foot small { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.item__media { position: relative; flex: none; width: 108px; height: 108px; }
.item__media img, .noimg { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-m); background: var(--bg); }
.item__media .addbtn { z-index: 2; right: -4px; bottom: -4px; }
.item.is-off .item__media img { filter: grayscale(.7); opacity: .75; }
.noimg { display: grid; place-items: center; background: var(--cream-soft); }
.noimg img { width: 56%; height: auto; border-radius: 50%; background: var(--red); opacity: .92; object-fit: contain; }

.badge { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--cream); color: #8a2a0c; }
.badge--off { background: var(--bg); color: var(--ink-2); }
.rating { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rating .icon { width: 13px; height: 13px; fill: #e8a200; stroke: none; }

/* Barra flotante del carrito */
.cartbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--sab) + 10px); z-index: 25;
  height: 56px; padding: 0 16px 0 10px; border-radius: 16px;
  display: flex; align-items: center; gap: 10px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(181, 22, 28, .38);
  animation: rise .34s var(--ease);
  transition: transform .14s var(--ease), background .15s;
}
.cartbar:active { transform: scale(.98); background: var(--red-dark); }
.cartbar__n { min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); font-weight: 800; }
.cartbar__n.bump { animation: bump .36s var(--ease); }
.cartbar__label { flex: 1; text-align: left; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes bump { 40% { transform: scale(1.28); } }

/* ---------- Capas: vistas y hojas ---------- */
.layer { position: fixed; inset: 0; z-index: 100; }
.backdrop { position: absolute; inset: 0; background: rgba(20, 16, 15, .5); animation: fade .24s; }
.layer.is-closing .backdrop { opacity: 0; transition: opacity .22s; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: absolute; inset: auto 0 0 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; overflow: hidden;
  animation: sheetUp .34s var(--ease);
  transition: transform .24s var(--ease);
  will-change: transform;
}
.sheet--tall { height: 94dvh; }
.layer.is-closing .sheet { transform: translateY(102%) !important; }
.sheet__grab { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 22px; display: grid; place-items: center; touch-action: none; }
.sheet__grab::before { content: ''; width: 38px; height: 4px; border-radius: 2px; background: #d6d0cb; }
.sheet__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 24px 16px 8px; }
.sheet__head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
@keyframes sheetUp { from { transform: translateY(100%); } }

.view {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--bg);
  animation: viewIn .3s var(--ease);
  transition: transform .24s var(--ease);
}
.layer.is-closing .view { transform: translateX(100%); }
@keyframes viewIn { from { transform: translateX(100%); } }
/* Carrito: modal de pantalla completa en móvil, sidebar desde tableta */
.view--cart { animation-name: cartUp; }
.layer.is-closing .view--cart { transform: translateY(100%); }
@keyframes cartUp { from { transform: translateY(100%); } }
.view__bar {
  flex: none; display: flex; align-items: center; gap: 4px;
  padding: var(--sat) 8px 0; min-height: calc(54px + var(--sat));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.view__bar h2 { flex: 1; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.view__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; }
.view__foot, .sheet__foot {
  flex: none; display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + var(--sab));
  background: var(--surface); box-shadow: var(--shadow-2); position: relative; z-index: 3;
}

.iconbtn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; transition: background .15s, transform .12s; }
.iconbtn:active { background: var(--bg); transform: scale(.92); }
.iconbtn--float { position: absolute; z-index: 6; top: 12px; width: 40px; height: 40px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.iconbtn--float .icon { width: 20px; height: 20px; }
.iconbtn[aria-pressed="true"] { color: var(--red); }
.iconbtn[aria-pressed="true"] .icon { fill: var(--red); }

.btn {
  flex: 1; min-height: 52px; padding: 0 16px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 700; text-align: center;
  transition: transform .12s var(--ease), background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); background: var(--red-dark); }
.btn--split { justify-content: space-between; }
.btn--ghost { background: var(--bg); color: var(--ink); }
.btn--ghost:active { background: var(--line); }
.btn--line { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.btn--line:active { background: var(--red-tint); }
.btn--sm { flex: none; min-height: 40px; font-size: 13px; border-radius: 11px; padding: 0 14px; }
.link { color: var(--red); font-weight: 700; font-size: 13px; padding: 8px 0; }

/* Modal de ciudad */
.layer--modal { display: grid; place-items: center; padding: 20px; }
.modal {
  position: relative; width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto;
  padding: 24px 18px 18px; text-align: center;
  background: var(--surface); border-radius: var(--r-l);
  animation: modalPop .26s var(--ease); transition: opacity .2s, transform .2s;
}
.layer.is-closing .modal { opacity: 0; transform: scale(.96); }
@keyframes modalPop { from { opacity: 0; transform: scale(.94); } }
.modal__close { position: absolute; top: 6px; right: 6px; }
.modal__logo { width: 84px; height: 84px; margin: 0 auto 10px; }
.modal h2 { font-size: 21px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.modal p { margin-top: 5px; color: var(--ink-2); font-size: 14px; }
.cityopts { display: grid; gap: 8px; margin-top: 16px; text-align: left; }
.cityopt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; text-align: left;
  border-radius: var(--r-m); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .15s, background .15s, transform .12s;
}
.cityopt:active { transform: scale(.98); background: var(--bg); }
.cityopt:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.cityopt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--red); }
.cityopt .rowbtn__txt strong { font-size: 16px; }
.cityopt > .icon { width: 18px; height: 18px; color: var(--ink-3); }
.cityopt[aria-pressed="true"] > .icon { color: var(--red); stroke-width: 3; }

/* Hoja de producto */
.pdp__bar {
  position: absolute; z-index: 4; inset: 0 0 auto 0; height: 64px; padding: 0 60px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.pdp__bar.on { opacity: 1; transform: none; }
#pdp .iconbtn--float { transition: box-shadow .16s; }
.pdp__hero { position: relative; width: 100%; aspect-ratio: 16 / 11; max-height: 42dvh; background: var(--bg); }
.pdp__hero > img, .pdp__hero .noimg { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.pdp__hero.is-contain > img { object-fit: contain; background: #fff; }
.pdp__hero .noimg img { width: 110px; height: 110px; }
.pdp__info { padding: 14px 16px 8px; }
.pdp__info h2 { font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.pdp__meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 15px; font-weight: 700; }
.pdp__info p { margin-top: 7px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.notice { display: flex; gap: 8px; margin: 10px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--cream-soft); font-size: 13px; font-weight: 600; color: #6e3f08; }
.notice .icon { width: 18px; height: 18px; }

.optgroup { margin-top: 10px; border: 0; padding: 0 0 2px; border-top: 8px solid var(--bg); min-width: 0; }
.optgroup__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 13px 16px 5px; }
.optgroup__head h3 { font-size: 15px; font-weight: 800; }
.optgroup__head small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.req { flex: none; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--ink); color: #fff; }
.req.ok { background: #e4f4ea; color: var(--green); }
.optgroup.is-missing .req { background: var(--red); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 16px; cursor: pointer; transition: background .12s; }
.opt:active { background: var(--bg); }
.opt + .opt::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: var(--line); }
.opt__label { flex: 1; font-size: 14px; font-weight: 500; }
.opt__price { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.opt input { position: absolute; opacity: 0; width: 22px; height: 22px; right: 16px; margin: 0; }
.opt__mark { order: 3; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #bdb6b1; display: grid; place-items: center; color: #fff; transition: background .12s, border-color .12s; }
.opt__mark.check { border-radius: 6px; }
.opt__mark .icon { width: 14px; height: 14px; stroke-width: 3.5; opacity: 0; }
.opt input:checked ~ .opt__mark { background: var(--red); border-color: var(--red); }
.opt input:checked ~ .opt__mark .icon { opacity: 1; }
.opt input:checked ~ .opt__label { font-weight: 700; }
.opt input:focus-visible ~ .opt__mark { outline: 2.5px solid var(--red); outline-offset: 2px; }
.morebtn { display: flex; align-items: center; gap: 4px; padding: 10px 16px; color: var(--red); font-weight: 700; font-size: 13px; }
.morebtn .icon { width: 16px; height: 16px; stroke-width: 2.8; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .notefield {
  width: 100%; min-height: 48px; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font-size: 16px; font-weight: 500; transition: border-color .15s;
}
.field textarea, .notefield { resize: none; min-height: 72px; }
.field input:focus, .field select:focus, .field textarea:focus, .notefield:focus { outline: none; border-color: var(--ink); }
.field.is-bad input, .field.is-bad select { border-color: var(--red); }
.field__err { display: none; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--red-dark); }
.field.is-bad .field__err { display: block; }
.pad { padding: 8px 16px; }

/* Cantidad */
.stepper { flex: none; display: flex; align-items: center; height: 52px; border-radius: 14px; background: var(--bg); }
.stepper button { width: 44px; height: 100%; display: grid; place-items: center; border-radius: 14px; transition: transform .12s; }
.stepper button:active { transform: scale(.84); }
.stepper button:disabled { color: #c9c3be; }
.stepper b { min-width: 22px; text-align: center; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .icon { width: 18px; height: 18px; stroke-width: 2.6; }
.stepper--sm { height: 36px; border-radius: 10px; }
.stepper--sm button { width: 36px; border-radius: 10px; }
.stepper--sm .icon { width: 15px; height: 15px; }
.stepper--sm b { font-size: 14px; min-width: 18px; }

/* Carrito y resumen */
.card { margin: 10px 12px 0; padding: 14px; border-radius: var(--r-m); background: var(--surface); }
.card > h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.card--flush { padding: 4px 14px; }
.card--rail { padding: 14px 0; }
.card--rail > h3 { padding: 0 14px; }
.card--rail .rail { padding-inline: 14px; }
.line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line img, .line .noimg { width: 60px; height: 60px; flex: none; border-radius: 10px; object-fit: cover; }
.line .noimg img { width: 34px; height: 34px; border-radius: 50%; }
.line__body { flex: 1; min-width: 0; }
.line__edit { display: block; width: 100%; text-align: left; }
.line h4 { font-size: 14px; font-weight: 700; line-height: 1.25; }
.line__opts { margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }
.line__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-weight: 700; }
.sum { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; color: var(--ink-2); }
.sum b { font-weight: 600; color: var(--ink); }
.sum--save, .sum--save b { color: var(--green); font-weight: 700; }
.sum--total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 800; color: var(--ink); }
.sum--total b { font-weight: 800; }
.upsell { width: 118px; position: relative; text-align: left; }
.upsell__open { display: block; width: 100%; text-align: left; }
.upsell img, .upsell .noimg { width: 118px; height: 88px; border-radius: 10px; object-fit: cover; }
.upsell h4 { margin-top: 5px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.upsell .price { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.upsell .addbtn { top: 54px; right: 4px; width: 32px; height: 32px; }
.img-contain { object-fit: contain !important; background: #fff !important; }

/* Filas de checkout y cuenta */
.rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 0; text-align: left; border-bottom: 1px solid var(--line); }
.rowbtn:last-child { border-bottom: 0; }
button.rowbtn:active, a.rowbtn:active { opacity: .65; }
.rowbtn__ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--red-tint); color: var(--red); }
.rowbtn__ic .icon { width: 20px; height: 20px; }
.rowbtn__txt { flex: 1; min-width: 0; }
.rowbtn__txt strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.rowbtn__txt small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-2); line-height: 1.3; overflow-wrap: anywhere; }
.rowbtn > .icon { width: 18px; height: 18px; color: var(--ink-3); }
.rowbtn.is-bad strong { color: var(--red-dark); }
.tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tips button { height: 44px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--bg); transition: background .15s, color .15s; }
.tips button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Búsqueda */
.searchhead { position: sticky; top: var(--head-h); z-index: 10; padding: 10px 16px; background: var(--surface); }
.searchhead h1, .pagehead h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.searchinput { position: relative; margin-top: 10px; }
.searchinput .icon { position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; color: var(--ink-2); pointer-events: none; }
.searchinput input { width: 100%; height: 46px; padding: 0 42px 0 42px; border: 0; border-radius: 12px; background: var(--bg); font-size: 16px; -webkit-appearance: none; appearance: none; }
.searchinput input:focus { outline: 2px solid var(--ink); outline-offset: -2px; background: #fff; }
.searchinput input::-webkit-search-cancel-button { display: none; }
.searchclear { position: absolute; right: 1px; top: 1px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-2); }
.searchclear .icon { position: static; width: 18px; height: 18px; }
.filters { padding-block: 10px 2px; gap: 6px; }
.pill { height: 36px; padding: 0 13px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; transition: background .15s, color .15s; }
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.resultcount { padding: 10px 16px 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.empty { padding: 44px 32px; text-align: center; }
.empty img { width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%; background: var(--red); }
.empty h3 { font-size: 17px; font-weight: 800; }
.empty p { margin: 4px auto 16px; max-width: 280px; color: var(--ink-2); }
.empty .btn { display: inline-flex; flex: none; }

/* Páginas */
.pagehead { padding: 14px 16px 8px; }
.page--tint { background: var(--bg); min-height: calc(100dvh - var(--head-h)); }
.page--tint .pagehead { background: var(--surface); padding-bottom: 14px; }
.ordercard { display: flex; gap: 12px; margin: 10px 12px 0; padding: 14px; border-radius: var(--r-m); background: var(--surface); }
.ordercard__txt { flex: 1; min-width: 0; }
.ordercard h3 { font-size: 15px; font-weight: 800; }
.ordercard p { margin-top: 2px; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ordercard__act { display: flex; gap: 8px; margin-top: 10px; }
.status { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #e4f4ea; color: var(--green); }
.status.live { background: var(--red-tint); color: var(--red-dark); }
.brandcard { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 10px 12px 0; border-radius: var(--r-m); background: var(--red); color: #fff; }
.brandcard img { width: 54px; height: 54px; border-radius: 50%; }
.brandcard strong { display: block; font-size: 16px; font-weight: 800; }
.brandcard small { font-size: 13px; opacity: .95; }
.foot { padding: 20px 16px; text-align: center; font-size: 12px; color: var(--ink-2); }

/* Seguimiento */
.track__hero { padding: 22px 16px; text-align: center; background: var(--surface); }
.track__hero small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.track__eta { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.track__hero p { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--red); }
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 16px; }
.progress i { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i.done { background: var(--red); }
.progress i.now { background: linear-gradient(90deg, var(--red) 0 50%, var(--line) 50%); background-size: 200% 100%; animation: pulseBar 1.6s linear infinite; }
@keyframes pulseBar { from { background-position: 100% 0; } to { background-position: 0 0; } }
.steps li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; color: var(--ink-3); font-weight: 600; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ''; flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--line); z-index: 1; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.steps li.done, .steps li.now { color: var(--ink); }
.steps li.now { font-weight: 800; }
.steps li.done::before, .steps li.now::before { background: var(--red); }
.steps li.now::before { box-shadow: 0 0 0 4px var(--red-tint); }
.steps li.done::after { background: var(--red); }
.twobtn { display: flex; gap: 8px; }

/* Aviso */
.toast {
  position: fixed; z-index: 400; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--sab) + 76px);
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px;
  border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  animation: rise .28s var(--ease);
}
.toast span { flex: 1; }
.toast button { padding: 8px 2px; font-weight: 800; color: var(--cream); }

.fly { position: fixed; z-index: 500; border-radius: 50%; object-fit: cover; pointer-events: none; transition: transform .52s cubic-bezier(.5, -.1, .7, .6), opacity .52s; }

/* ---------- Tableta ---------- */
@media (min-width: 640px) {
  .logo-iso { display: none; }
  .logo-full { display: block; }
  .items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .items > .item:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .sheet { inset: 50% auto auto 50%; width: 480px; max-height: 88dvh; border-radius: var(--r-l); transform: translate(-50%, -50%); animation: modalIn .26s var(--ease); }
  .sheet--tall { height: 88dvh; }
  .layer.is-closing .sheet { transform: translate(-50%, -46%) !important; opacity: 0; }
  .sheet__grab { display: none; }
  .iconbtn--float { top: 14px; }
  .view { left: auto; width: 480px; box-shadow: -8px 0 40px rgba(0, 0, 0, .2); }
  .view--cart { width: 440px; animation-name: viewIn; }
  .layer.is-closing .view--cart { transform: translateX(100%); }
  .layer--view { background: rgba(20, 16, 15, .4); animation: fade .24s; }
  .cartbar { left: 50%; right: auto; width: 420px; margin-left: -210px; }
  .toast { left: 50%; right: auto; width: 420px; margin-left: -210px; }
  .promo { width: 340px; }
  @keyframes modalIn { from { transform: translate(-50%, -46%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
}

/* ---------- Escritorio (solo PC: nada de aquí afecta a móvil ni tableta) ---------- */
@media (min-width: 1040px) {
  :root { --head-h: 72px; --gut: max(24px, calc((100vw - 1480px) / 2)); --cart-w: 372px; --nav-w: 304px; }
  html { scrollbar-gutter: stable; }

  /* Estructura: contenido + carrito siempre visible */
  .shell { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; padding-inline: var(--gut); }
  .shell.with-cart { grid-template-columns: minmax(0, 1fr) var(--cart-w); column-gap: 24px; }
  .main { padding-bottom: 40px !important; min-height: calc(100dvh - var(--head-h)); }
  .cartbar { display: none !important; }
  .toast { bottom: 24px; }

  /* Header: logo, ciudad, buscador, navegación y carrito en una sola línea */
  .topbar { padding-inline: var(--gut); gap: 12px; }
  .topbar__logo { width: 56px; height: 56px; margin-right: 6px; }
  .topbar__search {
    display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; max-width: 560px; height: 44px; padding: 0 14px;
    margin-right: calc(var(--nav-w) + 12px);
    background: #fff; border-radius: 12px; color: var(--ink-2); font-size: 14px; text-align: left; transition: box-shadow .15s;
  }
  .topbar__search .icon { width: 20px; height: 20px; }
  .topbar__search:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
  .citybtn:hover { background: rgba(0, 0, 0, .28); }
  .cartbtn:hover { background: var(--red-dark); }

  .tabbar {
    position: fixed; inset: 0 calc(var(--gut) + 60px) auto auto; z-index: 41; width: var(--nav-w); height: var(--head-h);
    display: flex; align-items: center; gap: 4px; padding: 0;
    border: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabbtn { flex: 1; height: 44px; flex-direction: row; gap: 6px; border-radius: 10px; font-size: 13px; color: #fff; transition: background .15s; }
  .tabbtn:active { transform: none; }
  .tabbtn:hover { background: rgba(0, 0, 0, .14); }
  .tabbtn:focus-visible { outline-color: #fff; }
  .tabbtn .icon { width: 18px; height: 18px; }
  .tabbtn[aria-current="page"] { color: #fff; background: rgba(0, 0, 0, .22); }
  .tabbtn[data-tab="search"] { display: none; } /* ya está el buscador del header */
  .tabbtn__dot { position: static; background: #fff; color: var(--red-dark); box-shadow: none; }

  /* Carrito lateral */
  .deskcart {
    display: flex; flex-direction: column; overflow: hidden;
    position: sticky; top: calc(var(--head-h) + 16px); height: calc(100dvh - var(--head-h) - 32px); margin-top: 16px;
    background: var(--bg); border-radius: var(--r-l);
  }
  .shell:not(.with-cart) .deskcart { display: none; }
  .deskcart.pulse { animation: deskPulse .7s var(--ease); }
  @keyframes deskPulse { 30% { box-shadow: 0 0 0 3px var(--red); } }
  .deskcart__head { flex: none; padding: 16px 16px 6px; }
  .deskcart__head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; }
  .deskcart__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; scrollbar-width: thin; }
  .deskcart .card { margin: 10px 10px 0; }
  .deskcart .empty { padding: 44px 24px; }
  .deskcart .view__foot { padding: 12px; box-shadow: none; border-top: 1px solid var(--line); }
  .card--rail .rail { scrollbar-width: thin; padding-bottom: 8px; }

  /* Inicio y menú: sin carriles (con ratón no se puede deslizar), todo a la vista */
  .apphead__red { display: none; }
  .apphead { padding: 16px 0 12px; }
  .statusline { margin-top: 0; }
  .main .rail { flex-wrap: wrap; overflow: visible; padding-inline: 0; scroll-snap-type: none; }
  .main .block__head, .main .section__head, .main .items, .resultcount, .searchhead { padding-inline: 0; }
  .main .rail.promos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .promo:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .promo { width: auto; height: 172px; }
  .promo:hover { transform: translateY(-2px); }
  .catcard { width: 92px; }
  .catcard img, .catcard .noimg { width: 84px; height: 84px; transition: transform .15s var(--ease); }
  .catcard:hover img { transform: scale(1.05); }
  .main .rail.featured { display: grid; grid-template-columns: repeat(auto-fill, 172px); justify-content: space-between; gap: 20px 12px; }
  .main .rail.featured > :nth-child(n + 7) { display: none; }
  .fcard { width: 172px; }
  .fcard__img { width: 172px; height: 172px; }
  .fcard .addbtn { top: 128px; }
  .fcard__open:hover h3 { color: var(--red); }
  .chips { gap: 6px; }
  .chip:hover:not([aria-pressed="true"]) { background: var(--line); }

  .main .items { gap: 12px; }
  .main .item {
    padding: 12px; border: 1px solid var(--line) !important; border-radius: var(--r-m); background: var(--surface);
    transition: box-shadow .15s, border-color .15s;
  }
  .main .item:hover { border-color: #d9d2cd !important; box-shadow: var(--shadow-1); }
  .main .item:has(.addbtn:focus-visible), .main .item:has(.item__open:focus-visible) { box-shadow: var(--shadow-1); }
  .item__open { border-radius: var(--r-m); }
  .item__media .addbtn { right: 4px; bottom: 4px; }
  .main .items > .rowbtn { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-m); }
  .main .items > .rowbtn:hover { background: var(--bg); }
  .addbtn:hover { transform: scale(1.1); }
  .foot { padding-inline: 0; }

  /* Pedidos y cuenta: columna centrada */
  .page--tint { width: 100%; max-width: 860px; min-height: 0; margin: 20px auto 0; padding-bottom: 20px; border-radius: var(--r-l); background: var(--bg); overflow: hidden; }
  .page--tint .foot { padding-inline: 16px; }

  /* Hoja de producto: foto a la izquierda, opciones a la derecha */
  #pdp { width: min(940px, calc(100vw - 64px)); height: min(88dvh, 680px); max-height: none; }
  #pdp .sheet__scroll, #pdp .sheet__foot { margin-left: 46%; }
  #pdp .pdp__hero { position: absolute; inset: 0 54% 0 0; width: auto; aspect-ratio: auto; max-height: none; }
  #pdp .pdp__bar { display: none; }
  #pdp .pdp__info { padding: 22px 64px 8px 16px; }
  #pdp [data-act="close"] { left: auto !important; right: 12px !important; }
  #pdp [data-act="fav"] { right: auto !important; left: 12px !important; }
  .iconbtn:hover { background: var(--bg); }
  .iconbtn--float:hover { background: #fff; }
  .opt:hover { background: var(--bg); }
  button.rowbtn:hover, a.rowbtn:hover { color: var(--red-dark); }

  /* Pago y seguimiento: ventana centrada */
  #checkoutView, #trackView {
    inset: 4dvh 0; margin-inline: auto; width: min(1000px, calc(100vw - 48px)); overflow: hidden;
    border-radius: var(--r-l); box-shadow: 0 16px 60px rgba(0, 0, 0, .28);
    animation-name: modalPop; transition: transform .2s, opacity .2s;
  }
  #trackView { width: 560px; }
  .layer.is-closing #checkoutView, .layer.is-closing #trackView { transform: scale(.97); opacity: 0; }
  #checkoutScroll { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-content: start; align-items: start; column-gap: 4px; padding: 4px 8px 20px; }
  #checkoutScroll > .card { grid-column: 1; }
  #checkoutScroll > .card:nth-last-child(2) { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 10px; }
  #checkoutScroll > .foot { grid-column: 1; }
  #checkoutFoot { justify-content: flex-end; }
  #checkoutFoot .btn { flex: 0 0 372px; }

  .btn:hover { background: var(--red-dark); }
  .btn--ghost:hover { background: var(--line); }
  .btn--line:hover { background: var(--red-tint); }
  .pill:hover:not([aria-pressed="true"]) { background: var(--bg); }
  .cityopt:hover { background: var(--bg); }
}

@media (min-width: 1400px) {
  .items { grid-template-columns: repeat(3, 1fr); }
  .items > .item:nth-last-child(3):nth-child(3n + 1), .items > .item:nth-last-child(2):nth-child(3n + 1), .items > .item:nth-last-child(2):nth-child(3n + 2) { border-bottom: 0; }
  .main .rail.featured > :nth-child(n + 7) { display: block; }
  .main .rail.promos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .promo:last-child:nth-child(odd) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Páginas normales del sitio (cuenta, pedido, páginas) ---------- */
.topbar--plain { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar--plain .plainlink { color: #fff; font-weight: 700; font-size: 13px; }
.plainpage { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; min-height: 60dvh; }
.plainfoot { padding: 18px 16px calc(18px + var(--sab)); text-align: center; color: var(--ink-2); font-size: 12px; }
.plainflash { padding: 10px 14px; border-radius: var(--r-s); margin-bottom: 12px; font-weight: 600; }
.plainflash--ok { background: #e8f6ee; color: var(--green); }
.plainflash--bad { background: var(--red-tint); color: var(--red-dark); }

/* KoraPoints */
.kora { display: flex; align-items: center; gap: 16px; padding: 18px; margin: 10px 12px 0; border-radius: var(--r-l); background: linear-gradient(135deg, #fff 0%, var(--red-tint) 100%); border: 1px solid #f6d3d4; box-shadow: var(--shadow-1); color: var(--ink); }
.kora__ic { flex: none; width: 64px; height: 64px; border-radius: 50%; background: #fff; padding: 4px; box-shadow: 0 0 0 1px #f6d3d4, 0 4px 12px rgba(217, 33, 40, .12); object-fit: contain; }
.kora__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kora__txt small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-dark); }
.kora__txt strong { font-size: 17px; font-weight: 600; line-height: 1.25; }
.kora__txt strong b { font-size: 26px; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; }
.kora__txt span { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.kora__btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.plainpage .kora { margin: 16px 0; }
