/* --- Base layout --- */
.uxdg-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}



/* --- Slider: always 1:1 ratio --- */
.row-prod-page-gallery {
  width: 90% !important;
}

.uxdg-slider-container,
.ux-slider-prod {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

/* --- Banner (square background image) --- */
.uxdg-square-banner {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.uxdg-square-banner .banner-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  cursor: pointer; /* pointer on banner image */
}

/* --- Hero image positioning --- */
.uxdg-hero-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -25%);
  width: 50%;
  max-width: 350px;
  aspect-ratio: 1 / 1;
  z-index: 3;
}

.uxdg-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: pointer; /* pointer on hero image */
}

.row-prod-page-gallery--single {
  margin-left: auto;
}

@media (min-width: 1000px) {
  .row-prod-page-gallery--single {
    margin-top: -100px;
  }
}


/* --- Slider images --- */
.uxdg-slider-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer; /* pointer on slider images */
}

/* --- Slider arrows --- */
.uxdg-slider-container .swiper-button-next,
.uxdg-slider-container .swiper-button-prev {
  width: 40px;
  height: 40px;
  background-color: rgba(60, 60, 60, 0.7);
  border-radius: 50%; /* round buttons */
  display: flex;
  align-items: center;
  justify-content: center;
}

.uxdg-slider-container .swiper-button-next::after,
.uxdg-slider-container .swiper-button-prev::after {
  font-size: 16px;
  color: white;
}

/* --- Modal gallery --- */
.uxdg-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
}

.uxdg-modal-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  object-fit: contain;
}

.uxdg-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
}

.uxdg-prev,
.uxdg-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.uxdg-prev:hover,
.uxdg-next:hover {
  background: rgba(255,255,255,0.5);
}

.uxdg-prev { left: 30px; }
.uxdg-next { right: 30px; }

/* --- Cursor on all clickable images --- */
.uxdg-clickable,
.banner-main-img,
.uxdg-square-banner {
  cursor: pointer;
}

/* --- Tablet & mobile adjustments --- */
@media (max-width: 1000px) {
  .uxdg-hero-wrapper {
    position: relative;
    top: auto;
    bottom: 0;
    right: 0;
    transform: none;
    margin-top: 10px;
    width: 70%;
    max-width: 260px;
    margin-top: -100px;
  }

  .uxdg-slider-container {
    max-width: 500px;
  }

  .uxdg-wrapper {
    margin-bottom: 65px;
  }

  .row-prod-page-gallery {
    width: 100%!important;
  }
}

@media (max-width: 640px) {
  .uxdg-hero-wrapper {
    position: relative;
    bottom: 0;
    right: 0;
    transform: none;
    margin-top: 10px;
    width: 70%;
    max-width: 260px;
    margin-top: -100px;
  }
}

/* --- Single image (no hero) --- */
.uxdg-wrapper.single-image .uxdg-hero-wrapper {
  display: none;
}

.product-gallery-single-image .single-image-end>.col-inner {
    display: flex;
    justify-content: end;
}

@media (max-width: 1000px) {
  /* Move prev/next buttons below the image on mobile */
  .uxdg-modal {
    flex-direction: column;
  }

  .uxdg-modal-img {
    max-width: 90%;
    max-height: 70%;
    margin-bottom: 20px;
  }

  .uxdg-prev,
  .uxdg-next {
    position: static;
    transform: none;
    margin: 5px;
    background: rgba(255,255,255,0.25);
  }

  .uxdg-prev:hover,
  .uxdg-next:hover {
    background: rgba(255,255,255,0.5);
  }

  /* Buttons container centered */
  .uxdg-modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
  }
}
