/* ===== BIRGUS GALLERY ===== */

/* Hide raw images before JS initializes */
[data-birgus-gallery]:not(.birgus-gallery) {
  min-height: 200px;
  background: #f5f5f5;
  border-radius: 8px;
}

[data-birgus-gallery]:not(.birgus-gallery) > * {
  display: none;
}

.birgus-gallery {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  user-select: none;
}

/* Main image container */
.birgus-gallery__main {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 500px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 8px;
}

.birgus-gallery__slides {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.birgus-gallery__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.birgus-gallery__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Navigation arrows */
.birgus-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.birgus-gallery__nav:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.birgus-gallery__nav--prev {
  left: 12px;
}

.birgus-gallery__nav--next {
  right: 12px;
}

.birgus-gallery__nav svg {
  width: 24px;
  height: 24px;
  fill: #333;
}

/* Counter */
.birgus-gallery__counter {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
}

/* Fullscreen button */
.birgus-gallery__fullscreen {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

.birgus-gallery__fullscreen:hover {
  background: rgba(0, 0, 0, 0.8);
}

.birgus-gallery__fullscreen svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* Thumbnails */
.birgus-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 4px 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.birgus-gallery__thumbs::-webkit-scrollbar {
  height: 6px;
}

.birgus-gallery__thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.birgus-gallery__thumbs::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.birgus-gallery__thumb {
  flex: 0 0 auto;
  width: 80px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.birgus-gallery__thumb:hover {
  opacity: 0.8;
}

.birgus-gallery__thumb--active {
  opacity: 1;
  border-color: #24c0d9;
}

.birgus-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== FULLSCREEN LIGHTBOX ===== */
.birgus-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.birgus-lightbox--open {
  opacity: 1;
  visibility: visible;
}

.birgus-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

.birgus-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.birgus-lightbox__close svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.birgus-lightbox__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  position: relative;
}

.birgus-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.birgus-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.birgus-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.birgus-lightbox__nav--prev {
  left: 20px;
}

.birgus-lightbox__nav--next {
  right: 20px;
}

.birgus-lightbox__nav svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.birgus-lightbox__counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.birgus-lightbox__thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  overflow-x: auto;
}

.birgus-lightbox__thumb {
  flex: 0 0 auto;
  width: 70px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.birgus-lightbox__thumb:hover {
  opacity: 0.7;
}

.birgus-lightbox__thumb--active {
  opacity: 1;
  border-color: #fff;
}

.birgus-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .birgus-gallery__nav {
    width: 40px;
    height: 40px;
  }

  .birgus-gallery__nav--prev {
    left: 8px;
  }

  .birgus-gallery__nav--next {
    right: 8px;
  }

  .birgus-gallery__nav svg {
    width: 20px;
    height: 20px;
  }

  .birgus-gallery__thumb {
    width: 60px;
    height: 45px;
  }

  .birgus-lightbox__main {
    padding: 60px 20px;
  }

  .birgus-lightbox__nav {
    width: 44px;
    height: 44px;
  }

  .birgus-lightbox__nav--prev {
    left: 8px;
  }

  .birgus-lightbox__nav--next {
    right: 8px;
  }
}
