/* === Clean BPC/TB Hero Animation Fullscreen Layout === */

.fade-in {
  animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Base hero container */
.bpc-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
  background: transparent;
  margin-bottom: 1.5rem;
}

/* Media container */
.media-frame {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 900px;
  width: 100%;
  overflow: hidden;
}

/* Video skal fylde maksimalt i modal */
.product-video {
  display: block;
  margin: 0 auto;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 88vh !important; /* her er nøglen */
  object-fit: contain !important;
  border-radius: 16px;
  background: #fff;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Løft modalens max-height */
.modal-content {
  max-height: 95vh !important;
  overflow-y: visible !important;
}

/* Fjern sorte kanter i video UI */
.product-video::-webkit-media-controls-panel,
.product-video::-webkit-media-controls-enclosure {
  background-color: transparent !important;
}

/* Subtil gradient for dybde */
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.1));
  pointer-events: none;
  border-radius: 16px;
}

/* --- Desktop optimering --- */
@media (min-width: 900px) {
  .media-frame {
    max-width: 850px !important;
  }

  .product-video {
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* --- Mobiltilpasning --- */
@media (max-width: 640px) {
  .media-frame {
    max-width: 95% !important;
    border-radius: 14px;
  }

  .product-video {
    max-height: 65vh !important;
    width: 100% !important;
  }
}

/* === Auto-balance video vs tekst (for real) === */

/* Modal body — fasthold top-flow og ingen overstræk */
#product-modal.show .modal-body {
  display: block;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: 1rem;
}

/* Video — tilpas dynamisk så teksten passer på skærmen */
#product-modal.show .product-video {
  display: block;
  margin: 0 auto 1.5rem;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: calc(70vh - 210px) !important; /* plads til titel + tekst */
  object-fit: contain !important;
  border-radius: 16px;
  transition: all 0.3s ease;
}

/* Tekst i modal */
#product-modal.show .modal-body p,
#product-modal.show .modal-body h3 {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 750px;
}

#product-modal .modal-content {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}


/* Lås scroll-kæder inde i modal'en (støttet bredt) */
#product-modal.show {
  overscroll-behavior: contain;
}

/* Kun modalens indhold må scrolle – og med iOS momentum */
#product-modal .modal-content {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

#product-modal .modal-body {
  overflow: auto;                 /* vigtig */
  -webkit-overflow-scrolling: touch; /* iOS momentum */
  overscroll-behavior: contain;   /* undgå scroll leak op/ned */
}

/* Når modal er åben: sørg for at body IKKE scroller */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100%;
  touch-action: none; /* hjælp mod utilsigtede gestures */
}
