:root {
  /* Paleta de elrincondememetla.mx: amarillo, texto casi negro, verde de la marca y beige. */
  --marigold: #F5C36B; --on-brand: #191919; --accent: #5C8328; --accent-ink: #527623; --error: #C2362F;
  --bg: #FFFFFF; --surface: #FFFFFF; --row: #F4F1ED; --text: #191919; --muted: #565656; --line: rgba(25,25,25,.10);
  --shadow: 0 6px 24px rgba(25,25,25,.07); --r-card: 24px; --r-ctl: 16px; --r-tile: 20px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-title: Montserrat, "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #141311; --surface: #232220; --row: #2A2825; --text: #F4F1ED; --muted: #C9C4BD; --line: rgba(255,255,255,.10); --accent: #8FC24A; --accent-ink: #8FC24A; --error: #FF8F87; --shadow: none; }
}
:root[data-theme="dark"] { --bg: #141311; --surface: #232220; --row: #2A2825; --text: #F4F1ED; --muted: #C9C4BD; --line: rgba(255,255,255,.10); --accent: #8FC24A; --accent-ink: #8FC24A; --error: #FF8F87; --shadow: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.err { color: var(--error); font-size: 14px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--marigold); color: var(--on-brand); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.noscript { padding: 24px; }

/* Estructura: barra inferior en teléfono, lateral en pantallas anchas. */
.shell { min-height: 100dvh; }
main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 820px; margin: 0 auto; outline: none; }
.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: 1px solid var(--line); }
.tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 12px; }
.tabs a svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs a[aria-current="page"] svg { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.tabs .brand { display: none; }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
@media (min-width: 900px) {
  .tabs { top: 0; right: auto; width: 240px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; font-size: 16px; }
  .tabs a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .tabs .brand { display: flex; color: var(--text); font-weight: 800; font-size: 15px; margin-bottom: 12px; }
  .tabs .brand img { width: 40px; height: 40px; border-radius: 50%; }
  .badge { position: static; margin-left: auto; }
  main { margin-left: max(256px, calc(50% - 410px + 128px)); padding-bottom: 48px; }
}

/* Superficies y controles */
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--marigold); color: var(--on-brand); font-weight: 750; cursor: pointer; text-decoration: none; width: 100%; }
.btn:disabled { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); cursor: not-allowed; }
.btn.secondary { background: var(--row); color: var(--text); }
.btn.dark { background: var(--on-brand); color: var(--marigold); }
.btn.small { min-height: 44px; width: auto; padding: 0 16px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent); font-weight: 650; cursor: pointer; text-decoration: underline; }
.danger { color: var(--error); }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--row); border: 0; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--marigold); color: var(--on-brand); }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.field input, .field textarea, .field select, .search input { min-height: 48px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font-weight: 400; }
.field textarea { padding: 12px 14px; min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Inicio */
.hello { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.hello img { width: 48px; height: 48px; border-radius: 50%; }
.search { display: flex; align-items: center; gap: 8px; background: var(--row); border-radius: 999px; padding: 0 8px 0 16px; }
.search input { flex: 1; border: 0; background: transparent; padding: 0; outline: none; }
.search svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.cat-dot { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; text-align: center; }
.cat-dot .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--marigold); display: grid; place-items: center; overflow: hidden; }
.cat-dot .ic img { width: 72px; height: 72px; object-fit: cover; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-tile); background: var(--row); text-decoration: none; color: var(--text); }
.banner .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--marigold); display: grid; place-items: center; font-size: 22px; }

/* Productos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 12px; align-items: start; }
/* Tarjeta como en la app: foto 3:4 con el precio en pastilla, nombre (2 renglones) y existencias debajo. */
.pcard { display: flex; flex-direction: column; gap: 6px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); transition: transform .15s; }
.pcard:active { transform: scale(.98); }
.pcard.out { opacity: .55; }
.ph { position: relative; width: 100%; border-radius: var(--r-tile); overflow: hidden; background: var(--row); display: grid; place-items: center; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph img.fill { object-fit: cover; }
.ph img.fit { object-fit: contain; }
.ph img.blur { object-fit: cover; filter: blur(18px); opacity: .55; transform: scale(1.15); }
.ph .placeholder { width: 32px; height: 32px; color: var(--muted); }
.price-pill { position: absolute; right: 8px; bottom: 8px; padding: 4px 12px; border-radius: 999px; font-weight: 750; font-size: 15px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6); border: 1px solid var(--line); }
.pcard .name { font-weight: 700; font-size: 16px; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.promo { width: 200px; }
.stock { font-size: 13px; font-weight: 650; color: var(--accent); min-height: 1em; }
.stock.out { color: var(--error); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px; border-radius: var(--r-tile); background: var(--row); text-decoration: none; color: var(--text); font-weight: 700; text-align: center; }
.cat-tile .ic { width: 88px; height: 88px; border-radius: 50%; background: var(--marigold); display: grid; place-items: center; overflow: hidden; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--accent); text-decoration: none; font-weight: 650; background: none; border: 0; padding: 0; cursor: pointer; }

