:root {
  --yellow: #eab308;
  --yellow-dark: #ca8a04;
  --black: #000;
  --white: #fff;
}

/* ===== BASE ===== */

.gallery { width: 100%; }

.slideshow-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.slideshow {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;

  touch-action: pan-y;              /* ✅ ДОБАВЛЕНО (safe) */
}

/* ===== SLIDES ===== */

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}

.slide.active { opacity: 1; }

/* ===== NAV BUTTONS ===== */

.slide-btn {
  position: absolute;
  top: auto;
  bottom: 5px;
  transform: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: 2px solid var(--yellow-dark);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.prev-btn { left: 5px; }
.next-btn { right: 5px; }

/* tap flash */
.slide-btn.tap {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
  transform: translateY(-50%) scale(.92);
}

/* hover only mouse */
@media (hover:hover) and (pointer:fine) {
  .slide-btn:hover {
    background: var(--yellow);
    color: #000;
    border-color: var(--yellow);
  }
}

/* ===== SLIDE COUNTER ===== */

.slide-indicators {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
}

.slide-counter {
  color: var(--yellow);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .04em;

  font-variant-numeric: tabular-nums;
  user-select: none;
  white-space: nowrap;

  padding: 2px 10px;

  border: 1px solid var(--yellow);
  border-radius: 7px;

  background: rgba(0, 0, 0, 0.45);

  box-sizing: border-box;
}

.gallery-title {
  text-align: center;
  color: var(--yellow);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ===== FULLSCREEN (IMAGE + VIDEO BASE) ===== */

.fullscreen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.fullscreen-modal.active { display: flex; }

.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  border: 2px solid var(--yellow);
  color: #fff;
  font-size: 22px;
}

/* ===== FULLSCREEN IMAGE ===== */

.fs-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fs-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fsImage {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 16px;
  display: block;
}

/* arrows */
.fs-stage .slide-btn {
  position: absolute;
  top: auto;
  bottom: 5px;
  transform: none;
  z-index: 10;
}

.fs-stage .prev-btn { left: 5px; }
.fs-stage .next-btn { right: 5px; }

/* caption */
.fs-caption {
  margin-top: 14px;
  min-height: 22px;
  text-align: center;
  color: var(--yellow);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ===== FULLSCREEN INDICATORS ===== */

.fs-indicators {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 15;
  pointer-events: auto;
}

/* ===== UX ===== */

.gallery img,
#fsImage {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* ===== BUTTON FEEDBACK ===== */

.slide-btn,
.close-btn {
  transition:
    transform 0.15s ease,
    filter 0.12s ease,
    opacity 0.12s ease;
  will-change: transform;
}

@media (hover:hover) and (pointer:fine) {
  .slide-btn:hover {
    transform: scale(1.08);
  }

  .close-btn:hover {
    transform: scale(1.08);
  }
}

.slide-btn:active {
  transform: scale(1);
  filter: brightness(0.8);
  opacity: 0.9;
}

.close-btn:active {
  transform: scale(1);
  filter: brightness(0.8);
  opacity: 0.9;
}

.slide-btn:focus,
.close-btn:focus {
  outline: none;
}

/* ===== VIDEO FULLSCREEN ===== */

#videoFullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.95);
}

#videoFullscreen.active {
  display: flex;
}

#videoFullscreen .fs-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#videoFullscreen .fs-stage {
  position: relative;
  width: 100%;
  max-height: 85vh;
  padding-left: 5px;
  padding-right: 5px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

#videoFullscreen video {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
}

#videoFullscreen .fs-caption {
  margin-top: 14px;
  padding: 0 16px;
  text-align: center;
  color: var(--yellow);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}

#videoFullscreen .close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
}

/* ===== VIDEO GALLERY ===== */

.video-gallery .slideshow-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.video-gallery .slideshow {
  width: 100%;
  height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000;

  touch-action: pan-y;          /* ✅ ДОБАВЛЕНО */
}

.video-gallery video.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  touch-action: pan-y;          /* ✅ Huawei fix */
}

/* ======================================================
   VIDEO INTERACTION SAFETY
====================================================== */

video {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ======================================================
   ✨ FIX: ARROWS ALWAYS ABOVE VIDEO
====================================================== */

.video-gallery .slide-btn {
  z-index: 10;
}

/* ======================================================
   ✨ FINAL FIX: INDICATORS ALWAYS ABOVE VIDEO
====================================================== */

.video-gallery .slide-indicators {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateZ(0);

  z-index: 2000;
  pointer-events: auto;
}

.video-gallery .indicator {
  position: relative;
}

/* ======================================================
   ✨ HUAWEI GPU STABILIZER (SAFE ADD-ON)
====================================================== */

.video-gallery .slide-indicators {
  transform: translateX(-50%) translateZ(0);
  backface-visibility: hidden;
}

.video-gallery video.slide {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ======================================================
   ✨ HUAWEI VIDEO COMPOSITING FIX (SAFE)
====================================================== */

.video-gallery {
  transform: translateZ(0);
}

/* ======================================================
   ✨ VIDEO UI LAYER FIX (Huawei-safe)
====================================================== */

.video-gallery .slide-indicators {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateZ(0);

  z-index: 2000;          /* выше video surface */
  pointer-events: auto;
}

/* ======================================================
   ✨ VIDEO DISSOLVE (NO BLACK, MOBILE SAFE)
====================================================== */

.video-gallery .slideshow.fading video.slide.active {
  filter: brightness(1.15);
  transition: filter 0.35s ease;
}

.video-gallery .slideshow.fading video.slide:not(.active) {
  filter: brightness(0.85);
  transition: filter 0.35s ease;
}

/* ======================================================
   3D VIEWER
====================================================== */

.viewer3d {
  position: relative;
  width: 100%;
  height: 0;

  /* Пропорция окна (как у галерей через ratio) */
  padding-bottom: 55%;

  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* Canvas внутри */
.viewer3d canvas {
  cursor: grab;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.viewer3d {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;   /* 🔥 ключевой фикс */
  background: #000;
}

.viewer3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* END FILE */







