/* Mercado Salamanca — estilos compartidos por las 3 webs */
@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-600-italic.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --papel: #f4eee3;
  --papel-2: #ebe3d4;
  --blanco: #fffdf8;
  --tinta: #1f1c18;
  --tinta-2: #5c554b;
  --tinta-3: #8b8276;
  --linea: #d9cfbe;
  --chile: #b8432f;
  --chile-osc: #8f3020;
  --nopal: #2f5b3c;
  --maiz: #e2a52e;
  --cielo: #2d5d7b;
  --ok: #2f6b3f;
  --aviso: #9a6a00;
  --error: #a3271a;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --texto: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 6px;
  --sombra: 0 1px 0 rgba(31, 28, 24, .06), 0 8px 24px -12px rgba(31, 28, 24, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papel); color: var(--tinta); font: 400 16px/1.5 var(--texto); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--maiz); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--tinta-2); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grow { flex: 1; }
.hidden { display: none !important; }
.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.kicker { font: 600 .74rem/1 var(--texto); letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-2); }
.serif-it { font-family: var(--display); font-style: italic; font-weight: 600; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1.1rem;
  border: 1.5px solid var(--tinta); border-radius: var(--r); background: var(--tinta); color: var(--papel);
  font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; white-space: nowrap; }
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.chile { background: var(--chile); border-color: var(--chile); color: #fff; }
.btn.chile:hover { background: var(--chile-osc); border-color: var(--chile-osc); }
.btn.nopal { background: var(--nopal); border-color: var(--nopal); color: #fff; }
.btn.ghost { background: transparent; color: var(--tinta); }
.btn.ghost:hover { background: var(--papel-2); }
.btn.link { background: none; border: 0; color: var(--tinta); padding: .3rem .2rem; min-height: 0; text-decoration: underline; font-weight: 500; }
.btn.sm { min-height: 34px; padding: .3rem .75rem; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--error); border-color: var(--error); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field small { color: var(--tinta-2); font-size: .8rem; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: .6rem .8rem; background: var(--blanco); border: 1.5px solid var(--linea);
  border-radius: var(--r); transition: border-color .15s; }
.input:focus { border-color: var(--tinta); outline: none; box-shadow: 0 0 0 3px rgba(226, 165, 46, .35); }
textarea.input { min-height: 96px; resize: vertical; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--chile); }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.seg { display: inline-flex; border: 1.5px solid var(--tinta); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .55rem 1rem; cursor: pointer; font-weight: 600; min-height: 42px; }
.seg button + button { border-left: 1.5px solid var(--tinta); }
.seg button[aria-pressed="true"] { background: var(--tinta); color: var(--papel); }

/* ---------- Bloques ---------- */
.panel { background: var(--blanco); border: 1px solid var(--linea); border-radius: 10px; padding: 1.25rem; }
.rule { border: 0; border-top: 1.5px solid var(--tinta); margin: 1.5rem 0; }
.rule.thin { border-top: 1px solid var(--linea); }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 3px; font: 600 .72rem/1.4 var(--texto); letter-spacing: .06em; text-transform: uppercase; background: var(--papel-2); color: var(--tinta-2); }
.tag.ad { background: var(--maiz); color: var(--tinta); }
.tag.ok { background: #dcebd9; color: var(--ok); }
.tag.warn { background: #f5e6bf; color: var(--aviso); }
.tag.bad { background: #f3d5cf; color: var(--error); }
.tag.info { background: #d7e5ee; color: var(--cielo); }
.notice { border-left: 4px solid var(--maiz); background: #fbf3df; padding: .8rem 1rem; border-radius: 0 var(--r) var(--r) 0; }
.notice.bad { border-color: var(--error); background: #f9e5e1; }
.notice.ok { border-color: var(--ok); background: #e4f0e1; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--tinta-2); border: 1.5px dashed var(--linea); border-radius: 10px; }
.empty strong { display: block; font-family: var(--display); font-size: 1.3rem; color: var(--tinta); margin-bottom: .3rem; }

/* Toldo de mercado: franjas del color del negocio */
.toldo { --c: var(--chile); height: 14px; background: repeating-linear-gradient(90deg, var(--c) 0 22px, var(--blanco) 22px 44px); position: relative; }
.toldo::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
  background: radial-gradient(circle at 11px 0, var(--c) 10px, transparent 10.5px) 0 0 / 44px 7px repeat-x,
              radial-gradient(circle at 33px 0, var(--blanco) 10px, transparent 10.5px) 0 0 / 44px 7px repeat-x; }

/* Estrellas */
.stars { display: inline-flex; gap: 1px; color: var(--maiz); letter-spacing: 0; font-size: 1rem; line-height: 1; }
.stars .off { color: var(--linea); }
.rate-input { display: inline-flex; gap: .2rem; }
.rate-input button { border: 0; background: none; font-size: 2rem; line-height: 1; padding: .1rem; cursor: pointer; color: var(--linea); }
.rate-input button.on { color: var(--maiz); }

/* Avatar / iniciales */
.mono { display: grid; place-items: center; background: var(--c, var(--chile)); color: #fff; font: 800 1.1rem/1 var(--display); border-radius: 50%; aspect-ratio: 1; overflow: hidden; flex: none; }
.mono img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Ventana modal / avisos ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(31, 28, 24, .5); display: grid; place-items: center; z-index: 1000; padding: 1rem; animation: fade .15s; }
.modal { background: var(--papel); border-radius: 12px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 1.5rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); position: relative; }
.modal .x { position: absolute; top: .6rem; right: .6rem; border: 0; background: none; font-size: 1.6rem; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; }
.modal .x:hover { background: var(--papel-2); }
@media (max-width: 560px) { .modal-bg { place-items: end stretch; padding: 0; } .modal { border-radius: 16px 16px 0 0; width: 100%; } }
.toasts { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 2000; display: grid; gap: .5rem; width: min(420px, 92vw); }
.toast { background: var(--tinta); color: var(--papel); padding: .8rem 1rem; border-radius: 8px; box-shadow: var(--sombra); animation: up .2s; font-weight: 500; }
.toast.bad { background: var(--error); }
.toast.ok { background: var(--nopal); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

/* Tablas */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font: 600 .74rem/1 var(--texto); letter-spacing: .08em; text-transform: uppercase; color: var(--tinta-2); padding: .7rem .6rem; border-bottom: 1.5px solid var(--tinta); }
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.5); }
.table-wrap { overflow-x: auto; }

.skeleton { background: linear-gradient(90deg, var(--papel-2), #f6f1e8, var(--papel-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Stepper de estado de pedido */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: .6rem 0 .3rem; }
.steps i { height: 6px; border-radius: 3px; background: var(--linea); }
.steps i.on { background: var(--nopal); }
.steps.bad i.on { background: var(--error); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