/* Hoja de producto / diálogos */
dialog#sheet { border: 0; padding: 0; width: min(560px, 100%); max-height: 92dvh; border-radius: 28px; background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog#sheet::backdrop { background: rgba(0,0,0,.4); }
@media (max-width: 600px) { dialog#sheet { margin: auto 0 0; max-width: 100%; border-radius: 28px 28px 0 0; } }
.sheet-body { padding: 0 20px 20px; overflow: auto; max-height: 92dvh; }
.sheet-top { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 12px 0 8px; z-index: 2; background: var(--bg); }
.close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--row); font-size: 20px; cursor: pointer; }
.hero { border-radius: var(--r-card); overflow: hidden; background: var(--row); margin: 0 0 16px; aspect-ratio: 4/3; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 700; margin-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: var(--r-ctl); background: var(--row); cursor: pointer; }
.opt input { width: 22px; height: 22px; accent-color: var(--accent); }
.opt .plus { margin-left: auto; color: var(--muted); font-size: 14px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--row); border-radius: 999px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper button:disabled { opacity: .4; }
.stepper output { min-width: 28px; text-align: center; font-weight: 750; }

/* Carrito y pedidos */
.line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .info { flex: 1; min-width: 0; }
.sum { display: flex; justify-content: space-between; gap: 12px; }
.sum.total { font-weight: 800; font-size: 20px; }
.hint { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-ctl); background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 15px; }
.hint img { width: 36px; height: 36px; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--row); }
.steps span.on { background: var(--accent); }
.order-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-tile); background: var(--row); text-decoration: none; color: var(--text); }

/* Maíz que suma */
.loyal { background: var(--marigold); color: var(--on-brand); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.loyal a, .loyal .link { color: var(--on-brand); }
.stamps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; justify-items: center; }
.stamps img { width: 100%; max-width: 72px; aspect-ratio: 1; object-fit: contain; }
.stamps .s { position: relative; width: 100%; display: grid; place-items: center; }
.stamps .s.gift::after { content: ""; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--on-brand)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5C36B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11h16v9H4zM3 7h18v4H3zM12 7v13'/%3E%3C/svg%3E") center / 12px no-repeat; }
.stamps .s.new img { animation: stamp .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--on-brand); color: var(--marigold); font-weight: 700; font-size: 15px; align-self: flex-start; }
.qr { background: #fff; padding: 16px; border-radius: 16px; display: grid; place-items: center; }

/* Perfil */
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--marigold); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 36px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.list { display: flex; flex-direction: column; border-radius: var(--r-tile); background: var(--row); overflow: hidden; }
.list > a, .list > button { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 0; background: none; text-align: left; color: var(--text); text-decoration: none; cursor: pointer; border-bottom: 1px solid var(--line); }
.list > :last-child { border-bottom: 0; }
.list .chev::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 22px; }
.crop { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 50%; overflow: hidden; background: #000; touch-action: none; cursor: grab; }
.crop canvas { width: 100%; height: 100%; }

/* Inicio de sesión con Apple (guía de Apple: botón negro / blanco) */
.apple-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 12px; border: 0; background: #000; color: #fff; font-weight: 600; font-size: 18px; cursor: pointer; }
.apple-btn svg { width: 18px; height: 22px; fill: currentColor; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .apple-btn { background: #fff; color: #000; } }

/* Pago */
.field .row > label, .stack-s .row > label.field { flex: 1; min-width: 0; }
.pay-head { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }

#toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -120%); transition: transform .3s; z-index: 50;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 12px 18px; border-radius: 999px; font-weight: 650; max-width: calc(100% - 32px); }
#toast.show { transform: translate(-50%, 0); }
.empty { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty img { width: 160px; }
.paymarks { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 34px; }
.paymarks img { width: 44px; height: auto; display: block; }

/* Íconos de línea */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.banner .dot .ic { width: 24px; height: 24px; color: var(--on-brand); }
.close { display: grid; place-items: center; color: var(--text); }
.back .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.list > a .ic, .list > div .ic { color: var(--accent); }
.hint .ic, .pill .ic { width: 22px; height: 22px; }
.stepper .ic { width: 18px; height: 18px; }
.thumb { width: 60px; flex: none; }
.thumb .ph { border-radius: 12px; }
.welcome-logo { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; box-shadow: 0 6px 24px rgba(25,25,25,.15); }

/* ============ Controles con el comportamiento de la app (iOS) que funcionan igual en Android y escritorio ============ */
:root { --press: cubic-bezier(.34, 1.56, .64, 1); --tint: color-mix(in srgb, var(--accent) 10%, transparent); --fill: color-mix(in srgb, var(--text) 7%, transparent); }
body { font-family: var(--font); }
h1, h2, h3, .pcard .name, .cat-tile, .loyal h2, .sum.total, .price-pill { font-family: var(--font-title); }
.cat-dot { font-weight: 600; font-size: 13px; }
h1 { font-weight: 800; letter-spacing: -.02em; } h2 { font-weight: 700; letter-spacing: -.01em; } h3 { font-weight: 700; }
a, button, label, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--marigold) 45%, transparent); }

/* Botón principal: cápsula de 52 pt, texto "headline", se encoge al 97 % al tocar (como PrimaryButtonStyle). */
.btn { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; text-align: center; padding: 14px 22px; user-select: none; -webkit-user-select: none;
  transition: transform .22s var(--press), filter .15s, background-color .2s, box-shadow .2s; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 14px color-mix(in srgb, var(--marigold) 35%, transparent); }
.btn:active:not(:disabled) { transform: scale(.97); filter: brightness(.94); }
.btn:disabled { box-shadow: none; }
.btn.secondary { background: var(--fill); color: var(--text); box-shadow: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn.dark { box-shadow: none; }
.btn.small { font-size: 15px; padding: 10px 18px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { filter: brightness(1.04); }
  .btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 11%, transparent); }
  .chip:hover, .list > a:hover, .list > button:hover, .opt:hover { background-color: color-mix(in srgb, var(--text) 9%, transparent); }
  .pcard:hover .ph img.fill, .pcard:hover .ph img.fit { transform: scale(1.03); }
}
.ph img.fill, .ph img.fit { transition: transform .35s ease; }

