/* =========================================================================
   EBC Frenos — Home (index) — override de fichero completo.
   Traducción a CSS del Home.jsx del Design System (Claude Design).
   Secciones: hero+buscador · comprar por vehículo · gamas · recomendador
   (interactivo, ebc-home.js) · hub técnico · banda de confianza.
   Todo scopeado bajo #index (body id = page_name) para no tocar otras vistas.
   Tokens: ebc.css (colores/tipografía/spacing del DS) ya cargado antes.
   ========================================================================= */

/* ---- Full-bleed: anulamos el contenedor/padding del wrapper en la home ---- */
#index #wrapper.wrapper { padding: 0; max-width: none; overflow-x: clip; }
#index #wrapper > .breadcrumb,
#index .ebc-home + * { margin: 0; }

.ebc-home { color: var(--text-strong); background: var(--surface-page); }
.ebc-home *,
.ebc-home *::before,
.ebc-home *::after { box-sizing: border-box; }

/* Columna central alineada (ancho máx + gutters), reutilizable por sección */
.ebc-wrap {
  width: 100%;
  max-width: var(--page-max, 1600px);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 24px);
}

/* Ritmo de secciones */
.ebc-sec { padding-block: var(--section-y); }
.ebc-sec--alt {
  background: var(--surface-card);
  border-block: 1px solid var(--border-soft);
}
.ebc-sec--dark { background: var(--black); color: #fff; }

/* ---------- Eyebrow (etiqueta superior con regla) ---------- */
.ebc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-600);
}
.ebc-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
  flex: none;
}
.ebc-eyebrow--impact { color: var(--text-on-impact-soft); }
.ebc-eyebrow--blue { color: var(--blue-700); }

/* ---------- Cabecera de sección ---------- */
.ebc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ebc-head__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 38px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 8px 0 0;
  color: var(--text-strong);
}
.ebc-sec--dark .ebc-head__title { color: #fff; }
.ebc-head__sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  margin: 8px 0 0;
  max-width: 620px;
  line-height: 1.5;
}
.ebc-head__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-link);
  white-space: nowrap;
}
.ebc-head__cta:hover { color: var(--text-link-hover); }
.ebc-ico { display: block; flex: none; }

/* =========================================================================
   HERO
   ========================================================================= */
.ebc-hero {
  position: relative;
  background: var(--black);
  overflow: hidden;
}
.ebc-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url(../img/hero-web.jpg);
  background-size: cover;
  background-position: center right;
}
/* Hero vertical del cliente en móvil (el sujeto va centrado en la imagen portrait) */
@media (max-width: 600px) {
  .ebc-hero__bg {
    background-image: url(../img/hero-movil.jpg);
    background-position: center;
  }
}
.ebc-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(10,10,12,.94) 0%, rgba(10,10,12,.82) 30%, rgba(10,10,12,.58) 52%, rgba(10,10,12,.34) 100%),
    linear-gradient(0deg, rgba(10,10,12,.84) 0%, rgba(10,10,12,0) 54%);
}
.ebc-hero__inner {
  position: relative;
  padding-block: clamp(36px, 5vw, 64px);
}
.ebc-hero__copy { max-width: 720px; }
.ebc-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 76px);
  text-transform: uppercase;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 14px 0 0;
  line-height: 0.92;
}
.ebc-hero__title .accent { color: var(--red-500); }
.ebc-hero__sub {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-on-impact-soft);
  margin: 18px 0 0;
  max-width: 540px;
  line-height: 1.5;
}
.ebc-hero__sub strong { color: #fff; font-weight: 600; }
.ebc-hero__search { margin-top: 28px; max-width: 920px; scroll-margin-top: calc(var(--ebc-hdr-h, 180px) + 16px); }

/* Fallback cuando el módulo find4ufilter no responde (CTA) */
.ebc-hero__fallback {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.ebc-hero__fallback p {
  font-family: var(--font-body);
  color: var(--text-body);
  margin: 0;
  font-size: 15px;
}
.ebc-hero__fallback strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 4px;
}

/* ---- Re-tema del buscador find4ufilter a los tokens EBC ---- */
.find4u-filter {
  --f4u-brand: var(--blue-700);   /* azul EBC #00378d (era #243588) */
  --f4u-accent: var(--red-600);   /* rojo EBC #e00209 (era #E84237) */
}
/* En el hero (sobre negro) el buscador es una tarjeta blanca flotante */
.ebc-hero__search .find4u-filter {
  box-shadow: var(--shadow-xl);
  width: 100%;
}

/* =========================================================================
   COMPRAR POR TIPO DE VEHÍCULO (world tiles)
   ========================================================================= */
.ebc-worlds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ebc-world {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--black);
  min-height: 240px;
  box-shadow: var(--shadow-md);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.ebc-world:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }
