/* Auto Forza mobile media: vertical showroom videos and touch-first navigation. */
.showroom-reel__swipe-hint {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

body.video-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.video-modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  background: #000;
  border: 0;
}

.video-modal::backdrop {
  background: #000;
}

.video-modal[open] {
  display: block;
}

.video-modal__frame {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.video-modal__header {
  position: absolute;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.video-modal__header p,
.video-modal__header button {
  min-height: 44px;
  color: #fff;
  background: rgba(32, 33, 36, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.video-modal__header p {
  max-width: min(70vw, 520px);
  padding: 12px 16px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-modal__header button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 0 13px 0 16px;
  pointer-events: auto;
  cursor: pointer;
}

.video-modal__header button span {
  font-size: 13px;
  font-weight: 750;
}

.video-modal__header button b {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.video-modal__header button:focus-visible {
  outline: 3px solid #d83238;
  outline-offset: 3px;
}

.video-modal video {
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  body {
    padding-bottom: 0;
  }

  .home-mobile-actions,
  .vehicle-mobile-actions,
  .floating-contact {
    display: none;
  }

  .page--home .showroom-reel__viewport {
    overflow: clip;
    touch-action: pan-y;
  }

  .page--home .showroom-slide__media--video {
    width: 100%;
    aspect-ratio: 9 / 16;
    margin-inline: auto;
    background: #111214;
  }

  .page--home .showroom-slide__media--video .showroom-slide__poster,
  .page--home .showroom-slide__media--video video {
    object-fit: contain;
  }

  .page--home .showroom-reel__controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .page--home .showroom-reel__swipe-hint {
    display: inline;
    align-self: center;
    justify-self: center;
  }

  :where(.page--stock, .page--home)
    .vehicle-card__media-gallery.is-video-active {
    aspect-ratio: 9 / 16;
    background: #111214;
  }

  :where(.page--stock, .page--home)
    .vehicle-card__media-gallery.is-video-active
    .vehicle-card__media-slide--video {
    background: #111214;
  }

  :where(.page--stock, .page--home)
    .vehicle-card__media-slide--video
    video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }

  :where(.page--stock, .page--home)
    .vehicle-card__media-gallery:not(.is-video-active) {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 380px) {
  .video-modal__header p {
    max-width: 58vw;
  }

  .video-modal__header button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .video-modal__header button {
    width: 48px;
    justify-content: center;
    padding: 0;
  }

  .page--home .showroom-reel__swipe-hint {
    font-size: 11px;
  }

  .page--home .showroom-reel__buttons button {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page--home .showroom-slide,
  :where(.page--stock, .page--home) .vehicle-card__media-gallery {
    transition: none;
  }
}
