/* ============================================================================
   Casi Nuevo · base.css
   ----------------------------------------------------------------------------
   Sistema de diseño compartido por el sitio público y el panel:
     1. Tokens (colores, tipografías, radios, sombras)  ← cambiar la marca acá
     2. Reset mínimo
     3. Tipografía
     4. Componentes comunes: botones, chips, badges, campos, "etiqueta confesión"
   Mobile-first: los estilos base son para celular; los @media (min-width)
   agregan lo necesario para pantallas grandes.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Paleta de marca: papel cálido + tinta + naranja "sticker" + amarillo etiqueta */
  --papel:        #FBF6EE;
  --papel-2:      #F3EBDD;
  --superficie:   #FFFFFF;
  --tinta:        #1F1B16;
  --tinta-2:      #5B5249;
  --tinta-3:      #8C8278;
  --borde:        #E6DCCB;

  --naranja:      #FF5B2E;   /* acción principal / marca */
  --naranja-osc:  #D9431B;
  --amarillo:     #FFD84D;   /* etiqueta "No es nuevo porque…" */
  --amarillo-sua: #FFF3C2;
  --verde:        #1FAF5A;   /* WhatsApp / disponible */
  --verde-osc:    #178A47;
  --azul:         #2F6FEB;   /* cuotas */
  --rojo:         #D93636;

  --fuente-titulo: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --fuente-texto:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fuente-mano:   "Caveat", "Segoe Print", "Comic Sans MS", cursive;

  --radio-s: 8px;
  --radio:   14px;
  --radio-l: 22px;
  --sombra:   0 1px 2px rgb(31 27 22 / .06), 0 4px 14px rgb(31 27 22 / .06);
  --sombra-l: 0 10px 40px rgb(31 27 22 / .14);
  --ancho-max: 1200px;
  --gutter: 16px;
}

/* ---------- 2. Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 16px/1.5 var(--fuente-texto);
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- 3. Tipografía ------------------------------------------------ */
h1, h2, h3, h4 { font-family: var(--fuente-titulo); line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1em; }
.mano { font-family: var(--fuente-mano); font-weight: 700; }
.apagado { color: var(--tinta-2); }
.chico { font-size: .875rem; }
.contenedor { width: 100%; max-width: var(--ancho-max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- 4. Componentes ----------------------------------------------- */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .7em 1.2em;
  border: 2px solid var(--tinta); border-radius: 999px;
  background: var(--superficie); color: var(--tinta);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
  box-shadow: 3px 3px 0 var(--tinta);
}
.btn:hover  { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinta); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.btn--primario { background: var(--naranja); color: #fff; }
.btn--wa       { background: var(--verde); color: #fff; }
.btn--fantasma { box-shadow: none; border-color: var(--borde); }
.btn--fantasma:hover { box-shadow: none; border-color: var(--tinta); }
.btn--peligro  { background: var(--rojo); color: #fff; }
.btn--chico    { min-height: 36px; padding: .35em .9em; font-size: .9rem; box-shadow: 2px 2px 0 var(--tinta); }
.btn--bloque   { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

/* Chips (filtros por rubro) */
.chip {
  display: inline-flex; align-items: center; gap: .35em; white-space: nowrap;
  padding: .45em .9em; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--borde); background: var(--superficie);
  font-size: .9rem; font-weight: 600; transition: all .12s;
}
.chip:hover { border-color: var(--tinta); }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .3em;
  padding: .2em .6em; border-radius: 6px;
  font-size: .75rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  background: var(--papel-2); color: var(--tinta);
}
.badge--cuotas    { background: var(--azul); color: #fff; }
.badge--reservado { background: var(--amarillo); color: var(--tinta); }
.badge--vendido   { background: var(--tinta); color: #fff; }
.badge--destacado { background: var(--naranja); color: #fff; }
.badge--pausada   { background: var(--tinta-3); color: #fff; }
.badge--activa    { background: #DDF5E6; color: var(--verde-osc); }

/* Etiqueta "No es nuevo porque…" — el sello de la marca.
   Parece una etiqueta de cartón colgada con un hilito. */
.confesion {
  position: relative;
  background: var(--amarillo-sua);
  border: 2px dashed #E9B800;
  border-radius: var(--radio);
  padding: 1.1em 1.2em 1em 1.2em;
}
.confesion__titulo {
  display: inline-block; margin: -1.9em 0 .4em -.2em; padding: .05em .6em;
  background: var(--amarillo); border: 2px solid var(--tinta); border-radius: 8px;
  transform: rotate(-2deg);
  font-family: var(--fuente-mano); font-size: 1.45rem; line-height: 1.2;
}
.confesion__texto { margin: 0; font-size: 1.02rem; white-space: pre-line; }

/* Campos de formulario */
.campo { display: grid; gap: .35em; margin-bottom: 1em; align-content: start; }
.campo > label, .campo > .etiqueta { font-weight: 700; font-size: .92rem; }
.campo .ayuda { font-size: .8rem; color: var(--tinta-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .6em .8em;
  border: 1.5px solid var(--borde); border-radius: var(--radio-s);
  background: var(--superficie); font-size: 16px; /* 16px evita el zoom en iPhone */
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--naranja); box-shadow: 0 0 0 3px rgb(255 91 46 / .2); }
.check { display: flex; align-items: center; gap: .6em; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--naranja); }

/* Logo */
/* Logo "Casi Nuevo": "Casi" es una etiqueta naranja inclinada (como un sticker de precio) */
.logo { display: inline-flex; align-items: center; gap: .3em; text-decoration: none; font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.logo__sello {
  display: inline-block; padding: .08em .42em .12em; border-radius: 8px;
  background: var(--naranja); color: #fff; border: 2px solid var(--tinta);
  transform: rotate(-6deg); box-shadow: 2px 2px 0 var(--tinta);
}
.logo b { color: var(--naranja); }

/* Toast (mensajes flotantes) */
.toast-zona { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 999; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: .8em 1em; border-radius: var(--radio); background: var(--tinta); color: #fff; font-weight: 600; box-shadow: var(--sombra-l); animation: toast-in .2s ease; }
.toast--error { background: var(--rojo); }
.toast--ok { background: var(--verde-osc); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Esqueleto de carga */
.esqueleto { background: linear-gradient(90deg, var(--papel-2) 25%, #fff 50%, var(--papel-2) 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: var(--radio); }
@keyframes brillo { to { background-position: -200% 0; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
