/* Adapted from https://github.com/HoanghoDev/youtube_v2/blob/main/slider_3d/style.css */

.mancingdollar-carousel-banner {
  width: 100%;
  /* height: 100vh; /* Height should be controlled by Elementor section/column */
  min-height: 410px; /* Ensure minimum height */
  text-align: center;
  overflow: visible; /* Allow horizontal overflow */
  position: relative;
  /* clip-path: inset(0); */ /* Clip vertically like overflow:hidden */
}

.mancingdollar-carousel-slider {
  position: absolute;
  width: 180px; /* Reduced from 200px */
  height: 220px; /* Reduced from 250px */
  top: 15%; /* Adjust positioning */
  left: calc(50% - 90px); /* Adjusted for new width */
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateY(0deg); /* Removed rotateX - Initial state upright */
  /* animation: mancingdollarAutoRun 30s linear infinite; */ /* Removed animation */
  transition: transform 0.8s ease-out; /* Added transition for smooth JS rotation */
  z-index: 2; /* Ensure it's above other static elements if needed */
}

.mancingdollar-carousel-item {
  position: absolute;
  inset: 0 0 0 0;
  transform: rotateY(
      calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
    )
    translateZ(485px); /* Greatly Increased radius from 320px */
  background-color: #555; /* Added background for visibility if image fails */
  border: 1px solid #ccc;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  overflow: hidden; /* Ensure image doesn't overflow item */
  cursor: pointer; /* Add pointer cursor to indicate clickability */
}

.mancingdollar-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Add a pointer cursor if we make items clickable later */
  /* cursor: pointer; */
}

/* --- Navigation Arrows Styling --- */
.mancingdollar-carousel-nav {
  position: absolute;
  top: 30%;
  transform: translateY(-80%);
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10; /* Ensure arrows are above slider items */
  user-select: none; /* Prevent text selection */
  transition: background-color 0.3s ease;
}

.mancingdollar-carousel-nav:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.mancingdollar-carousel-nav-prev {
  left: -50px; /* Adjust spacing from edge */
}

.mancingdollar-carousel-nav-next {
  right: -50px; /* Adjust spacing from edge */
}

/* --- Responsive Adjustments --- */

/* Tablet */
@media screen and (max-width: 1023px) {
  .mancingdollar-carousel-slider {
    width: 140px; /* Reduced from 160px */
    height: 175px; /* Reduced from 200px */
    left: calc(50% - 70px); /* Adjusted for new width */
  }
  .mancingdollar-carousel-item {
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(500px); /* Greatly Increased radius from 210px */
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .mancingdollar-carousel-slider {
    width: 140px; /* Reverted towards tablet size */
    height: 175px; /* Reverted towards tablet size */
    left: calc(50% - 70px); /* Adjusted for 140px width */
    top: 15%; /* Reverted top position */
  }
  .mancingdollar-carousel-item {
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(210px); /* Reverted to tablet radius */
  }
  /* Revert nav buttons closer to default for consistency */
  .mancingdollar-carousel-nav {
    top: 38%;
    width: 30px;
    height: 30px;
    line-height: 29px;
    font-size: 15px;
  }
  .mancingdollar-carousel-nav-prev {
    left: 15px; /* Slightly closer than desktop */
  }
  .mancingdollar-carousel-nav-next {
    right: 15px; /* Slightly closer than desktop */
  }
}

/* --- Image Popup Styles --- */
.mancingdollar-image-popup {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mancingdollar-image-popup.active {
  visibility: visible;
  opacity: 1;
}

.mancingdollar-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mancingdollar-image-popup.active .mancingdollar-popup-overlay {
  opacity: 1;
}

.mancingdollar-popup-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  max-width: 90%;
  max-height: 90vh;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mancingdollar-image-popup.active .mancingdollar-popup-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.mancingdollar-popup-content img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
}

.mancingdollar-popup-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 30px;
  height: 30px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  opacity: 0;
  transform: scale(0.8);
}

.mancingdollar-image-popup.active .mancingdollar-popup-close {
  opacity: 1;
  transform: scale(1);
}

.mancingdollar-popup-close:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);
}

/* --- Responsive Popup Styles --- */

/* Large screens (default styles above) */

/* Medium screens */
@media screen and (max-width: 1024px) {
  .mancingdollar-popup-content {
    max-width: 90%;
    padding: 15px;
  }

  .mancingdollar-popup-content img {
    max-height: 80vh;
  }

  .mancingdollar-popup-close {
    width: 35px;
    height: 35px;
    font-size: 22px;
    top: -12px;
    right: -12px;
  }
}

/* Tablets */
@media screen and (max-width: 768px) {
  .mancingdollar-carousel-banner {
	overflow-x: hidden;	
  }
  .mancingdollar-popup-content {
    max-width: 95%;
    padding: 10px;
  }

  .mancingdollar-popup-content img {
    max-height: 85vh;
  }

  .mancingdollar-popup-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    top: -10px;
    right: -10px;
  }
}

/* Mobile devices */
@media screen and (max-width: 480px) {
  .mancingdollar-popup-content {
    max-width: 98%;
    padding: 8px;
  }

  .mancingdollar-popup-content img {
    max-height: 90vh;
    width: auto;
    max-width: 100%;
  }

  .mancingdollar-popup-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
    top: -8px;
    right: -8px;
  }
}

/* Small mobile devices */
@media screen and (max-width: 320px) {
  .mancingdollar-popup-content {
    max-width: 98%;
    padding: 6px;
  }

  .mancingdollar-popup-content img {
    max-height: 92vh;
    width: auto;
    max-width: 100%;
  }

  .mancingdollar-popup-close {
    width: 24px;
    height: 24px;
    font-size: 16px;
    top: -6px;
    right: -6px;
  }
}

/* Handle landscape orientation on mobile */
@media screen and (max-height: 480px) and (orientation: landscape) {
  .mancingdollar-popup-content {
    max-height: 90vh;
    padding: 6px;
  }

  .mancingdollar-popup-content img {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
  }

  .mancingdollar-popup-close {
    width: 24px;
    height: 24px;
    font-size: 16px;
    top: -6px;
    right: -6px;
  }
}