.ebc-world__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 400ms var(--ease-out);
}
.ebc-world:hover .ebc-world__bg { transform: scale(1.04); }
.ebc-world__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8,8,9,.93) 0%, rgba(8,8,9,.66) 42%, rgba(8,8,9,.32) 100%),
    linear-gradient(0deg, rgba(8,8,9,.9) 0%, rgba(8,8,9,0) 56%);
}
.ebc-world__body {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 240px;
}
.ebc-world__icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  color: #fff;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ring-onblack);
}
.ebc-world__foot { margin-top: auto; }
.ebc-world__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.01em;
}
.ebc-world__desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-on-impact-soft);
  margin: 8px 0 0;
}
.ebc-world__more {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red-500);
}
.ebc-world__more .ebc-ico { transition: transform 180ms; }
.ebc-world:hover .ebc-world__more .ebc-ico { transform: translateX(3px); }

/* =========================================================================
   GAMAS POR VEHÍCULO (family cards)
   ========================================================================= */
.ebc-fams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ebc-fam {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms;
}
.ebc-fam:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue-300);
}
.ebc-fam__top { display: flex; align-items: center; justify-content: space-between; }
.ebc-fam__icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--graphite-800);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.ebc-fam__kicker {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ebc-fam__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.01em;
}
.ebc-fam__desc {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 7px 0 0;
}
.ebc-fam__swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.ebc-fam__sw {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.ebc-fam__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-link);
}
.ebc-fam:hover .ebc-fam__more { color: var(--text-link-hover); }
.ebc-fam__more .ebc-ico { transition: transform 180ms; }
.ebc-fam:hover .ebc-fam__more .ebc-ico { transform: translateX(3px); }

/* =========================================================================
   RECOMENDADOR DE GAMA (quiz) — ver ebc-home.js
   ========================================================================= */
.ebc-quiz {
  position: relative;
  overflow: hidden;
  background: var(--surface-brand-deep); /* azul-900 */
  border-radius: var(--radius-xl);
  color: #fff;
}
.ebc-quiz::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.10), transparent 50%);
  pointer-events: none;
}
.ebc-quiz__grid {
  position: relative;
  padding: clamp(24px, 4vw, 40px);
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.ebc-quiz__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  text-transform: uppercase;
  color: #fff;
  margin: 10px 0 0;
  line-height: 1;
}
.ebc-quiz__lead {
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255,255,255,.75);
  margin: 10px 0 0;
  max-width: 420px;
  line-height: 1.5;
}
.ebc-quiz__reset {
  margin-top: 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,.7);
  padding: 0;
  display: none; /* visible cuando hay resultado (JS) */
  align-items: center;
  gap: 6px;
}
.ebc-quiz.is-complete .ebc-quiz__reset { display: inline-flex; }
.ebc-quiz__reset:hover { color: #fff; }

.ebc-quiz__steps { display: flex; flex-direction: column; gap: 18px; }
.ebc-step[hidden] { display: none; }
.ebc-step__head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.ebc-step__num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ebc-step.is-done .ebc-step__num { background: var(--red-600); }
.ebc-step__label {
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,.85);
}
.ebc-step__opts { display: grid; gap: 10px; }
.ebc-step__opts--3 { grid-template-columns: repeat(3, 1fr); }
.ebc-step__opts--2 { grid-template-columns: repeat(2, 1fr); }

