.property-gallery-section {
  position: relative;
  z-index: 2;
  margin: 0 0 12px;
  padding-top: 12px;
}

.single-property .property-gallery-section + .section-detail-content {
  padding-top: 10px;
}

.property-gallery,
.property-gallery * {
  box-sizing: border-box;
}

.property-gallery__layout {
  display: flex;
  gap: 9px;
  width: 100%;
  height: 540px;
}

.property-gallery__stage,
.property-gallery__preview {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #e8ebee;
}

.property-gallery__stage {
  flex: 1 1 auto;
  min-width: 0;
  touch-action: pan-y;
}

.property-gallery__main {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.property-gallery__main-image,
.property-gallery__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-gallery__main-image {
  position: absolute;
  inset: 0;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: none;
  will-change: transform;
}

.property-gallery__previews {
  display: grid;
  flex: 0 0 21%;
  gap: 7px;
  min-width: 190px;
}

.property-gallery--previews-1 .property-gallery__previews {
  grid-template-rows: 1fr;
}

.property-gallery--previews-2 .property-gallery__previews {
  grid-template-rows: repeat(2, 1fr);
}

.property-gallery--previews-3 .property-gallery__previews {
  grid-template-rows: repeat(3, 1fr);
}

.property-gallery__preview {
  display: block;
  min-height: 0;
  cursor: zoom-in;
}

.property-gallery__preview img {
  transition: transform 350ms ease, filter 250ms ease;
}

.property-gallery__preview.is-loading img {
  filter: brightness(0.62);
}

.property-gallery__preview:hover img,
.property-gallery__preview:focus img {
  transform: scale(1.045);
  filter: brightness(0.9);
}

.property-gallery__preview.is-active::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: inherit;
  pointer-events: none;
}

@keyframes property-gallery-spinner {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.property-gallery__stage.is-loading::after,
.property-gallery__preview.is-loading::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 3px solid rgba(31, 122, 56, 0.2);
  border-top-color: #1f7a38;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: property-gallery-spinner 720ms linear infinite;
}

.property-gallery__preview.is-loading::before {
  width: 28px;
  height: 28px;
}

.property-gallery-modal__image-wrap.is-loading::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: property-gallery-spinner 720ms linear infinite;
}

.property-gallery__arrow,
.property-gallery-modal__arrow,
.property-gallery-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: #222;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.property-gallery__arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.property-gallery__arrow:hover,
.property-gallery__arrow:focus {
  color: #fff;
  background: #35974e;
  transform: translateY(-50%) scale(1.06);
}

.property-gallery__arrow--prev {
  left: 14px;
}

.property-gallery__arrow--next {
  right: 14px;
}

.property-gallery__arrow svg,
.property-gallery-modal__arrow svg,
.property-gallery-modal__close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.property-gallery:not(.is-enhanced) .property-gallery__arrow,
.property-gallery:not(.is-enhanced) .property-gallery__dots {
  display: none;
}

