/* ==========================================================================
   GHIOTTI MOTORS · Sistema de diseño (web + panel)
   Manual de marca V5: Negro #111111 · Champagne #C9A45C · Marfil #F1EDE5
   Regla 70/20/10 · DejaVu Serif (titulares) · DejaVu Sans Bold (datos,
   precios, llamados) · DejaVu Sans (textos)
   ========================================================================== */
@font-face { font-family: "DejaVu Serif"; src: url("../fonts/DejaVuSerif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DejaVu Sans"; src: url("../fonts/DejaVuSans.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DejaVu Sans"; src: url("../fonts/DejaVuSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --black: #111111;
  --bg: #111111;
  --bg-deep: #0B0B0B;
  --surface: #161616;
  --surface-2: #1C1C1B;
  --surface-3: #242422;
  --ivory: #F1EDE5;
  --ivory-2: rgba(241, 237, 229, .74);
  --ivory-3: rgba(241, 237, 229, .58);
  --line: rgba(241, 237, 229, .10);
  --line-2: rgba(241, 237, 229, .18);
  --gold: #C9A45C;
  --gold-2: #DCC08A;
  --gold-3: #A88742;
  --gold-soft: rgba(201, 164, 92, .12);
  --gold-line: linear-gradient(90deg, rgba(201,164,92,0), #C9A45C 18%, #E6CF9C 50%, #C9A45C 82%, rgba(201,164,92,0));
  --ok: #8FB996;
  --warn: #E2B45C;
  --bad: #D9806F;
  --hot: #E0896A;
  --warm: #D8B26A;
  --cold: #8AA8C4;

  --serif: "DejaVu Serif", Georgia, "Times New Roman", serif;
  --sans: "DejaVu Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1320px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, p, figure, ul, ol, dl, dd, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--gold); color: var(--black); }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 12px 18px; background: var(--gold); color: var(--black); border-radius: var(--r-pill); font-weight: 700; transform: translateY(-160%); transition: transform .3s var(--ease); }
.skip:focus { transform: none; }

.ico { width: 20px; height: 20px; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 26px; height: 26px; }

/* ---------- tipografía ---------- */
.serif { font-family: var(--serif); font-weight: 400; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .8; }
.eyebrow.plain::before { display: none; }
.h-display { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7.4vw, 108px); line-height: 1.02; letter-spacing: -.035em; }
.h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5.2vw, 72px); line-height: 1.06; letter-spacing: -.03em; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.025em; }
.h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.015em; }
.lead { font-size: clamp(15px, 1.25vw, 18px); color: var(--ivory-2); max-width: 56ch; line-height: 1.7; }
.muted { color: var(--ivory-3); }
.gold { color: var(--gold); }
.data { font-family: var(--sans); font-weight: 700; letter-spacing: .02em; }
.label { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ivory-3); }
.num-tab { font-variant-numeric: tabular-nums; }

/* ---------- botones ---------- */
.btn {
  --bh: 52px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--bh); padding: 0 28px; border-radius: var(--r-pill);
  font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid transparent; transition: color .45s var(--ease), border-color .45s var(--ease), background-color .45s var(--ease), scale .3s var(--ease-out);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  transform: translateX(-101%); transition: transform .6s var(--ease-io);
}
.btn .ico { width: 18px; height: 18px; transition: transform .45s var(--ease-out); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold::before { background: var(--ivory); }
.btn-ghost { border-color: var(--line-2); color: var(--ivory); background: rgba(17,17,17,.25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost::before { background: var(--gold); }
.btn-dark { background: var(--surface-2); color: var(--ivory); border-color: var(--line); }
.btn-dark::before { background: var(--gold); }
.btn-ivory { background: var(--ivory); color: var(--black); }
.btn-ivory::before { background: var(--gold); }
.btn-sm { --bh: 44px; padding: 0 20px; font-size: 11px; }
.btn-block { width: 100%; white-space: normal; text-align: center; line-height: 1.35; padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 479px) { .btn { letter-spacing: .1em; padding-left: 20px; padding-right: 20px; } }
.btn-icon { --bh: 44px; width: 44px; padding: 0; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover::before { transform: translateX(0); }
  .btn-ghost:hover, .btn-dark:hover { color: var(--black); border-color: var(--gold); }
  .btn:hover .ico-arrow { transform: translateX(4px); }
}
.btn:active { scale: .98; }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-line { position: relative; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory); padding: 10px 0; min-height: 44px; }
.link-line::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--gold); transform-origin: right; transform: scaleX(.3); transition: transform .6s var(--ease-io); }
.link-line:hover::after { transform-origin: left; transform: scaleX(1); }
.link-line .ico { width: 18px; height: 18px; color: var(--gold); transition: transform .45s var(--ease-out); }
.link-line:hover .ico { transform: translateX(4px); }

