/* ==========================================================================
   Rulfo Café — estilos
   Paleta tomada del logo (negro y oro) y de las cartas impresas (papel y salvia)
   ========================================================================== */
:root {
  --espresso: #1c140f;
  --espresso-2: #2a1f18;
  --espresso-3: #3a2c22;
  --oro: #c9a35b;
  --oro-claro: #efd08e;
  --oro-oscuro: #8a6326;
  --oro-grad: linear-gradient(100deg, #8a6326 0%, #c99c52 28%, #f2d491 50%, #b8883f 72%, #8a6326 100%);
  --papel: #f3ece0;
  --papel-2: #faf6ef;
  --papel-3: #ebe2d2;
  --tinta: #2b211a;
  --tinta-suave: #6b5f55;
  --linea: #d9cbb4;
  --salvia: #66775d;
  --salvia-suave: #e2e6d9;
  --alerta: #a3402c;

  --f-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --f-texto: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --top-h: 60px;
  --radio: 14px;
  --sombra-hoja: 0 -12px 40px rgba(28, 20, 15, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.bloqueado { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--oro); color: var(--espresso); padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(28, 20, 15, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  color: var(--papel);
  border-bottom: 1px solid rgba(201, 163, 91, .18);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: auto; }
.brand-name { font-family: var(--f-display); font-weight: 600; letter-spacing: .08em; font-size: 15px; color: var(--oro-claro); }
.estado { margin: 0 0 0 auto; display: flex; align-items: center; gap: 7px; font-size: 13px; color: #d8cdbd; white-space: nowrap; }
.estado-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b8178; }
.estado.abierto .estado-dot { background: #7fbf6a; box-shadow: 0 0 0 3px rgba(127, 191, 106, .2); }
.estado.pronto .estado-dot { background: #e0b04f; box-shadow: 0 0 0 3px rgba(224, 176, 79, .2); }
.estado.cerrado .estado-dot { background: #d0705c; }
.topbar-cart {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid rgba(201, 163, 91, .35); color: var(--oro-claro);
}
.topbar-cart svg { width: 21px; height: 21px; }
.topbar-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--oro); color: var(--espresso);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.topbar-count.pulso { animation: pulso .45s var(--ease); }
@keyframes pulso { 40% { transform: scale(1.35); } }

/* ---------- Portada ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 10%, rgba(201, 163, 91, .14), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(102, 119, 93, .12), transparent 70%),
    var(--espresso);
  color: var(--papel);
}
.hero::after { /* grano de papel */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: 36px 16px 34px;
  display: grid; gap: 8px;
}
.hero-mark { position: relative; width: min(58vw, 260px); margin: 0 auto; order: -1; }
.hero-mark img { width: 100%; height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); }
.hero-sheen { /* brillo único al cargar */
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("../assets/img/logo-r-web.png") center / contain no-repeat;
  mask: url("../assets/img/logo-r-web.png") center / contain no-repeat;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 220, .85) 50%, transparent 65%) -200% 0 / 250% 100% no-repeat;
  animation: sheen 2.2s .5s var(--ease) both;
}
@keyframes sheen { to { background-position: 200% 0; } }
.hero-copy { text-align: center; }
.wordmark {
  margin: 4px 0 0;
  display: flex; align-items: center; justify-content: center; gap: .32em;
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(34px, 9vw, 64px); line-height: 1.05; letter-spacing: .1em; text-transform: uppercase;
}
.wordmark span {
  background: var(--oro-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark .bean { width: .34em; height: .48em; stroke: none; }
.wordmark .bean ellipse { fill: var(--oro); }
.wordmark .bean path { fill: none; stroke: var(--espresso); stroke-width: 1.8; }
.hero-sub { margin: 14px auto 0; max-width: 34em; color: #d9cfc1; font-size: 16.5px; line-height: 1.55; }
.mesa-banner {
  margin: 18px auto 0; max-width: 420px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(201, 163, 91, .14); border: 1px solid rgba(201, 163, 91, .4);
  color: var(--oro-claro); font-weight: 600;
}

/* Selector de modalidad (portada y carrito) */
.modos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.modo {
  position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px 13px; border-radius: 12px;
  background: rgba(250, 246, 239, .04);
  border: 1px solid rgba(201, 163, 91, .28);
  color: var(--papel);
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.modo svg { width: 24px; height: 24px; color: var(--oro); }
.modo-titulo { font-weight: 600; font-size: 15px; line-height: 1.2; }
.modo-detalle { font-size: 12.5px; color: #b9ad9e; line-height: 1.3; }
.modo:hover { border-color: rgba(201, 163, 91, .6); }
.modo[aria-checked="true"] {
  background: rgba(201, 163, 91, .14);
  border-color: var(--oro);
  box-shadow: inset 0 0 0 1px var(--oro);
}
.modo[aria-checked="true"]::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--oro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c140f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.modo:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Diseño general ---------- */
.layout {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
.menu { min-width: 0; padding: 0 16px 40px; outline: none; scroll-margin-top: var(--top-h); }

/* Herramientas pegajosas: buscador + pestañas */
.menu-tools {
  position: sticky; top: var(--top-h); z-index: 30;
  margin: 0 -16px; padding: 12px 16px 0;
  background: rgba(243, 236, 224, .96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.buscar {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--papel-2); border: 1px solid var(--linea);
  color: var(--tinta-suave);
}
.buscar:focus-within { border-color: var(--oro); box-shadow: 0 0 0 3px rgba(201, 163, 91, .2); }
.buscar input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--tinta); }
.buscar input::placeholder { color: #9a8e82; }
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 8px -16px 0; padding: 0 16px;
  scroll-padding-inline: 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tab {
  flex: none; position: relative;
  padding: 10px 12px 12px; border: 0; background: none;
  font-size: 14.5px; font-weight: 500; color: var(--tinta-suave); white-space: nowrap;
}
.tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--espresso); transform: scaleX(0); transition: transform .25s var(--ease);
}
.tab[aria-current="true"] { color: var(--espresso); font-weight: 600; }
.tab[aria-current="true"]::after { transform: scaleX(1); }

/* Secciones del menú */
.seccion { padding-top: 34px; scroll-margin-top: calc(var(--top-h) + 118px); }
.seccion-cabeza { margin-bottom: 10px; }
.seccion h2 {
  margin: 0; font-family: var(--f-display); font-weight: 600;
  font-size: 25px; letter-spacing: .06em; color: var(--espresso);
}
.seccion-nota { margin: 4px 0 0; font-size: 14px; color: var(--salvia); }
.seccion-nota.no-disponible { color: var(--alerta); }
.seccion-foto {
  margin: 14px 0 6px; border-radius: var(--radio); overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--papel-3);
}
.seccion-foto img { width: 100%; height: 100%; object-fit: cover; }
.seccion-foto.temporada img { object-position: 50% 62%; }
.seccion-foto.mixologia img { object-position: 50% 60%; }

/* Renglón de producto — estilo carta impresa con puntos guía */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin: 0 -10px; padding: 4px 10px; border-radius: 12px;
  transition: background .15s;
}
.item:hover { background: var(--papel-2); }
.item-abrir {
  display: block; width: 100%; text-align: left;
  padding: 10px 0; border: 0; background: none;
}
.item-linea { display: flex; align-items: baseline; gap: 6px; }
.item-nombre { font-weight: 600; font-size: 16.5px; color: var(--tinta); }
.item-guia { flex: 1; min-width: 18px; border-bottom: 1.5px dotted #b9a98f; transform: translateY(-4px); }
.item-precio { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tinta); white-space: nowrap; }
.item-precio small { font-weight: 500; color: var(--tinta-suave); font-size: 12.5px; margin-right: 4px; }
.item-desc { margin: 3px 0 0; font-size: 14px; color: var(--tinta-suave); line-height: 1.45; max-width: 52ch; }
.item-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item-etiquetas:not(:has(.etq:not([hidden]))) { display: none; }
.etq { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--salvia-suave); color: var(--salvia); }
.etq.oro { background: rgba(201, 163, 91, .2); color: #7a5720; }
.etq.edad { background: #efe0dc; color: var(--alerta); }
.etq.en-pedido { background: var(--espresso); color: var(--oro-claro); }
.item-mas {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--espresso); background: var(--espresso); color: var(--oro-claro);
  transition: transform .15s var(--ease), background .15s;
}
.item-mas svg { width: 18px; height: 18px; stroke-width: 2.2; }
.item-mas:hover { transform: scale(1.06); }
.item-mas:active { transform: scale(.94); }
.item.no-disponible .item-nombre, .item.no-disponible .item-precio { color: #9d9186; }
.item.no-disponible .item-mas { background: transparent; border-color: var(--linea); color: #b3a796; cursor: not-allowed; transform: none; }
.item.no-disponible .item-abrir { cursor: default; }

.sin-resultados { padding: 40px 0; text-align: center; color: var(--tinta-suave); }
.link { border: 0; background: none; padding: 0; color: var(--espresso); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Carrito ---------- */
.carrito {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  max-height: calc(100dvh - 40px); height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  background: var(--papel-2); color: var(--tinta);
  border-radius: 20px 20px 0 0; box-shadow: var(--sombra-hoja);
  transform: translateY(105%); visibility: hidden;
  transition: transform .38s var(--ease), visibility 0s .38s;
}
.carrito.abierto { transform: none; visibility: visible; transition: transform .38s var(--ease), visibility 0s; }
.carrito-cabeza {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--linea);
}
.carrito-cabeza h2 { margin: 0; font-family: var(--f-display); font-size: 21px; letter-spacing: .05em; color: var(--espresso); }
.carrito-cabeza .cuenta { color: var(--tinta-suave); font-size: 14px; }
.cerrar {
  margin-left: auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--linea); background: var(--papel-2); color: var(--tinta);
}
.carrito-cuerpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 18px; }
.carrito-pie { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); background: var(--papel-2); }

.carrito .modos { margin-top: 0; gap: 8px; }
.carrito .modo { background: var(--papel); border-color: var(--linea); color: var(--tinta); padding: 11px 10px; }
.carrito .modo svg { color: var(--espresso); width: 22px; height: 22px; }
.carrito .modo-detalle { color: var(--tinta-suave); font-size: 12px; }
.carrito .modo[aria-checked="true"] { background: #fff; border-color: var(--espresso); box-shadow: inset 0 0 0 1px var(--espresso); }
.carrito .modo[aria-checked="true"]::after { background-color: var(--espresso); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efd08e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E"); }
.modo-info { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 13.5px; color: var(--tinta-suave); }
.modo-info svg { width: 17px; height: 17px; margin-top: 2px; color: var(--salvia); }

.vacio { text-align: center; padding: 34px 10px 20px; color: var(--tinta-suave); }
.vacio img { width: 64px; margin: 0 auto 12px; opacity: .9; }
.vacio p { margin: 0 auto; max-width: 26ch; }

.lineas { list-style: none; margin: 18px 0 0; padding: 0; }
.linea { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--papel-3); }
.linea:last-child { border-bottom: 0; }
.linea-nombre { font-weight: 600; font-size: 15px; line-height: 1.3; }
.linea-ops { font-size: 13px; color: var(--tinta-suave); margin-top: 2px; }
.linea-nota { font-size: 13px; color: var(--salvia); margin-top: 2px; font-style: italic; }
.linea-precio { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
.linea-aviso { font-size: 12.5px; color: var(--alerta); margin-top: 3px; font-weight: 600; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--linea); border-radius: 20px; background: #fff; }
.stepper button { width: 30px; height: 30px; border: 0; background: none; display: grid; place-items: center; color: var(--espresso); border-radius: 50%; }
.stepper button svg { width: 15px; height: 15px; stroke-width: 2.3; }
.stepper span { min-width: 20px; text-align: center; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.stepper.grande button { width: 42px; height: 42px; }
.stepper.grande button svg { width: 18px; height: 18px; }
.stepper.grande span { min-width: 26px; font-size: 16px; }

/* Formulario */
.bloque { margin-top: 22px; }
.bloque-titulo { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--espresso); }
.campo { display: block; margin-bottom: 12px; }
.campo-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; color: var(--tinta); }
.campo-label em { font-style: normal; font-weight: 500; color: var(--tinta-suave); }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--linea); background: #fff; font-size: 16px; color: var(--tinta);
  transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(201, 163, 91, .22); }
.campo.error input, .campo.error textarea, .campo.error select { border-color: var(--alerta); box-shadow: 0 0 0 3px rgba(163, 64, 44, .12); }
.campo-error { display: none; margin-top: 5px; font-size: 13px; color: var(--alerta); font-weight: 600; }
.campo.error .campo-error { display: block; }
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-ubicacion {
  display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 12px;
  padding: 9px 13px; border-radius: 20px; border: 1px dashed var(--salvia); background: transparent;
  color: var(--salvia); font-weight: 600; font-size: 14px;
}
.btn-ubicacion.ok { border-style: solid; background: var(--salvia-suave); }
.btn-ubicacion svg { width: 17px; height: 17px; }

.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcion span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 8px 14px; border-radius: 22px; border: 1px solid var(--linea); background: #fff;
  font-size: 14.5px; font-weight: 500; transition: all .15s;
}
.opcion span b { font-weight: 600; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }
.opcion input:checked + span { background: var(--espresso); border-color: var(--espresso); color: var(--papel); }
.opcion input:checked + span b { color: var(--oro-claro); }
.opcion input:focus-visible + span { outline: 2px solid var(--oro); outline-offset: 2px; }
.grupo.error .opcion span { border-color: var(--alerta); }
.grupo-error { display: none; margin: 6px 0 0; font-size: 13px; color: var(--alerta); font-weight: 600; }
.grupo.error .grupo-error { display: block; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: #f3e6e1; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--espresso); flex: none; }
.check.error { box-shadow: inset 0 0 0 1.5px var(--alerta); }

/* Totales y envío */
.totales { display: grid; gap: 4px; margin-bottom: 12px; font-size: 14.5px; }
.totales div { display: flex; justify-content: space-between; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }
.totales .total { color: var(--tinta); font-size: 18px; font-weight: 700; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 20px; border-radius: 26px; border: 1px solid transparent;
  font-weight: 600; font-size: 15.5px; text-decoration: none; transition: transform .15s var(--ease), background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-enviar { width: 100%; min-height: 54px; background: var(--espresso); color: var(--oro-claro); font-size: 16.5px; }
.btn-enviar:hover { background: var(--espresso-2); }
.btn-enviar svg { width: 22px; height: 22px; }
.btn-enviar[aria-disabled="true"] { background: #8e8379; color: #f1ebe2; cursor: not-allowed; }
.pie-nota { margin: 9px 0 0; font-size: 12.5px; text-align: center; color: var(--tinta-suave); }
.pie-nota.alerta { color: var(--alerta); font-weight: 600; }
.btn-claro { background: var(--papel-2); color: var(--espresso); border-color: var(--linea); }
.btn-claro:hover { border-color: var(--espresso); }
.btn-oscuro { background: var(--espresso); color: var(--oro-claro); }

/* Barra flotante (móvil) */
.barra-carrito {
  position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 0 18px 0 10px; border-radius: 30px; border: 1px solid rgba(201, 163, 91, .4);
  background: var(--espresso); color: var(--papel);
  box-shadow: 0 10px 30px rgba(28, 20, 15, .35);
  animation: subir .35s var(--ease);
}
@keyframes subir { from { transform: translateY(120%); } }
.barra-count { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 19px; display: grid; place-items: center; background: var(--oro); color: var(--espresso); font-weight: 700; }
.barra-label { font-weight: 600; }
.barra-total { margin-left: auto; font-weight: 700; color: var(--oro-claro); font-variant-numeric: tabular-nums; }

/* ---------- Hoja de producto (diálogo) ---------- */
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20, 14, 10, .5); animation: aparecer .25s ease; }
@keyframes aparecer { from { opacity: 0; } }
.hoja {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--papel-2); border-radius: 20px 20px 0 0; box-shadow: var(--sombra-hoja);
  animation: hojaSube .35s var(--ease);
}
@keyframes hojaSube { from { transform: translateY(100%); } }
.hoja-cuerpo { overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 10px; }
.hoja-cabeza { display: flex; align-items: flex-start; gap: 12px; }
.hoja h2 { margin: 0; font-size: 23px; font-weight: 700; line-height: 1.2; color: var(--espresso); }
.hoja-desc { margin: 6px 0 0; color: var(--tinta-suave); font-size: 15px; }
.hoja .cerrar { margin-left: auto; flex: none; }
.hoja .grupo { margin-top: 20px; }
.grupo-titulo { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.grupo-titulo small { font-weight: 500; font-size: 12.5px; color: var(--tinta-suave); }
.hoja-pie { display: flex; align-items: center; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.hoja-pie .btn { flex: 1; }

/* Confirmación */
.confirmacion {
  position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(20, 14, 10, .62); animation: aparecer .25s ease;
}
.conf-caja {
  width: min(440px, 100%); text-align: center; padding: 30px 24px 24px; border-radius: 20px;
  background: var(--espresso); color: var(--papel); border: 1px solid rgba(201, 163, 91, .35);
}
.conf-caja img { width: 92px; margin: 0 auto 14px; }
.conf-caja h2 { margin: 0; font-family: var(--f-display); font-size: 23px; letter-spacing: .05em; color: var(--oro-claro); }
.conf-caja p { margin: 10px 0 0; color: #d9cfc1; }
.conf-folio { display: inline-block; margin-top: 14px; padding: 6px 12px; border-radius: 8px; background: rgba(201, 163, 91, .14); color: var(--oro-claro); font-weight: 600; letter-spacing: .04em; }
.conf-acciones { display: grid; gap: 10px; margin-top: 22px; }
.conf-acciones .btn-oro { background: var(--oro); color: var(--espresso); }
.conf-acciones .btn-linea { background: transparent; color: var(--papel); border-color: rgba(243, 236, 224, .3); }

/* Aviso breve */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px;
  background: var(--tinta); color: var(--papel); font-size: 14.5px; font-weight: 500;
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
body.bloqueado .toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); }

/* ---------- Visítanos ---------- */
.visitanos { background: var(--papel-3); border-top: 1px solid var(--linea); }
.visitanos-inner { max-width: 1180px; margin: 0 auto; padding: 44px 16px 48px; display: grid; gap: 26px; }
.visitanos h2 { margin: 0 0 10px; font-family: var(--f-display); font-size: 27px; letter-spacing: .06em; color: var(--espresso); }
.direccion { margin: 0; font-size: 16px; max-width: 34ch; }
.horario { margin-top: 18px; display: grid; gap: 4px; max-width: 360px; }
.horario-fila { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; padding: 4px 0; border-bottom: 1px dotted #c4b498; }
.horario-fila span:last-child { font-variant-numeric: tabular-nums; }
.horario-fila.hoy { font-weight: 700; color: var(--espresso); }
.horario-nota { font-size: 14px; color: var(--salvia); margin-top: 8px; }
.visitanos-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.redes { list-style: none; display: flex; gap: 10px; padding: 0; margin: 20px 0 0; }
.redes a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--espresso); color: var(--oro-claro); transition: transform .15s var(--ease);
}
.redes a:hover { transform: translateY(-2px); }
.mapa { min-height: 280px; border-radius: var(--radio); overflow: hidden; background: var(--papel-2); border: 1px solid var(--linea); }
.mapa iframe { width: 100%; height: 100%; min-height: 280px; border: 0; display: block; filter: sepia(.18) saturate(.9); }
.mapa-cargar { width: 100%; height: 100%; min-height: 280px; border: 0; background: var(--papel-2); color: var(--espresso); font-weight: 600; display: grid; place-items: center; gap: 8px; }

