/* Temerario Spyder — fixes for running the Lamborghini page inside the tall CMS iframe.
   Scroll/viewport behaviour (reveals, fixed UI) is bridged by temerario-embed-viewport.js;
   keep selectors semantic (no emotion css-xxxx hashes — they change with every Lamborghini build). */
html.cms-embed {
  --cms-embed-vh: 900px;
  --cms-embed-modal-top: 0px;
  background-color: #000 !important;
  height: auto !important;
  min-height: 0 !important;
}

html.cms-embed body,
html.cms-embed #page,
html.cms-embed #__next,
html.cms-embed main {
  background-color: #000 !important;
  height: auto !important;
  min-height: 0 !important;
}

/* Empty trailing Lambo sections create bottom gap under banner */
html.cms-embed #form-model-page,
html.cms-embed #lamborghini-connect-list,
html.cms-embed #free-html {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Floating CTA — native show/hide, open/close, backdrop and offsets. position:fixed in the tall
   iframe would pin it to the end of the page, so raise its native bottom offset by the part of the
   frame below the parent viewport (vars from temerario-embed-viewport.js). Do NOT use transform
   here: it would become the containing block of the fixed full-screen ::before backdrop. */
html.embed-fmb-lift #floating-menu-button .floating-menu-button {
  top: auto !important;
  bottom: calc(var(--fmb-native-bottom, 32px) + var(--embed-below, 0px)) !important;
}

/* When framed by the CMS page, the floating CTA is rendered in the PARENT page instead
   (temerario-spyder-floating-menu.tsx) so it is truly fixed on screen while scrolling. Keep the
   native one in the DOM (its show/hide state is mirrored and its Enquire button is clicked by the
   parent) but never show it. */
html.cms-embed #floating-menu-button .floating-menu-button,
html.cms-embed #floating-menu-button .floating-menu-button::before {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Feel the Engine card: the local replacement video must cover the (absolutely positioned,
   full-card) background layer like the Meride video does on the live site. */
.carousel-slide__feel-the-engine-bg .urus-static-video > video {
  object-fit: cover !important;
}

/* Chapter media: native height is 40.625rem only on screens >= 51.875rem tall (a height media
   query, which inside the iframe always matches) — apply the short-screen height ourselves. */
html.embed-vh-short .chapter-header__media {
  height: 31.25rem !important;
}

/* html.cms-embed .lam-hero-slide__eyelet {
  font-size: inherit !important;
  line-height: inherit !important;
  text-transform: uppercase !important;
} */

/* Hide banner breadcrumbs on CMS embed */
html.cms-embed .lam-hero__breadcrumbs,
.lam-hero__breadcrumbs {
  display: none !important;
}

html.cms-embed .lam-hero-slide,
.lam-hero-slide {
  background-color: #000 !important;
  background-image: url('/models/temerario/temerario-spyder/assets/images/hero-video-header.jpg') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html.cms-embed .lam-hero-slide::before,
.lam-hero-slide::before,
html.cms-embed .lam-hero-slide::after,
.lam-hero-slide::after {
  transition: none !important;
}

/* CMS hero banner video — poster shows immediately before MP4 is ready */
html.cms-embed #temerario-hero-banner-video-wrap,
#temerario-hero-banner-video-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  display: block !important;
  visibility: visible !important;
  overflow: hidden !important;
  background-color: #000 !important;
  background-image: url('/models/temerario/temerario-spyder/assets/images/hero-video-header.jpg') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  pointer-events: none !important;
  opacity: 1 !important;
}

html.cms-embed #temerario-hero-banner-video,
#temerario-hero-banner-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

/* Hide leftover Meride hero shell so it cannot cover the local MP4 */
html.cms-embed .lam-hero-slide__video[data-cms-hidden-meride='1'],
html.cms-embed #video-2705[data-cms-hidden-meride='1'] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hero gradient overlays (native strength) must not block clicks */
html.cms-embed .lam-hero-slide::before,
html.cms-embed .lam-hero-slide::after {
  pointer-events: none !important;
}

/* Meride / video layer must not steal clicks */
html.cms-embed .lam-hero-slide__video,
.lam-hero-slide__video,
html.cms-embed .lam-hero-slide .meride-video-container,
.lam-hero-slide .meride-video-container {
  pointer-events: none !important;
}

