/* Modal flottante video */
#video_modal {
  pointer-events: none;
  overflow: visible;
}

/* Posizionamento desktop */
#video_modal .video-modal-dialog {
  position: fixed;
  right: 20px;
  bottom: 20px;
  margin: 0;
  width: auto;
  max-width: 360px;
  transform: none !important;
  pointer-events: auto;
  z-index: 1060;
}

/* Evita trasformazioni Bootstrap sul modal */
#video_modal.fade .video-modal-dialog,
#video_modal.show .video-modal-dialog {
  transform: none !important;
}

/* Contenitore */
#video_modal .video-modal-content {
  border: 0;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#video_modal .video-modal-body {
  position: relative;
  background: transparent;
}

/* Wrapper video */
#video_modal .video-modal-desktop,
#video_modal .video-modal-mobile {
  padding: 0;
  line-height: 0;
}

/* Video responsive */
#video_modal video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Pulsante chiusura */
#video_modal .video-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #111111;
  border: 2px solid #111111;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 20;
  cursor: pointer;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

#video_modal .video-modal-close span {
  display: block;
  line-height: 1;
  transform: translateY(-2px);
}

#video_modal .video-modal-close:hover {
  background: #111111;
  color: #ffffff;
}

#video_modal .video-modal-close:focus {
  outline: 3px solid rgba(0, 0, 0, 0.25);
  outline-offset: 2px;
}

/* Mobile generico */
@media (max-width: 575.98px) {
  #video_modal .video-modal-dialog {
    right: 14px;
    bottom: 14px;
    width: 230px;
    max-width: calc(100vw - 32px);
  }

  #video_modal .video-modal-content,
  #video_modal .video-modal-body,
  #video_modal .video-modal-mobile {
    width: 100%;
  }

  #video_modal .video-modal-mobile video {
    width: 100% !important;
    height: auto !important;
    display: block;
  }

  #video_modal .video-modal-close {
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    font-size: 26px;
  }

  /* Variante specifica iPhone */
  #video_modal.video-modal-iphone .video-modal-dialog {
    right: 12px;
    bottom: 12px;
    width: 320px;
    max-width: calc(100vw - 24px);
  }

  #video_modal.video-modal-iphone .video-modal-close {
    top: -16px;
    right: -12px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}