/* ═══════════════════════════════════════════════════════════════
   GALLERY — main swiper, thumbs, state badge, lightbox
   ═══════════════════════════════════════════════════════════════ */

.products-gallery {
  position: sticky;
  top: 20px;
  height: fit-content;
  user-select: none;
  animation: pd-fadeLeft var(--transition-slow) both;
  max-width: 634px;
}

/* ── Main swiper ───────────────────────────────────────────── */
.main-swiper {
  width: 100%;
  height: 520px;
  overflow: hidden;
  position: relative;
}

.main-swiper .swiper-slide {
  background:
    radial-gradient(circle at 50% 35%,
      color-mix(in srgb, var(--primary-more-light) 55%, transparent),
      transparent 58%),
    var(--bg-card);
}

.main-swiper img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  padding: 18px;
  cursor: default;
  transition: transform var(--transition-slow);
  display: block;
  touch-action: none;
  will-change: transform;
}

.main-swiper img:hover { transform: scale(1.04); }

.main-swiper .swiper-slide img.is-zoomed {
  transition: none;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════════
   SWIPER NAV — glass style (matches .gallery-action-btn)
   ═══════════════════════════════════════════════════════════════ */

.swiper-button-next,
.swiper-button-prev {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999rem;

  color: var(--text-white);

  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  background: color-mix(in srgb, var(--text-black) 20%, transparent);
  box-shadow: inset 0 1px color-mix(in srgb, var(--text-white) 20%, transparent);

  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast);
}

.swiper-button-next:hover,
.swiper-button-prev:hover,
.swiper-button-next:focus-visible,
.swiper-button-prev:focus-visible {
  background: color-mix(in srgb, var(--text-black) 35%, transparent);
  transform: scale(1.06);
  outline: none;
}

.swiper-button-next:active,
.swiper-button-prev:active {
  transform: scale(.95);
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px;
  font-weight: 800;
  color: currentColor;
}
/* ── Pagination ────────────────────────────────────────────── */
.swiper-pagination-bullet {
  background: var(--border-primary) !important;
  opacity: 1 !important;
  transition: background var(--transition-fast),
              transform var(--transition-fast) !important;
}

.swiper-pagination-bullet-active {
  background: var(--primary-color) !important;
  transform: scale(1.3) !important;
}

/* ── Thumbs ────────────────────────────────────────────────── */
.thumbs-swiper {
  margin-top: 12px;
  height: 100px;
  padding: 4px 0;
}

.thumbs-swiper .swiper-slide {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  flex-shrink: 0;
}

.thumbs-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
  aspect-ratio: 1 / 1 !important;
}

.thumbs-swiper .swiper-slide:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.thumbs-swiper .swiper-slide:hover img { transform: scale(1.07); }

.thumbs-swiper .swiper-slide-thumb-active {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px var(--primary-light);
  transform: translateY(-2px);
}

/* ── No-image fallback ─────────────────────────────────────── */
.no-image img {
  width: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
}

/* ── State badge ───────────────────────────────────────────── */
.gallery-state-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  min-height: 30px;
  padding: 4px 12px 4px 4px;
  border: 1px solid currentColor;
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-light);
  font-weight: 500;
  line-height: 1.25;
}

.gallery-state-badge__label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.gallery-state-badge__message {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
}

.gallery-state-badge.sale     { background: color-mix(in srgb, var(--error-bg) 90%, transparent); color: var(--error-color); }
.gallery-state-badge.new      { background: color-mix(in srgb, var(--primary-more-light) 92%, transparent); color: var(--primary-color); }
.gallery-state-badge.best,
.gallery-state-badge.limited  { background: color-mix(in srgb, var(--warning-bg) 92%, transparent); color: var(--warning-color); }
.gallery-state-badge.featured,
.gallery-state-badge.top      { background: color-mix(in srgb, var(--primary-more-light) 92%, transparent); color: var(--primary-color); }
.gallery-state-badge.popular  { background: color-mix(in srgb, var(--info-bg) 92%, transparent); color: var(--info-color); }
.gallery-state-badge.out,
.gallery-state-badge.regular  { background: color-mix(in srgb, var(--bg-secondary) 94%, transparent); color: var(--text-muted); }
/* ═══════════════════════════════════════════════════════════════
   GALLERY ACTION BUTTONS — glass style
   ═══════════════════════════════════════════════════════════════ */

.swiper-wrapper {
  position: relative;
}

.gallery-action-btn {
  position: absolute;
  z-index: 6;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999rem;

  color: var(--text-white);
  cursor: pointer;

  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  background: color-mix(in srgb, var(--text-black) 20%, transparent);
  box-shadow: inset 0 1px color-mix(in srgb, var(--text-white) 20%, transparent);

  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast);
}

.gallery-action-btn:hover,
.gallery-action-btn:focus-visible {
  background: color-mix(in srgb, var(--text-black) 35%, transparent);
  transform: scale(1.06);
  outline: none;
}

