/* ============================================================
   Marcas oficiales: índice (/marcas/) y ficha de marca (/marcas/{slug}/)
   Identidad Grupo Marmo (Marmo UI, manual Ed. 2): manda la marca del grupo.
   De cada fabricante solo entran su logotipo y sus fotografías.
   Sin colores nuevos: todo sale de los tokens de Marmo UI.
   ============================================================ */

.mk-page {
  --mk-gap: var(--space-5);
  overflow-x: clip;
}

.mk-page h2 {
  color: var(--marmo-blue-dark);
  text-wrap: balance;
}

.mk-page .section-dark h2,
.mk-page .on-dark h1 {
  color: var(--marmo-white);
}

.mk-alt {
  background: var(--marmo-surface);
}

/* Cabecera de bloque: título a la izquierda, acción o filtros a la derecha */
.mk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
}

.mk-head > div:first-child {
  max-width: 720px;
}

.mk-head h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-titulo-bloque);
}

.mk-head p {
  margin: 0;
  color: var(--marmo-muted);
}

/* ---------- Cabecera de la página ---------- */
.mk-hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-8);
  background: var(--marmo-gradient-dark);
  color: var(--marmo-white);
}

.mk-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-7);
}

.mk-hero--index .mk-hero__grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

/* Mosaico de marcas destacadas (índice): una foto grande y dos pequeñas */
.mk-hero--index {
  padding-bottom: var(--space-7);
}

.mk-hero--index .mk-hero__copy {
  align-self: center;
}

.mk-hero--index .mk-hero__facts {
  margin-top: var(--space-6);
}

.mk-bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  height: clamp(380px, 38vw, 500px);
}

.mk-bento__tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--marmo-white-12);
  border-radius: var(--radius-md);
  background: var(--marmo-blue-deep);
  color: var(--marmo-white);
  text-decoration: none;
}

.mk-bento__tile.is-main {
  grid-row: 1 / span 2;
}

.mk-bento__tile > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

.mk-bento__tile:hover > img {
  transform: scale(1.04);
}

.mk-bento__tile:focus-visible {
  outline: none;
  border-color: var(--focus-color-dark);
}

.mk-bento__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 26, 51, 0) 40%, rgba(4, 26, 51, 0.88) 100%);
}

.mk-bento__logo {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: grid;
  height: 40px;
  place-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--marmo-white);
}

.mk-bento__logo img {
  width: auto;
  max-width: 110px;
  height: 22px;
}

.mk-bento__logo.is-light-logo img {
  filter: brightness(0);
}

.mk-bento__text {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  display: grid;
  gap: 2px;
}

.mk-bento__text strong {
  font-size: var(--text-titulo-menor);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
}

.mk-bento__tile.is-main .mk-bento__text strong {
  font-size: 1.75rem;
}

.mk-bento__text span {
  color: var(--marmo-white-78);
  font-size: var(--text-etiqueta);
}

.mk-bento__text strong::after {
  content: " →";
  color: var(--marmo-gold-light);
  opacity: 0;
  transition: opacity var(--duration-state) var(--ease);
}

.mk-bento__tile:hover .mk-bento__text strong::after,
.mk-bento__tile:focus-visible .mk-bento__text strong::after {
  opacity: 1;
}

/* Franja de logotipos bajo la cabecera: acceso directo a cada ficha */
.mk-rail {
  border-bottom: var(--border);
  background: var(--marmo-white);
}

