/* Mobile Video Section Styles */
#promoVideoSectionMobile {
  position: relative;
  z-index: 1;
}

.mobile-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16/9;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(245, 192, 110, 0.2),
              0 8px 20px rgba(245, 192, 110, 0.15);
}

.mobile-promo-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
  display: block;
  outline: none;
  border: none;
  transition: border-radius 0.3s ease;
}

/* Remove border-radius in fullscreen mode */
.mobile-video-wrapper.is-fullscreen .mobile-promo-video {
  border-radius: 0;
}

.mobile-video-wrapper.is-fullscreen {
  border-radius: 0;
}

/* Rotate video 90 degrees in portrait fullscreen mode */
.mobile-video-wrapper.is-fullscreen.is-portrait .mobile-promo-video {
  transform: rotate(90deg);
  transform-origin: center center;
  width: 100vh;
  height: 100vw;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -50vh;
  margin-top: -50vw;
  object-fit: contain;
}

.mobile-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@media (min-width: 992px) {
  .mobile-video-overlay {
    opacity: 0;
  }
  
  .mobile-video-wrapper:hover .mobile-video-overlay,
  .mobile-video-wrapper:focus-within .mobile-video-overlay {
    opacity: 1;
  }
}

.mobile-fullscreen-btn,
.mobile-mute-btn {
  position: absolute;
  background: rgba(245, 192, 110, 0.8);
  color: #6d3a1b;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  pointer-events: auto;
}

.mobile-fullscreen-btn {
  bottom: 15px;
  right: 15px;
  display: flex;
}

/* Hide fullscreen button when in fullscreen mode */
.mobile-landscape-fullscreen .mobile-fullscreen-btn {
  display: none;
}

/* Hide original mute button when in fullscreen mode */
.mobile-landscape-fullscreen .mobile-mute-btn {
  display: none;
}

/* Hide original overlay when in fullscreen mode */
.mobile-landscape-fullscreen .mobile-video-overlay {
  display: none;
}

.mobile-mute-btn {
  top: 15px;
  right: 15px;
}

/* In fullscreen portrait mode - reposition buttons */
.mobile-video-wrapper.is-fullscreen .mobile-fullscreen-btn {
  bottom: 15px;
  right: 15px;
  top: auto;
}

.mobile-video-wrapper.is-fullscreen .mobile-mute-btn {
  top: 15px;
  right: 15px;
  bottom: auto;
  left: auto;
  transform: rotate(90deg);
}

/* In fullscreen landscape mode - reposition buttons */
.mobile-video-wrapper.is-fullscreen.is-landscape .mobile-mute-btn {
  top: 15px;
  left: 15px;
  bottom: auto;
  right: auto;
  transform: rotate(0deg);
}

.mobile-video-wrapper.is-fullscreen.is-landscape .mobile-fullscreen-btn {
  top: 15px;
  right: 15px;
  bottom: auto;
}

.mobile-fullscreen-btn:hover,
.mobile-mute-btn:hover {
  transform: scale(1.1);
  background: rgba(245, 192, 110, 0.8);
}

/* Landscape Fullscreen Styles */
.mobile-landscape-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
  max-width: none !important;
  z-index: 99999999999999999 !important;
  border-radius: 0 !important;
  background: #000 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mobile-landscape-fullscreen .mobile-promo-video {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  width: 100dvh !important; /* Dynamic viewport height for mobile browsers */
  height: 100vw !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  transform-origin: center center !important;
}

/* Alternative approach for true landscape fill */
@media (orientation: portrait) {
  .mobile-landscape-fullscreen .mobile-promo-video {
    width: 100vh !important;
    width: 100dvh !important; /* Dynamic viewport height for mobile browsers */
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
  }
}

/* When device is rotated to landscape while in fullscreen - MORE SPECIFIC SELECTOR */
.mobile-landscape-fullscreen.landscape-rotated .mobile-promo-video {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
  border-radius: 0 !important;
  object-fit: cover !important;
  transform: translate(-50%, -50%) rotate(0deg) !important;
  transform-origin: center center !important;
}