.ebc-chip {
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  transition: all 150ms;
  width: 100%;
  color: #fff;
}
.ebc-chip:hover { border-color: rgba(255,255,255,.4); }
.ebc-chip.is-on { border-color: var(--red-500); background: rgba(224,2,9,.14); }
.ebc-chip__ico { color: #fff; }
.ebc-chip.is-on .ebc-chip__ico { color: var(--red-500); }
.ebc-chip__txt { min-width: 0; }
.ebc-chip__label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #fff;
}
.ebc-chip__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: rgba(255,255,255,.6);
  margin-top: 2px;
}

.ebc-quiz__result { border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; }
.ebc-quiz__result[hidden] { display: none; }
.ebc-quiz__result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.ebc-quiz__result-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}
.ebc-quiz__cards { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.ebc-quiz__cards.is-one { grid-template-columns: minmax(0, 360px); }
.ebc-rescard {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}
.ebc-rescard__band { padding: 11px 14px; }
.ebc-rescard__cat {
  display: block;
  font-family: var(--font-heading);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: .9;
}
.ebc-rescard__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.01em;
}
.ebc-rescard__body { padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ebc-rescard__tag { font-family: var(--font-body); font-size: 12.5px; color: var(--text-body); line-height: 1.45; }
.ebc-rescard__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-link);
}
.ebc-quiz__note {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* =========================================================================
   HUB TÉCNICO (edu cards)
   ========================================================================= */
.ebc-edu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.ebc-edu__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  text-decoration: none;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
  height: 100%;
}
.ebc-edu__card:hover { border-color: var(--blue-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ebc-edu__icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--blue-50);
  color: var(--blue-700);
  align-items: center;
  justify-content: center;
}
.ebc-edu__tag {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red-600);
}
.ebc-edu__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--text-strong);
  flex: 1;
}
.ebc-edu__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* =========================================================================
   BANDA DE CONFIANZA (trust)
   ========================================================================= */
.ebc-trust {
  border: 1px solid var(--border-onblack);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ebc-trust__item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-right: 1px solid var(--border-onblack);
}
.ebc-trust__item:last-child { border-right: none; }
.ebc-trust__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
.ebc-trust__t {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: #fff;
}
.ebc-trust__s {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-on-impact-soft);
}

/* =========================================================================
   RESPONSIVE (PC / Tablet / Móvil) — media queries de viewport
   ========================================================================= */
@media (max-width: 1000px) {
  .ebc-quiz__grid { grid-template-columns: 1fr; }
  .ebc-quiz__lead { max-width: none; }
}
@media (max-width: 900px) {
  .ebc-worlds,
  .ebc-fams,
  .ebc-edu { grid-template-columns: repeat(2, 1fr); }
  .ebc-trust { grid-template-columns: repeat(2, 1fr); }
  .ebc-trust__item:nth-child(2) { border-right: none; }
  .ebc-trust__item:nth-child(-n+2) { border-bottom: 1px solid var(--border-onblack); }
}
@media (max-width: 560px) {
  .ebc-worlds,
  .ebc-fams,
  .ebc-edu { grid-template-columns: 1fr; }
  .ebc-trust { grid-template-columns: 1fr; }
  .ebc-trust__item { border-right: none; border-bottom: 1px solid var(--border-onblack); }
  .ebc-trust__item:last-child { border-bottom: none; }
  .ebc-step__opts--3 { grid-template-columns: 1fr; }
  .ebc-quiz__cards,
  .ebc-quiz__cards.is-one { grid-template-columns: 1fr; }
  .ebc-head { gap: 12px; }
}