/* ---------- formularios ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field > span, .field > label { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ivory-3); }
.field small { color: var(--ivory-3); font-size: 12px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ivory); font-size: 15px;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A45C' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.select option { background: var(--surface); color: var(--ivory); }
.input::placeholder, .textarea::placeholder { color: rgba(241,237,229,.38); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(241,237,229,.3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); background: var(--surface-2); outline: none; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input-money { position: relative; }
.input-money::before { content: "$"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gold); font-weight: 700; pointer-events: none; }
.input-money .input { padding-left: 34px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* chips / segmentos */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); color: var(--ivory-2); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  transition: all .35s var(--ease); background: transparent; white-space: nowrap;
}
.chip:hover { border-color: rgba(241,237,229,.36); color: var(--ivory); }
.chip[aria-pressed="true"], .chip.is-on, .chip:has(input:checked) { background: var(--ivory); color: var(--black); border-color: var(--ivory); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .count { font-size: 10px; opacity: .6; }

/* rango */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), var(--line-2) var(--p, 50%)); }
.range::-moz-range-track { height: 2px; background: var(--line-2); }
.range::-moz-range-progress { height: 2px; background: var(--gold); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--ivory); border: 5px solid var(--gold); box-shadow: 0 0 0 6px rgba(201,164,92,.12); transition: transform .25s var(--ease); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ivory); border: 5px solid var(--gold); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }

/* ---------- insignias de estado (manual: el estado es el primer nivel) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  background: rgba(17,17,17,.72); color: var(--ivory); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge.st-disponible { color: var(--ok); }
.badge.st-senado { color: var(--gold); border-color: rgba(201,164,92,.5); }
.badge.st-vendido { color: var(--ivory); background: rgba(17,17,17,.85); }
.badge.st-oculto { color: var(--ivory-3); }
.badge.gold { color: var(--black); background: var(--gold); border-color: var(--gold); }
.badge.gold::before { background: var(--black); }

/* ---------- datos con íconos de línea fina (120.000 KM · 2021 AÑO · AT CAJA) ---------- */
.specs { display: flex; flex-wrap: wrap; align-items: stretch; }
.spec { display: grid; gap: 2px; padding: 0 16px; border-left: 1px solid var(--line-2); }
.spec:first-child { padding-left: 0; border-left: 0; }
.spec b { font-weight: 700; font-size: 15px; letter-spacing: .01em; color: var(--ivory); line-height: 1.2; white-space: nowrap; }
.spec small { font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ivory-3); display: inline-flex; align-items: center; gap: 6px; }
.spec small .ico { width: 13px; height: 13px; color: var(--gold); }

/* ---------- línea champagne ---------- */
.gline { height: 1px; background: var(--gold-line); border: 0; }
.vline { width: 1px; background: linear-gradient(180deg, rgba(201,164,92,0), var(--gold), rgba(201,164,92,0)); }

/* ---------- modal / hoja ---------- */
.modal {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: end center; padding: 0;
  visibility: hidden; pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal__bg { position: absolute; inset: 0; background: rgba(5,5,5,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity .45s var(--ease); }
.modal.is-open .modal__bg { opacity: 1; }
.modal__box {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(40px); opacity: 0; transition: transform .6s var(--ease-out), opacity .45s var(--ease); box-shadow: var(--shadow);
}
.modal__box::before { content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: var(--gold-line); }
.modal.is-open .modal__box { transform: none; opacity: 1; }
.modal__close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ivory-2); transition: background .3s, color .3s; }
.modal__close:hover { background: var(--surface-3); color: var(--ivory); }
.modal__head { padding-right: 44px; margin-bottom: 20px; display: grid; gap: 8px; }
.modal__head h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; letter-spacing: -.015em; }
@media (min-width: 720px) {
  .modal { place-items: center; padding: 24px; }
  .modal__box { border-radius: var(--r-lg); padding: 36px 34px 32px; transform: translateY(24px) scale(.98); }
  .modal__box.wide { max-width: 860px; }
}

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 600; display: grid; gap: 10px; width: min(92vw, 440px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: rgba(28,28,27,.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45;
  animation: toastIn .5s var(--ease-out) both; backdrop-filter: blur(10px);
}
.toast .ico { color: var(--gold); margin-top: 1px; }
.toast.bad .ico { color: var(--bad); }
.toast b { display: block; font-weight: 700; }
.toast .toast__act { margin-left: auto; color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; padding: 4px 0 4px 8px; min-height: 32px; }
.toast.out { animation: toastOut .35s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- estados vacíos / carga ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ivory-2); }
.empty .ico { width: 34px; height: 34px; color: var(--gold); }
.empty h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ivory); }
.skeleton { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; border-radius: var(--r); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Cambios instantáneos para quien prefiere menos movimiento (sin ?motion=full) */
html.m-reduced *, html.m-reduced *::before, html.m-reduced *::after { scroll-behavior: auto !important; }
