/* Gallery controls inherit the existing card typography and cover dimensions. */
.property-gallery-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: inline;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  white-space: normal;
  cursor: pointer;
  touch-action: manipulation;
}

.product-img > .property-gallery-trigger { display: block; width: 100%; }
.ltn__product-item .product-img img { display: block; width: 100%; height: auto; }
.product-title > .property-gallery-trigger:hover { color: var(--ltn__secondary-color); }
.property-gallery-trigger:focus-visible { outline: 3px solid #172b70; outline-offset: 3px; }
.product-img > .property-gallery-trigger:focus-visible { outline-offset: -3px; }

/* One shared lightbox for all property listings. */
.property-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  /* Keep the photo and controls stable when browser toolbars hide or return. */
  height: 100svh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 16px 24px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
  color: #fff;
  background: #111719;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

.property-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.property-lightbox:not([open]),
.property-lightbox [hidden] { display: none !important; }
.property-lightbox *,
.property-lightbox *::before,
.property-lightbox *::after { box-sizing: border-box; }

.property-lightbox__layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  width: 100%;
  max-width: 1600px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
}

.property-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.property-lightbox__heading { min-width: 0; }
.property-lightbox__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #b7c7ca;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.property-lightbox .property-lightbox__title {
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.property-lightbox .property-lightbox__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #576367;
  border-radius: 50%;
  color: #fff;
  background: #253034;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease;
}

.property-lightbox .property-lightbox__button:hover { background: #3c4b50; }
.property-lightbox .property-lightbox__button:disabled { opacity: .35; cursor: default; }
.property-lightbox button:focus-visible { outline: 3px solid #b9dfec; outline-offset: 3px; }
.property-lightbox__button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.property-lightbox__stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.property-lightbox .property-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}

.property-lightbox__image[data-loading] { visibility: hidden; }
.property-lightbox__stage[data-dragging],
.property-lightbox__stage[data-dragging] .property-lightbox__image { cursor: grabbing; }
.property-lightbox__caption {
  max-height: 4.2em;
  overflow: auto;
  padding-top: 8px;
  color: #d9e1e3;
  font-size: 14px;
  text-align: center;
}

.property-lightbox__message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: auto;
  padding: 12px;
  text-align: center;
}

.property-lightbox__message p { margin: 0; color: #fff; }
.property-lightbox .property-lightbox__retry {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #b7c7ca;
  border-radius: 6px;
  color: #fff;
  background: #253034;
  font: inherit;
  cursor: pointer;
}

.property-lightbox__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.property-lightbox__counter { min-width: 80px; text-align: center; font-variant-numeric: tabular-nums; }
.property-lightbox__thumbnails {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 5px 4px 9px;
  scrollbar-width: thin;
  scrollbar-color: #6c858d transparent;
}

.property-lightbox__thumbnails::before,
.property-lightbox__thumbnails::after { content: ''; margin: auto; }
.property-lightbox .property-lightbox__thumbnail {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  margin: 0;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 5px;
  background: #293337;
  opacity: .6;
  cursor: pointer;
  touch-action: manipulation;
}

.property-lightbox__thumbnail[aria-current="true"],
.property-lightbox__thumbnail:hover { border-color: #b9dfec; opacity: 1; }
.property-lightbox__thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }

@media (max-width: 600px) {
  .property-lightbox { padding: 10px; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .property-lightbox__layout { gap: 8px; }
  .property-lightbox__header { gap: 10px; }
  .property-lightbox__eyebrow { font-size: 10px; }
  .property-lightbox .property-lightbox__thumbnail { flex-basis: 60px; width: 60px; height: 48px; }
}

/* Landscape phones and high browser zoom: reserve space for photo and controls. */
:where(html[data-viewport-height~="short"]) .property-lightbox__layout { grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; }
:where(html[data-viewport-height~="short"]) .property-lightbox__thumbnails,
:where(html[data-viewport-height~="short"]) .property-lightbox__eyebrow { display: none; }
:where(html[data-viewport-height~="short"]) .property-lightbox .property-lightbox__title { font-size: 16px; }
:where(html[data-viewport-height~="short"]) .property-lightbox .property-lightbox__button { width: 44px; height: 44px; }
:where(html[data-viewport-height~="short"]) .property-lightbox__caption { max-height: 2.8em; padding-top: 3px; font-size: 12px; }


@media (prefers-reduced-motion: reduce) {
  .property-lightbox .property-lightbox__button { transition: none; }
}
