/* ==========================================================================
   velí · tienda — base
   Reset + tipografía + componentes compartidos (botón, campo, swatch, card).
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Fraunces_72pt_Soft-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/Fraunces-VariableFont_SOFT,WONK,opsz,wght.ttf") format("truetype-variations");
  font-variation-settings: "opsz" 72, "SOFT" 50, "WONK" 0;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype-variations");
}

/* -------------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-secondary);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* foco visible siempre, sin resets agresivos */
:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------- tipografía */
.h-display, .h1, .h2, .h3 {
  font-family: var(--font-primary);
  font-weight: 400;
  font-variation-settings: "opsz" 40, "SOFT" 40, "WONK" 0;
  letter-spacing: var(--ls-h1);
  color: var(--ink);
}
.h-display { font-size: var(--size-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.h1 { font-size: var(--size-h1); line-height: var(--lh-h1); }
.h2 { font-size: var(--size-h2); line-height: var(--lh-h2); }
.h3 { font-size: var(--size-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }

.eyebrow {
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--clay);
}

.text-muted { color: var(--stone); }

/* -------------------------------------------------------------------- botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  font-size: var(--size-body);
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-default), opacity var(--duration-fast) var(--ease-default);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--terracotta); color: var(--paper); }
.btn-primary:hover:not(:disabled) { opacity: 0.92; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: rgba(27, 24, 20, 0.05); }

.btn-block { width: 100%; }
.btn-small { padding: 9px 16px; font-size: var(--size-body-small); }

/* -------------------------------------------------------------------- campos */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-m);
}
.field label {
  font-size: var(--size-body-small);
  font-weight: 600;
  color: var(--ink);
}
.field .hint {
  font-size: var(--size-caption);
  color: var(--stone);
}
.field input,
.field select,
.field textarea {
  background: var(--paper);
  border: 1.5px solid var(--bone);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: var(--size-body);
  color: var(--ink);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--steel); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--clay); }
.field textarea { resize: vertical; min-height: 72px; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--terracotta); }
.field-error {
  font-size: var(--size-body-small);
  color: var(--terracotta);
  min-height: 1.2em;
}

.banner-error {
  background: rgba(140, 74, 51, 0.1);
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  font-size: var(--size-body-small);
}
.banner-error:empty { display: none; }

.banner-info {
  background: var(--bone);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  font-size: var(--size-body-small);
  color: var(--ink);
}

/* -------------------------------------------------------------------- swatch */
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: none;
  padding: var(--space-xs);
  cursor: pointer;
  text-align: center;
}
.swatch .dot {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--swatch-color, var(--bone));
  box-shadow: inset 0 0 0 1.5px rgba(27, 24, 20, 0.14);
  transition: box-shadow var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
}
.swatch .label {
  font-size: 11px;
  color: var(--stone);
  font-weight: 500;
}
.swatch[aria-pressed="true"] .dot {
  box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4.5px var(--clay);
  transform: scale(1.05);
}
.swatch[aria-pressed="true"] .label { color: var(--ink); font-weight: 700; }

/* -------------------------------------------------------------------- card */
.card {
  background: var(--paper);
  border: 1.5px solid var(--bone);
  border-radius: var(--radius-l);
  padding: var(--space-l);
}
.card-bone { background: var(--bone); border-color: var(--bone); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--size-caption);
  font-weight: 600;
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  background: var(--bone);
  color: var(--ink);
}
.badge-pagado, .badge-entregado { background: rgba(31, 122, 77, 0.16); color: #1F5D3A; }
.badge-pendiente_pago { background: rgba(227, 178, 60, 0.22); color: #8A6410; }
.badge-grabando { background: rgba(183, 138, 99, 0.22); color: var(--terracotta); }
.badge-enviado { background: rgba(30, 58, 138, 0.14); color: #1E3A8A; }
.badge-cancelado { background: rgba(140, 74, 51, 0.14); color: var(--terracotta); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(246,242,234,0.5);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
