/**
 * Additional Properties — detail page gallery only.
 * Scoped under .adprop-gallery-wrap to avoid clashes with PIAB Properties global slick/lightslider rules.
 */

/* Layout — counter main.css mobile absolute positioning on .top-gallery-section */
.adprop-gallery-wrap .property-banner,
.adprop-gallery-wrap #pills-gallery,
.adprop-gallery-wrap .top-gallery-section {
  position: relative !important;
  width: 100%;
}

.adprop-gallery-wrap .lSSlideOuter {
  position: relative;
  width: 100%;
}

.adprop-gallery-wrap .lSSlideOuter .lSSlideWrapper {
  background: #f4f4f4;
}

.adprop-gallery-wrap .lSSlideOuter .lslide {
  height: auto !important;
}

/* cS-hidden fallback until lightSlider loads — override lightslider.css height:1px */
.adprop-gallery-wrap #adprop-property-gallery.cS-hidden {
  height: auto !important;
  min-height: 0;
  opacity: 1 !important;
  overflow: hidden !important;
}

.adprop-gallery-wrap
  #adprop-property-gallery.cS-hidden
  > div:not(:first-child) {
  display: none !important;
}

.adprop-gallery-wrap .lSSlideOuter.adprop-gallery-ready,
.adprop-gallery-wrap #adprop-property-gallery:not(.cS-hidden) {
  opacity: 1 !important;
  overflow: hidden !important;
}

/* lightSlider sets inline padding-bottom hack — JS sets explicit height on the track */
.adprop-gallery-wrap #adprop-property-gallery.lightSlider,
.adprop-gallery-wrap #adprop-property-gallery.lSSlide {
  padding-bottom: 0 !important;
}

/* Override piab_search-public.css global img { height: 170px } inside gallery */
.piab-property-css-parent .adprop-gallery-wrap .lslide img,
.adprop-gallery-wrap .lSSlideOuter .lslide img {
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  object-position: center center;
  display: block !important;
  vertical-align: top;
}

.adprop-gallery-wrap .lslide .hz-image-caption {
  background: rgba(255, 255, 255, 0.65);
  color: #5c6872;
  padding: 5px;
  font-size: 12px;
  font-weight: 400;
  line-height: 12px;
}

/* lightSlider wraps slick buttons in <a class="lSPrev"> — reset anchor, style button only */
.adprop-gallery-wrap .lSAction > a {
  z-index: 10 !important;
  background: none !important;
  background-image: none !important;
  width: auto !important;
  height: auto !important;
  margin-top: -20px !important;
  opacity: 1 !important;
  padding: 0 !important;
  border: none !important;
  text-decoration: none !important;
  line-height: 0 !important;
}

.adprop-gallery-wrap .lSAction > a.lSPrev {
  left: 20px !important;
}

.adprop-gallery-wrap .lSAction > a.lSNext {
  right: 20px !important;
}

.adprop-gallery-wrap .lSAction > a.lSPrev:before,
.adprop-gallery-wrap .lSAction > a.lSNext:before {
  display: none !important;
  content: none !important;
}

/* PIAB main.css slick slider — scoped to detail gallery */
.adprop-gallery-wrap .lSAction .slick-prev,
.adprop-gallery-wrap .lSAction .slick-next {
  position: relative !important;
  display: block !important;
  height: 40px !important;
  width: 40px !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 10;
  text-align: center;
  border-radius: 3px;
  font-weight: 700;
  color: #fff;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.adprop-gallery-wrap .lSAction .slick-prev:before,
.adprop-gallery-wrap .lSAction .slick-next:before {
  display: inline-block;
  font-size: 16px;
  opacity: 1;
}

.adprop-gallery-wrap .lSAction .slick-prev:before {
  content: "";
  font-family: "piab-iconfont";
}

.adprop-gallery-wrap .lSAction .slick-next:before {
  content: "";
  font-family: "piab-iconfont";
}

/* Thumbnail pager */
.adprop-gallery-wrap .lSPager.lSGallery {
  margin-top: 12px;
}

.adprop-gallery-wrap .lSPager.lSGallery li {
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
}

.adprop-gallery-wrap .lSPager.lSGallery li.active {
  border-color: #478700;
}

.adprop-gallery-wrap .lSPager.lSGallery li img {
  width: 100%;
  height: 54px;
  object-fit: cover;
  display: block;
}

@media (max-width: 767.98px) {
  .piab-property-css-parent.property-detail-v3
    .adprop-gallery-wrap
    .top-gallery-section,
  .piab-property-css-parent.property-detail-v4
    .adprop-gallery-wrap
    .top-gallery-section,
  .adprop-gallery-wrap .top-gallery-section {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-height: 0;
  }

  .adprop-gallery-wrap .property-top-wrap,
  .adprop-gallery-wrap .property-banner,
  .adprop-gallery-wrap .lSSlideOuter,
  .adprop-gallery-wrap .lSSlideOuter .lSSlideWrapper {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    height: auto !important;
  }

  .piab-property-css-parent .adprop-gallery-wrap .lslide img,
  .adprop-gallery-wrap .lSSlideOuter .lslide img {
    width: 100% !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Override main.css global: .slick-prev, .slick-next { display: none } on mobile */
  .adprop-gallery-wrap .lSAction .slick-prev,
  .adprop-gallery-wrap .lSAction .slick-next {
    display: block !important;
  }

  .adprop-gallery-wrap .lSAction > a.lSPrev {
    left: 12px !important;
  }

  .adprop-gallery-wrap .lSAction > a.lSNext {
    right: 12px !important;
  }
}