/* Botón de texto (como los botones "plain" de iOS): sin subrayado, color de acento. */
.link { text-decoration: none; font-weight: 600; font-size: 16px; padding: 0 4px; border-radius: 8px; transition: opacity .15s; }
.link:active { opacity: .45; }
.link.danger, .danger { color: var(--error); }

/* Chips (propina, regalo): cápsula de 44 pt como GlassChip. */
.chip { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 500; background: var(--fill); color: var(--text); border: 1px solid transparent;
  transition: transform .2s var(--press), background-color .15s; user-select: none; -webkit-user-select: none; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--marigold); color: var(--on-brand); font-weight: 600; }

/* Selector de cantidad (− n +): botones de 48 pt en verde sobre cápsula tenue (QuantityStepper). */
.stepper { background: var(--tint); padding: 0; gap: 0; }
.stepper button { width: 48px; height: 48px; background: none; color: var(--accent); font-size: 22px; font-weight: 500; display: grid; place-items: center; border-radius: 50%; transition: transform .2s var(--press); }
.stepper button:active:not(:disabled) { transform: scale(.85); }
.stepper output { font-variant-numeric: tabular-nums; min-width: 24px; color: var(--text); }

/* Renglones de opción (entrega, forma de pago, opciones del platillo) con selección tipo iOS. */
.opt { gap: 12px; min-height: 52px; border: 1.5px solid transparent; transition: background-color .15s, border-color .15s; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.opt:active { transform: scale(.99); }
.opt input[type="radio"], .opt input[type="checkbox"], .check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; width: 24px; height: 24px; flex: none; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 50%; display: grid; place-items: center; background: var(--surface); transition: background-color .15s, border-color .15s; cursor: pointer; }
.opt input[type="checkbox"], .check input[type="checkbox"] { border-radius: 7px; }
.opt input:checked, .check input:checked { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat; border-color: var(--accent); }
.opt input:disabled { opacity: .5; cursor: not-allowed; }
.opt input:focus-visible, .check input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* Campos de texto: relleno agrupado sin borde, foco con anillo de acento (16 px o más para que iOS no haga zoom). */
.field input, .field textarea, .field select, input.coupon-input {
  font-size: 17px; border: 1.5px solid transparent; background: var(--row); border-radius: 12px; min-height: 50px; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background-color .15s; -webkit-appearance: none; appearance: none; }
.field input:focus, .field textarea:focus, .field select:focus, input.coupon-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); background: var(--surface); }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input[type="date"] { min-width: 0; }
input[type="range"] { accent-color: var(--accent); width: 100%; height: 32px; }

/* Listas tipo "Ajustes": renglón de 52 pt con resaltado al tocar. */
.list { border-radius: 16px; }
.list > a, .list > button { transition: background-color .12s; font-size: 17px; }
.list > a:active, .list > button:active { background: color-mix(in srgb, var(--text) 12%, transparent); }
.list .chev::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .6; margin-right: 4px; }

/* Enlace de regreso como el botón "atrás" de la barra de navegación. */
.back { font-size: 17px; font-weight: 400; gap: 2px; margin-left: -6px; padding: 0 6px; border-radius: 10px; transition: opacity .15s; }
.back:active { opacity: .45; }