.mk-rail__list {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-rail__list a {
  display: grid;
  height: 72px;
  place-items: center;
  border-radius: var(--radius-md);
  transition: background-color var(--duration-state) var(--ease);
}

.mk-rail__list a:hover,
.mk-rail__list a:focus-visible {
  outline: none;
  background: var(--marmo-surface);
}

.mk-rail__list img {
  width: auto;
  max-width: 76%;
  height: 26px;
  filter: grayscale(1) opacity(0.7);
  transition: filter var(--duration-state) var(--ease);
}

.mk-rail__list img.is-light-logo {
  filter: brightness(0) opacity(0.6);
}

.mk-rail__list a:hover img,
.mk-rail__list a:focus-visible img {
  filter: none;
}

.mk-rail__list a:hover img.is-light-logo,
.mk-rail__list a:focus-visible img.is-light-logo {
  filter: brightness(0);
}

.mk-crumbs {
  margin-bottom: var(--space-6);
  color: var(--marmo-white-72);
}

.mk-crumbs a {
  color: var(--marmo-white-78);
  text-decoration: none;
}

.mk-crumbs a:hover {
  color: var(--marmo-white);
  text-decoration: underline;
}

.mk-crumbs [aria-current="page"] {
  color: var(--marmo-white);
}

/* Pastilla del logotipo del fabricante: blanca, radio md (como la del logo del grupo) */
.mk-logo {
  display: inline-grid;
  place-items: center;
  height: 64px;
  margin-bottom: var(--space-5);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--marmo-white);
}

.mk-logo img {
  width: auto;
  max-width: 180px;
  height: auto;
  max-height: 40px;
}

/* Logotipos que vienen en blanco (LEPAS): se pintan en oscuro sobre la pastilla */
.mk-logo.is-light-logo img,
img.is-light-logo,
.mk-brand__logo.is-light-logo img {
  filter: brightness(0);
}

.mk-hero .eyebrow {
  color: var(--marmo-gold-light);
}

.mk-hero h1 {
  max-width: 18ch;
  margin-bottom: var(--space-4);
  font-size: clamp(2.25rem, 4.4vw, var(--text-titular));
  text-wrap: balance;
}

.mk-lead {
  max-width: 560px;
  margin-bottom: var(--space-6);
  color: var(--marmo-white-78);
  font-size: var(--text-entradilla);
  line-height: 1.6;
}

.mk-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  margin: var(--space-7) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--marmo-white-20);
  list-style: none;
}

.mk-hero__facts li {
  display: grid;
  gap: 2px;
}

.mk-hero__facts strong {
  color: var(--marmo-white);
  font-size: var(--text-cifra);
  font-weight: var(--weight-medium);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mk-hero__facts span {
  color: var(--marmo-white-72);
  font-size: var(--text-tarjeta);
}

.mk-hero__media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--marmo-blue-deep);
  aspect-ratio: 4 / 3;
}

.mk-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Resumen (respuesta directa) ---------- */
.mk-summary {
  border-bottom: var(--border);
  background: var(--marmo-white);
}

.mk-summary__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-7);
  padding-block: var(--space-7);
}

.mk-summary__text {
  margin: 0;
  color: var(--marmo-text);
  font-size: var(--text-entradilla);
  line-height: 1.7;
}

.mk-summary__facts dd a {
  color: var(--marmo-blue);
}

/* ---------- Gama ---------- */
.mk-filter {
  margin-left: auto;
}

.mk-models,
.mk-grid,
.mk-dealer-list,
.mk-brand-grid {
  display: grid;
  gap: var(--mk-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-models,
.mk-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.mk-model[hidden] {
  display: none;
}

.mk-model__card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--marmo-white);
  transition: border-color var(--duration-state) var(--ease), box-shadow var(--duration-state) var(--ease);
}

.mk-model__card:hover {
  border-color: var(--marmo-blue-34);
  box-shadow: var(--shadow-card);
}

.mk-model__media {
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  background: var(--marmo-surface);
}

.mk-model__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Recortes del fabricante (coche sin fondo): se ven enteros sobre el gris claro */
.mk-model__media.is-cutout {
  background: linear-gradient(180deg, var(--marmo-white) 0%, var(--marmo-surface) 100%);
}

.mk-model__media.is-cutout img {
  width: 86%;
  height: 82%;
  object-fit: contain;
}

/* Sin foto oficial: el nombre del modelo en grande, sobre el fondo de marca */
.mk-model__media.is-empty {
  background: var(--marmo-blue-light);
}

.mk-model__placeholder {
  padding: var(--space-4);
  color: var(--marmo-blue-dark);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-modelo);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.mk-model__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.mk-model__type {
  color: var(--marmo-gold);
  font-size: var(--text-antetitulo);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-antetitulo);
  text-transform: uppercase;
}

