/* ==========================================================================
   WDP Gallery Carousel Stylesheet
   ========================================================================== */

.wdp-gallery-carousel {
  position: relative;
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  touch-action: pan-y;
  padding: 50px 0; /* Memberikan ruang ekstra di atas/bawah agar drop shadow kartu tidak terpotong */
  box-sizing: content-box;
  isolation: isolate; /* Isolate stacking context so arrow z-index doesn't leak to global body/lightbox */
  z-index: 1;
}

/* Stage - Isolate z-index of cards from arrow buttons */
.wdp-gc-stage {
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 0;
  right: 0;
  overflow: visible; /* Biarkan box shadow menggambar ke luar batas stage */
  isolation: isolate;
  z-index: 1;
}

/* Card */
.wdp-gc-card {
  position: absolute;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease;
}

/* Pseudo-element for box-shadow (supports inset shadows on top of images) */
.wdp-gc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: box-shadow 0.3s ease;
  z-index: 2; /* Sits on top of the image to render inset shadow correctly */
}

.wdp-gc-card img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Navigation Arrow Buttons - Controlled Z-Index (Scoped within widget) */
.wdp-gc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10; /* Lower z-index so it doesn't leak over global lightboxes */
  padding: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.wdp-gc-arrow:hover {
  opacity: 0.85;
  transform: translateY(-50%) scale(1.08);
}

.wdp-gc-arrow svg {
  display: block;
  pointer-events: none;
}

/* Hide arrows when Lightbox popup or Modal is open in document */
body.elementor-lightbox-open .wdp-gc-arrow,
body.dialog-lightbox-open .wdp-gc-arrow,
body.wdp-modal-open .wdp-gc-arrow,
.wdp-gc-modal.is-open ~ .wdp-gallery-carousel .wdp-gc-arrow,
body:has(.wdp-gc-modal.is-open) .wdp-gc-arrow,
body:has(.elementor-lightbox:not([style*="display: none"])) .wdp-gc-arrow {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Single/Static image display (guard < 2 items) */
.wdp-gc-single-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wdp-gc-single-image {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Modal Lightbox Preview (Global in body)
   ========================================================================== */

.wdp-gc-modal {
  position: fixed;
  inset: 0;
  z-index: 999999 !important; /* Topmost z-index above all page elements */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.wdp-gc-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.wdp-gc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.wdp-gc-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.wdp-gc-modal-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.wdp-gc-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.wdp-gc-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Fallback gradient styling for placeholder backgrounds */
.wdp-gc-card-fallback-0 { background: linear-gradient(160deg, #ff6b6b, #ffd93d); }
.wdp-gc-card-fallback-1 { background: linear-gradient(160deg, #4facfe, #00f2fe); }
.wdp-gc-card-fallback-2 { background: linear-gradient(160deg, #43e97b, #38f9d7); }
.wdp-gc-card-fallback-3 { background: linear-gradient(160deg, #fa709a, #fee140); }
.wdp-gc-card-fallback-4 { background: linear-gradient(160deg, #a18cd1, #fbc2eb); }
.wdp-gc-card-fallback-5 { background: linear-gradient(160deg, #f093fb, #f5576c); }
.wdp-gc-card-fallback-6 { background: linear-gradient(160deg, #5ee7df, #b490ca); }