.container {
  max-width: 1400px;
  padding: 0 15px;
  margin: 0 auto;
}
.lock {
  overflow: hidden;
}

.gallery__tabs-items {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}
.gallery__tabs-item {
  display: block;
  color: #364153;
  background: #fff;
  border: 1px solid transparent;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
}
.gallery__tabs-item[aria-selected="true"] {
  border-color: #364153;
}

.gallery__tabs-body {
  padding: 32px 0;
}

.gallery__tab {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery__tab.active {
  display: grid;
}

.gallery__tab-img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
}

/* ----- модалка ----- */
.gallery-dialog:not([open]) {
  display: none;
}
.gallery-dialog[open] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  z-index: 9999;
}

/* відключаємо нативний бекдроп (на деяких мобілах некоректний) */
.gallery-dialog::backdrop {
  background: transparent;
}

/* власний бекдроп, по якому теж закриваємо */
.gallery-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 12, 16, 0.86);
}

/* кнопка закриття — завжди поверх */
.gallery-dialog__close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
}

.gallery-swiper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 10000;
}
.gallery-swiper .swiper-wrapper {
  align-items: center;
}
.gallery-swiper .swiper-slide {
  width: auto;
  max-width: 95vw;
}
.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.swiper-slide img {
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}

@media (max-width: 1000px) {
  .gallery__tab {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .gallery__tab {
    grid-template-columns: 1fr;
  }
  .swiper-slide img {
    max-width: 96vw;
    max-height: calc(100vh - 70px);
  }
}

@media (min-width: 1400px) {
  .container {
    padding: 0;
  }
}