.mk-model__name {
  margin: 0;
  color: var(--marmo-ink);
  font-size: var(--text-titulo-menor);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.mk-model__energy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-model__link {
  margin-top: auto;
  padding-top: var(--space-3);
  color: var(--marmo-blue);
  font-size: var(--text-boton);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.mk-model__link::after {
  content: " →";
}

.mk-model__link:hover {
  text-decoration: underline;
}

.mk-note,
.mk-empty {
  margin: var(--space-5) 0 0;
  color: var(--marmo-muted);
  font-size: var(--text-legal);
}

.mk-empty {
  font-size: var(--text-cuerpo);
}

.mk-grid > li > .vehicle-card {
  height: 100%;
}

/* ---------- Concesionarios ---------- */
.mk-dealer-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.mk-dealer {
  height: 100%;
  gap: var(--space-3);
}

.mk-dealer .card-title {
  font-size: var(--text-titulo-menor);
}

.mk-dealer__line {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  color: var(--marmo-text);
  font-size: var(--text-tarjeta);
}

.mk-dealer__line .ui-ico {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--marmo-blue);
}

.mk-dealer__line a {
  color: var(--marmo-blue);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.mk-dealer__hours {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: var(--space-3) 0 0;
  border-top: var(--border);
  font-size: var(--text-tarjeta);
}

.mk-dealer__hours div {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-3);
}

.mk-dealer__hours dt {
  color: var(--marmo-muted);
}

.mk-dealer__hours dd {
  margin: 0;
  color: var(--marmo-ink);
}

.mk-dealer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
}

/* ---------- Servicios ---------- */
.mk-services .feature-title a {
  color: inherit;
  text-decoration: none;
}

.mk-services .feature-title a::after {
  content: " →";
  color: var(--marmo-blue);
}

.mk-services .feature-title a:hover {
  color: var(--marmo-blue);
}

/* ---------- Experiencia (E-E-A-T) ---------- */
.mk-trust__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-8);
}

.mk-trust .eyebrow {
  color: var(--marmo-gold-light);
}

.mk-trust__copy p {
  max-width: 640px;
  color: var(--marmo-white-78);
  line-height: 1.7;
}

.mk-awards {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.mk-awards li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--marmo-white-20);
  border-radius: var(--radius-md);
  color: var(--marmo-white);
  font-weight: var(--weight-medium);
}

.mk-awards .ui-ico {
  color: var(--marmo-gold-light);
}

.mk-group-facts {
  display: grid;
  gap: 1px;
  margin: 0 0 var(--space-6);
  overflow: hidden;
  border: 1px solid var(--marmo-white-20);
  border-radius: var(--radius-md);
  background: var(--marmo-white-20);
}

.mk-group-facts div {
  display: grid;
  gap: 4px;
  padding: var(--space-4) var(--space-5);
  background: var(--marmo-blue-deep);
}

.mk-group-facts dt {
  color: var(--marmo-white);
  font-size: var(--text-cifra);
  font-weight: var(--weight-medium);
  line-height: 1.05;
}

.mk-group-facts dd {
  margin: 0;
  color: var(--marmo-white-72);
  font-size: var(--text-tarjeta);
}

.mk-timeline {
  margin-bottom: var(--space-5);
}

.mk-trust .timeline-item::after {
  background: var(--marmo-white-20);
}

.mk-trust .timeline-item.is-done .timeline-dot {
  border-color: var(--marmo-gold-light);
  background: var(--marmo-gold-light);
}

.mk-trust .timeline-time {
  color: var(--marmo-gold-light);
  font-weight: var(--weight-semibold);
}

.mk-trust .timeline-text {
  margin: 2px 0 0;
  color: var(--marmo-white-78);
  font-size: var(--text-tarjeta);
}

.mk-trust__link {
  color: var(--marmo-white);
  font-weight: var(--weight-semibold);
}

.mk-trust__link::after {
  content: " →";
}

/* ---------- Preguntas frecuentes ---------- */
.mk-faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  align-items: start;
  gap: var(--space-7);
}

.mk-faq__grid > div:first-child p {
  color: var(--marmo-muted);
}

.mk-faq__grid a:not([class]) {
  color: var(--marmo-blue);
}

.mk-accordion .accordion-body p {
  margin: 0;
  color: var(--marmo-text);
  line-height: 1.65;
}