.footer { text-align: center; padding: 34px 16px calc(100px + env(safe-area-inset-bottom)); background: var(--espresso); color: #b9ad9e; font-size: 14px; }
.footer img { width: 56px; margin: 0 auto 10px; }
.footer p { margin: 4px 0; }
.footer-legal { font-size: 12.5px; color: #8f8478; }

/* ---------- Pantallas medianas ---------- */
@media (min-width: 640px) {
  .hero-inner { padding: 48px 24px 44px; }
  .menu { padding: 0 24px 56px; }
  .menu-tools { margin: 0 -24px; padding: 14px 24px 0; }
  .tabs { margin: 8px -24px 0; padding: 0 24px; }
  .modo { padding: 16px 14px 15px; }
  .modo-titulo { font-size: 16px; }
  .modo-detalle { font-size: 13px; }
  .seccion h2 { font-size: 28px; }
  .hoja { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, calc(100% - 48px)); max-height: min(86dvh, 760px); border-radius: 20px; transform: translate(-50%, -50%); animation: hojaZoom .3s var(--ease); }
  @keyframes hojaZoom { from { opacity: 0; transform: translate(-50%, -46%); } }
  .visitanos-inner { padding: 56px 24px 60px; grid-template-columns: 1fr 1.2fr; align-items: stretch; }
  .barra-carrito { left: 50%; right: auto; width: 420px; transform: translateX(-50%); animation: none; }
}

/* ---------- Escritorio: carrito fijo a la derecha ---------- */
@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 40px; padding: 64px 24px 60px; }
  .hero-copy { text-align: left; }
  .wordmark { justify-content: flex-start; }
  .hero-sub { margin-left: 0; font-size: 17.5px; }
  .mesa-banner { margin-left: 0; }
  .hero-mark { order: 0; width: min(100%, 400px); }
  .modos { max-width: 560px; }

  .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 36px; padding: 0 24px; }
  .menu { padding: 0 0 64px; }
  .menu-tools { margin: 0; padding: 14px 0 0; }
  .tabs { margin: 8px 0 0; padding: 0; }
  .carrito {
    position: sticky; inset: auto; top: calc(var(--top-h) + 18px); z-index: 1; align-self: start;
    height: calc(100vh - var(--top-h) - 36px); max-height: none;
    margin-top: 18px; border-radius: 18px; border: 1px solid var(--linea);
    box-shadow: 0 8px 30px rgba(28, 20, 15, .07);
    transform: none; visibility: visible; transition: none;
  }
  .carrito .cerrar { display: none; }
  .barra-carrito, .topbar-cart { display: none !important; }
  .scrim.solo-movil { display: none !important; }
  .footer { padding-bottom: 34px; }
  .toast { bottom: 28px; }
}

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


