/* lightbox */
.custom-lightbox {
  display: none;
  position: fixed;
  top: env(safe-area-inset-top, 0);
  right: env(safe-area-inset-right, 0);
  bottom: env(safe-area-inset-bottom, 0);
  left: env(safe-area-inset-left, 0);
  width: calc(100% - env(safe-area-inset-left, 0) - env(safe-area-inset-right, 0));
  height: calc(100% - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.custom-lightbox.active {
  display: flex;
  opacity: 1;
}
.custom-lightbox-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-lightbox-zoom-wrapper {
  position: relative;
  display: flex;
  cursor: grab;
  transform: scale(1.25);
  transform-origin: center center;
  transition: transform 0.3s ease;
}
.custom-lightbox-zoom-wrapper:active {
  cursor: grabbing;
}
.custom-lightbox-pan-wrapper {
  transform: translate(0px, 0px);
  transition: transform 0.3s ease;
}
.custom-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  will-change: opacity;
}
.custom-lightbox-img.loaded {
  opacity: 1;
}
.custom-lightbox-controls,
.custom-lightbox-close-wrapper {
  position: absolute;
  right: -50px;
  z-index: 10;
}
.custom-lightbox-controls {
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.custom-lightbox-close-wrapper {
  top: calc(5% - 60px);
}
.custom-lightbox-btn {
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.custom-lightbox-btn:hover {
  background: #af0b0b;
}
.custom-lightbox-btn svg {
  width: 20px;
  height: 20px;
  stroke: #000;
  fill: none;
  transition: transform 0.2s ease;
  will-change: transform;
}
.custom-lightbox-btn:hover svg {
  transform: scale(1.1);
  stroke: #fff;
}

/* --- Lightbox buttons sizing & centering (fix) --- */
.custom-lightbox-btn{
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;             /* без влияния шрифта */
  background: #fff;
  cursor: pointer;
}

.custom-lightbox-btn svg{
  width: 22px !important;     /* внутри кружка */
  height: 22px !important;
  display: block;
}

.custom-lightbox-btn svg path{
  stroke: #1d1d1d;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.custom-lightbox-btn:hover{
  background: #af0b0b;
}
.custom-lightbox-btn:hover svg path{
  stroke: #fff;
}