/* ---------- Formulario ---------- */
.mk-contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  align-items: start;
  gap: var(--space-7);
}

.mk-contact__copy p {
  color: var(--marmo-muted);
}

.mk-contact__points {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.mk-contact__points li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--marmo-ink);
  font-weight: var(--weight-medium);
}

.mk-contact__points .ui-ico {
  color: var(--marmo-success);
}

.mk-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--marmo-white);
}

.mk-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.mk-field {
  display: grid;
  gap: 6px;
  color: var(--marmo-ink);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-semibold);
}

.mk-field .input {
  width: 100%;
  font-weight: var(--weight-regular);
}

.mk-req {
  color: var(--marmo-red);
}

.mk-optional {
  color: var(--marmo-muted);
  font-weight: var(--weight-regular);
}

.mk-form [aria-invalid="true"] {
  border-color: var(--marmo-red);
}

.mk-form .checkbox-label a {
  color: var(--marmo-blue);
}

.mk-form .btn {
  justify-self: start;
}

.mk-form__status {
  min-height: 1.5em;
  margin: 0;
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-medium);
}

.mk-form__status[data-state="error"] {
  color: var(--marmo-red);
}

.mk-form__status[data-state="success"] {
  color: var(--marmo-success);
}

.mk-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Otras marcas ---------- */
.mk-others {
  padding-block: var(--space-7);
}

.mk-others__title {
  margin-bottom: var(--space-5);
  font-size: var(--text-titulo-menor);
}

.mk-others__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-others__list a {
  display: grid;
  height: 76px;
  place-items: center;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--marmo-white);
  transition: border-color var(--duration-state) var(--ease);
}

.mk-others__list a:hover,
.mk-others__list a:focus-visible {
  border-color: var(--marmo-blue-34);
}

.mk-others__list img {
  width: auto;
  max-width: 76%;
  height: auto;
  max-height: 34px;
  filter: grayscale(1) opacity(0.75);
  transition: filter var(--duration-state) var(--ease);
}

.mk-others__list img.is-light-logo {
  filter: brightness(0) opacity(0.66);
}

.mk-others__list a:hover img,
.mk-others__list a:focus-visible img {
  filter: none;
}

.mk-others__list a:hover img.is-light-logo,
.mk-others__list a:focus-visible img.is-light-logo {
  filter: brightness(0);
}

.mk-byline {
  padding-block: var(--space-5) var(--space-7);
  border-top: var(--border);
}

.mk-byline p {
  max-width: 900px;
  margin: 0;
  color: var(--marmo-muted);
  font-size: var(--text-legal);
}

/* ---------- Índice de marcas ---------- */
.mk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.mk-toolbar__city {
  min-width: 220px;
}

.mk-brand-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.mk-brand-grid > li[hidden] {
  display: none;
}

.mk-brand {
  height: 100%;
}

.mk-brand__link {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--marmo-white);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--duration-state) var(--ease), box-shadow var(--duration-state) var(--ease);
}

.mk-brand__link:hover,
.mk-brand__link:focus-visible {
  border-color: var(--marmo-blue-34);
  box-shadow: var(--shadow-card);
}

.mk-brand__link:focus-visible {
  outline: none;
  border-color: var(--focus-color);
}

.mk-brand__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--marmo-gradient-dark);
}

.mk-brand__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.mk-brand__link:hover .mk-brand__media > img {
  transform: scale(1.03);
}

.mk-brand__logo {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  display: grid;
  height: 48px;
  place-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--marmo-white);
}

.mk-brand__logo img {
  width: auto;
  max-width: 120px;
  height: auto;
  max-height: 30px;
}

.mk-brand__media.is-logo-only .mk-brand__logo {
  left: 50%;
  bottom: 50%;
  height: 72px;
  padding: 12px 22px;
  transform: translate(-50%, 50%);
}

.mk-brand__media.is-logo-only .mk-brand__logo img {
  max-width: 160px;
  max-height: 44px;
}

.mk-brand__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.mk-brand__name {
  margin: 0;
  color: var(--marmo-ink);
  font-size: var(--text-titulo-menor);
  font-weight: var(--weight-semibold);
}

