/* Solito Catálogo — estilos compartidos (catálogo y panel)
   Dirección "Etiqueta de tianguis": fondo neutro para que la ropa sea el color,
   precio en etiqueta amarilla, sello rojo para lo vendido, color de la tienda solo como firma. */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f2f2ef; --surface-3: #e9e9e4;
  --ink: #151515; --ink-2: #4a4a46; --ink-3: #75756f; --line: #e5e5e0;
  --brand: #d2442f; --brand-ink: #ffffff;
  --tag: #ffd60a; --tag-ink: #151515;
  --ok: #12804a; --ok-soft: #e1f3e8; --warn: #a86400; --warn-soft: #fdf0d6; --bad: #c8261b; --bad-soft: #fce5e2;
  --info: #2446e8; --wa: #128c4a;
  --f-d: "Archivo", "Helvetica Neue", system-ui, sans-serif; --f-b: "Archivo", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
/* Fondo negro: si el visitante lo elige con el botón, o si su celular está en modo oscuro y no eligió otra cosa */
:root[data-theme="dark"] {
    --bg: #121211; --surface: #1b1b1a; --surface-2: #242422; --surface-3: #2e2e2b;
    --ink: #f2f2ee; --ink-2: #c4c4bd; --ink-3: #8d8d86; --line: #33332f;
    --ok: #4fca82; --ok-soft: #173a26; --warn: #f0b64e; --warn-soft: #3a2d13; --bad: #ff7466; --bad-soft: #3d1c19; --info: #8ea2ff; --wa: #1fae5f;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --surface: #1b1b1a; --surface-2: #242422; --surface-3: #2e2e2b;
    --ink: #f2f2ee; --ink-2: #c4c4bd; --ink-3: #8d8d86; --line: #33332f;
    --ok: #4fca82; --ok-soft: #173a26; --warn: #f0b64e; --warn-soft: #3a2d13; --bad: #ff7466; --bad-soft: #3d1c19; --info: #8ea2ff; --wa: #1fae5f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-b); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom, 0px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-d); font-weight: 800; font-stretch: 108%; letter-spacing: -.01em; margin: 0; line-height: 1.1; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: max(clamp(14px, 3vw, 40px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(14px, 3vw, 40px), env(safe-area-inset-right, 0px)); }
.muted { color: var(--ink-3); }

/* Botones: negro para la acción principal, verde solo para WhatsApp */
.btn { border: none; border-radius: 8px; padding: 12px 16px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-block { width: 100%; }
.btn-brand, .btn-dark { background: var(--ink); color: var(--bg); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost { background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.btn-sm { padding: 7px 11px; font-size: 13.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-bad { background: var(--bad-soft); color: var(--bad); }

/* Etiqueta de precio (con su hoyito) */
.tag { display: inline-block; position: relative; background: var(--tag); color: var(--tag-ink); font-family: var(--f-d); font-weight: 800; font-stretch: 118%;
  font-size: 19px; line-height: 1; padding: 7px 11px 7px 21px; border-radius: 3px 6px 6px 3px; transform: rotate(-3deg); box-shadow: 0 2px 0 rgba(0,0,0,.18); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.28); }
.tag.lg { font-size: 30px; padding: 10px 16px 10px 30px; }
.tag.lg::before { left: 11px; width: 9px; height: 9px; margin-top: -4.5px; }
.tag.off { background: #d9d9d4; color: #55554f; text-decoration: line-through; }

/* Sello de vendido/apartado */
.sello { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); border: 3px solid currentColor; color: var(--bad); background: rgba(255,255,255,.82);
  font-family: var(--f-d); font-weight: 800; font-stretch: 120%; font-size: 18px; padding: 3px 12px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.sello.apartado { color: var(--warn); }

/* Etiqueta negra de pieza única */
.unica { position: absolute; top: 8px; left: 8px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 3px; }

/* Pastillas de estado (panel): un color = un significado */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.e-disponible, .e-confirmado { background: var(--ok-soft); color: var(--ok); }
.e-apartado, .e-nuevo { background: var(--warn-soft); color: var(--warn); }
.e-vendido, .e-agotado, .e-cancelado { background: var(--bad-soft); color: var(--bad); }
.e-oculto { background: var(--surface-2); color: var(--ink-3); }

/* Formularios */
.field { display: grid; gap: 5px; }
.field label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); width: 100%; min-width: 0; }
.field textarea { resize: vertical; min-height: 64px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[disabled] { opacity: .35; text-decoration: line-through; cursor: default; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.switch input { width: 20px; height: 20px; accent-color: var(--ink); }

/* Hoja inferior (modal) */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.velo.on { opacity: 1; pointer-events: auto; }
.hoja { position: fixed; left: 50%; bottom: 0; width: min(560px, 100%); transform: translate(-50%, 105%); background: var(--surface); border-radius: 18px 18px 0 0; padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); transition: transform .28s ease; z-index: 31; max-height: 90vh; overflow-y: auto; display: grid; gap: 12px; visibility: hidden; }
.hoja.on { transform: translate(-50%, 0); visibility: visible; }
.hoja .agarre { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: -4px auto 2px; }
@media (min-width: 760px) {
  .hoja { top: 50%; bottom: auto; width: min(var(--hoja-w, 600px), calc(100% - 48px)); border-radius: 14px; padding: 24px; max-height: 88vh; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease, visibility .22s; }
  .hoja.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .hoja .agarre { display: none; }
}

.aviso { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; opacity: 0; transition: .2s; z-index: 40; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.aviso.on { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: g .8s linear infinite; display: inline-block; }
@keyframes g { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 3s !important; } }
