/* Revive product media gallery — images + description videos in one slider.
   Loaded only on the product template. Colours follow the per-product theme vars (--pp-*). */

.pp-gal { display: block; width: 100%; }

/* ---------- stage ---------- */
.pp-gal-stage {
  position: relative; overflow: hidden; outline: none;
  aspect-ratio: var(--product-page-image-aspect-ratio, 16/9);
  border-radius: 20px; border: 1px solid transparent;
  background:
    linear-gradient(#0b0a12, #0b0a12) padding-box,
    linear-gradient(135deg, rgba(var(--pp-rgb2),.7), rgba(255,255,255,.07) 40%, rgba(var(--pp-rgb3),.7)) border-box;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8);
  touch-action: pan-y;
}
.pp-gal-stage:focus-visible { box-shadow: 0 0 0 2px var(--pp-a), 0 40px 90px -30px rgba(0,0,0,.8); }
.pp-gal-slides { position: absolute; inset: 0; }
.pp-gal-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .45s var(--pp-ease, ease), visibility 0s linear .45s;
}
.pp-gal-slide.is-active { opacity: 1; visibility: visible; transition-delay: 0s; z-index: 1; }
.pp-gal-slide > img { width: 100%; height: 100%; object-fit: var(--product-image-fit, cover); display: block; user-select: none; }
.pp-gal-slide[data-type="image"] > img { transition: transform .8s var(--pp-ease, ease); }
.pp-gal:hover .pp-gal-slide[data-type="image"].is-active > img { transform: scale(1.02); }

/* ---------- arrows + counter ---------- */
.pp-gal-arrow {
  position: absolute; top: 50%; z-index: 4; width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0;
  background: rgba(10,8,16,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--pp-line, rgba(255,255,255,.1)); border-radius: 999px;
  opacity: .0; transition: opacity .25s, background .25s, transform .25s;
}
.pp-gal-arrow svg { width: 18px; height: 18px; }
.pp-gal-prev { left: 14px; } .pp-gal-next { right: 14px; }
.pp-gal-stage:hover .pp-gal-arrow, .pp-gal-stage:focus-within .pp-gal-arrow { opacity: 1; }
.pp-gal-arrow:hover { background: var(--pp-a); transform: scale(1.06); }
.pp-gal-arrow:focus-visible { opacity: 1; outline: 2px solid var(--pp-soft); outline-offset: 2px; }
@media (hover: none) { .pp-gal-arrow { opacity: .85; width: 36px; height: 36px; margin-top: -18px; } }

.pp-gal-count {
  position: absolute; top: 14px; right: 14px; z-index: 4; pointer-events: none;
  padding: 6px 11px; border-radius: 9px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #fff;
  background: rgba(10,8,16,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--pp-line, rgba(255,255,255,.1));
}

/* single item → no controls */
.pp-gal[data-count="0"] .pp-gal-arrow, .pp-gal[data-count="1"] .pp-gal-arrow,
.pp-gal[data-count="0"] .pp-gal-count, .pp-gal[data-count="1"] .pp-gal-count,
.pp-gal[data-count="0"] .pp-gal-thumbs, .pp-gal[data-count="1"] .pp-gal-thumbs { display: none; }

/* ---------- video slides ---------- */
.pp-gal-slide[data-type="video"] { background: #07060c; }
.pp-gal-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 50% 40%, rgba(var(--pp-rgb),.25), #07060c 70%);
}
.pp-gal-poster > img, .pp-gal-poster > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--pp-ease, ease), filter .3s; }
.pp-gal-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45)); transition: opacity .3s; }
.pp-gal-poster:hover > img, .pp-gal-poster:hover > video { transform: scale(1.03); }
.pp-gal-poster:focus-visible { outline: 2px solid var(--pp-soft); outline-offset: -4px; }
.pp-gal-play {
  position: relative; z-index: 2; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(var(--pp-rgb), .92); box-shadow: 0 0 0 8px rgba(var(--pp-rgb), .22), 0 18px 50px rgba(var(--pp-rgb), .55);
  transition: transform .3s var(--pp-ease, ease), box-shadow .3s;
}
.pp-gal-play svg { width: 28px; height: 28px; margin-left: 4px; fill: #fff; }
.pp-gal-poster:hover .pp-gal-play { transform: scale(1.1); box-shadow: 0 0 0 12px rgba(var(--pp-rgb), .2), 0 22px 60px rgba(var(--pp-rgb), .65); }
.pp-gal-label {
  position: absolute; z-index: 2; left: 14px; bottom: 14px; padding: 5px 10px; border-radius: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff;
  background: rgba(10,8,16,.7); border: 1px solid var(--pp-line, rgba(255,255,255,.1)); backdrop-filter: blur(8px);
}
.pp-gal-slide iframe, .pp-gal-slide > video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* ---------- thumbnail strip ---------- */
.pp-gal-thumbs {
  display: flex; gap: 10px; margin-top: 12px; padding: 4px 2px 8px; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: rgba(var(--pp-rgb),.5) transparent;
}
.pp-gal-thumbs::-webkit-scrollbar { height: 5px; }
.pp-gal-thumbs::-webkit-scrollbar-thumb { background: rgba(var(--pp-rgb),.5); border-radius: 99px; }
.pp-gal-thumb {
  position: relative; flex: 0 0 auto; width: 128px; aspect-ratio: 16/9; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--pp-line, rgba(255,255,255,.1)); background: #0b0a12; opacity: .6;
  transition: opacity .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.pp-gal-thumb > img, .pp-gal-thumb > video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pp-gal-thumb:hover { opacity: .95; transform: translateY(-2px); }
.pp-gal-thumb.is-active { opacity: 1; border-color: var(--pp-a); box-shadow: 0 0 0 1px var(--pp-a), 0 8px 24px rgba(var(--pp-rgb), .35); }
.pp-gal-thumb:focus-visible { outline: 2px solid var(--pp-soft); outline-offset: 2px; }
.pp-gal-thumb[data-type="video"]::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.pp-gal-thumb-play {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(var(--pp-rgb), .92); box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.pp-gal-thumb-play svg { width: 12px; height: 12px; margin-left: 2px; fill: #fff; }
.pp-gal-thumb-generic { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle at 50% 40%, rgba(var(--pp-rgb),.3), #0b0a12 75%); }

@media (max-width: 767px) {
  .pp-gal-stage { border-radius: 16px; }
  .pp-gal-thumb { width: 96px; border-radius: 10px; }
  .pp-gal-play { width: 58px; height: 58px; }
  .pp-gal-play svg { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-gal-slide, .pp-gal-slide > img, .pp-gal-thumb, .pp-gal-poster > img { transition: none !important; }
}
.pp-gal-poster[hidden]{display:none}
