.cdp-hero {
  position: relative;
  overflow: hidden;
}

.cdp-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, #000);
  pointer-events: none;
}

.hero-bg-holder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: transparent;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  pointer-events: none;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.78) 100%);
}

.hero-slide.is-active {
  opacity: 1;
}

/* El texto y los botones van por encima del degradado inferior del hero */
.cdp-hero-contenido {
  position: relative;
  z-index: 2;
}

/* <h1> que agrupa el antetitulo ("Volantes personalizados") y el titular: no anade estilo propio */
.cdp-hero-encabezado {
  margin: 0;
  font: inherit;
  color: inherit;
}

.cdp-hero-encabezado > span {
  display: block;
}

/* El tema da estas medidas en movil a "#header h1.display-1"; ahora el titular es un <span> dentro del <h1> */
@media (max-width: 991.98px) {
  #header .cdp-hero-encabezado .display-1 {
    font-size: 3rem;
    line-height: 0.95;
    margin-top: 1.25rem;
    margin-bottom: 0;
  }
}

@media (max-width: 575.98px) {
  #header .cdp-hero-encabezado .display-1 {
    font-size: 2.35rem;
  }
}

.cdp-hero-titulo {
  line-height: 1.08;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.cdp-hero-subtitulo {
  max-width: 34rem;
  margin: 0 auto 1.5rem;
  color: #e8e8e8;
  font-size: 1.1rem;
  line-height: 1.55;
}

.cdp-hero-acciones {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cdp-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.7rem 1.75rem;
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cdp-btn-hero:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.cdp-btn-hero--principal {
  color: #fff;
  background: #d62828;
  border-color: #d62828;
  box-shadow: 0 12px 30px rgba(214, 40, 40, 0.38);
}

.cdp-btn-hero--principal:hover,
.cdp-btn-hero--principal:focus {
  color: #fff;
  background: #b51f1f;
  border-color: #b51f1f;
}

.cdp-btn-hero--secundario {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.85);
}

.cdp-btn-hero--secundario:hover,
.cdp-btn-hero--secundario:focus {
  color: #111;
  background: #fff;
  border-color: #fff;
}

@media (min-width: 576px) {
  .cdp-hero-acciones {
    flex-direction: row;
    justify-content: center;
  }

  .cdp-btn-hero {
    min-width: 220px;
  }
}

/* Escritorio: carrusel de coches de fondo y texto a la derecha */
@media (min-width: 992px) {
  .hero-slide--1 { background-image: url("../img/portada/fondo-atardecer-2400.webp"); }
  .hero-slide--2 { background-image: url("../img/portada/fondo-bmw-1600.webp"); }
  .hero-slide--3 { background-image: url("../img/portada/fondo-golf6-2400.webp"); }

  .cdp-hero-foto {
    display: none;
  }

  .cdp-hero-fila {
    min-height: 75vh;
  }

  .cdp-hero-subtitulo {
    margin-right: 0;
  }

  .cdp-hero-acciones {
    justify-content: flex-end;
  }
}

@media (min-width: 1200px) {
  .cdp-hero-fila {
    min-height: 100vh;
  }
}

/* Movil y tablet: primero la foto del volante, despues titulo, subtitulo y botones, sin huecos */
@media (max-width: 991.98px) {
  /* 64px = alto de la cabecera fija en movil (el tema reserva mucho mas para #header) */
  #header.cdp-hero {
    padding-top: 64px !important;
    background: #000;
  }

  .cdp-hero::after,
  .hero-bg-holder {
    display: none;
  }

  .cdp-hero-foto {
    position: relative;
    display: block;
    max-width: 600px;
    margin: 0 auto;
  }

  .cdp-hero-foto img {
    display: block;
    width: 100%;
    height: auto;
  }

  .cdp-hero-foto::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), #000 88%);
    pointer-events: none;
  }

  .cdp-hero-contenido {
    margin-top: -2.75rem;
    padding-bottom: 2rem;
  }

  .cdp-hero-titulo {
    font-size: clamp(2.1rem, 9.6vw, 3.4rem);
    line-height: 1.02;
    margin-bottom: 0.9rem;
  }

  .cdp-hero-subtitulo {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.5;
  }
}

/* Tablet: la foto no llega a los bordes, asi que se funde con el fondo negro */
@media (min-width: 600px) and (max-width: 991.98px) {
  .cdp-hero-foto {
    -webkit-mask-image: radial-gradient(closest-side, #000 86%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 86%, transparent 100%);
  }
}

.store-bg-holder {
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.45)), url("../img/portada/fondo-coche-1700.webp");
  background-position: right center;
  background-size: cover;
  opacity: 0.34;
}

.cdp-story-carousel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-height: 320px;
  padding: 3rem 4.5rem;
}

.cdp-story-carousel h3 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
}

.cdp-story-carousel p {
  color: #d6d6d6;
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 1rem 0 0;
}

.tarjeta-producto-inicio {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tarjeta-producto-inicio::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #d62828;
  border-radius: 0 0 4px 4px;
}

.tarjeta-producto-inicio:hover {
  border-color: rgba(214, 40, 40, 0.55);
  transform: translateY(-4px);
}

.tarjeta-producto-inicio img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.tarjeta-producto-inicio span {
  color: #9e9e9e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tarjeta-producto-inicio strong {
  color: #fff;
  display: block;
  font-size: 1.15rem;
  margin-top: 0.25rem;
}

.tarjeta-producto-inicio em {
  color: #d62828;
  font-style: normal;
  font-weight: 800;
  margin-top: 0.65rem;
}

.mensaje-productos-inicio {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
}

.control-carrusel-inicio {
  width: 3rem;
}

.brand-tile {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.brand-tile:hover {
  border-color: rgba(214, 40, 40, 0.55);
  transform: translateY(-3px);
}

.brand-tile img {
  max-width: 150px;
  max-height: 88px;
  object-fit: contain;
}

.footer-logo {
  height: 76px;
  width: auto;
}

@media (max-width: 991.98px) {
  .cdp-story-carousel {
    padding: 2rem 3.5rem;
  }

  .cdp-seccion-inicio.py-8,
  .cdp-seccion-inicio.py-7,
  .cdp-seccion-inicio.py-6 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
}

/* Movil: secciones mas juntas, novedades en una tira deslizable y marcas de dos en dos */
@media (max-width: 767.98px) {
  .cdp-seccion-inicio.py-8,
  .cdp-seccion-inicio.py-7,
  .cdp-seccion-inicio.py-6 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .store-bg-holder {
    background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.45)), url("../img/portada/fondo-coche-800.webp");
  }

  #catalogo-preview .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
  }

  .fila-productos-inicio {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .fila-productos-inicio::-webkit-scrollbar {
    display: none;
  }

  .fila-productos-inicio > [class*="col-"] {
    flex: 0 0 76%;
    max-width: 76%;
    scroll-snap-align: start;
  }

  .tarjeta-producto-inicio img {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .control-carrusel-inicio {
    display: none;
  }

  .brand-tile {
    min-height: 108px;
    padding: 1rem;
  }

  .brand-tile img {
    width: auto;
    height: auto;
    max-width: 104px;
    max-height: 60px;
  }
}

@media (max-width: 575.98px) {
  .cdp-story-carousel {
    padding: 1.5rem;
  }
}