/* Hoja (diálogo): asa en teléfono, botón de cierre circular gris como en iOS. */
.grabber { display: none; }
@media (max-width: 600px) {
  .grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 45%, transparent); margin: 8px auto 0; }
  dialog#sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1); }
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.close { width: 36px; height: 36px; background: var(--row); opacity: 1; transition: transform .2s var(--press); }
.close:active { transform: scale(.9); }
.close .ic { width: 16px; height: 16px; stroke-width: 2.6; color: var(--text); }
dialog#sheet::backdrop { background: rgba(0,0,0,.35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

/* Tarjetas tocables y pestañas: misma respuesta al toque. */
.pcard, .cat-dot, .cat-tile, .banner, .order-row { transition: transform .22s var(--press); }
.cat-dot:active, .cat-tile:active, .banner:active, .order-row:active { transform: scale(.97); }
.tabs a { transition: color .15s, transform .2s var(--press); }
.tabs a:active { transform: scale(.92); }
a.hint { text-decoration: none; color: var(--text); transition: transform .2s var(--press); }
a.hint::after { content: ""; margin-left: auto; width: 8px; height: 8px; flex: none; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .6; }
a.hint:active { transform: scale(.98); }

/* ============ Paleta de la app aplicada como en iOS ============
   Amarillo #F5C36B (marca, botón principal, íconos en círculo) · texto #191919 · gris #565656
   Verde #5C8328 del botón de la página (íconos y resaltados; #527623 en texto) · blanco y beige #F4F1ED (fondos agrupados), como elrincondememetla.mx */
/* Tarjetas: superficie + borde 8 % + sombra suave (cardSurface). */
.card { box-shadow: 0 4px 10px rgba(0,0,0,.06); }
/* Avisos (sellos, regalo): tarjeta blanca como StampHint, no verde. */
.hint { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 10px rgba(0,0,0,.06); border-radius: var(--r-ctl); padding: 12px; color: var(--text); font-weight: 500; }
.hint img { width: 44px; height: 44px; }
.hint > .ic, h3.row > .ic { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--marigold); color: var(--on-brand); stroke-width: 2; }
/* Aviso informativo: caléndula al 35 % con texto tinta (como el aviso de entrega de la app). */
.hint.notice { background: color-mix(in srgb, var(--marigold) 35%, transparent); border-color: transparent; box-shadow: none; color: var(--on-brand); }
:root[data-theme="dark"] .hint.notice { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hint.notice { color: var(--text); } }
/* Botones secundarios: estilo "bordered" teñido de verde (como .buttonStyle(.bordered).tint(DS.accent)). */
.btn.secondary { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, transparent); } }
/* Enlaces de la interfaz: verde sin subrayado (en párrafos de texto legal sí se subrayan). */
.section-head a, .hint a, .back, .list a, .banner, .order-row, .cat-dot, .cat-tile { text-decoration: none; }
.section-head a { font-weight: 600; font-size: 15px; }
/* Pedido activo: bolsa verde en círculo caléndula (como la app). */
.banner .dot .ic { color: var(--accent); }
/* Opción elegida: borde verde sobre la superficie (sin teñir el fondo). */
.opt:has(input:checked) { background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
/* Iconos de la lista de contacto en verde, como los SF Symbols con tinte de acento. */
.list .ic { color: var(--accent); }
.gift-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--marigold); color: var(--on-brand); display: grid; place-items: center; flex: none; }
.gift-dot .ic { width: 22px; height: 22px; stroke-width: 2; }

