/* =====================================================================
   base.css — Colores, tipografías, botones y formularios
   compartidos por la tienda y el panel.
   Para cambiar la paleta, tocá solo las variables de :root.
   ===================================================================== */
:root {
  --fondo: #FBF7F2;          /* crema claro de fondo */
  --superficie: #FFFFFF;     /* tarjetas */
  --tinta: #1A1714;          /* texto principal (casi negro cálido) */
  --tinta-suave: #6E655C;    /* texto secundario */
  --linea: #ECE3D8;          /* bordes */
  --acento: #FF5A1F;         /* naranja principal */
  --acento-osc: #E2470F;
  --acento-suave: #FFEADF;
  --oscuro: #1A1714;
  --amarillo: #FFC23D;
  --ok: #1E8E4F;
  --ok-suave: #DFF3E7;
  --alerta: #B86E00;
  --alerta-suave: #FFF2D6;
  --peligro: #D13B2C;
  --peligro-suave: #FBE1DE;
  --wsp: #1FAF55;

  --radio: 18px;
  --radio-chico: 12px;
  --sombra: 0 1px 2px rgba(26, 23, 20, .05), 0 8px 24px rgba(26, 23, 20, .07);
  --sombra-alta: 0 12px 40px rgba(26, 23, 20, .22);

  --fuente-titulos: "Bricolage Grotesque", system-ui, sans-serif;
  --fuente: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--fuente-titulos); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sin-scroll { overflow: hidden; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 46px; padding: 0 1.15em;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: .98rem; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primario { background: var(--acento); color: #fff; }
.btn-primario:hover { background: var(--acento-osc); }
.btn-oscuro { background: var(--oscuro); color: #fff; }
.btn-claro { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.btn-borde { background: var(--superficie); color: var(--tinta); border: 1.5px solid var(--linea); }
.btn-borde:hover { border-color: var(--tinta); }
.btn-wsp { background: var(--wsp); color: #fff; }
.btn-texto { background: none; color: var(--tinta-suave); min-height: 40px; padding: 0 .6em; }
.btn-texto:hover { color: var(--tinta); }
.btn-bloque { width: 100%; }
.btn-chico { min-height: 38px; font-size: .88rem; padding: 0 .9em; }
.btn-icono {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  display: inline-grid; place-items: center;
  background: var(--fondo); font-size: 1.15rem;
}
.cargando::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------------- Formularios ---------------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span { font-weight: 600; font-size: .92rem; }
.campo input, .campo textarea, .campo select, .control-form {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid var(--linea); border-radius: var(--radio-chico);
  background: var(--superficie); font-size: 16px; /* 16px evita el zoom en iPhone */
  transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus, .campo textarea:focus, .control-form:focus {
  outline: none; border-color: var(--acento); box-shadow: 0 0 0 4px var(--acento-suave);
}
.campo.con-error input, .campo.con-error textarea { border-color: var(--peligro); }
.ayuda { color: var(--tinta-suave); font-size: .82rem; }
.error { color: var(--peligro); font-size: .85rem; font-weight: 600; min-height: 0; }
.error:empty { display: none; }

.nota { color: var(--tinta-suave); font-size: .83rem; }

/* ---------------- Avisos ---------------- */
.aviso { padding: 12px 14px; border-radius: var(--radio-chico); font-size: .92rem; }
.aviso-ok { background: var(--ok-suave); color: #135C33; }
.aviso-alerta { background: var(--alerta-suave); color: #7A4A00; }
.aviso-error { background: var(--peligro-suave); color: #8E2318; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 140%); z-index: 100;
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px;
  background: var(--oscuro); color: #fff; font-weight: 600; font-size: .95rem;
  box-shadow: var(--sombra-alta); opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .25s;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--peligro); }
.toast.ok { background: var(--ok); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
