/* Zelax Zoom v1.0.0 — product image lightbox with zoom & pan.
   Brand tokens mirror zelax-theme's :root (ink / cream / accent). */

:root {
  --zxz-ink: #111114;
  --zxz-cream: #FFF9E8;
  --zxz-yellow: #FFDE59;
}

/* ---------- trigger: the product page main image ---------- */

.zp-main { position: relative; }

.zp-main .zp-mimg,
.zp-main #zpMainImg { cursor: zoom-in; }

.zxz-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid rgba(17, 17, 20, .14);
  border-radius: 999px;
  background: rgba(255, 249, 232, .92);
  color: var(--zxz-ink);
  font: 600 12px/1 var(--z-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  letter-spacing: .01em;
  text-transform: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 1px 3px rgba(17, 17, 20, .12);
  cursor: zoom-in;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.zxz-hint:hover,
.zxz-hint:focus-visible {
  background: var(--zxz-yellow);
  box-shadow: 0 2px 8px rgba(17, 17, 20, .2);
  transform: translateY(-1px);
}
.zxz-hint:focus-visible { outline: 2px solid var(--zxz-ink); outline-offset: 2px; }
.zxz-hint .zxz-hint-ico { font-size: 13px; line-height: 1; }

@media (max-width: 640px) {
  .zxz-hint { right: 8px; bottom: 8px; padding: 8px 10px; font-size: 11px; }
  .zxz-hint .zxz-hint-txt { display: none; }
  .zxz-hint .zxz-hint-ico { font-size: 15px; }
}

/* ---------- overlay ---------- */

.zxz-lb {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  /* near-opaque on purpose: at .95 the page behind ghosts through against
     white product shots and competes with the detail you opened this to see */
  background: rgba(17, 17, 20, .975);
  opacity: 0;
  /* visibility + pointer-events matter: the overlay stays in the DOM after
     closing, and an opacity-0 fixed layer would otherwise swallow every click
     on the page underneath. The delayed visibility keeps the fade-out visible. */
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility 0s linear .18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: contain;
}
.zxz-lb.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .18s ease, visibility 0s;
}
.zxz-lb:focus { outline: none; }

html.zxz-locked, body.zxz-locked { overflow: hidden !important; }

/* top bar */
.zxz-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--zxz-cream);
}
.zxz-cap {
  min-width: 0;
  font: 500 13px/1.35 var(--z-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  color: rgba(255, 249, 232, .72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zxz-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* buttons — reset hard, the theme styles bare <button> elements */
.zxz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 249, 232, .26);
  border-radius: 999px;
  background: rgba(255, 249, 232, .08);
  color: var(--zxz-cream);
  font: 400 17px/1 var(--z-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  text-transform: none;
  letter-spacing: normal;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease, opacity .14s ease;
}
.zxz-btn:hover:not(:disabled),
.zxz-btn:focus-visible {
  background: var(--zxz-yellow);
  border-color: var(--zxz-yellow);
  color: var(--zxz-ink);
}
.zxz-btn:focus-visible { outline: 2px solid var(--zxz-cream); outline-offset: 2px; }
.zxz-btn:disabled { opacity: .3; cursor: default; }
.zxz-btn svg { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* stage */
.zxz-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}
.zxz-stage.is-zoomed { cursor: grab; }
.zxz-stage.is-panning { cursor: grabbing; }

.zxz-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.zxz-img.is-ready { opacity: 1; }
.zxz-img.is-eased { transition: transform .22s cubic-bezier(.22, .61, .36, 1), opacity .2s ease; }

.zxz-spin {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 249, 232, .22);
  border-top-color: var(--zxz-yellow);
  border-radius: 50%;
  animation: zxz-spin .7s linear infinite;
  pointer-events: none;
}
.zxz-spin[hidden] { display: none; }
@keyframes zxz-spin { to { transform: rotate(360deg); } }

/* side arrows */
.zxz-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  font-size: 20px;
  background: rgba(17, 17, 20, .55);
}
.zxz-nav-prev { left: 14px; }
.zxz-nav-next { right: 14px; }

/* bottom: zoom controls + thumbnails */
.zxz-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 18px;
}
.zxz-zoombar { display: flex; align-items: center; gap: 8px; }
.zxz-pct {
  min-width: 58px;
  text-align: center;
  font: 600 12px/1 var(--z-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  color: rgba(255, 249, 232, .72);
  font-variant-numeric: tabular-nums;
}

.zxz-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
}
.zxz-thumbs::-webkit-scrollbar { display: none; }
.zxz-thumbs[hidden] { display: none; }

.zxz-th {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(255, 249, 232, .26);
  border-radius: 8px;
  background: rgba(255, 249, 232, .06);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .14s ease, opacity .14s ease;
  opacity: .62;
}
.zxz-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zxz-th:hover, .zxz-th:focus-visible { opacity: 1; border-color: rgba(255, 249, 232, .6); }
.zxz-th:focus-visible { outline: 2px solid var(--zxz-cream); outline-offset: 2px; }
.zxz-th.on { opacity: 1; border-color: var(--zxz-yellow); }

@media (max-width: 640px) {
  .zxz-bar { padding: 10px; }
  .zxz-cap { font-size: 12px; }
  .zxz-nav { width: 40px; height: 40px; }
  .zxz-nav-prev { left: 8px; }
  .zxz-nav-next { right: 8px; }
  .zxz-foot { gap: 10px; padding: 8px 10px 14px; }
  .zxz-th { width: 46px; height: 46px; }
}

/* the desktop-only zoom buttons take space we'd rather give the image on phones */
@media (max-width: 480px) {
  .zxz-zoombar .zxz-btn { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .zxz-lb, .zxz-img, .zxz-img.is-eased, .zxz-btn, .zxz-hint, .zxz-th { transition: none !important; }
  .zxz-spin { animation-duration: 1.6s; }
}
