/* Phone and tablet only. Desktop (1280px and up) is unchanged. */

@media (max-width: 1279px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow-wrap: break-word;
  }

  img,
  svg,
  iframe {
    max-width: 100%;
  }

  iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  a,
  button,
  summary,
  [role="button"] {
    touch-action: manipulation;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
    line-height: 1.4;
    min-height: 44px;
  }

  textarea {
    min-height: 8rem;
  }

  .site-header {
    padding-top: env(safe-area-inset-top);
    z-index: 100;
    isolation: isolate;
  }

  .site-header__bar {
    position: relative;
    z-index: 90;
    pointer-events: auto;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    column-gap: 0.45rem;
    background: #050505;
  }

  .site-header__menu {
    position: relative;
    z-index: 91;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .site-header__book,
  .site-header__lang-current {
    min-height: 44px;
    height: 44px;
  }

  .site-header__langs-menu .site-header__lang {
    min-height: 44px;
    min-width: 7.5rem;
    justify-content: flex-start;
    padding: 0 0.75rem;
  }

  .site-header__langs.lang-open .site-header__langs-menu,
  .site-header__langs:focus-within .site-header__langs-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* Full-height drawer. Never cover the header bar (that was the black screen). */
  header.site-header > div.bg-black {
    position: fixed;
    z-index: 70;
    top: var(--header-h, 4.25rem) !important;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    background: #050505;
    color: #fff;
  }

  header.site-header > div.bg-black,
  header.site-header > div.bg-black a,
  header.site-header > div.bg-black .site-mnav,
  header.site-header > div.bg-black .site-mnav__label {
    visibility: visible !important;
    opacity: 1 !important;
  }

  header.site-header > div.bg-black a,
  header.site-header > div.bg-black .site-mnav__label {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  header.site-header > div.bg-black .flex-wrap {
    gap: 0.5rem;
  }

  header.site-header > div.bg-black .flex-wrap a {
    min-width: 44px;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  html.mnav-open {
    overflow: hidden;
  }

  html.mnav-open body {
    overflow: visible !important;
  }

  html.mnav-open video {
    visibility: hidden !important;
  }

  html.mnav-open header.site-header > div.bg-black {
    touch-action: pan-y;
  }

  #karting .asf-modes, #motos .asf-modes,
  #infantil .asf-modes,
  #infantil .asf-gallery,
  #infantil .asf-gallery--kids {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .ca-pay,
  .asf-btn {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
    min-height: 44px;
    height: auto;
  }
}

@media (max-width: 800px) {
  .season-hero__strip {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }

  .season-hero__step,
  .season-hero__step--on {
    height: 44px !important;
    min-height: 44px !important;
  }

  .season-hero__cta,
  .hero-audio__btn,
  .season-hero__arrow {
    min-width: 44px;
    min-height: 44px;
  }

  .season-hero__cta {
    display: inline-flex !important;
    align-items: center;
    padding: 0 0.2rem;
  }

  footer,
  body > footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }

  body:has(.launch-cookie) main {
    padding-bottom: 4.75rem;
  }
}

@media (max-width: 639px) {
  .site-header__langs {
    display: flex !important;
  }

  .site-header__logo {
    max-width: 7.4rem;
    height: auto;
  }
}

@media (max-width: 767px) {
  .asf-hero h2 span,
  .neu-act h2 span,
  .season-hero__title,
  .cx-hud h1 {
    font-size: clamp(2.4rem, 12vw, 4.6rem) !important;
  }

  .asf-sub,
  .neu-act .asf-sub,
  .asf-lead,
  .asf-note,
  .asf-copy p,
  .cx-lead {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  .neu-act__hero {
    min-height: min(78dvh, 34rem);
  }

  .neu-act__hero .asf-rail,
  #sport-drift-bmw.neu-act .neu-act__hero .asf-rail,
  .asf-hero .asf-rail,
  html body #curs-nivell-1 .asf-rail,
  html body #prova-el-teu-cotxe .asf-rail {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
    width: calc(100% - 1rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .neu-act__hero .asf-rail span,
  .asf-hero .asf-rail span,
  html body #curs-nivell-1 .asf-rail span,
  html body #prova-el-teu-cotxe .asf-rail span {
    min-height: 5.2rem;
    padding: 0.65rem 0.6rem 0.75rem !important;
  }

  .neu-act__hero .asf-rail b,
  .asf-hero .asf-rail b,
  html body #curs-nivell-1 .asf-rail b,
  html body #prova-el-teu-cotxe .asf-rail b {
    font-size: 0.86rem !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  .neu-act__body > .border-t > div:last-child,
  .asf-ticket .asf-cta,
  .asf-cta--mod,
  .asf-strip .asf-cta,
  .asf-finale .asf-cta {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .asf-hero {
    min-height: min(78dvh, 36rem);
  }

  /* Page heroes (Neu / Asfalt / Drift…): title stays up, CTAs sit in the
     bottom frame so they fill the empty band on the phone. */
  html body .video-hero {
    position: relative !important;
  }

  html body .video-hero > .justify-end,
  html body .video-hero .flex.h-full.flex-col.justify-end {
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom)) !important;
  }

  html body .video-hero__copy {
    position: static !important;
    transform: none !important;
    padding-bottom: 7.75rem !important;
  }

  html body .video-hero__cta,
  html body .video-hero__copy > .flex.flex-wrap {
    position: absolute !important;
    left: max(1rem, env(safe-area-inset-left)) !important;
    right: max(1rem, env(safe-area-inset-right)) !important;
    bottom: calc(1.2rem + env(safe-area-inset-bottom)) !important;
    z-index: 8 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 0.5rem;
    width: auto;
    max-width: none;
    margin: 0 !important;
    padding: 0;
    align-items: stretch;
  }

  html body .video-hero__cta > :is(a, button, .ca-pay-cluster),
  html body .video-hero__copy > .flex.flex-wrap > :is(a, button, .ca-pay-cluster) {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 0.65rem !important;
    box-sizing: border-box;
    text-align: center;
    border-radius: 0 !important;
  }

  html body .video-hero__cta > :is(.ca-pay, .ca-pay-cluster),
  html body .video-hero__copy > .flex.flex-wrap > :is(.ca-pay, .ca-pay-cluster) {
    grid-column: auto;
  }

  html body .video-hero__cta > .ca-pay-cluster > :is(a, button),
  html body .video-hero__copy > .flex.flex-wrap > .ca-pay-cluster > :is(a, button) {
    width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
  }

  html body .drift-hero .drift-hero__actions,
  html body .drift-hero .drift-hero__bar {
    width: calc(100% - 2rem);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  main :is(p, li) {
    overflow-wrap: break-word;
  }
}

@media (max-width: 420px) {
  .season-hero__step-name {
    font-size: 0.62rem !important;
    letter-spacing: 0.04em !important;
  }

  .site-header__book {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .asf-hero .asf-rail,
  .neu-act__hero .asf-rail,
  html body #curs-nivell-1 .asf-rail,
  html body #prova-el-teu-cotxe .asf-rail {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.35rem !important;
  }

  .neu-act__hero .asf-rail b,
  .asf-hero .asf-rail b,
  html body #curs-nivell-1 .asf-rail b,
  html body #prova-el-teu-cotxe .asf-rail b {
    font-size: 0.8rem !important;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero-cinema.season-hero {
    height: auto !important;
    min-height: 100dvh;
  }

  .season-portal {
    height: 4.4rem !important;
    max-height: 4.4rem !important;
  }
}

@media (hover: none) {
  .asf-strip:hover .asf-strip__media img,
  #infantil .asf-shot:hover,
  #infantil .asf-shot:hover img {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
