/* PtyMenu — estilos compartidos */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

:root {
  --brand: #C2410C;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --brand-strong: color-mix(in srgb, var(--brand) 80%, #000); /* texto de marca sobre --brand-soft (contraste >= 4.5) */
  --on-ink: #fff;
  --bg: #FBF7F2;
  --surface: #fff;
  --ink: #1F1A17;
  --ink-2: #5B524C;
  --ink-3: #7A706A;
  --line: #EADFD3;
  --ok: #15803D;
  --warn: #B45309;
  --bad: #B91C1C;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31,26,23,.05), 0 8px 24px rgba(31,26,23,.07);
  --shadow-lg: 0 12px 48px rgba(31,26,23,.22);
  --display: 'Fraunces', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; border-radius: 8px; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 600; text-decoration: none;
  background: var(--brand); color: var(--brand-ink); transition: transform .15s var(--ease), filter .15s, background .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--surface); filter: none; border-color: var(--ink-3); }
.btn.soft { background: var(--brand-soft); color: var(--brand-strong); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; transition: background .15s; }
.iconbtn:hover { background: rgba(31,26,23,.07); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, .field input[type=text], .field input[type=number], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 500; font-size: 14px; white-space: nowrap; transition: all .15s; }
.chip[aria-pressed=true], .chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); color: var(--ink-2); }
.tag.veg { background: #DCFCE7; color: #166534; } .tag.picante { background: #FEE2E2; color: #991B1B; }
.tag.singluten { background: #FEF3C7; color: #92400E; } .tag.nuevo { background: #E0E7FF; color: #3730A3; }
.tag.pop { background: var(--brand-soft); color: var(--brand-strong); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-3); }

/* hoja / modal */
.scrim { position: fixed; inset: 0; background: rgba(31,26,23,.5); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  transform: translateY(105%); transition: transform .32s var(--ease); box-shadow: var(--shadow-lg); padding-bottom: env(safe-area-inset-bottom); visibility: hidden; }
.sheet.open { transform: none; visibility: visible; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); border-radius: 24px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
}
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 14px; font-weight: 500; font-size: 15px;
  opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 60; max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* Acceso del personal con PIN */
.gate { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
.gate-card { width: min(340px, 100%); text-align: center; display: grid; gap: 14px; justify-items: center; }
.gate-card h1 { font-size: 28px; } .gate-card > p { color: var(--ink-3); }
.gate-dots { display: flex; gap: 14px; margin: 6px 0; }
.gate-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); transition: background .15s, border-color .15s; }
.gate-dots i.on { background: var(--brand); border-color: var(--brand); }
.gate-msg { min-height: 22px; color: var(--bad); font-weight: 600; font-size: 14px; }
.gate-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.gate-pad button { height: 64px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 26px; font-weight: 600; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .1s, background .15s; }
.gate-pad button:active { transform: scale(.94); background: var(--brand-soft); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Selector segmentado */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31,26,23,.15); }
.pillst { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); color: var(--ink-2); white-space: nowrap; }
.pillst.ok { background: #DCFCE7; color: #166534; } .pillst.warn { background: #FEF3C7; color: #92400E; } .pillst.bad { background: #FEE2E2; color: #991B1B; } .pillst.brand { background: var(--brand-soft); color: var(--brand-strong); }

/* Marca PtyMenu */
.pm-logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: #DA121A; }
.pm-logo b { font-weight: 700; color: #072357; }
@media (prefers-color-scheme: dark) { .pm-logo { color: #FF6B6B; } .pm-logo b { color: #FFFFFF; } }
:root[data-font=sans] h1, :root[data-font=sans] h2, :root[data-font=sans] h3 { font-weight: 700; letter-spacing: -.02em; }
