:root {
  --fondo: #06110a;
  --panel: #0c1c12;
  --panel2: #11261a;
  --borde: #1c3826;
  --verde: #14873f;
  --verde2: #0f6b32;
  --oro: #f3b734;
  --oro2: #ffd36b;
  --texto: #f5f2e9;
  --suave: #a7b7ab;
  --tenue: #6d8373;
  --rojo: #e5484d;
  --radio: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(20, 135, 63, .35), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
  color: var(--texto);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

button { font: inherit; color: inherit; cursor: pointer; }

/* Encabezado */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 16px 14px;
  max-width: 640px;
  margin: 0 auto;
}
.logo { width: 92px; height: auto; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
.hero h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .3px; line-height: 1.1; }
.hero h1 span { color: var(--oro); display: block; }
.sub { margin: 4px 0 0; color: var(--suave); text-transform: uppercase; letter-spacing: 4px; font-size: 11px; }
.mesa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 5px 14px 5px 10px;
  background: rgba(243, 183, 52, .12);
  border: 1px solid rgba(243, 183, 52, .55);
  border-radius: 999px;
  color: var(--oro2);
  font-weight: 800;
  font-size: 15px;
}
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--tenue); display: inline-block; }
.punto.on { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }

.aviso-qr {
  max-width: 600px;
  margin: 0 auto 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(229, 72, 77, .12);
  border: 1px solid rgba(229, 72, 77, .45);
  color: #ffc9cb;
  font-size: 14px;
  text-align: center;
}

/* Menú / Mi cuenta */
.vistas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 600px;
  margin: 0 auto 4px;
  padding: 0 14px;
  gap: 8px;
}
.vista {
  border: 1px solid var(--borde);
  background: var(--panel);
  border-radius: 12px;
  padding: 11px 0;
  font-weight: 800;
  color: var(--suave);
}
.vista.activo { background: var(--oro); border-color: var(--oro); color: #1b1404; }

/* Barra fija */
.barra {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(6, 17, 10, .97);
  border-bottom: 1px solid var(--borde);
  padding: 10px 14px 10px;
}
.tabs, .chips, .buscar, main, .cuenta { max-width: 600px; margin-left: auto; margin-right: auto; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 4px;
}
.tab { border: 0; border-radius: 10px; padding: 10px 0; background: transparent; color: var(--suave); font-weight: 800; }
.tab.activo { background: linear-gradient(180deg, var(--verde), var(--verde2)); color: #fff; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--borde);
  background: var(--panel);
  color: var(--texto);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.chip:active { background: var(--panel2); }

.buscar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 12px;
}
.buscar svg { width: 18px; height: 18px; fill: var(--suave); flex: none; }
.buscar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--texto); font: inherit; padding: 10px 0;
}
.buscar input::placeholder { color: var(--tenue); }

/* Lista */
main { padding: 4px 14px 20px; }
.grupo { scroll-margin-top: 170px; }
.grupo-cab { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; }
.grupo-cab h2 { margin: 0; font-size: 18px; font-weight: 800; }
.grupo-cab small { color: var(--tenue); font-weight: 600; margin-left: auto; font-size: 13px; }

.ico {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid transparent;
}
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.peq { width: 34px; height: 34px; border-radius: 10px; }
.ico.peq svg { width: 19px; height: 19px; }

.tarjetas { display: grid; gap: 10px; }
.prod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  min-height: 70px;
}
.prod-info { flex: 1; min-width: 0; }
.prod-n { font-weight: 700; font-size: 15.5px; line-height: 1.25; overflow-wrap: anywhere; }
.prod-p { margin-top: 3px; color: var(--oro); font-weight: 800; font-variant-numeric: tabular-nums; }

