/* Ürün sayfası galerisi — Sahne / Mozaik / 3D vitrin + tam ekran (gallery.js) */
.gallery.pg { display: block; --pg-ease: cubic-bezier(.2, .8, .2, 1); --pg-r: var(--r-lg, 18px); --pg-bg: var(--line-2, #f1f3f5); --pg-ratio: var(--pi-single-ratio, 4 / 5); --pg-fit: var(--pi-single-fit, cover); }
.gallery.pg-mozaik, .gallery.pg-vitrin { position: static; }
.pg img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.pg .pg-badges { z-index: 4; pointer-events: none; }

/* ---------- Sahne ---------- */
.pg-sahne.pg-multi:not(.pg-l-slider) { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; }
.pg-sahne.pg-l-thumbs-bottom { grid-template-columns: minmax(0, 1fr) !important; }
.pg-sahne.pg-l-thumbs-bottom .pg-rail { order: 2; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pg-rail { position: relative; display: flex; flex-direction: column; gap: 10px; }
.pg-rail button { position: relative; flex: none; width: 76px; aspect-ratio: var(--pi-thumb-ratio, 4 / 5); padding: 0; border: 0; border-radius: var(--r-sm, 10px); overflow: hidden; background: var(--pg-bg); cursor: pointer; opacity: .55; transition: opacity .25s, transform .25s var(--pg-ease); }
.pg-rail button:hover { opacity: .9; transform: translateX(3px); }
.pg-l-thumbs-bottom .pg-rail button:hover { transform: translateY(-2px); }
.pg-rail button.on { opacity: 1; }
.pg-rail img { width: 100%; height: 100%; object-fit: var(--pi-thumb-fit, cover); display: block; }
.pg-ind { position: absolute; left: 0; top: 0; width: 76px; aspect-ratio: var(--pi-thumb-ratio, 4 / 5); border: 2px solid var(--ink, #111318); border-radius: var(--r-sm, 10px); pointer-events: none; z-index: 2; transition: transform .45s var(--pg-ease); }
.pg-l-thumbs-bottom .pg-ind { top: 2px; left: 2px; }
.pg-stage { position: relative; border-radius: var(--pg-r); overflow: hidden; background: var(--pg-bg); }
.pg-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: var(--pg-ratio); cursor: zoom-in; outline: 0; }
.pg-track::-webkit-scrollbar { display: none; }
.pg-stage:has(.pg-track:focus-visible) { outline: 3px solid var(--ink, #111318); outline-offset: 2px; }
.pg-s { flex: 0 0 100%; margin: 0; scroll-snap-align: center; overflow: hidden; position: relative; }
.pg-s img { width: 100%; height: 100%; object-fit: var(--pg-fit); display: block; will-change: transform; transition: transform .5s var(--pg-ease); }
.pg-s.zoom img { transition: transform .25s ease-out; }
.pg-nav { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 46px; height: 46px; margin-top: -23px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .94); color: #111318; cursor: pointer; box-shadow: 0 6px 20px rgb(0 0 0 / .14); opacity: 0; transition: opacity .25s, transform .25s var(--pg-ease), background .2s; }
.pg-nav svg { width: 20px; height: 20px; }
.pg-nav:hover { background: #fff; }
.pg-prev { left: 14px; transform: translateX(-10px); }
.pg-next { right: 14px; transform: translateX(10px); }
.pg-stage:hover .pg-nav, .pg-stage:focus-within .pg-nav { opacity: 1; transform: none; }
.pg-nav:disabled { opacity: 0 !important; pointer-events: none; }
.pg-prog { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 3; display: flex; gap: 6px; pointer-events: none; }
.pg-prog i { flex: 1; height: 3px; border-radius: 3px; background: rgb(17 19 24 / .14); overflow: hidden; }
.pg-prog i::after { content: ""; display: block; height: 100%; width: var(--f, 0%); background: rgb(17 19 24 / .85); transition: width .3s var(--pg-ease); }
.pg-hint { position: absolute; right: 14px; top: 14px; z-index: 3; padding: 6px 10px; border-radius: 999px; background: rgb(17 19 24 / .72); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }
.pg-stage:hover .pg-hint { opacity: 1; transform: none; }
.pg-stage.zooming .pg-hint { opacity: 0; }
.pg .rz-slot.rz-lg { animation: pg-pop .7s var(--pg-ease) both .2s; }
@keyframes pg-pop { from { opacity: 0; transform: scale(.4) rotate(-20deg); } to { opacity: 1; transform: none; } }

/* ---------- Mozaik ---------- */
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-t { position: relative; display: block; padding: 0; border: 0; border-radius: var(--pg-r); overflow: hidden; background: var(--pg-bg); cursor: zoom-in; aspect-ratio: var(--pg-ratio); opacity: 0; transform: translateY(24px) scale(.98); transition: opacity .6s var(--pg-ease) calc(var(--i) * 90ms), transform .7s var(--pg-ease) calc(var(--i) * 90ms), filter .3s; }
.pg-t:first-child { grid-column: 1 / -1; aspect-ratio: 5 / 4; }
.pg-t:only-child { aspect-ratio: var(--pg-ratio); }
.pg-grid.in .pg-t { opacity: 1; transform: none; }
.pg-t > img { width: 100%; height: 100%; object-fit: var(--pg-fit); display: block; transition: transform .8s var(--pg-ease); }
.pg-t:hover > img { transform: scale(1.06); }
.pg-grid:hover .pg-t:not(:hover) { filter: saturate(.75) brightness(.97); }
.pg-t:focus-visible { outline: 3px solid var(--ink, #111318); outline-offset: 2px; }

/* ---------- 3D vitrin ---------- */
.pg-3d { position: relative; overflow: hidden; border-radius: var(--pg-r); padding-top: 12px; background: radial-gradient(70% 60% at 50% 42%, var(--pg-bg), transparent); }
.pg-3d > .pg-badges { left: 16px; top: 16px; }
.pg-3d-stage { position: relative; aspect-ratio: 1 / .86; max-height: 600px; perspective: 1400px; touch-action: pan-y; user-select: none; cursor: grab; outline: 0; }
.pg-3d-stage.drag { cursor: grabbing; }
.pg-3d-stage::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: 3%; height: 34px; border-radius: 50%; background: radial-gradient(rgb(0 0 0 / .16), transparent 70%); pointer-events: none; }
.pg-card { --w: min(64%, 440px); position: absolute; left: 50%; top: 0; width: var(--w); aspect-ratio: var(--pg-ratio); margin-left: calc(var(--w) / -2); padding: 0; border: 0; border-radius: var(--pg-r); overflow: hidden; background: var(--pg-bg); cursor: pointer; box-shadow: 0 30px 60px -24px rgb(0 0 0 / .35); transition: transform .65s var(--pg-ease), opacity .5s, filter .5s; }
.pg-3d-stage.drag .pg-card { transition: none; }
.pg-card img { width: 100%; height: 100%; object-fit: var(--pg-fit); display: block; pointer-events: none; }
.pg-dots { display: flex; justify-content: center; gap: 2px; }
.pg-dots button { width: 36px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.pg-dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--line, #dfe2e7); transition: width .35s var(--pg-ease), background .35s; }
.pg-dots button.on i { width: 26px; background: var(--ink, #111318); }

/* ---------- Tam ekran ---------- */
html.pg-lock { overflow: hidden; }
.pg-lb { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; }
.pg-lb-bg { position: absolute; inset: 0; background: #0b0c10; opacity: 0; transition: opacity .4s ease; }
.pg-lb.in .pg-lb-bg { opacity: .94; }
.pg-lb-top, .pg-lb-thumbs { position: relative; }
.pg-lb-top, .pg-lb-thumbs, .pg-lb-nav { opacity: 0; transition: opacity .3s ease .15s; }
.pg-lb.in .pg-lb-top, .pg-lb.in .pg-lb-thumbs, .pg-lb.in .pg-lb-nav { opacity: 1; }
.pg-lb.out .pg-lb-top, .pg-lb.out .pg-lb-thumbs, .pg-lb.out .pg-lb-nav { opacity: 0; transition-delay: 0s; }
.pg-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; }
.pg-lb-top span { font-size: 13px; color: rgb(255 255 255 / .72); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-lb-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; }
.pg-lb-x svg { width: 20px; height: 20px; }
.pg-lb-track { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pg-lb-track::-webkit-scrollbar { display: none; }
.pg-lb-s { flex: 0 0 100%; display: grid; place-items: center; padding: 6px 76px; scroll-snap-align: center; }
.pg-lb-s img { max-width: 100%; max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); border-radius: 14px; box-shadow: 0 30px 80px rgb(0 0 0 / .5); background: #fff; }
.pg-lb-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -26px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; cursor: pointer; }
.pg-lb-nav svg { width: 22px; height: 22px; }
.pg-lb-nav:hover { background: rgb(255 255 255 / .24); }
.pg-lb-prev { left: 16px; } .pg-lb-next { right: 16px; }
.pg-lb-thumbs { display: flex; justify-content: center; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-x: auto; }
.pg-lb-thumbs button { flex: none; width: 52px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; opacity: .5; cursor: pointer; background: #fff; transition: opacity .2s, border-color .2s; }
.pg-lb-thumbs button.on { opacity: 1; border-color: #fff; }
.pg-lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-fly { position: fixed; z-index: 1001; object-fit: cover; pointer-events: none; transition: left .55s var(--pg-ease, ease), top .55s var(--pg-ease, ease), width .55s var(--pg-ease, ease), height .55s var(--pg-ease, ease), border-radius .55s; }

@media (max-width: 900px) {
  .pg-sahne.pg-multi:not(.pg-l-slider) { grid-template-columns: minmax(0, 1fr); }
  .pg-sahne .pg-rail { order: 2; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 2px; }
  .pg-sahne .pg-rail button { width: 64px; }
  .pg-sahne .pg-ind { width: 64px; top: 2px; left: 2px; }
  .pg-rail button:hover { transform: none; }
}
@media (max-width: 600px) {
  .pg-nav, .pg-hint { display: none; }
  .pg-grid { gap: 6px; }
  .pg-card { --w: 72%; }
  .pg-lb-s { padding: 6px 10px; }
  .pg-lb-nav { display: none; }
}
@media (hover: none) { .pg-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .pg *, .pg-lb, .pg-lb * { transition-duration: 0s !important; animation: none !important; } }