.mk-brand__claim {
  margin: 0;
  color: var(--marmo-muted);
  font-size: var(--text-tarjeta);
  line-height: 1.55;
}

.mk-brand__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  color: var(--marmo-text);
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-medium);
}

.mk-brand__meta span + span::before {
  content: "· ";
  color: var(--marmo-muted);
}

.mk-brand__cta {
  margin-top: auto;
  padding-top: var(--space-3);
  color: var(--marmo-blue);
  font-size: var(--text-boton);
  font-weight: var(--weight-semibold);
}

.mk-brand__cta::after {
  content: " →";
}

.mk-table {
  overflow-x: auto;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--marmo-white);
}

.mk-table:focus-visible {
  outline: none;
  border-color: var(--focus-color);
}

.mk-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--text-tarjeta);
}

.mk-table th,
.mk-table td {
  padding: 12px var(--space-4);
  border-bottom: var(--border);
  text-align: left;
  vertical-align: top;
}

.mk-table thead th {
  background: var(--marmo-surface);
  color: var(--marmo-muted);
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}

.mk-table tbody tr:last-child > * {
  border-bottom: 0;
}

.mk-table tbody th a {
  color: var(--marmo-blue-dark);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.mk-table tbody th a:hover {
  text-decoration: underline;
}

.mk-table .num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Barra fija en móvil ---------- */
.mk-mobile-cta {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .mk-trust__grid,
  .mk-faq__grid,
  .mk-contact__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }
}

@media (max-width: 900px) {
  .mk-hero {
    padding: var(--space-5) 0 var(--space-7);
  }

  .mk-hero__grid,
  .mk-summary__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }

  .mk-hero__media {
    aspect-ratio: 16 / 10;
  }

  .mk-hero--index .mk-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mk-bento {
    height: 420px;
  }

  .mk-rail__list {
    display: flex;
    gap: var(--space-2);
    margin-inline: -16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mk-rail__list::-webkit-scrollbar {
    display: none;
  }

  .mk-rail__list li {
    flex: 0 0 112px;
  }

  .mk-filter {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .mk-page {
    --mk-gap: var(--space-4);
  }

  .mk-crumbs {
    margin-bottom: var(--space-5);
  }

  .mk-logo {
    height: 56px;
    padding: 8px 16px;
  }

  .mk-logo img {
    max-height: 34px;
  }

  .mk-hero__facts {
    gap: var(--space-4) var(--space-6);
    margin-top: var(--space-6);
  }

  .mk-hero__facts strong {
    font-size: 1.85rem;
  }

  .mk-head h2 {
    font-size: 1.75rem;
  }

  .mk-bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 150px;
    height: auto;
  }

  .mk-bento__tile.is-main {
    grid-column: 1 / span 2;
    grid-row: auto;
  }

  .mk-bento__tile.is-main .mk-bento__text strong {
    font-size: var(--text-titulo-menor);
  }

  .mk-bento__tile:not(.is-main) .mk-bento__logo {
    display: none;
  }

  .mk-bento__tile:not(.is-main) .mk-bento__text span {
    display: none;
  }

  /* Los filtros se desplazan en horizontal en vez de ocupar tres líneas */
  .mk-filter,
  .mk-toolbar .pills {
    flex-wrap: nowrap;
    width: 100%;
    margin-inline: -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    width: calc(100% + 32px);
  }

  .mk-filter::-webkit-scrollbar,
  .mk-toolbar .pills::-webkit-scrollbar {
    display: none;
  }

  .mk-filter .pill,
  .mk-toolbar .pill {
    flex: none;
  }

  .mk-toolbar__city {
    width: 100%;
  }

  /* Gama en dos columnas compactas: la ficha no se hace interminable en el móvil */
  .mk-models {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .mk-model__body {
    gap: 6px;
    padding: var(--space-3);
  }

  .mk-model__type {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .mk-model__name {
    font-size: var(--text-cuerpo);
  }

  .mk-model__energy .badge {
    height: 20px;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .mk-model__link {
    padding-top: var(--space-2);
    font-size: var(--text-etiqueta);
  }

  .mk-model__placeholder {
    font-size: 1.2rem;
  }

  .mk-form {
    padding: var(--space-5);
  }

  .mk-form__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .mk-form .btn {
    justify-self: stretch;
  }

  .mk-dealer-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Acciones principales siempre a mano en la ficha de marca */
  [data-page="marca"] .mk-mobile-cta {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-3);
    padding: var(--space-3) 16px calc(var(--space-3) + env(safe-area-inset-bottom));
    border-top: var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    transform: translateY(110%);
    transition: transform var(--duration-state) var(--ease);
  }

  [data-page="marca"] .mk-mobile-cta.is-visible {
    transform: none;
  }

  [data-page="marca"] .mk-mobile-cta .btn {
    width: 100%;
  }

  [data-page="marca"] .site-footer {
    padding-bottom: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-brand__media > img,
  .mk-bento__tile > img,
  .mk-mobile-cta {
    transition: none;
  }
}

/* Los anclajes (#gama, #contacto…) no quedan tapados por la cabecera fija */
.mk-page [id] {
  scroll-margin-top: 96px;
}

.mk-field__label {
  display: block;
}

/* Logotipos: alto fijo para que los SVG sin tamaño propio no colapsen */
.mk-logo img { height: 40px; }
.mk-brand__logo img { height: 28px; }
.mk-brand__media.is-logo-only .mk-brand__logo img { height: 40px; }
.mk-others__list img { height: 30px; }
@media (max-width: 640px) { .mk-logo img { height: 34px; } }

/* ---------- Logotipos sin pastilla sobre foto u oscuro (índice de marcas) ----------
   El logotipo va en blanco directamente sobre la imagen; una veladura suave
   arriba y abajo garantiza el contraste en cualquier fotografía. */
.mk-bento__logo,
.mk-brand__logo {
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.mk-bento__logo img,
.mk-bento__logo.is-light-logo img,
.mk-brand__logo img,
.mk-brand__logo.is-light-logo img {
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(4, 26, 51, 0.55));
}

.mk-bento__logo img {
  max-width: 140px;
  height: 26px;
}

.mk-bento__tile.is-main .mk-bento__logo img {
  max-width: 170px;
  height: 32px;
}

.mk-bento__shade {
  background:
    linear-gradient(180deg, rgba(4, 26, 51, 0.55) 0%, rgba(4, 26, 51, 0) 32%),
    linear-gradient(180deg, rgba(4, 26, 51, 0) 40%, rgba(4, 26, 51, 0.88) 100%);
}

.mk-brand__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 26, 51, 0.6) 0%, rgba(4, 26, 51, 0) 45%);
  pointer-events: none;
}