/* Hero text + buttons above gradients (z-index 10) */
html.cms-embed .lam-hero-slide__header,
.lam-hero-slide__header {
  position: relative !important;
  z-index: 20 !important;
  pointer-events: auto !important;
}

html.cms-embed .lam-hero-slide__header a,
html.cms-embed .lam-hero-slide__header button,
html.cms-embed .lam-hero-slide__actions,
html.cms-embed .lam-hero-slide__actions a,
.lam-hero-slide__header a,
.lam-hero-slide__header button,
.lam-hero-slide__actions,
.lam-hero-slide__actions a {
  position: relative !important;
  z-index: 21 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

html.cms-embed .lam-hero-slide [data-cms-hidden-meride="1"],
.lam-hero-slide [data-cms-hidden-meride="1"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Chapter header media keeps the native reveal (opacity .1 -> 1 on .is-inview); the bridge
   makes .is-inview flip when the section actually scrolls into the parent viewport. */

html.cms-embed #urus-aero-chapter-video-wrap,
html.cms-embed #urus-mechanical-powertrain-video-wrap,
html.cms-embed #urus-carbon-elements-video-wrap,
html.cms-embed #urus-exterior-chapter-video-wrap,
#urus-aero-chapter-video-wrap,
#urus-mechanical-powertrain-video-wrap,
#urus-carbon-elements-video-wrap,
#urus-exterior-chapter-video-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 3 !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #000 !important;
  pointer-events: none !important;
}

html.cms-embed #urus-aero-chapter-video,
html.cms-embed #urus-mechanical-powertrain-video,
html.cms-embed #urus-carbon-elements-video,
html.cms-embed #urus-exterior-chapter-video,
#urus-aero-chapter-video,
#urus-mechanical-powertrain-video,
#urus-carbon-elements-video,
#urus-exterior-chapter-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #000 !important;
}

/* Keep the KPI video row tall enough for the overlay MP4 */
html.cms-embed #video-with-preview .video-row__inner,
#video-with-preview .video-row__inner,
html.cms-embed #video .video-row__inner,
#video .video-row__inner {
  position: relative !important;
  min-height: 26.25rem !important;
}

html.cms-embed #video-with-preview .video-lazy-container,
html.cms-embed #video-with-preview #video-2709,
#video-with-preview .video-lazy-container,
#video-with-preview #video-2709,
html.cms-embed #video .video-lazy-container,
#video .video-lazy-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

/* Preview MP4 sits behind the hexagon play control */
#video #temerario-preview-video-wrap,
#video-with-preview #temerario-preview-video-wrap,
#video #temerario-preview-video,
#video-with-preview #temerario-preview-video {
  z-index: 1 !important;
  pointer-events: none !important;
}

#video .video-row__inner .position-relative,
#video-with-preview .video-row__inner .position-relative {
  position: relative !important;
}

#video #urus-exterior-chapter-video-wrap,
#video-with-preview #urus-exterior-chapter-video-wrap {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#video .btn-play,
#video-with-preview .btn-play,
#video .video-row__inner > .position-relative > .btn-play,
#video-with-preview .video-row__inner > .position-relative > .btn-play {
  z-index: 10 !important;
  pointer-events: auto !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

#video .btn-play .hexagon-bg,
#video-with-preview .btn-play .hexagon-bg {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 4.5rem !important;
  height: 4.5rem !important;
  fill: var(--interactive-accent-accent-default, #ffc000) !important;
}

#video .btn-play .hexagon-bg .hexagon,
#video-with-preview .btn-play .hexagon-bg .hexagon {
  fill: var(--interactive-accent-accent-default, #ffc000) !important;
  stroke: var(--interactive-accent-accent-default, #ffc000) !important;
}

#video .btn-play .icon,
#video-with-preview .btn-play .icon {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #000 !important;
  fill: #000 !important;
  stroke: #000 !important;
}

/* Carbon Elements light configurator media frame */
html.cms-embed #light-configurator .light-configurator__media,
#light-configurator .light-configurator__media,
#carbon-configurator-content .light-configurator__media {
  position: relative !important;
  min-height: 320px !important;
  height: 31.25rem !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Never show Meride players — static local MP4s only (no blob:) */
