/* Галерея фото готелю (assets/otpusk/gallery.js): слайдер з мініатюрами + повноекранний перегляд зі збільшенням */

/* ---------- Слайдер у вкладці «Фото» ---------- */
.otp-gallery { --gallery-h: min(62vh, 560px); }
.otp-gallery__stage { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--brand-navy); }
.otp-gallery__main { height: var(--gallery-h); }
.otp-gallery__main .swiper-slide { display: flex; align-items: center; justify-content: center; }
.otp-gallery__open {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.otp-gallery__open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.otp-gallery__open:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: -3px; }

.otp-gallery__arrow, .otp-lb__arrow {
  position: absolute; top: 50%; z-index: 5; width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--brand-navy); font-size: 1.25rem;
  box-shadow: var(--shadow-float); transition: background .2s var(--ease), color .2s var(--ease), opacity .2s;
}
.otp-gallery__arrow:hover, .otp-lb__arrow:hover { background: var(--brand-orange); color: #fff; }
.otp-gallery__arrow--prev, .otp-lb__arrow--prev { left: 16px; }
.otp-gallery__arrow--next, .otp-lb__arrow--next { right: 16px; }
.otp-gallery__arrow.swiper-button-disabled, .otp-lb__arrow.swiper-button-disabled { opacity: 0; pointer-events: none; }

.otp-gallery__counter, .otp-gallery__fs {
  position: absolute; bottom: 14px; z-index: 5; padding: 6px 12px; border-radius: 999px;
  background: rgba(8, 24, 45, .72); color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.3;
  backdrop-filter: blur(4px);
}
.otp-gallery__counter { left: 14px; font-variant-numeric: tabular-nums; pointer-events: none; }
.otp-gallery__fs { right: 14px; display: inline-flex; align-items: center; gap: 6px; border: 0; transition: background .2s var(--ease); }
.otp-gallery__fs:hover { background: var(--brand-orange); }

/* Мініатюри */
.otp-gallery__thumbs { margin-top: 10px; }
.otp-gallery__thumbs .swiper-slide {
  width: 120px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  opacity: .55; outline: 3px solid transparent; outline-offset: -3px; transition: opacity .2s var(--ease), outline-color .2s var(--ease);
}
.otp-gallery__thumbs .swiper-slide:hover { opacity: .85; }
.otp-gallery__thumbs .swiper-slide-thumb-active { opacity: 1; outline-color: var(--brand-orange); }
.otp-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Фото в шапці туру відкриває повноекранний перегляд */
.otp-tour .tour-head__zoom {
  position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: var(--radius); overflow: hidden; cursor: zoom-in;
}
.otp-tour .tour-head__zoom img { display: block; transition: transform .5s var(--ease); }
.otp-tour .tour-head__zoom:hover img { transform: scale(1.05); }
.otp-tour .tour-head__zoom:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.otp-tour .tour-head__count {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; background: rgba(8, 24, 45, .72); color: #fff; font-size: .8rem; font-weight: 600;
}

@media (max-width: 767.98px) {
  .otp-gallery { --gallery-h: 62vw; }
  .otp-gallery__arrow { width: 38px; height: 38px; margin-top: -19px; font-size: 1rem; }
  .otp-gallery__arrow--prev { left: 8px; }
  .otp-gallery__arrow--next { right: 8px; }
  .otp-gallery__fs span { display: none; }   /* на телефоні — лише іконка */
  .otp-gallery__fs { padding: 7px 10px; }
  .otp-gallery__thumbs .swiper-slide { width: 84px; }
  .otp-tour .tour-head__zoom { width: 100%; }
  .otp-tour .tour-head__zoom img { width: 100%; }
}

/* ---------- Повноекранний перегляд ---------- */
html.otp-lb-open { overflow: hidden; }
.otp-lb {
  position: fixed; inset: 0; z-index: 2100; display: none; flex-direction: column;
  background: rgba(6, 16, 30, .96); color: #fff;
}
.otp-lb.is-open { display: flex; }
.otp-lb__top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex: none; }
.otp-lb__counter { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; }
.otp-lb__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .75); font-size: .95rem; }
.otp-lb__btn {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.2rem; transition: background .2s var(--ease);
}
.otp-lb__btn:hover { background: var(--brand-orange); }
.otp-lb__btn:focus-visible, .otp-lb__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.otp-lb__swiper { flex: 1 1 auto; width: 100%; min-height: 0; }
.otp-lb__swiper .swiper-slide { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.otp-lb__swiper .swiper-zoom-container > img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.otp-lb.is-zoomed .swiper-zoom-container { cursor: grab; }
.otp-lb__hint { flex: none; margin: 0; padding: 10px 16px 14px; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .55); }
.otp-lb.is-zoomed .otp-lb__hint { visibility: hidden; }

@media (max-width: 767.98px) {
  .otp-lb__arrow { display: none; }   /* на телефоні гортаємо свайпом */
  .otp-lb__top { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .otp-gallery__open img, .otp-tour .tour-head__zoom img { transition: none; }
}