.mk-brand__media.is-logo-only::after {
  display: none;
}

.mk-brand__logo {
  z-index: 1;
}

.mk-brand__logo img {
  max-width: 130px;
  height: 26px;
}

.mk-brand__media.is-logo-only .mk-brand__logo {
  padding: 0;
}

.mk-brand__media.is-logo-only .mk-brand__logo img {
  max-width: 190px;
  height: 42px;
}

@media (max-width: 640px) {
  .mk-bento__tile:not(.is-main) .mk-bento__logo {
    display: block;
  }

  .mk-bento__tile:not(.is-main) .mk-bento__logo img {
    max-width: 96px;
    height: 20px;
  }
}

.mk-brand__logo img {
  max-width: 150px;
  height: 32px;
}

/* ============================================================
   Logotipos normalizados
   Cada logo está recortado a su contenido (sin márgenes) y lleva --ls,
   un factor que iguala el peso óptico: los alargados se ven más bajos y
   los compactos más altos, pero todos ocupan la misma caja y el mismo sitio.
   ============================================================ */
.mk-logo img,
.mk-bento__logo img,
.mk-bento__tile.is-main .mk-bento__logo img,
.mk-brand__logo img,
.mk-brand__media.is-logo-only .mk-brand__logo img,
.mk-rail__list img,
.mk-others__list img {
  width: auto;
  max-width: none;
  height: calc(var(--logo-h, 28px) * var(--ls, 1));
  max-height: none;
  object-fit: contain;
}

