/* Галерея */
.custom-gallery {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}
.custom-gallery-bg {
  position: absolute;
  inset: 0;
  background-image: var(--bg-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.6);
  z-index: 0;
  transition: background-image 0.5s ease;
}
.custom-gallery-main {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
}
.custom-slide {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
}
.custom-slide.active {
  display: flex;
}
.custom-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Зоны клика (стрелки + центр) */
.click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  pointer-events: auto;
}
.click-zone-left {
  left: 0;
}
.click-zone-right {
  right: 0;
}
.click-zone:hover {
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.click-zone-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10%;
  right: 10%;
  z-index: 4;
  cursor: zoom-in;
  background: rgba(255, 0, 0, 0); /* можно убрать */
  pointer-events: auto;
}

.custom-slider-arrow {
  width: 40px;
  height: 40px;
  opacity: 0.8;
}

/* Превьюшки снизу */
.custom-gallery-thumbs {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;  
  gap: 8px;      
  overflow-y: auto;
  width: 100%; 

}
.custom-thumb {
  width: 80px;           /* или 100px, подбирайте под себя */
  height: 80px;          /* или чуть больше, чтобы не обрезать содержимое */
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  /* Чтобы картинка занимала всё пространство, но не «выползала» */
  object-fit: cover;     /* если надо обрезать, или contain – если вписывать */
  flex-shrink: 0;        /* чтобы миниатюры не сжимались сами */
}
.custom-thumb.active {
  border-color: #00adee;
}
.custom-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.custom-gallery-wrapper {
  position: relative;
  width: 100%;       /* ограничиваем общую ширину */
  margin: 0 auto;   /* центрируем */
}

.custom-gallery-wrapper.archived-ad img,
.custom-gallery-wrapper.archived-ad .custom-gallery-bg {
  filter: grayscale(100%);
  opacity: 0.6;
}

/* Серый полупрозрачный фон поверх фотографий, если объявление снято с продажи */
.custom-gallery-wrapper.archived-ad::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(128, 128, 128, 0.5);
  z-index: 2;
}