@media (orientation: landscape) {
  .mobile-landscape-fullscreen.landscape-rotated .mobile-promo-video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
    border-radius: 0 !important;
    object-fit: cover !important;
    transform: translate(-50%, -50%) rotate(0deg) !important;
    transform-origin: center center !important;
  }
}

.mobile-landscape-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: rgba(0, 0, 0, 0.1);
  z-index: 99998;
  display: none;
  pointer-events: none; /* Make overlay non-interactive */
}

.mobile-landscape-overlay.active {
  display: block;
}

.mobile-landscape-controls {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 100001;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.mobile-landscape-fullscreen .mobile-landscape-controls {
  opacity: 1;
}

.mobile-landscape-exit-btn,
.mobile-landscape-mute-btn {
  background: rgba(245, 192, 110, 0.95);
  color: #6d3a1b;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  position: absolute;
  pointer-events: auto;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 100002;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Mute button - top right */
.mobile-landscape-mute-btn {
  top: 20px;
  right: 20px;
  transform: rotate(90deg);
  transition: all 0.3s ease;
}

/* Exit button - bottom right */
.mobile-landscape-exit-btn {
  bottom: 20px;
  right: 20px;
  transform: rotate(90deg);
  transition: all 0.3s ease;
}

/* When in landscape mode, reposition buttons */
.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-mute-btn {
  top: 20px;
  left: 20px;
  right: auto;
  bottom: auto;
  transform: rotate(0deg);
}

.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-exit-btn {
  top: 20px;
  right: 20px;
  bottom: auto;
  left: auto;
  transform: rotate(0deg);
}

.mobile-landscape-exit-btn:hover,
.mobile-landscape-mute-btn:hover,
.mobile-landscape-exit-btn:active,
.mobile-landscape-mute-btn:active {
  transform: rotate(90deg) scale(1.1);
  background: rgba(245, 192, 110, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

/* Hover/active states for landscape mode */
.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-exit-btn:hover,
.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-mute-btn:hover,
.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-exit-btn:active,
.mobile-landscape-fullscreen.landscape-rotated .mobile-landscape-mute-btn:active {
  transform: rotate(0deg) scale(1.1);
  background: rgba(245, 192, 110, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.mobile-landscape-exit-btn:focus,
.mobile-landscape-mute-btn:focus {
  outline: 3px solid rgba(245, 192, 110, 0.7);
  outline-offset: 3px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .mobile-video-wrapper {
    max-width: 100%;
    margin: 0px;
  }
  
  .mobile-fullscreen-btn,
  .mobile-mute-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  /* Hide fullscreen button on mobile in fullscreen mode */
  .mobile-landscape-fullscreen .mobile-fullscreen-btn,
  .mobile-landscape-fullscreen .mobile-mute-btn {
    display: none !important;
  }
  
  .mobile-landscape-exit-btn,
  .mobile-landscape-mute-btn {
    width: 55px;
    height: 55px;
    font-size: 20px;
  }
  
  /* Maintain positions on mobile */
  .mobile-landscape-mute-btn {
    top: 15px;
    right: 15px;
    transform: rotate(90deg);
  }

  .mobile-landscape-exit-btn {
    bottom: 15px;
    right: 15px;
    transform: rotate(90deg);
  }
}

/* Prevent body scroll when in landscape fullscreen */
body.mobile-landscape-active {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  right: 0 !important;
}

/* Hide problematic sections during fullscreen */
body.mobile-landscape-active #occasion {
  display: none !important;
}

body.mobile-landscape-active .swiper {
  display: none !important;
}

/* Pulse animation for button press feedback */
@keyframes button-pulse {
  0% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(245, 192, 110, 0.7);
  }
  50% {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 0 10px rgba(245, 192, 110, 0.3);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(245, 192, 110, 0);
  }
}

.mobile-landscape-exit-btn.clicked,
.mobile-landscape-mute-btn.clicked {
  animation: button-pulse 0.4s ease-out;
}