/* Caja común: alto fijo, logo alineado a la izquierda y centrado en vertical */
.mk-bento__logo,
.mk-brand__logo {
  --logo-h: 28px;
  display: flex;
  width: 180px;
  height: 48px;
  align-items: center;
  justify-content: flex-start;
}

/* Mosaico: todos arriba a la izquierda, mismo margen */
.mk-bento__logo,
.mk-bento__tile.is-main .mk-bento__logo {
  top: var(--space-5);
  left: var(--space-5);
}

/* Tarjetas: todos abajo a la izquierda, mismo margen */
.mk-brand__logo,
.mk-brand__media.is-logo-only .mk-brand__logo {
  top: auto;
  right: auto;
  bottom: var(--space-4);
  left: var(--space-5);
  transform: none;
}

/* Pastilla de la ficha de marca: caja fija, logo centrado */
.mk-logo {
  --logo-h: 30px;
  display: inline-flex;
  width: 220px;
  height: 72px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.mk-rail__list,
.mk-others__list {
  --logo-h: 22px;
}

@media (max-width: 640px) {
  .mk-bento__logo,
  .mk-bento__tile.is-main .mk-bento__logo {
    --logo-h: 22px;
    top: var(--space-4);
    left: var(--space-4);
    height: 36px;
  }

  .mk-bento__tile:not(.is-main) .mk-bento__logo {
    display: flex;
  }

  .mk-logo {
    --logo-h: 26px;
    width: 180px;
    height: 60px;
  }
}

/* Logotipos más contenidos (revisión 09/11): misma caja y posición, menor tamaño */
.mk-bento__logo,
.mk-brand__logo {
  --logo-h: 18px;
  width: 140px;
  height: 36px;
}

.mk-bento__tile.is-main .mk-bento__logo {
  --logo-h: 20px;
}

.mk-logo {
  --logo-h: 22px;
  width: 180px;
  height: 60px;
  padding: 0 20px;
}

.mk-rail__list,
.mk-others__list {
  --logo-h: 15px;
}

.mk-rail__list a {
  height: 56px;
}

.mk-others__list a {
  height: 60px;
}

@media (max-width: 640px) {
  .mk-bento__logo,
  .mk-bento__tile.is-main .mk-bento__logo {
    --logo-h: 15px;
    height: 30px;
  }

  .mk-logo {
    --logo-h: 18px;
    width: 150px;
    height: 52px;
  }
}

/* Logotipos a la mitad (revisión 09/11, 2.ª) */
.mk-bento__logo,
.mk-brand__logo { --logo-h: 9px; height: 24px; }
.mk-bento__tile.is-main .mk-bento__logo { --logo-h: 10px; }
.mk-logo { --logo-h: 11px; width: 110px; height: 38px; padding: 0 12px; }
.mk-rail__list,
.mk-others__list { --logo-h: 8px; }
.mk-rail__list a { height: 40px; }
.mk-others__list a { height: 44px; }
@media (max-width: 640px) {
  .mk-bento__logo,
  .mk-bento__tile.is-main .mk-bento__logo { --logo-h: 8px; height: 20px; }
  .mk-logo { --logo-h: 9px; width: 96px; height: 34px; }
}

/* Ficha de marca: logotipo en blanco, sin pastilla (revisión 09/11) */
.mk-logo {
  --logo-h: 16px;
  display: flex;
  width: auto;
  height: 40px;
  justify-content: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.mk-logo img,
.mk-logo.is-light-logo img {
  filter: brightness(0) invert(1);
}

@media (max-width: 640px) {
  .mk-logo {
    --logo-h: 14px;
    width: auto;
    height: 34px;
  }
}

/* ---------- Tarjeta de modelo con ficha propia (/marcas/{marca}/{modelo}) ---------- */
.mk-model.has-page .mk-model__card {
  position: relative;
  transition: box-shadow var(--duration-state) var(--ease), transform var(--duration-state) var(--ease);
}

.mk-model.has-page .mk-model__card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.mk-model__page {
  color: inherit;
  text-decoration: none;
}

/* Toda la tarjeta es pulsable: el enlace del nombre la cubre */
.mk-model__page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.mk-model.has-page .mk-model__link {
  position: relative;
  z-index: 2;
}
