.custom-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.custom-video-wrapper video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.custom-video-wrapper video::-webkit-media-controls {
  display: none !important;
}

.custom-video-page-locked {
  overflow: hidden !important;
}

.custom-video-wrapper.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.custom-video-wrapper.is-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.custom-video-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10002;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 44px;
  line-height: 43px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.custom-video-wrapper.is-fullscreen .custom-video-close {
  display: block;
}

.custom-video-wrapper #play.custom-play-button,
.custom-video-wrapper .custom-play-button {
  position: absolute !important;
  inset: 0 !important;
  z-index: 10001 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  opacity: 0.85 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  box-shadow: none !important;
  transition: opacity 0.25s ease !important;
  padding: 0 !important;
}

.custom-video-wrapper #play.custom-play-button:hover,
.custom-video-wrapper .custom-play-button:hover {
  opacity: 1 !important;
}

.custom-video-wrapper #play.custom-play-button .player-logo,
.custom-video-wrapper .custom-play-button .player-logo {
  width: 160px !important;
  max-width: 30% !important;
  height: auto !important;
  display: block !important;
  transition: transform 0.25s ease !important;
}

.custom-video-wrapper #play.custom-play-button:hover .player-logo,
.custom-video-wrapper .custom-play-button:hover .player-logo {
  transform: scale(1.08) !important;
}

.custom-video-wrapper.is-user-started #play.custom-play-button,
.custom-video-wrapper.is-user-started .custom-play-button,
.custom-video-wrapper.is-ended #play.custom-play-button,
.custom-video-wrapper.is-ended .custom-play-button {
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-continue-overlay {
  position: absolute;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.custom-continue-overlay[hidden] {
  display: none !important;
}

.custom-continue-overlay button {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  padding: 0 !important;
  width: 160px !important;
  max-width: 30% !important;
  opacity: 0.85 !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.custom-continue-overlay button:hover {
  opacity: 1 !important;
  transform: scale(1.08) !important;
}

.custom-continue-overlay button .player-logo {
  width: 100% !important;
  height: auto !important;
  display: block !important;
}

.custom-video-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10003;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
}

.custom-video-progress[hidden] {
  display: none !important;
}

.custom-video-progress-fill {
  width: 0%;
  height: 100%;
  background: red;
  transition: width 0.1s linear;
}

#order_form_wrapper[data-vsl-generated="1"] {
  display: none;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 0;
}

#order_form_wrapper[data-vsl-generated="1"] #form_overlay_close {
  display: none;
}

/* New variant: form appears in the video position after the video ends */
#order_form_wrapper[data-vsl-generated="1"].is-vsl-inline-form {
  display: block;
  max-width: 870px;
  margin: 0 auto 20px;
  padding: 20px 0;
  background: transparent;
  box-sizing: border-box;
}

#order_form_wrapper[data-vsl-generated="1"].is-vsl-inline-form form {
  display: block !important;
  width: 100%;
}

@media (max-width: 480px) {

  .custom-video-wrapper #play.custom-play-button .player-logo,
  .custom-video-wrapper .custom-play-button .player-logo,
  .custom-continue-overlay button {
    width: 120px !important;
    max-width: 40% !important;
  }

  .custom-video-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 38px;
    line-height: 37px;
  }
}