/* Native-ratio video previews with white frame */
.media-video {
  --media-radius: 1.6rem;
  --media-frame: clamp(0.75rem, 2vw, 1.25rem);
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: var(--media-frame) !important;
  margin: 0;
  border: 0 !important;
  outline: none !important;
  background: #fff;
  overflow: hidden;
  border-radius: var(--media-radius);
  box-shadow: 0 18px 50px rgba(15, 40, 35, 0.12);
  -webkit-appearance: none !important;
  appearance: none !important;
  cursor: pointer;
  text-align: left;
  line-height: 0;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}
.media-video--portrait {
  max-width: min(100%, 420px);
  margin-inline: auto;
}
.media-video--portrait .media-video__el {
  aspect-ratio: 4 / 5;
}
.media-video--landscape .media-video__el {
  aspect-ratio: 16 / 9;
}
.media-video__el {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  object-fit: cover;
  object-position: center center;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  border-radius: var(--media-radius);
}

/* Mobile layout fixes */
html, body {
  overflow-x: hidden;
}
.min-h-screen {
  overflow-x: hidden;
}
.shell {
  max-width: 1180px;
  padding-inline: clamp(1rem, 4vw, 1.375rem);
  box-sizing: border-box;
}

/* Prevent decorative blobs from causing horizontal scroll */
#top .absolute,
#kalkulator .absolute {
  max-width: 70vw;
  max-height: 70vw;
}

@media (max-width: 767px) {
  header .shell {
    gap: 0.75rem;
  }
  header img.h-12 {
    height: 2.25rem;
    width: auto;
  }

  #top .shell {
    gap: 1.75rem;
    padding-block: 2.5rem;
  }

  #top h1 {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    line-height: 1.05 !important;
  }

  #top .mt-8.flex {
    width: 100%;
  }
  #top .mt-8.flex > a {
    width: 100%;
    justify-content: center;
  }

  .section-pad {
    padding-block: clamp(2.5rem, 8vw, 4rem);
  }

  /* Product cards stack cleanly */
  #produkt .shell {
    gap: 2rem;
  }

  /* Advantage / stats cards */
  #calc-advantage .sm\:grid-cols-3,
  #calc-advantage .grid {
    grid-template-columns: 1fr;
  }

  /* Calculator forms */
  #kalkulator input[type="number"] {
    min-width: 0;
    font-size: 16px; /* prevent iOS zoom */
  }

  /* Contact */
  #kontakt .shell,
  #film .shell {
    gap: 1.75rem;
  }

  footer .shell {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .rounded-\[2\.2rem\] { border-radius: 1.25rem; }
  .rounded-\[1\.6rem\] { border-radius: 1rem; }
  .rounded-\[2rem\] { border-radius: 1.25rem; }
}

.media-video__play {
  position: absolute;
  inset: var(--media-frame);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0,0,0,.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  border-radius: var(--media-radius);
}
.media-video--open:hover .media-video__play,
.media-video--open:focus-visible .media-video__play {
  opacity: 1;
}
.media-video__play svg {
  width: 4rem;
  height: 4rem;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.45));
}

/* Full video modal */
.video-modal[hidden] { display: none !important; }
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
}
.video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
}
.video-modal__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.video-modal__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.video-modal__frame[data-ratio="4/5"] {
  width: min(420px, 100%);
  margin-inline: auto;
  aspect-ratio: 4 / 5;
}
.video-modal__dialog:has(.video-modal__frame[data-ratio="4/5"]) {
  width: min(420px, 100%);
}
.video-modal__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
body.video-modal-open {
  overflow: hidden;
}
