/* ===== Root ===== */
:root {
  --dark: rgb(48, 55, 62);
  --galery-button: rgba(237, 237, 237, 0.9);
}

/* ===== Lightbox ===== */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.gallery-lightbox.active,
.gallery-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  z-index: 100;
}

.lightbox-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--galery-button);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  user-select: none;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.lightbox-button {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--galery-button);
  cursor: pointer;
  font-family: Arial, sans-serif;
  transition: color 0.3s ease;
}

.lightbox-button span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-button:hover {
  color: #fff;
}

.icon-fullscreen {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.icon-zoom {
  display: block;
  font-size: 30px;
  line-height: 1;
  transform: rotate(-20deg);
}

.lightbox-arrow-dropdown {
  position: absolute;
  width: 200px;
  top: 50px;
  right: 45px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;

  z-index: 1000;
}

.lightbox-arrow-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 18px;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
  z-index: -1;
}

.lightbox-arrow-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.arrow-dropdown-list {
  padding: 20px;
  margin: 0;
  list-style: none;
}

.arrow-dropdown-list li:not(:last-child) {
  margin-bottom: 1rem;
}

.dropdown-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dark);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.dropdown-contact img {
  width: 16px;
  height: 16px;
}

.gallery-lightbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.gallery-lightbox.dropdown-open::before {
  opacity: 1;
}

.lightbox-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
  z-index: 10;
  user-select: none;
  touch-action: pan-y;
}

.lightbox-content.is-dragging {
  cursor: grabbing;
}

.lightbox-content.is-dragging img {
  cursor: grabbing !important;
}

.lightbox-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: flex;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lightbox-track.is-dragging {
  transition: none;
}

.lightbox-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 70px 40px 30px;
}

.lightbox-slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 100px);
  object-fit: contain;
  margin: 0;
  padding: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.lightbox-slide img.zoomed {
  max-width: none;
  max-height: none;
  transform: scale(1.5);
  cursor: zoom-out;
}

/* Hide buttons */
.fade-object {
  pointer-events: auto;
  transition: color 0.5s ease;
}

.fade-object.is-hidden {
  color: transparent !important;
  pointer-events: none;
}

body.lightbox-open {
  overflow: hidden;
}
