/* =============================================================
   detail-product.css
   Styles untuk halaman detail produk: Swiper gallery, lightbox,
   product info bar, dan layout overrides.
   ============================================================= */

/* ── Override product-detail to single column ── */
.product-detail {
  display: block !important;
}

/* ── Swiper Gallery Wrapper ── */
.swiper-gallery-wrap {
  width: 100%;
  /* max-width: 800px; */
  /* margin: 0 auto var(--space-10); */
  /* padding kanan kiri swiper gallery gambar  */
}

/* ── Product Info Bar (name + prices + buy now, below slider) ── */
.product-info-bar {
  width: 100%;
  margin-top: 20px;
  /* max-width: 800px; */
  /* margin: 0 auto var(--space-8); */
  /* padding kanan kiri product info */
}

.product-info-bar .product-detail__name {
  /* margin-bottom: var(--space-6); */
}

.product-info-bar__prices {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* ── Main Swiper ── */
/* Outer ratio-box: establishes real pixel height via padding-bottom trick */
.swiper-main-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  /* 4:3 */
  height: 0;
  margin-bottom: var(--space-4);
}

/* The actual Swiper element fills the ratio-box absolutely */
.swiper-main {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* Swiper wrapper stays at default layout — DO NOT override position/inset */
.swiper-main .swiper-wrapper {
  height: 100%;
}

/* Slides are normal flex items in the row — Swiper's translateX works correctly */
.swiper-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  cursor: zoom-in;
  height: 100%;
}

.swiper-main .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* ── Thumbnail Swiper ── */
.swiper-thumbs {
  height: 76px;
}

.swiper-thumbs .swiper-slide {
  width: 76px;
  height: 76px;
  padding: var(--space-1);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  transition: border-color 0.2s, opacity 0.2s;
}

.swiper-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.swiper-thumbs .swiper-slide-thumb-active {
  border-color: var(--color-accent);
  opacity: 1;
}

/* ── Navigation Arrows ── */
.swiper-main .swiper-button-prev,
.swiper-main .swiper-button-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.swiper-main:hover .swiper-button-prev,
.swiper-main:hover .swiper-button-next {
  opacity: 1;
}

.swiper-main .swiper-button-prev:hover,
.swiper-main .swiper-button-next:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.swiper-main .swiper-button-prev::after,
.swiper-main .swiper-button-next::after {
  font-size: 14px;
  font-weight: 700;
}

/* ── Pagination Bullets ── */
.swiper-main .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5);
  opacity: 1;
  transition: background 0.2s, transform 0.2s;
}

.swiper-main .swiper-pagination-bullet-active {
  background: var(--color-accent);
  transform: scale(1.25);
}

/* ── Image Counter badge ── */
.swiper-counter {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  z-index: 10;
  pointer-events: none;
}

/* ── Lightbox Modal ── */
#swiperLightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#swiperLightbox.lightbox--open {
  pointer-events: auto;
  opacity: 1;
}

#swiperLbBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
}

#swiperLbBox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}

#swiperLbImg {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  display: block;
  animation: lbZoomIn 0.25s ease;
}

@keyframes lbZoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

#swiperLbClose {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

#swiperLbClose:hover {
  background: var(--color-accent);
}