/* fwc-domingo: FWC 2026 Retail Day app. Palette = finewinecelebration.com design system. */
:root {
  --sage: #b9c7ad; --sage-soft: #e3e9dc; --wine: #72283f; --wine-deep: #431925;
  --gold: #c5a151; --gold-soft: #ead69b; --paper: #f5f0e7; --card: #fffdf8;
  --ink: #2a1d20; --muted: #6f6266; --line: #e3d9c8; --ok: #3f6b3a; --warn: #9a5b12; --bad: #9b2335;
  --radius: 14px; --shadow: 0 1px 2px rgba(67,25,37,.08), 0 4px 14px rgba(67,25,37,.06);
  --font: "Avenir Next", Avenir, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--wine); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* top */
.top { position: sticky; top: 0; z-index: 20; background: var(--wine-deep); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.brand { font-weight: 700; letter-spacing: .01em; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--gold-soft); letter-spacing: .08em; text-transform: uppercase; }
.who { flex: none; white-space: nowrap; font-size: 13px; color: var(--gold-soft); background: none; border: 1px solid rgba(234,214,155,.5); border-radius: 999px; padding: 6px 12px; }
.clock { background: var(--gold); color: var(--wine-deep); font-size: 13px; font-weight: 600; text-align: center; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock b { font-variant-numeric: tabular-nums; }
.clock.done { background: #d9cfc0; color: var(--muted); }
.pill { background: #fff3cd; color: #6b4e00; border: 0; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; }

/* main also has .wrap, whose padding would win over a bare `main` rule: say main.wrap */
main.wrap { padding: 10px 16px calc(96px + env(safe-area-inset-bottom)); }
body.con-checkout main.wrap { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
h1 { font-size: 24px; margin: 6px 0 10px; color: var(--wine-deep); }
h2 { font-size: 19px; margin: 18px 0 8px; color: var(--wine-deep); }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }

/* tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.tabs a { text-decoration: none; color: var(--muted); text-align: center; font-size: 12px; padding: 8px 0 9px; position: relative; }
.tabs a .ic { display: block; width: 24px; height: 24px; margin: 0 auto 2px; }
.tabs a { letter-spacing: .02em; }
.tabs a.on { color: var(--wine); font-weight: 600; }
.tabs a.on .ic { stroke-width: 1.9; }
.tabs a.on::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--wine); }
.badge { position: absolute; top: 4px; left: 50%; margin-left: 8px; background: var(--wine); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; padding: 1px 5px; font-weight: 700; }

/* search + chips */
.search { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 17px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: 14px; }
.chip.on { background: var(--wine); color: #fff; border-color: var(--wine); }

/* tables list */
.mesas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.mesa-row { min-width: 0; display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; text-decoration: none; color: inherit; }

.mesa-row .t { flex: 1; min-width: 0; }
.mesa-row .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mesa-row .t span { font-size: 13px; color: var(--muted); }
.prog { font-size: 12px; color: var(--ok); font-weight: 600; white-space: nowrap; }

/* wine card */
.vinos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.vinos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.vino { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px 8px 6px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; min-width: 0; position: relative; }
.vino .foto { width: 34px; height: 100%; max-height: 118px; display: flex; align-items: center; justify-content: center; grid-row: 1 / span 2; }
.vino .foto img { max-width: 34px; max-height: 112px; object-fit: contain; }
.vino .foto.none img { width: 30px; opacity: .45; }
.vino h3 { margin: 0; font-size: 16px; line-height: 1.2; }
.vino .bodega { font-size: 13px; color: var(--muted); margin: 2px 0 0; line-height: 1.3; }
.precio { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.precio .was { text-decoration: line-through; color: var(--muted); font-size: 13px; }
.precio .now { font-size: 18px; font-weight: 700; color: var(--wine); }
.precio .now.pronto { font-size: 15px; color: var(--muted); }
.precio .ivu { font-size: 11px; color: var(--muted); }
.precio .socio { font-size: 11px; background: var(--gold-soft); color: var(--wine-deep); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.precio .unc { font-size: 11px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 11px; border-radius: 6px; padding: 1px 6px; background: var(--sage-soft); color: var(--wine-deep); }
.tag.warn { background: #fbe7cf; color: var(--warn); font-weight: 600; }
.tag.bad { background: #f6d9dd; color: var(--bad); font-weight: 600; }
.tag.hot { background: #f2e6c4; color: #6b4e00; }
.acc { grid-column: 2; display: flex; align-items: center; gap: 3px; margin-top: 5px; }
.ib { width: 33px; height: 34px; border: 1px solid var(--line); background: var(--card); border-radius: 9px; font-size: 17px; line-height: 1; padding: 0; display: grid; place-items: center; color: var(--muted); }
.ib.on { background: var(--sage); border-color: var(--sage); color: var(--wine-deep); font-weight: 700; }
.acc .qty { margin-left: auto; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); height: 34px; }
.qty.has { border-color: var(--wine); }
.qty button { border: 0; background: none; width: 30px; height: 34px; font-size: 20px; color: var(--wine); padding: 0; }
.qty .n { width: 32px; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.qty.has .n { background: var(--wine); color: #fff; }
.nInp { width: 52px; height: 34px; border: 0; text-align: center; font-size: 16px; font-weight: 700; background: #fff; }
.quick { grid-column: 2; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.quick button { border: 1px solid var(--wine); background: #fff; color: var(--wine); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.notaTxt { grid-column: 2; font-size: 13px; color: var(--muted); font-style: italic; }
.leyenda { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.vino .nudge { grid-column: 2; margin-top: 4px; }
.acciones { grid-column: 1 / -1; display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.fila { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 13px; font-size: 15px; min-height: 42px; }
.btn.on { background: var(--sage); border-color: var(--sage); color: var(--wine-deep); font-weight: 600; }
.btn.primary { background: var(--wine); border-color: var(--wine); color: #fff; font-weight: 600; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--wine-deep); font-weight: 700; }
.btn.block { width: 100%; padding: 14px; font-size: 17px; }
.btn:disabled { opacity: .5; }
.gusto { display: flex; gap: 6px; flex-wrap: wrap; }
.gusto .btn { padding: 8px 11px; font-size: 14px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.qty button { border: 0; background: none; width: 44px; height: 42px; font-size: 22px; color: var(--wine); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.nota { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; resize: vertical; }
.nudge { font-size: 13px; color: var(--wine-deep); background: var(--gold-soft); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.nudge b { text-decoration: underline; margin-left: 4px; }
.desc { background: var(--card); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; color: var(--ink); box-shadow: var(--shadow); margin-bottom: 12px; }
.desc summary { cursor: pointer; font-weight: 600; color: var(--wine); }
.back { display: inline-block; margin: 2px 0 6px; text-decoration: none; font-size: 15px; }

/* suggestions */
.porque { font-size: 12px; color: var(--muted); margin-top: 3px; }
h2.porq { font-size: 15px; font-weight: 500; margin: 16px 0 8px; }
h2.porq span { color: var(--muted); font-size: 13px; }
.vamos { margin-top: 4px; display: inline-block; background: var(--wine-deep); color: #fff; border-radius: 8px; padding: 3px 9px; font-size: 13px; font-weight: 600; text-decoration: none; }

/* cart */
.linea { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.linea .n { font-weight: 600; }
.linea .d { font-size: 13px; color: var(--muted); }
.linea .p { text-align: right; font-weight: 700; color: var(--wine); }
.lineas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.totales { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-top: 12px; }
.totales div { display: flex; justify-content: space-between; padding: 3px 0; }
.totales .tot { font-size: 20px; font-weight: 700; color: var(--wine-deep); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.opcion.on { border-color: var(--wine); }
.opcion input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--wine); }
.campo { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 17px; margin: 6px 0; }
label.lbl { font-size: 14px; color: var(--muted); display: block; margin-top: 10px; }
.aviso { background: #fbf3e2; border-left: 4px solid var(--gold); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.err { background: #f6d9dd; color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 15px; margin: 10px 0; }
.okbox { background: #e3eedc; color: var(--ok); border-radius: 8px; padding: 10px 12px; font-size: 15px; margin: 10px 0; }

/* modal (opens from the top: phone keyboards push bottom sheets away) */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(42,29,32,.55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.sheet { background: var(--paper); border-radius: 18px; width: 100%; max-width: 480px; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.sheet h2 { margin-top: 0; }
.sheet .cerrar { float: right; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--wine); }
.codigo { font-size: 28px; letter-spacing: .3em; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--wine-deep); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 15px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.pedido { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.estado { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .04em; }
.estado.pendiente { background: #fbe7cf; color: var(--warn); }
.estado.pagado { background: #e3eedc; color: var(--ok); }
.estado.reembolsado, .estado.anulado { background: #eee; color: var(--muted); }
.loader { text-align: center; padding: 40px 0; color: var(--muted); }


/* v1.1 */
.buscar { display: flex; gap: 8px; }
.buscar .search { flex: 1; min-width: 0; }
.scanbtn { flex: none; width: 50px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 22px; }
.checkout { position: fixed; left: 0; right: 0; bottom: calc(61px + env(safe-area-inset-bottom)); z-index: 25; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(67,25,37,.08); display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.checkout div { flex: 1; }
.checkout b { display: block; font-size: 19px; color: var(--wine-deep); }
.checkout span { font-size: 12px; color: var(--muted); }
.checkout .btn { min-height: 46px; }
.dos { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.scan { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan .frame { position: relative; width: 64vmin; height: 64vmin; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scan .hint, .scan .msg { position: relative; color: #fff; margin-top: 16px; font-size: 15px; text-align: center; padding: 0 20px; }
.scan .msg { color: var(--gold-soft); min-height: 20px; }
.scan .bar { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); }

/* v1.2: scan-first home, table rows as buttons */
.hero-scan { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; border-radius: 16px; background: var(--wine); color: #fff; padding: 18px 16px; box-shadow: var(--shadow); margin-top: 4px; }
.hero-scan .ic { font-size: 34px; line-height: 1; background: rgba(255,255,255,.14); border-radius: 12px; width: 56px; height: 56px; display: grid; place-items: center; flex: none; }
.hero-scan b { display: block; font-size: 20px; }
.hero-scan small { display: block; font-size: 13px; color: var(--gold-soft); margin-top: 2px; line-height: 1.3; }
.o { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 8px; }
.mesa-row .t span { display: block; }
.mesa-row .t .coincide { color: var(--wine); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mesa-row .prog { font-style: normal; color: var(--ok); font-weight: 600; }
.vermesa { flex: none; background: var(--sage-soft); color: var(--wine-deep); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.chips:empty { display: none; }

/* unpaid is unmistakable (Lucas 2026-10-15) */
.sinpagar { background: #fbe7cf; color: var(--warn); border: 1px solid #f0c58a; border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 8px 0; text-align: center; }
.sinpagar b { letter-spacing: .04em; }
.linkbtn { display: block; width: 100%; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; padding: 12px 0 2px; }
.estado.pendiente { background: #fbe7cf; color: var(--warn); }

/* v1.2 (2026-10-16): stars, cart edits, order detail */
.stars { display: flex; gap: 0; }
.st { width: 29px; height: 34px; border: 0; background: none; padding: 0; font-size: 23px; line-height: 1; color: #d9d0c8; }
.st.on { color: var(--gold); }
.stxt { color: var(--gold); letter-spacing: 1px; font-size: 13px; }
.linea.cl { grid-template-columns: minmax(0, 1fr) auto; }
.cctl { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding-top: 8px; }
.quitar { border: 0; background: none; color: var(--bad); font-size: 14px; font-weight: 600; padding: 8px 4px; }
.linea.fuera { opacity: .4; }
.detped { margin: 6px 0 8px; }
.detped summary { color: var(--wine); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; }
.detped ul { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.detped li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; font-size: 14px; align-items: baseline; }
.detped li .q { font-weight: 700; color: var(--wine-deep); }
.detped li small { display: block; color: var(--muted); font-size: 12px; }
.detped li .m { font-weight: 600; font-variant-numeric: tabular-nums; }
.pedido.abierto { border: 1.5px solid var(--gold); }

/* trade mode (2026-10-16): Monday guests, no cart, no prices, EN toggle */
.who.lang { padding: 6px 10px; font-weight: 700; letter-spacing: .04em; }
body.lunes .tabs .wrap { grid-template-columns: repeat(3, 1fr); }
body.lunes #tabCarrito, body.lunes .clock { display: none; }
body.lunes .top { background: #2e3b29; }
body.lunes .brand small { color: var(--sage); }
.mesa-sub { color: var(--muted); font-size: 14px; margin: -6px 0 10px; }
.stand-link { display: block; text-align: center; margin: 28px 0 8px; font-size: 13px; color: var(--muted); }
.stand-link a { color: var(--wine); }
.ident-o { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
.campo.carnet { font-size: 22px; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.verprecio { border: 0; background: none; padding: 2px 0; color: var(--wine); font-size: 13px; font-weight: 600; text-decoration: underline; text-align: left; }
body.lunes .precio .ivu { font-size: 11px; }