/* Verde de texto (enlaces, existencias, botones de texto): tono #4B7A0A para leerse bien sobre blanco y beige. */
a, .link, .back, .stock, .section-head a, .btn.secondary, .tabs a[aria-current="page"] { color: var(--accent-ink); }
.link.danger, .danger { color: var(--error); }
.btn.secondary { background: color-mix(in srgb, var(--accent) 13%, transparent); }
/* Botón principal: amarillo de la página con texto casi negro. */
.btn { background: var(--marigold); color: var(--on-brand); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 14px color-mix(in srgb, var(--marigold) 40%, transparent); }
.btn.dark { background: var(--on-brand); color: var(--marigold); }
:root[data-theme="dark"] .btn.dark { background: #191919; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.dark { background: #191919; } }
/* La tarjeta de lealtad y los círculos de categoría usan el amarillo con texto negro. */
.loyal, .loyal a, .loyal .link { color: #191919; }
.pill { background: #191919; color: var(--marigold); }

/* Interruptor (como el de Ajustes en iOS; en Android y escritorio se ve igual) */
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 17px; cursor: pointer; }
.list > .switch-row:last-child { border-bottom: 0; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: color-mix(in srgb, var(--muted) 30%, transparent); position: relative; flex: none; cursor: pointer; transition: background-color .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .25s var(--press); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Botones para entrar: Apple (negro/blanco, guía de Apple) y Google (botón oficial), misma altura y forma */
.login-buttons { align-items: stretch; }
.apple-btn { min-height: 44px; border-radius: 999px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; font-size: 17px; font-weight: 500; transition: transform .2s var(--press), opacity .15s; }
.apple-btn:active { transform: scale(.97); }
.apple-btn svg { width: 16px; height: 19px; margin-top: -2px; }
.login-buttons { max-width: 400px; width: 100%; margin: 0 auto; }

/* Íconos Memetla (Figma): dos tonos — trazo del color del texto + acento amarillo de la marca */
.ic path.a { fill: var(--icon-accent, var(--marigold)); stroke: none; transition: opacity .2s; }
.ic path.s { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tabs a svg.tab-ic { fill: none; width: 26px; height: 26px; }
.tabs a:not([aria-current="page"]) .ic path.a { opacity: 0; }   /* inactiva: sólo trazo; activa: dos tonos (como iOS) */
.tabs a[aria-current="page"] svg.tab-ic { fill: none; }
/* Íconos dentro de un círculo amarillo: el acento pasa a crema para no perderse */
.hint > .ic, h3.row > .ic, .gift-dot .ic, .banner .dot .ic, .pill .ic { --icon-accent: #FFF4DC; }
.pill .ic { --icon-accent: var(--marigold); color: var(--marigold); }
.search .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search .ic path.a { opacity: .55; }

/* ================= Adaptación por plataforma ================= */
/* Android (Material 3): Material Symbols, indicador en cápsula en la pestaña activa, botón atrás con flecha. */
.ms.material-symbols-rounded { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; width: 1em; height: 1em;
  display: inline-flex; align-items: center; justify-content: center; letter-spacing: normal; text-transform: none; white-space: nowrap; overflow: hidden;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; flex: none; }
.platform-android .hint > .ms, .platform-android h3.row > .ms, .platform-android .gift-dot .ms, .platform-android .banner .dot .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.platform-android .hint > .ms, .platform-android h3.row > .ms { width: 40px; height: 40px; font-size: 22px; border-radius: 50%; background: var(--marigold); color: var(--on-brand); }
.platform-android .tabs a { font-size: 12px; font-weight: 500; letter-spacing: .01em; gap: 4px; }
.platform-android .tabs .m3-ind { display: grid; place-items: center; width: 64px; height: 32px; border-radius: 16px; transition: background-color .2s; }
.platform-android .tabs .m3-ind .ms { font-size: 24px; }
.platform-android .tabs a[aria-current="page"] .m3-ind { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.platform-android .tabs a[aria-current="page"] .ms { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.platform-android .tabs a[aria-current="page"] { color: var(--text); }
.platform-android .tabs a:active { transform: none; }
.platform-android .tabs { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 0; box-shadow: 0 -1px 0 var(--line); }
.platform-android .back { gap: 8px; font-weight: 500; }
.platform-android .back .ms { font-size: 22px; }
.platform-android .btn, .platform-android .chip { letter-spacing: .01em; }
.platform-android .btn:active:not(:disabled) { transform: none; filter: brightness(.92); }   /* Android: respuesta por color, no por escala */
.platform-android .search .ms { color: var(--muted); font-size: 22px; }
.platform-android .list .ms { color: var(--accent); }
.platform-android .pill .ms { font-size: 20px; }
@media (min-width: 900px) { .platform-android .tabs a { flex-direction: row; } .platform-android .tabs .m3-ind { width: 40px; } }

/* iPhone / iPad: íconos Memetla de dos tonos y barra translúcida (estilo iOS); pestaña activa con relleno. */
.platform-ios .tabs a { font-size: 10.5px; font-weight: 500; }
.platform-ios .tabs a svg.tab-ic { width: 28px; height: 28px; }
.platform-ios .ic path.s { stroke-width: 1.6; }

/* Escritorio: barra lateral con los íconos Memetla; el cursor muestra qué se puede tocar. */
.platform-desktop .tabs a svg.tab-ic { width: 24px; height: 24px; }
@media (hover: hover) { .platform-desktop .tabs a:hover:not([aria-current="page"]) { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
  .platform-desktop .tabs a:hover .ic path.a { opacity: 1; } }

/* Ya instalada como app: más aire arriba para la barra de estado */
.installed main { padding-top: calc(16px + env(safe-area-inset-top)); }

/* "Continuar con Google": botón propio con la "G" oficial, misma forma que el de Apple (guía de marca de Google: fondo blanco, borde gris) */
.google-btn-own { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; border-radius: 999px; cursor: pointer;
  background: #fff; color: #1F1F1F; border: 1px solid #747775; font-family: Roboto, "DM Sans", system-ui, sans-serif; font-size: 16px; font-weight: 500;
  transition: transform .2s var(--press), background-color .15s; }
.google-btn-own svg { width: 18px; height: 18px; flex: none; }
.google-btn-own:active { transform: scale(.97); background: #F2F2F2; }
@media (hover: hover) { .google-btn-own:hover { background: #F8F8F8; } }
:root[data-theme="dark"] .google-btn-own { background: #131314; color: #E3E3E3; border-color: #8E918F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .google-btn-own { background: #131314; color: #E3E3E3; border-color: #8E918F; } }
.platform-android .google-btn-own:active { transform: none; }

/* Sin anillo de foco al cambiar de pantalla (el foco va al contenido para lectores de pantalla, no se dibuja) */
#view:focus, #view:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible, dialog:focus, dialog:focus-visible { outline: none; }

/* Aviso emergente: totalmente oculto (no sólo desplazado) mientras no hay mensaje; en iPhone el margen de la barra de estado lo dejaba asomar. */
#toast { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, calc(-100% - 24px - env(safe-area-inset-top)));
  transition: transform .3s, opacity .2s, visibility 0s linear .3s; }
#toast:empty { display: none; }
#toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: transform .3s, opacity .2s, visibility 0s; }

/* Invitación de iPhone: agregar a la pantalla de inicio / activar notificaciones */
.ios-invite h2 { font-size: 20px; }
.ios-app-icon { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.15); flex: none; }
.ios-steps { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ios-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--row); font-size: 15px; line-height: 1.45; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--marigold); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ios-glyph { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: #007AFF; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ios-more { display: inline-block; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, #007AFF 12%, transparent); color: #007AFF; font-weight: 700; letter-spacing: 1px; font-size: 12px; line-height: 18px; vertical-align: 1px; }
.invite-bell { width: 72px; height: 72px; border-radius: 50%; background: var(--marigold); display: grid; place-items: center; margin: 0 auto; color: var(--on-brand); --icon-accent: #FFF4DC; }
.invite-bell .ic { width: 36px; height: 36px; }

/* Entrar con correo / llaves de acceso */
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 4px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 92px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--accent-ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.google-btn-own .ic { width: 20px; height: 20px; color: currentColor; }
.google-btn-own .ms { font-size: 20px; }
.google-btn-own { --icon-accent: #F5C36B; }
form .field input[type="email"], form .field input[type="password"], form .field input[type="text"] { width: 100%; }

/* Campo de contraseña: la etiqueta y el botón "Mostrar" van separados */
div.field { display: flex; flex-direction: column; gap: 6px; }
div.field > label { font-weight: 600; font-size: 15px; }
.pw-toggle { min-height: 44px; min-width: 64px; right: 2px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.forgot-link { align-self: flex-end; margin-top: -4px; padding: 6px 2px; }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Botón de llave de acceso: ícono de llave de acceso (FIDO) a la izquierda, igual de grande que Apple y Google */
.passkey-btn .pk { width: 22px; height: 22px; fill: currentColor; flex: none; }
.passkey-btn .ms { font-size: 22px; }
.invite-bell .pk { width: 28px; height: 28px; fill: currentColor; }

/* Cupón: resultado animado (palomita y confeti al canjear; equis y sacudida si no sirve) */
.coupon-status:empty { display: none; }
.coupon-banner { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-ctl); font-weight: 600; font-size: 15px; animation: cp-pop .45s cubic-bezier(.2,1.3,.4,1) both; }
.coupon-banner.ok { background: color-mix(in srgb, #5C8328 16%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, #5C8328 50%, transparent); }
.coupon-banner.bad { background: color-mix(in srgb, #C0392B 14%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, #C0392B 50%, transparent); }
.coupon-banner.still { animation: none; justify-content: space-between; }
.cp-mark { width: 34px; height: 34px; flex: none; fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.coupon-banner.ok .cp-mark { stroke: #5C8328; } .coupon-banner.bad .cp-mark { stroke: #C0392B; }
.cp-ring { stroke-dasharray: 150; stroke-dashoffset: 150; animation: cp-draw .5s .05s ease-out forwards; }
.cp-tick { stroke-dasharray: 50; stroke-dashoffset: 50; animation: cp-draw .35s .4s ease-out forwards; }
.shake { animation: cp-shake .45s ease-in-out; }
.confetti { position: absolute; left: 30px; top: 50%; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; width: 7px; height: 11px; border-radius: 2px; opacity: 0; animation: cp-burst 1s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes cp-draw { to { stroke-dashoffset: 0; } }
@keyframes cp-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cp-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes cp-burst { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .coupon-banner, .cp-ring, .cp-tick, .shake { animation: none !important; } .cp-ring, .cp-tick { stroke-dashoffset: 0; } }

.field input.locked { background: color-mix(in srgb, var(--surface) 70%, var(--line)); color: var(--muted); cursor: not-allowed; }
.lock-note::before { }

.free-note { color: var(--accent); font-weight: 600; }

.need-note { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--brand) 28%, transparent); padding: 6px 10px; border-radius: 8px; }

/* Sugerencias en el carrito */
.suggestions .hscroll { margin: 0 -16px; padding: 0 16px 6px; }
.pcard.sugg { width: 148px; gap: 8px; cursor: default; }
.pcard.sugg .pcard-open { display: flex; flex-direction: column; gap: 6px; text-align: left; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
.pcard.sugg .sugg-add { width: 100%; }
.suggestions .goal { margin: 0; }

/* Seguimiento de la entrega: mapa interactivo */
.track-map { width: 100%; aspect-ratio: 4 / 3; max-height: 420px; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--surface); position: relative; z-index: 0; display: grid; place-items: center; }
.track-info { display: flex; flex-direction: column; gap: 8px; }
.trk-pin span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.35); border: 2px solid #fff; }
.trk-pin svg { width: 22px; height: 22px; }
.trk-pin.store span { background: #F5C36B; color: #291F08; }
.trk-pin.home span { background: #5C8328; color: #fff; }
.trk-pin.courier span { background: #1F1B14; color: #F5C36B; }
.trk-pin.courier.live span { animation: trk-pulse 1.8s ease-out infinite; }
@keyframes trk-pulse { 0% { box-shadow: 0 0 0 0 rgba(245,195,107,.7); } 100% { box-shadow: 0 0 0 16px rgba(245,195,107,0); } }
@media (prefers-reduced-motion: reduce) { .trk-pin.courier.live span { animation: none; } }

.notes-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.card textarea { min-height: 84px; padding: 12px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font: inherit; width: 100%; resize: vertical; }
.card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }

  padding: 6px 14px; border-radius: 999px; background: var(--card, #fff); color: var(--ink, #3b2a1a); box-shadow: 0 2px 10px rgba(0,0,0,.15); font-size: .85rem; transition: opacity .15s; }
body, html { overscroll-behavior-y: contain; }

.maps-links { gap: 8px; flex-wrap: wrap; align-items: center; }
.maps-links .small { flex: 1 1 100%; }
.maps-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; flex: 1 1 120px; width: auto; }

.chat { display: flex; flex-direction: column; gap: 2px; height: min(55dvh, 460px); overflow-y: auto; padding: 12px 14px; border-radius: 18px; background: var(--card, #fff); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.bubble { position: relative; max-width: 78%; padding: 8px 14px; border-radius: 18px; line-height: 1.32; font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; }
.bubble + .bubble { margin-top: 2px; }
.bubble.user { align-self: flex-end; background: #0e7a3a; color: #fff; }
.bubble.bot, .bubble.agent { align-self: flex-start; background: #e9e9eb; color: #111; }
.bubble.agent { background: #fdeeb0; }
.bubble.user:not(:has(+ .bubble.user))::after { content: ""; position: absolute; right: -6px; bottom: 0; width: 16px; height: 16px; background: #0e7a3a; border-bottom-left-radius: 16px 14px; }
.bubble.user:not(:has(+ .bubble.user))::before { content: ""; position: absolute; right: -10px; bottom: 0; width: 10px; height: 16px; background: var(--card, #fff); border-bottom-left-radius: 10px; z-index: 1; }
.bubble:is(.bot,.agent):not(:has(+ .bubble:is(.bot,.agent)))::after { content: ""; position: absolute; left: -6px; bottom: 0; width: 16px; height: 16px; background: inherit; border-bottom-right-radius: 16px 14px; }
.bubble:is(.bot,.agent):not(:has(+ .bubble:is(.bot,.agent)))::before { content: ""; position: absolute; left: -10px; bottom: 0; width: 10px; height: 16px; background: var(--card, #fff); border-bottom-right-radius: 10px; z-index: 1; }
@media (prefers-color-scheme: dark) { .bubble.bot { background: #2c2c2e; color: #fff; } .bubble.agent { background: #4a3f12; color: #fff; } }
.chat-form { display: flex; gap: 8px; align-items: center; } .chat-form input { flex: 1; border-radius: 22px; padding: 10px 16px; }
.mark { text-align: center; font-size: .72rem; line-height: 1.5; opacity: .55; padding: 8px 16px calc(88px + env(safe-area-inset-bottom)); }
.mark strong { font-weight: 700; }
main { padding-bottom: 8px; }

.chat-products { display: grid; gap: 6px; margin-top: 8px; }
.chat-all { width: 100%; }
.chat-product { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.85); color: #111; }

/* Aviso de cierre especial: la imagen se ajusta al alto y ancho disponibles en cualquier pantalla */
.closure-bar { display: block; width: 100%; border: 0; padding: 10px 16px; background: #f5a009; color: #3a1a52; font: inherit; font-size: .92rem; text-align: center; cursor: pointer; }
.closure-dlg { border: 0; padding: 0; background: transparent; border-radius: 18px; overflow: hidden; max-width: 96vw; max-height: 94dvh; }
.closure-dlg::backdrop { background: rgba(0,0,0,.6); }
.closure-dlg img { display: block; width: auto; height: auto; max-width: min(96vw, 560px); max-height: 92dvh; object-fit: contain; }
.closure-dlg form { position: absolute; top: 8px; right: 8px; z-index: 1; }
.closure-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.sync-opt { display: grid; gap: 4px; text-align: left; width: 100%; cursor: pointer; border: 0; font: inherit; color: inherit; padding: 14px 16px; }

/* Círculo de espera en botones y en el cupón mientras se procesa */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 2.5px solid rgba(128,128,128,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; color: var(--ink); }
.btn.busy:not(.secondary)::after { border-top-color: var(--ink); }
.spin-sm { flex: none; width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.coupon-wait { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 14px; color: var(--muted, inherit); }
@media (prefers-reduced-motion: reduce) { .btn.busy::after, .spin-sm { animation-duration: 1.6s; } }

.express{margin-bottom:6px}.express[hidden]{display:none}

/* Categorías con foto propia: la imagen ya trae su aro y fondo, sin círculo de color detrás. */
.cat-dot .ic.photo, .cat-tile .ic.photo { background: transparent; overflow: visible; }
.cat-dot .ic.photo img, .cat-tile .ic.photo img { object-fit: contain; width: 100%; height: 100%; }

/* Bienvenida: tarjeta emergente flotante tipo App Clip */
dialog#sheet.clip { background: transparent; box-shadow: none; overflow: visible; max-height: none; width: min(520px, calc(100% - 24px)); margin: auto auto 12px; border-radius: 0; }
dialog#sheet.clip::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.clip-card { background: var(--bg); color: var(--text); border-radius: 36px; overflow: hidden; max-height: calc(100dvh - 36px); overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.45); animation: clip-in .38s cubic-bezier(.2,.9,.25,1.05); }
@keyframes clip-in { from { transform: translateY(40px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .clip-card { animation: none; } }
.clip-hero { position: relative; aspect-ratio: 16 / 10; background: var(--row); }
.clip-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 16% 50%; display: block; }
.clip-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--marigold); color: var(--on-brand, #1b1b1b); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.clip-close .ic { width: 20px; height: 20px; stroke-width: 2.6; }
.clip-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.clip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clip-head h2 { font-size: 30px; line-height: 1.05; margin: 0; }
.clip-sub { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.clip-go { width: auto; min-width: 124px; border-radius: 999px; padding: 0 26px; flex: none; }
.clip-body h3 { font-size: 16px; margin: 4px 0 0; }
.clip-body .btn.ghost { background: var(--row); color: var(--accent); }
.clip-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.clip-foot img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.clip-foot p { margin: 0; }

.hero.gal { position: relative; }
.gal-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; }
.gal-slide img { width: 100%; height: 100%; object-fit: cover; }
.gal-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gal-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 2px rgba(0,0,0,.4); }
.gal-dots i.on { background: #fff; transform: scale(1.25); }

/* Contacto + idioma: tres íconos al inicio del contenido (se van con el scroll) */
.contactbar { display: flex; gap: 8px; justify-content: flex-end; align-items: center; position: relative; z-index: 12; max-width: 820px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 16px; box-sizing: border-box; }
@media (min-width: 900px) { .contactbar { margin-left: max(256px, calc(50% - 410px + 128px)); } }
.contactbar .cb { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.contactbar .cb svg { width: 20px; height: 20px; fill: currentColor; }
.contactbar .cg.msg .cb { color: #0a84ff; } .contactbar .cb.tel { color: #128c4a; } .contactbar .cg.lang .cb svg { fill: none; }
.contactbar .cg { position: relative; }
.contactbar .menu { position: absolute; right: 0; top: 46px; min-width: 190px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.contactbar .menu[hidden] { display: none; }
.contactbar .menu a, .contactbar .menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.contactbar .menu a:hover, .contactbar .menu button:hover { background: var(--row); }
.contactbar .menu svg { width: 20px; height: 20px; fill: currentColor; flex: none; } .contactbar .menu a:first-child svg { color: #128c4a; } .contactbar .menu a:last-child svg { color: #0a84ff; }
.contactbar .menu button.on { color: var(--accent-ink); } .contactbar .menu button.on::after { content: "✓"; margin-left: auto; }

/* Selector de LADA internacional */
.lada-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; position: relative; }
.lada-wrap { position: relative; display: flex; gap: 8px; }
.lada-wrap input[type="tel"] { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font-weight: 400; font: inherit; color: var(--text); }
.lada-wrap input[type="tel"]:focus, .lada-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.lada-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; flex: none; }
.lada-btn i { font-style: normal; font-size: 11px; color: var(--muted); }
.lada-menu { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(0,0,0,.28); padding: 10px; }
.lada-q { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 400; margin-bottom: 8px; }
.lada-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.lada-list li { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; cursor: pointer; font-weight: 400; }
.lada-list li:hover, .lada-list li:focus { background: var(--row); outline: none; }
.lada-list li b { flex: 1; font-weight: 500; }
.lada-list li em { font-style: normal; color: var(--muted); }
.lada-list li[aria-selected="true"] { background: var(--tint); }
.lada-list li.none { color: var(--muted); cursor: default; justify-content: center; }