.property-gallery__counter {
  position: absolute;
  z-index: 4;
  left: 18px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
  background: rgba(20, 22, 24, 0.72);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.property-gallery__counter svg,
.property-gallery__more svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.property-gallery__dots {
  position: absolute;
  z-index: 4;
  right: 92px;
  bottom: 24px;
  left: 92px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.property-gallery__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  transition: width 180ms ease, background-color 180ms ease;
}

.property-gallery__dot.is-active {
  width: 24px;
  border-radius: 8px;
  background: #fff;
}

.property-gallery__more {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  background: linear-gradient(180deg, rgba(10, 13, 15, 0.28), rgba(10, 13, 15, 0.7));
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.property-gallery__more-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 11px 7px 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  background: rgba(9, 12, 14, 0.7);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
}

.property-gallery__more-icon {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.property-gallery__more-icon svg {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.property-gallery__more-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.property-gallery__more strong {
  margin: 0;
  font-size: 17px;
  line-height: 18px;
  font-weight: 700;
}

.property-gallery__more-copy > span {
  font-size: 10px;
  line-height: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

body.property-gallery-modal-open {
  overflow: hidden;
}

.property-gallery-modal[hidden] {
  display: none !important;
}

.property-gallery-modal {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  padding: 26px 42px 20px;
  color: #fff;
  background: rgba(5, 7, 8, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.property-gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.property-gallery-modal__dialog {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  transform: scale(0.985);
  transition: transform 260ms ease;
}

.property-gallery-modal.is-open .property-gallery-modal__dialog {
  transform: scale(1);
}

.property-gallery-modal__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 18px 72px 12px;
  touch-action: pan-y;
}

.property-gallery-modal__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.property-gallery-modal__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: none;
  will-change: transform;
}

.property-gallery-modal__close {
  position: absolute;
  z-index: 7;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.property-gallery-modal__close:hover,
.property-gallery-modal__close:focus {
  color: #fff;
  background: #35974e;
  transform: rotate(5deg) scale(1.06);
}

.property-gallery-modal__arrow {
  position: absolute;
  z-index: 6;
  top: 44%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

.property-gallery-modal__arrow:hover,
.property-gallery-modal__arrow:focus {
  color: #fff;
  background: #35974e;
  transform: translateY(-50%) scale(1.06);
}

.property-gallery-modal__arrow--prev {
  left: 0;
}

.property-gallery-modal__arrow--next {
  right: 0;
}

.property-gallery-modal__footer {
  min-width: 0;
  padding-top: 8px;
}

.property-gallery-modal__counter {
  display: table;
  margin: 0 auto 10px;
  padding: 5px 12px;
  border-radius: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.property-gallery-modal__thumbs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 2px 8px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}

.property-gallery-modal__thumbs::before,
.property-gallery-modal__thumbs::after {
  content: "";
  flex: 1 0 0;
}

.property-gallery-modal__thumb {
  flex: 0 0 86px;
  width: 86px;
  height: 64px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #202326;
  opacity: 0.58;
  cursor: pointer;
  transition: opacity 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.property-gallery-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-gallery-modal__thumb:hover,
.property-gallery-modal__thumb:focus,
.property-gallery-modal__thumb.is-active {
  border-color: #fff;
  opacity: 1;
  transform: translateY(-2px);
}

.property-gallery a:focus-visible,
.property-gallery button:focus-visible,
.property-gallery-modal button:focus-visible {
  outline: 3px solid #f3c878;
  outline-offset: 2px;
}

@media (max-width: 1199px) {
  .property-gallery__layout {
    height: 500px;
  }
}

@media (max-width: 991px) {
  .property-gallery__layout {
    height: 430px;
  }

  .property-gallery__previews {
    flex-basis: 23%;
    min-width: 160px;
  }
}

@media (max-width: 767px) {
  .property-gallery-section {
    margin-bottom: 8px;
    padding-top: 8px;
  }

  .single-property .property-gallery-section + .section-detail-content {
    padding-top: 6px;
  }

  .property-gallery__layout {
    display: block;
    height: auto;
  }

  .property-gallery__stage {
    width: 100%;
    height: 72vw;
    min-height: 260px;
    max-height: 460px;
    border-radius: 10px;
  }

  .property-gallery__previews {
    width: 100%;
    min-width: 0;
    height: 110px;
    margin-top: 7px;
    grid-template-rows: 1fr !important;
  }

  .property-gallery--previews-1 .property-gallery__previews {
    grid-template-columns: 1fr;
  }

  .property-gallery--previews-2 .property-gallery__previews {
    grid-template-columns: repeat(2, 1fr);
  }

  .property-gallery--previews-3 .property-gallery__previews {
    grid-template-columns: repeat(3, 1fr);
  }

  .property-gallery__preview {
    border-radius: 8px;
  }

  .property-gallery__arrow {
    width: 36px;
    height: 36px;
  }

  .property-gallery__arrow--prev {
    left: 10px;
  }

  .property-gallery__arrow--next {
    right: 10px;
  }

  .property-gallery__counter {
    left: 12px;
    bottom: 12px;
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .property-gallery__dots {
    right: 72px;
    bottom: 19px;
    left: 72px;
  }

  .property-gallery__more strong {
    font-size: 16px;
  }

  .property-gallery__more-copy > span {
    font-size: 11px;
  }

  .property-gallery-modal {
    padding: 14px 12px 10px;
  }

  .property-gallery-modal__image-wrap {
    padding: 54px 42px 10px;
  }

  .property-gallery-modal__close {
    width: 40px;
    height: 40px;
  }

  .property-gallery-modal__arrow {
    top: 43%;
    width: 38px;
    height: 38px;
  }

  .property-gallery-modal__thumbs {
    gap: 6px;
    padding-right: 0;
    padding-left: 0;
  }

  .property-gallery-modal__thumbs::before,
  .property-gallery-modal__thumbs::after {
    display: none;
  }

  .property-gallery-modal__thumb {
    flex-basis: 68px;
    width: 68px;
    height: 51px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .property-gallery__stage {
    height: 78vw;
    min-height: 240px;
  }

  .property-gallery__previews {
    height: 86px;
  }

  .property-gallery__more {
    padding: 4px;
  }

  .property-gallery__more-content {
    gap: 5px;
    padding: 4px 6px 4px 4px;
    border-radius: 8px;
  }

  .property-gallery__more-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    border-radius: 7px;
  }

  .property-gallery__more-icon svg {
    width: 16px;
    height: 16px;
  }

  .property-gallery__more strong {
    font-size: 14px;
    line-height: 15px;
  }

  .property-gallery__more-copy > span {
    font-size: 9px;
    line-height: 11px;
  }

  .property-gallery__dots {
    gap: 4px;
  }

  .property-gallery__dot {
    width: 7px;
    height: 7px;
  }

  .property-gallery__dot.is-active {
    width: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .property-gallery__stage.is-loading::after,
  .property-gallery__preview.is-loading::before,
  .property-gallery-modal__image-wrap.is-loading::after {
    animation: none !important;
  }

  .property-gallery__main-image,
  .property-gallery__preview img,
  .property-gallery__arrow,
  .property-gallery__dot,
  .property-gallery-modal,
  .property-gallery-modal__dialog,
  .property-gallery-modal__image,
  .property-gallery-modal__arrow,
  .property-gallery-modal__close,
  .property-gallery-modal__thumb {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