.mas {
  flex: none;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: var(--oro);
  color: #1b1404;
  font-size: 26px; font-weight: 800; line-height: 1;
  display: grid; place-items: center;
}
.mas:active { transform: scale(.94); }
.paso {
  flex: none;
  display: inline-flex;
  align-items: center;
  background: var(--oro);
  border-radius: 999px;
  color: #1b1404;
  height: 42px;
}
.paso button { width: 40px; height: 42px; border: 0; background: transparent; font-size: 22px; font-weight: 800; color: #1b1404; }
.paso b { min-width: 22px; text-align: center; font-size: 16px; }

.estado { text-align: center; color: var(--suave); padding: 36px 10px; }
.pie { text-align: center; color: var(--tenue); font-size: 13px; padding: 6px 16px 20px; }
.pie p { margin: 2px 0; }

/* Barra del carrito */
.carrito-barra {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 8;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--verde), var(--verde2));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.cb-cant { background: var(--oro); color: #1b1404; border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; padding: 0 8px; }
.cb-txt { flex: 1; text-align: left; font-size: 17px; }
.cb-total { font-size: 17px; font-variant-numeric: tabular-nums; }

/* Hoja inferior */
.hoja-fondo { position: fixed; inset: 0; z-index: 9; background: rgba(0, 0, 0, .6); }
.hoja {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  max-width: 640px;
  margin: 0 auto;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #0b1a10;
  border: 1px solid var(--borde);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.hoja-asa { width: 44px; height: 5px; border-radius: 3px; background: #2b4a35; margin: 8px auto 0; }
.hoja-cab { display: flex; align-items: center; padding: 8px 18px 6px; }
.hoja-cab h2 { margin: 0; font-size: 19px; flex: 1; }
.cerrar { border: 0; background: var(--panel2); width: 36px; height: 36px; border-radius: 50%; color: var(--suave); }
.hoja-cuerpo { overflow-y: auto; padding: 4px 18px 8px; flex: 1; }
.hoja-pie { padding: 12px 18px 16px; border-top: 1px solid var(--borde); }

.linea { padding: 12px 0; border-bottom: 1px solid var(--borde); }
.linea-fila { display: flex; align-items: center; gap: 12px; }
.linea-n { flex: 1; min-width: 0; font-weight: 700; }
.linea-n small { display: block; color: var(--oro); font-weight: 800; margin-top: 2px; }
.linea .paso { height: 38px; }
.linea .paso button { height: 38px; width: 36px; }
.nota-btn { border: 0; background: none; color: var(--suave); font-size: 13px; padding: 6px 0 0; text-decoration: underline; }
.nota-in {
  width: 100%;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 10px;
  color: var(--texto);
  font: inherit;
  font-size: 15px;
  padding: 9px 11px;
  outline: 0;
}
.total-fila { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.total-fila span:last-child { color: var(--oro); }
.ayuda { color: var(--tenue); font-size: 13px; margin: 0 0 12px; }
.btn-prin {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px;
  background: var(--oro);
  color: #1b1404;
  font-size: 17px;
  font-weight: 800;
}
.btn-prin[disabled] { opacity: .6; }
.btn-sec { width: 100%; margin-top: 8px; border: 1px solid var(--borde); background: transparent; color: var(--suave); border-radius: 14px; padding: 12px; font-weight: 700; }

.resultado { text-align: center; padding: 26px 6px 10px; }
.resultado .icono-res { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 32px; font-weight: 800; }
.resultado .ok { background: rgba(61, 220, 132, .15); color: #3ddc84; }
.resultado .mal { background: rgba(229, 72, 77, .15); color: var(--rojo); }
.resultado h3 { margin: 0 0 6px; font-size: 20px; }
.resultado p { margin: 0; color: var(--suave); }
.giro { width: 46px; height: 46px; border: 4px solid var(--borde); border-top-color: var(--oro); border-radius: 50%; margin: 6px auto 16px; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* Mi cuenta */
.cuenta { padding: 10px 14px 20px; }
.cuenta-tarjeta { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--borde); border-radius: 18px; padding: 16px; }
.cuenta-cab { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.cuenta-cab h2 { margin: 0; font-size: 19px; }
.cuenta-cab small { color: var(--tenue); }
.c-linea { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--borde); }
.c-cant { color: var(--oro); font-weight: 800; min-width: 30px; }
.c-n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.c-t { font-weight: 700; font-variant-numeric: tabular-nums; }
.c-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-size: 22px; font-weight: 800; }
.c-total span:last-child { color: var(--oro); }
.c-pool { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .35); color: #bfe9ff; font-size: 14px; }
.c-nota { color: var(--tenue); font-size: 13px; text-align: center; margin-top: 14px; }

@media (min-width: 720px) {
  .tarjetas { grid-template-columns: 1fr 1fr; }
  .logo { width: 110px; }
}
