/* WoodenKing product gallery — Swiper-based main gallery, thumbnails and fullscreen zoom. */
.wk-ui .product-gallery {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-areas: "thumbs main";
  gap: var(--spacing-md);
  align-items: stretch;
}

.wk-ui .product-gallery__main {
  grid-area: main;
  width: min(100%, 560px);
  min-width: 0;
  aspect-ratio: 3 / 4;
  margin-inline: 0 auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-background-alt);
}

.wk-ui .product-gallery__main .swiper-wrapper,
.wk-ui .product-gallery__slide {
  height: 100%;
}

.wk-ui .product-gallery__slide {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--color-background-alt);
}

.wk-ui .product-gallery__open,
.wk-ui .product-gallery__video {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--color-text);
  background: var(--color-background-alt);
  cursor: zoom-in;
}

.wk-ui .product-gallery__open img,
.wk-ui .product-gallery__video img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.wk-ui .product-gallery__zoom-hint,
.wk-ui .product-gallery__play {
  position: absolute;
  inset-inline-end: var(--spacing-md);
  inset-block-end: var(--spacing-md);
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(230, 221, 213, 0.9);
  border-radius: 50%;
  color: var(--color-text-strong);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.wk-ui .product-gallery__zoom-hint svg,
.wk-ui .product-gallery__play svg { width: 23px; height: 23px; }
.wk-ui .product-gallery__open:hover .product-gallery__zoom-hint { color: #fff; background: var(--color-primary); transform: scale(1.04); }
.wk-ui .product-gallery__play { inset: 50% auto auto 50%; width: 72px; height: 72px; transform: translate(-50%, -50%); }
.wk-ui .product-gallery__play svg { width: 34px; height: 34px; }

.wk-ui .product-gallery__thumbs {
  grid-area: thumbs;
  width: 84px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.wk-ui .product-gallery__thumb {
  position: relative;
  display: grid;
  width: 80px;
  height: auto !important;
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.wk-ui .product-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-sm) - 3px);
  object-fit: cover;
  object-position: center;
}
.wk-ui .product-gallery__thumb:hover { opacity: 1; }
.wk-ui .product-gallery__thumb svg { position: absolute; inset: 50% auto auto 50%; width: 30px; height: 30px; padding: 5px; border-radius: 50%; color: #fff; background: rgba(44, 33, 27, 0.72); transform: translate(-50%, -50%); }
.wk-ui .product-gallery__thumb.swiper-slide-thumb-active { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-soft); opacity: 1; }

.wk-ui .product-gallery__nav,
.wk-ui .product-lightbox__nav {
  position: absolute;
  z-index: 3;
  inset-block-start: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(230, 221, 213, 0.92);
  border-radius: 50%;
  color: var(--color-text-strong);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  transform: translateY(-50%);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
}
.wk-ui .product-gallery__nav:hover { color: #fff; background: var(--color-primary); transform: translateY(-50%) scale(1.04); }
.wk-ui .product-gallery__nav svg,
.wk-ui .product-lightbox__nav svg { width: 22px; height: 22px; }
.wk-ui .product-gallery__nav--prev { inset-inline-start: var(--spacing-md); }
.wk-ui .product-gallery__nav--next { inset-inline-end: var(--spacing-md); }
.wk-ui .product-gallery__nav.swiper-button-disabled,
.wk-ui .product-lightbox__nav.swiper-button-disabled { opacity: 0.25; pointer-events: none; }

.wk-ui .product-gallery__pagination { display: none; }

.wk-ui .product-lightbox[hidden] { display: none !important; }
.wk-ui .product-lightbox,
.wk-ui .product-lightbox * { box-sizing: border-box; }
.wk-ui .product-lightbox {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-width: 0;
  margin: 0;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}
.wk-ui .product-lightbox__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(20, 15, 12, 0.94); backdrop-filter: blur(8px); }
.wk-ui .product-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  max-width: 100%;
  height: calc(100dvh - 40px);
  max-height: 100%;
  min-width: 0;
  margin: 0 auto;
  overflow: hidden;
}
.wk-ui .product-lightbox__swiper { width: 100%; max-width: 100%; height: 100%; min-width: 0; overflow: hidden; }
.wk-ui .product-lightbox__swiper .swiper-wrapper { width: 100%; height: 100%; }
.wk-ui .product-lightbox__swiper .swiper-slide { display: grid; width: 100%; min-width: 0; height: 100%; place-items: center; overflow: hidden; }
.wk-ui .product-lightbox__swiper .swiper-zoom-container { display: flex; width: 100%; max-width: 100%; height: 100%; min-width: 0; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.wk-ui .product-lightbox__swiper .swiper-zoom-container img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; object-position: center; }
.wk-ui .product-lightbox__close {
  position: absolute;
  z-index: 6;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.38);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.wk-ui .product-lightbox__close:hover { background: var(--color-primary); transform: scale(1.04); }
