.pd-standalone-gallery__rail-shell {
  position: relative;
  padding-left: 0;
  padding-right: 2.8rem;
  margin-top: 1.25rem;
}

.pd-standalone-gallery__rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0 0.5rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pd-standalone-gallery__rail::-webkit-scrollbar {
  display: none;
}

.pd-standalone-gallery__thumb {
  flex: 0 0 auto;
  width: 120px;
  height: 90px;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: #dbe4ee;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  scroll-snap-align: center;
}

.pd-standalone-gallery__thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.pd-standalone-gallery__thumb.is-active {
  border-color: #f28d48;
  transform: none;
  box-shadow: 0 12px 28px rgba(242, 141, 72, 0.2);
}

.pd-standalone-gallery__thumb img,
.pd-standalone-gallery__thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;   
  background: #fff; 
}

#property-gallery .pd-standalone-gallery__thumb {
  width: 200px;
  height: 180px;
}

#property-gallery .pd-standalone-gallery__nav {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

#property-gallery .pd-standalone-gallery__nav--next {
  right: 0.15rem;
}

#property-gallery .pd-standalone-gallery__nav--next.is-hidden,
#property-gallery .pd-standalone-gallery__nav--next:disabled {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pd-standalone-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.pd-standalone-gallery__nav:hover:not(:disabled) {
  color: #f28d48;
}

.pd-standalone-gallery__nav:disabled,
.pd-standalone-gallery__nav.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pd-standalone-gallery__nav--prev {
  left: 0.5rem;
}

.pd-standalone-gallery__nav--next {
  right: 0.5rem;
}

.pd-standalone-gallery__nav i {
  font-size: 1.05rem;
  line-height: 1;
}

.pd-standalone-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pd-standalone-gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pd-standalone-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

.pd-standalone-gallery-modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: var(--pd-primary, #0f172a);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.pd-standalone-gallery-modal__close:hover {
  background: var(--pd-orange-light, rgba(242, 141, 72, 0.08));
  color: var(--pd-orange, #f28d48);
  border-color: var(--pd-orange, #f28d48);
  transform: scale(1.05);
}

.pd-standalone-gallery-modal__stage {
  position: relative;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  overflow: visible;
}

.pd-standalone-gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #ffffff;
  color: var(--pd-primary, #0f172a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.pd-standalone-gallery-modal__nav:hover:not(:disabled) {
  background: var(--pd-orange-light, rgba(242, 141, 72, 0.08));
  color: var(--pd-orange, #f28d48);
  border-color: var(--pd-orange, #f28d48);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(242, 141, 72, 0.16);
}

.pd-standalone-gallery-modal__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pd-standalone-gallery-modal__nav--prev {
  left: 0.75rem;
}

.pd-standalone-gallery-modal__nav--next {
  right: 0.75rem;
}

.pd-standalone-gallery-modal__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.pd-standalone-gallery-modal__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  background: transparent;
  opacity: 1;
  transition: opacity 0.2s ease;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
}

.pd-standalone-gallery-modal__image.is-transitioning {
  opacity: 0.25;
}

body.pd-standalone-gallery-open {
  overflow: hidden;
}


@media (max-width: 991.98px) {
  .pd-standalone-gallery__rail-shell {
    padding-inline: 2.4rem;
  }

  .pd-standalone-gallery__thumb {
    width: 104px;
    height: 78px;
  }

  #property-gallery .pd-standalone-gallery__thumb {
    width: 124px;
    height: 92px;
  }

  .pd-standalone-gallery__nav {
    width: 36px;
    height: 36px;
  }

  .pd-standalone-gallery-modal__stage {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
  }

  .pd-standalone-gallery-modal__image-wrap {
    max-width: 90vw;
    max-height: 90vh;
  }

  .pd-standalone-gallery-modal__image {
    max-height: 90vh;
  }
}

@media (max-width: 575.98px) {
  .pd-standalone-gallery__rail-shell {
    padding-inline: 2rem;
  }

  .pd-standalone-gallery__thumb {
    width: 92px;
    height: 68px;
    border-radius: 12px;
  }

  #property-gallery .pd-standalone-gallery__thumb {
    width: 110px;
    height: 82px;
  }

  .pd-standalone-gallery-modal__nav {
    width: 40px;
    height: 40px;
  }

  .pd-standalone-gallery-modal__stage {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
  }

  .pd-standalone-gallery-modal__image-wrap {
    max-width: 90vw;
    max-height: 90vh;
  }

  .pd-standalone-gallery-modal__image {
    max-height: 90vh;
  }
}
