.detail-media.product-gallery { position: sticky; top: 88px; min-width: 0; min-height: 0; padding: 14px; background: #f7f6f2; border: 1px solid var(--line); }
.product-gallery-stage { position: relative; min-height: 452px; overflow: hidden; background: var(--white); border: 1px solid var(--line); touch-action: pan-y; }
.product-gallery-main { display: grid; width: 100%; min-height: 450px; padding: 32px; place-items: center; color: inherit; background: transparent; border: 0; cursor: zoom-in; }
.product-gallery-main img { width: 100%; height: 386px; object-fit: contain; transition: transform .22s ease; }
.product-gallery-main:hover img { transform: scale(1.025); }
.product-gallery-main:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.product-gallery-sku { position: absolute; z-index: 3; top: 14px; left: 14px; padding: 7px 9px; color: var(--ink); background: var(--accent); font-size: .68rem; font-weight: 900; letter-spacing: .09em; pointer-events: none; }
.product-gallery-zoom-hint { position: absolute; z-index: 3; right: 12px; bottom: 12px; padding: 7px 9px; color: var(--ink); background: rgba(255,255,255,.93); border: 1px solid var(--line); font-size: .66rem; font-weight: 850; letter-spacing: .03em; pointer-events: none; }
.product-gallery-arrow { position: absolute; z-index: 4; top: 50%; display: grid; width: 42px; height: 42px; padding: 0; place-items: center; color: var(--white); background: rgba(18,18,15,.88); border: 0; border-radius: 50%; cursor: pointer; transform: translateY(-50%); }
.product-gallery-arrow span { color: inherit; font-size: 1.8rem; font-weight: 500; line-height: 1; letter-spacing: 0; }
.product-gallery-prev { left: 12px; }
.product-gallery-next { right: 12px; }
.product-gallery-arrow:hover { background: var(--accent-dark); }
.product-gallery-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: thin; }
.product-gallery-thumbs[hidden], .product-gallery-arrow[hidden], .product-gallery-count[hidden] { display: none; }
.product-gallery-thumb { flex: 0 0 74px; width: 74px; height: 74px; padding: 5px; background: var(--white); border: 1px solid var(--line); cursor: pointer; }
.product-gallery-thumb.is-active { border-color: var(--accent-dark); box-shadow: 0 0 0 2px var(--accent); }
.product-gallery-thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-gallery-meta { display: flex; gap: 16px; align-items: start; justify-content: space-between; padding: 12px 4px 2px; }
.product-gallery-meta small { display: block; margin-top: 0; color: var(--muted); line-height: 1.5; }
.product-gallery-count { flex: 0 0 auto; color: var(--accent-dark); font-size: .72rem; font-weight: 850; letter-spacing: .05em; }
.product-gallery > script { display: none; }
.product-lightbox { width: min(1120px, calc(100vw - 32px)); max-width: none; height: min(860px, calc(100vh - 32px)); max-height: none; padding: 0; overflow: hidden; background: #f7f6f2; border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0,0,0,.38); }
.product-lightbox::backdrop { background: rgba(8,8,8,.78); backdrop-filter: blur(3px); }
.product-lightbox-panel { position: relative; display: grid; box-sizing: border-box; height: 100%; min-height: 0; padding: 54px 70px 24px; place-items: center; }
.product-lightbox figure { display: grid; width: 100%; height: 100%; min-height: 0; margin: 0; grid-template-rows: minmax(0,1fr) auto; overflow: hidden; }
.product-lightbox figure > img { width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: 100%; object-fit: contain; }
.product-lightbox figcaption { display: flex; gap: 18px; justify-content: space-between; padding-top: 12px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.product-lightbox figcaption small { flex: 0 0 auto; color: var(--ink); font-weight: 850; }
.product-lightbox-close { position: absolute; z-index: 2; top: 12px; right: 12px; min-height: 36px; padding: 0 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line); font: inherit; font-size: .72rem; font-weight: 850; cursor: pointer; }
.product-lightbox-arrow { position: absolute; z-index: 2; top: 50%; display: grid; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--white); background: rgba(18,18,15,.9); border: 0; border-radius: 50%; cursor: pointer; transform: translateY(-50%); }
.product-lightbox-arrow[hidden] { display: none; }
.product-lightbox-arrow span { font-size: 2rem; line-height: 1; }
.product-lightbox-prev { left: 14px; }
.product-lightbox-next { right: 14px; }
.product-lightbox button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .detail-media.product-gallery { position: relative; top: auto; }
  .product-gallery-stage { min-height: 430px; }
  .product-gallery-main { min-height: 428px; }
  .product-gallery-main img { height: 364px; }
}

@media (max-width: 580px) {
  .detail-media.product-gallery { min-height: 0; padding: 10px; }
  .product-gallery-stage { min-height: 310px; }
  .product-gallery-main { min-height: 308px; padding: 30px 18px 24px; }
  .product-gallery-main img { height: 254px; }
  .product-gallery-zoom-hint { right: 8px; bottom: 8px; }
  .product-gallery-arrow { width: 38px; height: 38px; }
  .product-gallery-prev { left: 8px; }
  .product-gallery-next { right: 8px; }
  .product-gallery-thumb { flex-basis: 64px; width: 64px; height: 64px; }
  .product-lightbox { width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .product-lightbox-panel { padding: 52px 12px 18px; }
  .product-lightbox figcaption { padding-inline: 4px; }
  .product-lightbox-arrow { top: auto; bottom: 72px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .product-gallery-main img { transition: none; }
}