.wk-ui .product-lightbox__close svg { width: 25px; height: 25px; }
.wk-ui .product-lightbox__nav { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(0,0,0,.38); }
.wk-ui .product-lightbox__nav:hover { background: var(--color-primary); transform: translateY(-50%) scale(1.04); }
.wk-ui .product-lightbox__nav--prev { inset-inline-start: 16px; }
.wk-ui .product-lightbox__nav--next { inset-inline-end: 16px; }
.wk-ui .product-lightbox__pagination { color: #fff; }
.wk-ui .product-lightbox__pagination .swiper-pagination-bullet { background: #fff; }
.wk-ui.is-product-lightbox-open { overflow: hidden; }

@media (max-width: 1199px) {
  .wk-ui .product-gallery { grid-template-columns: 72px minmax(0, 1fr); gap: var(--spacing-sm); }
  .wk-ui .product-gallery__main { width: min(100%, 500px); }
  .wk-ui .product-gallery__thumbs { width: 72px; }
  .wk-ui .product-gallery__thumb { width: 68px; }
}

@media (max-width: 767px) {
  .wk-ui .product-gallery { display: block; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
  .wk-ui .product-gallery__main { width: min(100%, 480px); max-width: 100%; aspect-ratio: 3 / 4; margin-inline: auto; border-radius: var(--radius-md); }
  .wk-ui .product-gallery__open,
  .wk-ui .product-gallery__video { min-height: 0; padding: 0; }
  .wk-ui .product-gallery__thumbs { width: 100%; max-width: 100%; min-width: 0; height: auto; max-height: none; margin-block-start: var(--spacing-sm); overflow: hidden; }
  .wk-ui .product-gallery__thumbs .swiper-wrapper { max-width: 100%; }
  .wk-ui .product-gallery__thumb { width: 64px; max-width: 64px; height: auto !important; aspect-ratio: 3 / 4; }
  .wk-ui .product-gallery__nav { display: none; }
  .wk-ui .product-gallery__pagination { display: block; inset-block-end: 10px !important; }
  .wk-ui .product-gallery__pagination .swiper-pagination-bullet { width: 7px; height: 7px; background: var(--color-text-muted); opacity: .45; }
  .wk-ui .product-gallery__pagination .swiper-pagination-bullet-active { width: 20px; border-radius: var(--radius-pill); background: var(--color-primary); opacity: 1; }
  .wk-ui .product-gallery__zoom-hint { width: 42px; height: 42px; }
  .wk-ui .product-lightbox { width: 100%; height: 100dvh; padding: 0; }
  .wk-ui .product-lightbox__dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; }
  .wk-ui .product-lightbox__nav { display: none; }
  .wk-ui .product-lightbox__close { inset-block-start: max(12px, env(safe-area-inset-top)); inset-inline-end: max(12px, env(safe-area-inset-right)); }
}