.gallery-action-btn:active {
  transform: scale(.95);
}

.gallery-action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Positions ─────────────────────────────────────────────── */
.gallery-action-btn--fullscreen {
  top: 12px;
  right: 12px;
}

.gallery-action-btn--video {
  bottom: 12px;
  right: 12px;
}
/* ═══════════════════════════════════════════════════════════════
   PRODUCT IMAGE LIGHTBOX
   ═══════════════════════════════════════════════════════════════ */

.product-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast, .2s ease);
}

.product-image-lightbox.is-open {
  display: flex;
  opacity: 1;
}

.product-image-lightbox[hidden] { display: none; }

/* ── Backdrop ──────────────────────────────────────────────── */
.product-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-modal);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}

/* ── Content shell ─────────────────────────────────────────── */
.product-image-lightbox__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  max-height: 100dvh;
  padding: 14px clamp(14px, 3vw, 32px) 20px;
  gap: 12px;
  animation: pdi-fadeUp .22s ease-out both;
}

@keyframes pdi-fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   SHARED BUTTON STYLE (matches .gallery-action-btn)
   ═══════════════════════════════════════════════════════════════ */

.product-image-lightbox__close,
.product-image-lightbox__nav,
.product-image-lightbox__thumb {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--text-white);
  cursor: pointer;

  /* Frosted glass */
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  background: color-mix(in srgb, var(--text-black) 20%, transparent);
  box-shadow: inset 0 1px color-mix(in srgb, var(--text-white) 20%, transparent);

  /* Transition */
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    opacity var(--transition-fast);
}

.product-image-lightbox__close:hover,
.product-image-lightbox__close:focus-visible,
.product-image-lightbox__nav:hover,
.product-image-lightbox__nav:focus-visible,
.product-image-lightbox__thumb:hover,
.product-image-lightbox__thumb:focus-visible {
  background: color-mix(in srgb, var(--text-black) 35%, transparent);
  outline: none;
}

.product-image-lightbox__close:active,
.product-image-lightbox__nav:active,
.product-image-lightbox__thumb:active {
  transform: scale(.95);
}

/* ── Top bar: name · counter · close ───────────────────────── */
.product-image-lightbox__topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.product-image-lightbox__title {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  letter-spacing: -.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-lightbox__counter {
  grid-column: 2;
  justify-self: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  letter-spacing: .04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Close button ──────────────────────────────────────────── */
.product-image-lightbox__close {
  grid-column: 3;
  justify-self: end;
  width: 40px;
  height: 40px;
  border-radius: 999rem;
}

/* ── Main image area ───────────────────────────────────────── */
.product-image-lightbox__main {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
}

#product-image-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform .12s ease-out;
  will-change: transform;
}

/* ── Prev / Next nav ───────────────────────────────────────── */
.product-image-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999rem;
  z-index: 2;
}

.product-image-lightbox__nav--prev { left: 14px; }
.product-image-lightbox__nav--next { right: 14px; }

/* Keep centered on hover while scaling */
.product-image-lightbox__nav:hover,
.product-image-lightbox__nav:focus-visible {
  transform: translateY(-50%) scale(1.06);
}

.product-image-lightbox__nav:active {
  transform: translateY(-50%) scale(.95);
}

.product-image-lightbox__nav:disabled {
  opacity: .3;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.product-image-lightbox__nav:disabled:hover {
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--text-black) 20%, transparent);
}

/* ── Thumbnails strip ──────────────────────────────────────── */
.product-image-lightbox__thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

.product-image-lightbox__thumbs::-webkit-scrollbar { height: 4px; }
.product-image-lightbox__thumbs::-webkit-scrollbar-track { background: transparent; }
.product-image-lightbox__thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .25);
  border-radius: 4px;
}

.product-image-lightbox__thumb {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  opacity: .55;
}

.product-image-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.product-image-lightbox__thumb:hover,
.product-image-lightbox__thumb:focus-visible {
  opacity: .85;
  transform: translateY(-2px);
}

.product-image-lightbox__thumb.is-active {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 1px color-mix(in srgb, var(--text-white) 20%, transparent);
}

/* ── Hint ──────────────────────────────────────────────────── */
.product-image-lightbox__hint {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .product-image-lightbox__content { padding: 10px 12px 14px; }

  .product-image-lightbox__nav {
    width: 38px;
    height: 38px;
  }
  .product-image-lightbox__nav--prev { left: 6px; }
  .product-image-lightbox__nav--next { right: 6px; }

  .product-image-lightbox__thumb {
    width: 46px;
    height: 46px;
  }

  .product-image-lightbox__title { font-size: 13px; }
  .product-image-lightbox__counter { font-size: 12px; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .product-image-lightbox,
  .product-image-lightbox__content,
  .product-image-lightbox__close,
  .product-image-lightbox__nav,
  .product-image-lightbox__thumb,
  #product-image-lightbox-image {
    animation: none !important;
    transition: none !important;
  }
}