.meride-video-container,
.md-settings,
.meride-video-container video {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Exception: our own replacement wrappers (see temerario-block-meride.js) are tagged
   .meride-video-container so the page's `video.closest('.meride-video-container')`
   resolves and can't throw — but they hold the visible local MP4, so the blanket
   hide rule above must not catch them. Two-class selectors win on specificity. */
.meride-video-container.urus-static-video,
.meride-video-container.urus-static-video > video.urus-native-video {
  display: block !important;
  visibility: visible !important;
}

/* Popup / full-video modal (Meride 2711) — local MP4 with controls */
.full-video-player-wrapper,
#video-2703-modal,
#video-2711-modal,
#video-2712-modal {
  position: relative !important;
  width: 100% !important;
  min-height: 50vh !important;
  background: #000 !important;
}

.meride-video-container.urus-static-video--modal,
.meride-video-container.urus-static-video--modal > video.urus-native-video--modal {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  object-fit: contain !important;
}

html.cms-embed .modal {
  z-index: 1055 !important;
}

html.cms-embed .modal-backdrop {
  z-index: 1050 !important;
}

html.cms-embed body.modal-open {
  padding-right: 0 !important;
}

/* Allow scroll inside modals while the page body is locked */
html.cms-embed.cms-embed-modal-active,
html.cms-embed.cms-embed-modal-active body.modal-open,
html.cms-embed.cms-embed-modal-active body.modal-open #scroll-container {
  touch-action: auto !important;
  overflow: hidden !important;
}

/* Full-screen modal overlay inside the fixed iframe */
html.cms-embed.cms-embed-modal-active .modal.show {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: var(--cms-embed-vh, 100dvh) !important;
  max-height: var(--cms-embed-vh, 100dvh) !important;
  overflow: hidden !important;
  z-index: 1055 !important;
}

html.cms-embed.cms-embed-modal-active .modal-backdrop.show {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--cms-embed-vh, 100dvh) !important;
  max-height: var(--cms-embed-vh, 100dvh) !important;
  z-index: 1050 !important;
}

html.cms-embed.cms-embed-modal-active .modal.show .modal-dialog {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: var(--cms-embed-vh, 100dvh) !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  touch-action: pan-y !important;
}

html.cms-embed.cms-embed-modal-active .modal.show .modal-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

html.cms-embed.cms-embed-modal-active .modal.show .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y !important;
}

@media (max-width: 991.98px) {
  html.cms-embed {
    --cms-embed-vh: 600px;
  }

  html.cms-embed .lam-hero-slide,
  .lam-hero-slide {
    background-image: url('/models/temerario/temerario-spyder/assets/images/hero-video-header-mobile.jpg') !important;
  }

  html.cms-embed #temerario-hero-banner-video-wrap,
  #temerario-hero-banner-video-wrap {
    background-image: url('/models/temerario/temerario-spyder/assets/images/hero-video-header-mobile.jpg') !important;
  }

  /* Carbon / Start Configuration block: drop fixed 500px height that left a black void */
  html.cms-embed #light-configurator .light-configurator__media,
  #light-configurator .light-configurator__media,
  #carbon-configurator-content .light-configurator__media {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
    width: calc(100% - 48px) !important;
    max-width: calc(100% - 48px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  html.cms-embed #light-configurator .light-configurator__media video,
  #light-configurator .light-configurator__media video,
  html.cms-embed #urus-carbon-elements-video,
  #urus-carbon-elements-video {
    object-fit: cover !important;
    object-position: center center !important;
  }

  html.cms-embed #light-configurator .light-configurator__actions,
  #light-configurator .light-configurator__actions {
    margin-top: 1rem !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* Hide official Lamborghini.com site chrome (header, footer, news, chatbot) */
html.dealer-sanitize #__next > header,
html.dealer-sanitize header:not(#page header),
html.dealer-sanitize #__next > footer,
html.dealer-sanitize #news-list,
html.dealer-sanitize #smart-title-1,
html.dealer-sanitize #ceDisclaimer,
html.dealer-sanitize [class*='chatbot'],
html.dealer-sanitize [id*='chatbot'],
html.dealer-sanitize .virtual-assistant {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}