/* ============================================================
   Subaru · Anfruns Motors — estilo del sitio (rojo/negro/blanco, Lato)
   Encabezado replicado de anfrunsmotors.cl para integración visual.
   ============================================================ */

:root {
  --red:    #e30527;
  --red-2:  #c40a20;
  --red-3:  #9b051c;
  --grad:   linear-gradient(312.95deg, #e30527 0%, #c40a20 51.06%, #9b051c 100%);
  --black:  #111111;
  --ink:    #1a1a1a;
  --grey:   #717171;
  --grey-2: #9a9a9a;
  --bg:     #f9f9f9;
  --white:  #ffffff;
  --line:   #e6e6e6;
  --line-2: #f0f0f0;
  --ok:     #1f9d63;
  --err:    #d64545;

  --r-card: 18px;
  --r-pill: 30px;
  --shadow:  0 10px 30px -14px rgba(0,0,0,.22);
  --shadow-hover: 0 20px 44px -16px rgba(0,0,0,.28);

  --font: "Lato", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--grey);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ============================================================
   ENCABEZADO (réplica Anfruns)
   ============================================================ */
.site-header { background: var(--grad); position: relative; z-index: 40; }
.site-header__bar {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 1.3rem;
  padding: 0 1.25rem; min-height: 84px; position: relative;
}
.site-header__derco { flex: none; display: flex; align-items: center; }
.site-header__derco img { height: 58px; width: auto; }
.site-header__logo { flex: none; display: flex; align-items: center; }
.site-header__logo img { height: 46px; width: auto; }

/* menú horizontal (escritorio) */
.site-header__nav { margin-left: auto; display: flex; align-items: center; gap: 1.15rem; }
.site-header__nav a {
  color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap; transition: opacity .15s;
}
.site-header__nav a:hover { opacity: .78; }
.site-header__comparar { display: inline-flex; align-items: center; gap: .4rem; }
.site-header__comparar svg { width: 15px; height: 15px; }

/* botón hamburguesa (solo móvil) */
.site-header__toggle {
  display: none; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: .5rem; flex-direction: column; gap: 5px;
}
.site-header__toggle span { width: 30px; height: 3px; background: #fff; border-radius: 3px; transition: .25s; }
.site-header__toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(8px) rotate(45deg); }
.site-header__toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.site-header__toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

/* menú desplegable (solo móvil) */
.site-nav { background: var(--black); color: #fff; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.site-nav.is-open { max-height: 620px; }
.site-nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: .5rem 1.25rem 1rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .1rem 1.5rem;
}
.site-nav a { display: block; padding: .7rem 0; color: #e8e8e8; font-weight: 700; font-size: .92rem; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-nav a:hover { color: #fff; }

/* interruptor escritorio ↔ móvil */
@media (max-width: 1140px) {
  .site-header__bar { justify-content: center; min-height: 74px; }
  .site-header__derco, .site-header__nav { display: none; }
  .site-header__toggle { display: flex; }
}
@media (min-width: 1141px) {
  .site-nav { display: none; }
}

/* barra negra "comparar" + Buscar */
.compare-bar { background: var(--black); color: #cfcfcf; }
.compare-bar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.compare-bar__text { font-size: .95rem; }
.compare-bar__text b { color: #fff; font-weight: 900; }
.btn-buscar {
  background: var(--red); color: #fff; font-weight: 900; font-family: var(--font);
  border: 0; border-radius: var(--r-pill); padding: .7rem 2rem; font-size: 1rem;
  cursor: pointer; transition: background .2s, transform .15s;
}
.btn-buscar:hover { background: var(--red-2); }
.btn-buscar:active { transform: translateY(1px); }

/* ============================================================
   HERO (banda de marca)
   ============================================================ */
.hero {
  background: var(--grad); color: #fff; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 85% -20%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.hero__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.25rem 3.4rem; position: relative; z-index: 1;
}
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: .74rem; font-weight: 900;
  color: rgba(255,255,255,.85); margin: 0 0 .8rem;
}
.hero__title {
  font-weight: 900; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.04;
  margin: 0 0 .8rem; color: #fff; letter-spacing: -.01em; max-width: 20ch;
}
.hero__lede { max-width: 56ch; color: rgba(255,255,255,.9); font-size: 1.05rem; margin: 0 0 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.2rem; }
.hero__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; margin: 0;
  background: rgba(255,255,255,.22); border-radius: 14px; overflow: hidden; max-width: 660px;
}
.hero__stats > div { background: rgba(155,5,28,.55); padding: 1rem 1.1rem; }
.hero__stats dt { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 900; color: rgba(255,255,255,.85); margin-bottom: .3rem; }
.hero__stats dd { margin: 0; font-weight: 900; font-size: 1.4rem; color: #fff; }
@media (max-width: 620px){ .hero__stats { grid-template-columns: repeat(2,1fr); } }

/* botones genéricos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font); font-weight: 900; font-size: 1rem;
  padding: .8rem 1.8rem; border-radius: var(--r-pill); cursor: pointer; border: 2px solid transparent;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #fff; color: var(--red); }
.btn--ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--red-2); }
.btn--block { width: 100%; }

/* ============================================================
   TÍTULOS de sección (estilo Anfruns: negro, bold, centrado)
   ============================================================ */
.section { padding: 3rem 0; }
.section-head { text-align: center; margin-bottom: 2rem; }
.section-title {
  font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--ink);
  margin: 0 0 .5rem; letter-spacing: -.01em;
}
.section-sub { color: var(--grey); max-width: 60ch; margin: 0 auto; }

/* ============================================================
   FILTROS
   ============================================================ */
.filterbar { position: sticky; top: 0; z-index: 30; background: rgba(249,249,249,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.filterbar__inner { max-width: var(--maxw); margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filterbar__label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); font-weight: 900; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--font); font-weight: 700; font-size: .9rem;
  padding: .45rem 1.1rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: #fff; color: var(--grey); cursor: pointer; transition: all .16s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.chip__count { opacity: .6; font-size: .78em; margin-left: .35em; font-weight: 900; }

/* ============================================================
   CATÁLOGO
   ============================================================ */
.catalogo { max-width: var(--maxw); margin: 0 auto; padding: 2.2rem 1.25rem 3.5rem; }
.catalogo__grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.loading { grid-column: 1/-1; text-align: center; color: var(--grey); padding: 3rem 0; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: box-shadow .25s, transform .25s; opacity: 0; transform: translateY(14px);
}
.card.is-in { opacity: 1; transform: none; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.card__media { position: relative; aspect-ratio: 16/10; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 10px; }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card__cat {
  position: absolute; top: .8rem; left: .8rem; z-index: 2;
  font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 900;
  background: var(--red); color: #fff; padding: .35rem .7rem; border-radius: var(--r-pill);
}
.card__spec {
  position: absolute; bottom: .7rem; right: .8rem; z-index: 2;
  font-size: .62rem; letter-spacing: .04em; font-weight: 700;
  background: rgba(17,17,17,.82); color: #fff; padding: .3rem .6rem; border-radius: var(--r-pill);
}

.card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card__model { font-weight: 900; font-size: 1.5rem; line-height: 1.08; margin: 0 0 .1rem; color: var(--ink); }
.card__submodel { font-size: .82rem; color: var(--grey-2); margin: 0 0 1rem; }

.versions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.vpill {
  font-family: var(--font); font-weight: 700; font-size: .74rem; padding: .38rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--grey); cursor: pointer; transition: all .14s; text-align: left;
}
.vpill:hover { border-color: var(--red); color: var(--red); }
.vpill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* desglose de bonos */
.price { margin-top: auto; }
.price__lista { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: .55rem; font-size: .85rem; color: var(--grey); }
.price__lista s { text-decoration-color: var(--grey-2); }
.bonos { display: flex; flex-direction: column; gap: .3rem; padding: .55rem 0; border-top: 1px dashed var(--line); }
.bono { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; }
.bono__k { color: var(--grey); display: flex; align-items: center; gap: .45rem; }
.bono__k::before { content: "−"; color: var(--red); font-weight: 900; }
.bono__v { font-weight: 900; color: var(--red); }
.price__final { margin-top: .5rem; padding-top: .8rem; border-top: 2px solid var(--ink); display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; }
.price__final-k { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); font-weight: 900; }
.price__final-v { font-weight: 900; font-size: 1.7rem; line-height: 1; color: var(--ink); }
.price__cuota { font-size: .8rem; color: var(--grey); margin-top: .5rem; }
.price__cuota b { color: var(--ink); font-weight: 900; }
.price__ahorro { display: inline-block; margin-top: .7rem; font-weight: 900; font-size: .78rem; background: #fde7ea; color: var(--red-2); padding: .32rem .7rem; border-radius: var(--r-pill); }
.price__nobono { font-size: .8rem; color: var(--grey); margin-top: .6rem; font-style: italic; }

.card__cta { margin-top: 1.1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.card__cta a {
  display: block; text-align: center; font-weight: 900; padding: .75rem .6rem; border-radius: var(--r-pill);
  border: 2px solid var(--red); transition: all .18s; font-size: .9rem;
}
.card__cta .btn-vermodelo { background: #fff; color: var(--red); }
.card__cta .btn-vermodelo:hover { background: #fde7ea; }
.card__cta .btn-cta { background: var(--red); color: #fff; }
.card__cta .btn-cta:hover { background: var(--red-2); }
@media (max-width: 380px){ .card__cta { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--black); color: #b7b7b7; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 2.4rem 1.25rem; }
.footer__brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 900; margin-bottom: 1rem; }
.footer__brand img { height: 34px; }
.footer__disclaimer { font-size: .78rem; line-height: 1.6; max-width: 100ch; margin: 0 0 1rem; }
.footer__meta { font-size: .72rem; color: var(--grey-2); margin: 0; }

/* ============================================================
   PÁGINA COTIZAR
   ============================================================ */
.cotizar-page { max-width: 960px; margin: -0 auto; padding: 2.5rem 1.25rem 4rem; }
.cotizar-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.6rem); margin-top: -2.5rem; position: relative; z-index: 2;
}
.cotizar-card__title { text-align: center; font-weight: 900; font-size: clamp(1.7rem,4vw,2.4rem); color: var(--ink); margin: 0 0 1.6rem; }
.vehiculo {
  display: flex; align-items: center; gap: 1.1rem; padding: 1rem 1.2rem; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg); margin-bottom: 1.8rem;
}
.vehiculo__logo { width: 76px; height: 56px; object-fit: contain; flex: none; }
.vehiculo__badge { width: 72px; height: 56px; flex: none; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1.6rem; }
.vehiculo__name { font-weight: 900; font-size: 1.5rem; color: var(--ink); line-height: 1.05; }
.vehiculo__ver { color: var(--grey); font-size: .95rem; }
.vehiculo__price { margin-left: auto; text-align: right; }
.vehiculo__price small { display: block; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); font-weight: 900; }
.vehiculo__price b { font-size: 1.4rem; color: var(--ink); font-weight: 900; }
@media (max-width: 560px){ .vehiculo { flex-wrap: wrap; } .vehiculo__price { margin-left: 0; text-align: left; width: 100%; } }

.cotizar-desglose { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; background: var(--bg); margin-bottom: 1.8rem; }
.cotizar-desglose .price { margin-top: 0; max-width: 380px; }

/* formulario */
.form__row { margin-bottom: .9rem; }
.form__row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 500px){ .form__row--2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field__label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); font-weight: 900; }
.field__opt { text-transform: none; letter-spacing: 0; color: var(--grey-2); }
.field input, .field select, .field textarea {
  font-family: var(--font); font-size: .98rem; color: var(--ink); padding: .75rem .9rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,5,39,.14); }
