/* AIXUE product gallery — hero viewer + grid + lightbox
   used by /products/* pages via /assets/pdp-gallery.css */

/* ---------- hero ---------- */
.pdp-media { min-width: 0; }

.pdp-main {
  position: relative;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.pdp-main img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  transition: opacity .18s ease;
}
.pdp-main.is-zoomable { cursor: zoom-in; }

.pdp-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .88);
  color: #111;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
  transition: background .18s ease, transform .18s ease;
  z-index: 3;
}
.pdp-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.pdp-arrow[disabled] { opacity: .35; cursor: default; transform: translateY(-50%); }
.pdp-arrow.pdp-arrow-prev { left: 12px; }
.pdp-arrow.pdp-arrow-next { right: 12px; }

.pdp-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 3;
}

.pdp-zoom-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .08);
  color: #333;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 3;
}
.pdp-main:hover .pdp-zoom-hint { opacity: 1; }
@media (hover: none) { .pdp-zoom-hint { display: none; } }

.pdp-thumbs {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.pdp-thumbs[hidden] { display: none; }
.pdp-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f6f6;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb.is-active { border-color: #111; transform: translateY(-1px); }

/* ---------- gallery section ---------- */
.pdp-gallery-sec { padding-top: 8px; }
.pdp-gallery-sec[hidden] { display: none; }

.pdp-gal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pdp-gal-head h2 { margin: 0; }
.pdp-gal-count {
  color: #8a8a8a;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pdp-gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.pdp-gal-item {
  position: relative;
  padding: 0;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 12px;
  overflow: hidden;
  background: #f7f7f7;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  -webkit-tap-highlight-color: transparent;
}
.pdp-gal-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  transition: transform .35s ease;
}
.pdp-gal-item:hover img { transform: scale(1.04); }
.pdp-gal-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .2s ease;
}
.pdp-gal-item:hover::after { background: rgba(0, 0, 0, .06); }
.pdp-gal-item:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* ---------- lightbox ---------- */
.pdp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  background: #0a0a0a;
  color: #fff;
}
.pdp-lightbox.is-open { display: flex; }
body.pdp-lb-lock { overflow: hidden; }

.pdp-lb-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 8px;
  -webkit-overflow-scrolling: touch;
}
.pdp-lb-stage img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  user-select: none;
  transition: opacity .16s ease;
}
.pdp-lightbox.is-zoomed .pdp-lb-stage { align-items: flex-start; justify-content: flex-start; }
.pdp-lightbox.is-zoomed .pdp-lb-stage img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
  margin: auto;
}

.pdp-lb-btn {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s ease;
  z-index: 2;
}
.pdp-lb-btn:hover { background: rgba(255, 255, 255, .24); }
.pdp-lb-close { top: 14px; right: 14px; font-size: 26px; }
.pdp-lb-prev { top: 50%; left: 14px; transform: translateY(-50%); }
.pdp-lb-next { top: 50%; right: 14px; transform: translateY(-50%); }
.pdp-lb-btn[disabled] { opacity: .3; cursor: default; }

.pdp-lb-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 16px;
  font-size: 12.5px;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .78);
}
.pdp-lb-bar a { color: rgba(255, 255, 255, .78); text-decoration: underline; text-underline-offset: 3px; }
.pdp-lb-bar a:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .pdp-gal-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .pdp-gal-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 14px; }
  .pdp-arrow { width: 34px; height: 34px; font-size: 18px; }
  .pdp-arrow.pdp-arrow-prev { left: 8px; }
  .pdp-arrow.pdp-arrow-next { right: 8px; }
  .pdp-thumbs { gap: 7px; }
  .pdp-thumb { flex-basis: 56px; width: 56px; height: 56px; }
  .pdp-lb-stage { padding: 52px 6px 6px; }
  .pdp-lb-stage img { max-width: 96vw; max-height: 72vh; }
  .pdp-lb-prev { left: 8px; }
  .pdp-lb-next { right: 8px; }
  .pdp-lb-btn { width: 40px; height: 40px; }
}