/* ==========================================================================
   MEJORAS AÑADIDAS: CLUB RULFO, FIDELIDAD, REPETIR PEDIDO Y EXTRAS
   ========================================================================== */

/* Topbar Club */
.topbar-club {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 20px;
  background: rgba(201, 163, 91, .15); border: 1px solid rgba(201, 163, 91, .35);
  color: var(--oro-claro); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all .15s ease;
}
.topbar-club:hover { background: rgba(201, 163, 91, .28); border-color: var(--oro); }
.topbar-bean { width: 12px; height: 17px; stroke: var(--oro); stroke-width: 2.2; }
.club-badge-num { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--oro); color: var(--espresso); font-weight: 700; }

/* Banner Repetir último pedido */
.repetir-banner {
  margin: 14px auto 0; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(243, 236, 224, .1); border: 1px solid rgba(201, 163, 91, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-align: left;
}
.repetir-info { display: flex; align-items: center; gap: 10px; }
.repetir-info svg { width: 22px; height: 22px; color: var(--oro); flex: none; }
.repetir-tit { display: block; font-weight: 600; font-size: 14px; color: var(--oro-claro); }
.repetir-det { display: block; font-size: 12.5px; color: #cfc4b4; margin-top: 1px; }
.repetir-acciones { display: flex; align-items: center; gap: 8px; flex: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 18px; }
.btn-cerrar-banner { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; }
.btn-cerrar-banner:hover { color: #fff; }

/* Buscador con botón limpiar */
.buscar-wrapper { position: relative; width: 100%; }
.buscar-limpiar-x {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.08);
  color: var(--tinta-suave); font-size: 18px; display: grid; place-items: center; cursor: pointer;
}
.buscar-limpiar-x:hover { background: rgba(0,0,0,.15); color: var(--tinta); }

/* Club Rulfo (Fidelidad) Sección */
.fidelidad {
  padding: 48px 16px; background: var(--espresso); color: var(--papel);
  border-top: 1px solid rgba(201,163,91,.2); position: relative; overflow: hidden;
}
.fidelidad-inner { max-width: 900px; margin: 0 auto; }
.fidelidad-card {
  background: var(--espresso-2); border: 1.5px solid rgba(201, 163, 91, .38);
  border-radius: 24px; padding: 32px 24px 28px; box-shadow: 0 16px 40px rgba(0,0,0,.35);
  position: relative;
}
.fidelidad-cabeza { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.fidelidad-emblema { display: flex; align-items: center; gap: 14px; }
.bean-oro { width: 28px; height: 38px; stroke: var(--oro); stroke-width: 2.2; }
.fidelidad-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--oro); }
.fidelidad-card h2 { margin: 2px 0 0; font-family: var(--f-display); font-size: 28px; letter-spacing: .06em; color: var(--oro-claro); }
.fidelidad-progreso-num {
  font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: .05em;
  padding: 6px 14px; border-radius: 20px; background: rgba(201,163,91,.15); border: 1px solid rgba(201,163,91,.3); color: var(--oro-claro);
}
.fidelidad-desc { margin: 16px 0 24px; font-size: 16px; color: #d8cdbd; max-width: 60ch; line-height: 1.5; }
.fidelidad-desc strong { color: var(--oro-claro); }

/* Grid de sellos */
.fidelidad-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 680px; margin: 0 auto 24px;
}
@media (max-width: 500px) {
  .fidelidad-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
.sello {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed rgba(201, 163, 91, .4); background: rgba(28, 20, 15, .5);
  color: #7d7266; transition: all .3s var(--ease); position: relative;
}
.sello svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; }
.sello .sello-num { font-size: 11px; font-weight: 700; font-family: var(--f-display); }
.sello.activo {
  border-style: solid; border-color: var(--oro);
  background: radial-gradient(circle at center, #c9a35b 0%, #8a6326 100%);
  color: var(--espresso); box-shadow: 0 0 16px rgba(201, 163, 91, .35);
  animation: selloPop .35s var(--ease);
}
.sello.activo svg { stroke: var(--espresso); stroke-width: 2.2; }
.sello.activo .sello-num { color: var(--espresso); }
.sello.premio { border-color: var(--oro-claro); }
.sello.premio.activo {
  background: radial-gradient(circle at center, #f5dfa9 0%, #c9a35b 100%);
  box-shadow: 0 0 24px rgba(239, 208, 142, .6);
}
@keyframes selloPop { 0% { transform: scale(.7); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Premio desbloqueado */
.fidelidad-premio {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px;
  background: rgba(201,163,91,.18); border: 1.5px solid var(--oro); margin-bottom: 20px;
}
.premio-ico { font-size: 32px; flex: none; }
.premio-txt strong { display: block; font-size: 16px; color: var(--oro-claro); margin-bottom: 2px; }
.premio-txt p { margin: 0; font-size: 14px; color: #e8ded2; }

.fidelidad-pie {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 18px; border-top: 1px solid rgba(201,163,91,.18); font-size: 13.5px; color: #a4988a;
}
.fidelidad-tip { display: flex; align-items: center; gap: 8px; margin: 0; }
.fidelidad-tip svg { width: 18px; height: 18px; color: var(--oro); flex: none; }

/* Feedback cambio efectivo */
.cambio-feedback { margin-top: 8px; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.cambio-feedback.ok { background: #e5f4e1; color: #286422; }
.cambio-feedback.falta { background: #fbeae7; color: var(--alerta); }

/* Botón copiar pedido */
.btn-copiar {
  width: 100%; min-height: 46px; background: transparent; color: var(--papel);
  border: 1px solid rgba(243,236,224,.35); border-radius: 24px; font-weight: 600; font-size: 14.5px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s ease;
}
.btn-copiar:hover { background: rgba(255,255,255,.08); border-color: var(--oro); }
.btn-copiar.copiado { background: #286422; border-color: #286422; color: #fff; }

/* Extras checkboxes */
.opcion-check input:checked + span {
  background: var(--espresso); border-color: var(--espresso); color: var(--papel);
}
.opcion-check input:checked + span b { color: var(--oro-claro); }