.field input:invalid:not(:placeholder-shown) { border-color: var(--err); }
.form__status { margin: .9rem 0 0; font-weight: 700; min-height: 1.2em; }
.form__status.is-ok { color: var(--ok); }
.form__status.is-err { color: var(--err); }
.form__legal { margin: 1rem 0 0; font-size: .74rem; color: var(--grey-2); }
.form__back { display: inline-block; margin-top: 1.4rem; color: var(--red); font-weight: 900; }

/* ============================================================
   PÁGINA VER MODELO
   ============================================================ */
.modelo-page { max-width: var(--maxw); margin: 0 auto; padding: 2.4rem 1.25rem 4rem; }
.modelo-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.2rem; align-items: start; }
@media (max-width: 900px){ .modelo-top { grid-template-columns: 1fr; } }

/* galería */
.galeria__main {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card);
  aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow);
}
.galeria__main img { width: 100%; height: 100%; object-fit: contain; padding: 12px; transition: opacity .2s; }
.galeria__thumbs { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.galeria__thumb {
  width: 78px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line);
  background: #fff; cursor: pointer; padding: 2px; transition: border-color .15s;
}
.galeria__thumb.is-active { border-color: var(--red); }
.galeria__thumb img { width: 100%; height: 100%; object-fit: contain; }

