:root {
  --gold: #c27c12;
  --gold-700: #9c620c;
  --gold-50: #fbf4e6;
  --ink: #111111;
  --text: #1d2026;
  --muted: #6a6e76;
  --line: #e4e1da;
  --bg: #f5f4f0;
  --ok: #1d7a4b;
  --wa: #1fa855;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

/* barra superior */
.cat-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
.cat-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.cat-brand img { width: 52px; height: auto; }
.cat-nav { margin-left: auto; display: flex; gap: 8px; }
.cat-nav a { text-decoration: none; font-size: .88rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.cat-ig { border: 1px solid rgba(255,255,255,.28); }
.cat-wa { background: var(--wa); }
@media (max-width: 420px) { .cat-ig { display: none; } .cat-brand span { font-size: .95rem; } }

.cat-hero { background: radial-gradient(120% 140% at 0% 0%, #2a2216 0%, #111 55%); color: #fff; padding: 34px 16px 30px; text-align: center; }
.cat-hero h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 4.5vw, 2.5rem); letter-spacing: -.02em; }
.cat-hero h1::after { content: ""; display: block; width: 56px; height: 4px; background: var(--gold); border-radius: 4px; margin: 12px auto 0; }
.cat-hero p { margin: 10px auto 0; max-width: 560px; color: #cfcac0; }

.cat-wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }

/* filtros */
.cat-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-filtros input, .cat-filtros select { font: 16px var(--font); padding: 11px 12px; border: 1px solid #d3cfc6; border-radius: 12px; background-color: #fff; color: var(--text); }
.cat-filtros input { flex: 2 1 240px; }
.cat-filtros select { flex: 1 1 170px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.cat-filtros input:focus, .cat-filtros select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194,124,18,.18); }

/* tarjetas */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.09); }
.cat-foto { position: relative; aspect-ratio: 4 / 3; background: #e9e6df; display: block; }
.cat-foto img { width: 100%; height: 100%; object-fit: cover; }
.cat-sinfoto, .det-sinfoto { display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 600; }
.cat-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.cat-titulo { font-weight: 800; font-size: 1.08rem; color: var(--ink); letter-spacing: -.01em; }
.cat-sub { color: var(--muted); font-size: .9rem; }
.cat-specs { color: #3a3d44; font-size: .86rem; margin-top: 4px; }
.cat-precio { margin-top: 8px; font-weight: 800; font-size: 1.25rem; color: var(--gold-700); }
.cat-precio small { font-size: .74rem; font-weight: 600; color: var(--muted); }
.badge-cat { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .02em; background: var(--ink); color: #fff; }
.badge-cat.reservado { background: #b42318; }
.badge-cat.proximo { background: #1f5fbf; }
.badge-cat.garantia { left: auto; right: 10px; background: rgba(255,255,255,.94); color: var(--ok); }
.cat-nada, .cat-empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.cat-empty h1, .cat-empty h2 { color: var(--ink); }

.cat-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 12px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 700 1rem var(--font); text-decoration: none; cursor: pointer; }
.cat-btn-wa { background: var(--wa); border-color: var(--wa); }
.cat-btn-sec { background: #fff; color: var(--ink); border-color: #cfcabf; }

/* detalle */
.cat-volver { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.det-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .det-grid { grid-template-columns: 1fr; gap: 18px; } }
.det-galeria { position: relative; }
.det-fotos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 16px; background: #e9e6df; scrollbar-width: none; }
.det-fotos::-webkit-scrollbar { display: none; }
.det-fotos img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; }
.det-sinfoto { aspect-ratio: 4 / 3; border-radius: 16px; background: #e9e6df; }
.det-miniaturas { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: thin; }
.det-miniaturas button { flex: 0 0 76px; height: 57px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #e9e6df; opacity: .75; }
.det-miniaturas button.on { border-color: var(--gold); opacity: 1; }
.det-miniaturas img { width: 100%; height: 100%; object-fit: cover; }
.det-contador { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.det-kicker { margin: 0; color: var(--muted); font-weight: 600; font-size: .9rem; }
.det-info h1 { margin: 2px 0 6px; font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
.det-info h1 span { display: block; font-size: .62em; color: #3a3d44; font-weight: 600; }
.det-precio { margin: 4px 0 10px; font-size: 1.9rem; font-weight: 800; color: var(--gold-700); }
.det-precio small { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.det-garantia { display: inline-block; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: #e8f5ee; color: var(--ok); font-weight: 700; font-size: .92rem; }
.det-garantia::before { content: "✓ "; }
.det-desc { margin: 0 0 14px; color: #33363c; }
.det-ctas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.det-ctas .cat-btn-wa { flex: 1 1 220px; }
.det-ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 18px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.det-ficha div { background: #fff; padding: 10px 12px; }
.det-ficha dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.det-ficha dd { margin: 0; font-weight: 700; color: var(--ink); }
.det-info h2 { font-size: 1.05rem; margin: 0 0 8px; }
.det-equipos { list-style: none; padding: 0; margin: 0 0 16px; columns: 2; column-gap: 16px; }
@media (max-width: 480px) { .det-equipos { columns: 1; } }
.det-equipos li { position: relative; padding-left: 22px; margin-bottom: 6px; break-inside: avoid; }
.det-equipos li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 800; }
.det-nota { padding: 10px 12px; background: var(--gold-50); border-radius: 10px; }
.det-ref { color: var(--muted); font-size: .82rem; }
.det-barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; align-items: center; gap: 12px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
.det-barra div { display: flex; flex-direction: column; min-width: 0; }
.det-barra strong { color: var(--gold-700); font-size: 1.1rem; }
.det-barra span { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-barra .cat-btn { margin-left: auto; padding: 11px 16px; flex-shrink: 0; }
@media (max-width: 900px) { .det-barra { display: flex; } .cat-detalle { padding-bottom: 90px; } }

/* ferias de préstamos (página principal) */
.cat-ferias { background: linear-gradient(180deg, #111 0%, #111 40%, var(--bg) 40%); padding: 0 16px 6px; }
.ferias-fila { max-width: 1148px; margin: 0 auto; display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ferias-fila::-webkit-scrollbar { display: none; }
.feria-card { flex: 1 0 280px; max-width: 420px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(0,0,0,.10); }
.feria-card.destacada { background: linear-gradient(135deg, #fff8ea 0%, #ffffff 60%); border-color: #efd6a6; }
.feria-tag { align-self: flex-start; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-700); background: var(--gold-50); border: 1px solid #efd6a6; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }
.feria-banco { font-size: 1.05rem; color: var(--ink); }
.feria-nombre { font-size: .86rem; color: var(--muted); }
.feria-tasa { font-size: 2.1rem; font-weight: 900; color: var(--gold-700); line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.feria-tasa small { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.feria-det { font-size: .86rem; color: #3a3d44; margin-top: 4px; }

/* bancos con los que trabajamos */
.cat-bancos { margin: 36px 0 0; padding: 26px 18px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.cat-bancos h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--ink); letter-spacing: -.01em; }
.cat-bancos p { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.bancos-fila { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.banco-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; height: 56px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #faf9f6; font-weight: 800; font-size: .92rem; color: #2a2d33; letter-spacing: -.01em; }
.banco-chip img { max-height: 36px; max-width: 130px; object-fit: contain; filter: grayscale(.15); }

/* calculadora de cuota (ficha del vehículo) */
.det-financia { margin: 0 0 18px; padding: 16px; border-radius: 16px; border: 1.5px solid #efd6a6; background: linear-gradient(160deg, #fffaf0 0%, #fff 70%); }
.det-financia h2 { margin: 0 0 10px !important; font-size: 1.05rem; }
.det-financia label { display: block; font-size: .82rem; font-weight: 700; color: #3a3d44; margin-bottom: 10px; }
.det-financia select { display: block; width: 100%; margin-top: 4px; font: 15px var(--font); padding: 10px 32px 10px 11px; border: 1px solid #d3cfc6; border-radius: 10px; background-color: #fff; color: var(--text); appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.det-financia output { float: right; font-weight: 800; color: var(--ink); }
.det-financia input[type="range"] { display: block; width: 100%; margin-top: 8px; accent-color: var(--gold); }
.fin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 12px; align-items: end; }
@media (max-width: 420px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-cuota { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: #111; color: #fff; margin: 4px 0 12px; }
.fin-cuota span { font-size: .78rem; font-weight: 700; color: #cfcac0; text-transform: uppercase; letter-spacing: .06em; }
.fin-cuota strong { font-size: 1.7rem; color: #f0b545; line-height: 1.15; }
.fin-cuota small { color: #cfcac0; font-size: .8rem; }
.det-financia .cat-btn { width: 100%; }
.fin-nota { margin: 10px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.4; }
.det-financia-simple p { margin: 0 0 10px; color: #3a3d44; font-size: .92rem; }

.cat-pie { text-align: center; padding: 28px 16px 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.cat-pie img { margin: 0 auto 8px; width: 46px; height: auto; }
.cat-pie p { margin: 4px 0; }
.cat-pie a { color: var(--gold-700); font-weight: 700; text-decoration: none; }