/* panel derecho */
.modelo-info h1 { font-weight: 900; font-size: clamp(1.9rem,4vw,2.6rem); color: var(--ink); margin: 0 0 .2rem; }
.modelo-info__cat { display: inline-block; background: var(--red); color: #fff; font-weight: 900; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; padding: .3rem .7rem; border-radius: var(--r-pill); margin-bottom: 1rem; }
.modelo-info__spec { color: var(--grey); margin: 0 0 1.4rem; }
.modelo-info__spec b { color: var(--ink); }

/* colores */
.colores { margin: 1.6rem 0; }
.colores__title, .versiones__title { font-weight: 900; color: var(--ink); font-size: 1rem; margin: 0 0 .8rem; text-transform: uppercase; letter-spacing: .04em; }
.colores__nombre { color: var(--grey); font-weight: 700; margin: 0 0 .8rem; min-height: 1.2em; }
.colores__nombre b { color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: .55rem; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; padding: 0; position: relative;
  border: 1px solid rgba(0,0,0,.15); box-shadow: inset 0 0 0 2px #fff; transition: transform .12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--red); }

/* versiones (detalle) */
.modelo-versiones { margin-top: 2.6rem; }
.mver-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); }
.mver {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.mver__name { font-weight: 900; color: var(--ink); font-size: 1.05rem; margin: 0 0 .8rem; }
.mver .price { margin-top: 0; }
.mver .card__cta { margin-top: 1rem; }

/* accesibilidad */
:focus-visible { outline: 3px solid rgba(227,5,39,.5); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card { opacity: 1; transform: none; }
}
