/* body.no-scroll {
  overflow: hidden;
  height: 100vh;
} */
.homes_portfolio_section {
  position: relative;
  z-index: 1;
}

/* === SLIDER WRAP === */
.homes_portfolio_section .wrap_cards {
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 13px;
  overflow: hidden;
  position: relative;
}
.homes_portfolio_section .wrap_cards .slick-track {
  display: flex;
}
.homes_portfolio_section .wrap_cards .slick-slide {
  margin: 0 10px;
}

/* === CARD === */
.homes_portfolio_section .property_card {
  position: relative;
  width:calc(33.33% - 28px/3);
  cursor: pointer;
  overflow: hidden;;
}
.homes_portfolio_section .property_card .image_container {
  width: 100%;
  aspect-ratio: 339 / 257;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}
.homes_portfolio_section .property_card:hover .image_container {
  transform: scale(1.05);
}

/* === HOVER OVERLAY === */
.homes_portfolio_section .property_card .overlay_content {
  position: absolute;
  inset: 0;
  background: rgba(239, 239, 234, 0.91);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.homes_portfolio_section .property_card:hover .overlay_content {
  opacity: 1;
}
.homes_portfolio_section .property_card .overlay_content p.specifications,
.homes_portfolio_section .property_card .overlay_content .project_type p{
 {# color: var(--tertiary_color);
  text-align: center;
  font-family: Boston;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 25px;
  margin-bottom: 0; #}
}
.homes_portfolio_section .property_card .overlay_content p.title {
  color: var(--tertiary_color);
  font-family: Cardo;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 25px;
  text-align: center;
  text-transform: uppercase;
  padding-bottom: 3px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--primary_color);
}

.homes_portfolio_section .slider-arrow.next {
  position: absolute;
  right: 10px;
  transform: translateX(-5px);
}
.homes_portfolio_section .slider-arrow.next:after {
  background: var(--white_color);
  content: "";
  height: 1px;
  position: absolute;
  right: -1px;
  top: 17px;
  transform: translate(-50%, -50%) rotate(41deg);
  transform-origin: center;
  width: 14px;
}
.homes_portfolio_section .slider-arrow.next:before {
  content: "";
  bottom: 14px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(134deg);
}
.homes_portfolio_section .slider-arrow.prev {
  position: absolute;
  left: 10px;
  transform: translateX(5px);
}
.homes_portfolio_section .slider-arrow.prev:after {
  content: "";
  top: 18px;
  left: 12px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.homes_portfolio_section .slider-arrow.prev:before {
  content: "";
  bottom: 14px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(45deg);
}
/* === POPUP STYLES (CLEAN + FINAL) === */

.homes_portfolio_section .wrap_property_popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  overflow-y: auto; /* scroll overlay when tall */
  -webkit-overflow-scrolling: touch;
  padding: 50px 15px;
}

.homes_portfolio_section .wrap_property_popup.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 15px;
  overflow-y: auto;
}

body.no-scroll {
  overflow: hidden !important;
  height: 100%;
}

/* Popup inner wrapper */
.homes_portfolio_section .popup_with_close_btn {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: auto;
  background: var(--secondary_color);
  border: 21px solid rgba(11, 55, 68, 0.22);
  padding: 60px 80px;
  box-sizing: border-box;
  overflow: visible; /* prevent double scroll */
}

/* Main popup box */
.homes_portfolio_section .property_popup {
  background: var(--secondary_color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

/* Close button */
.homes_portfolio_section .close_popup {
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 40px;
  top: 30px;
  width: 25px;
  height: 25px;
}
.homes_portfolio_section .close_popup::before,
.homes_portfolio_section .close_popup::after {
  content: "";
  position: absolute;
  width: 31px;
  height: 1px;
  background: #0B3744;
  transform-origin: center;
}
.homes_portfolio_section .close_popup::before {
  transform: rotate(45deg);
}
.homes_portfolio_section .close_popup::after {
  transform: rotate(-45deg);
}

/* Title + Specs + Button */
.homes_portfolio_section .popup_title_conta h3 {
  text-transform: uppercase;
  margin-bottom: 12px;
  font-size: 1.3rem;
}
.homes_portfolio_section .specs_conta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  font-size: 0.95rem;
}
.homes_portfolio_section .button_conta {
  margin-bottom: 20px;
}

/* === IMAGE GALLERY === */
.homes_portfolio_section .gallery_img_with_active {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
}
.homes_portfolio_section .gallery_active_img {
  width: 100%;
  height: 360px;
  border-radius: 4px;
  overflow: hidden;
  background: #f8f8f8;
  position: relative;
}
.homes_portfolio_section .gallery_active_img .image {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  transition: opacity 0.4s ease;
  opacity: 0;
}
.homes_portfolio_section .gallery_active_img .image.active {
  opacity: 1;
}
.homes_portfolio_section .wrap_gallery_img {
  margin-top: 8px;
  overflow-x: auto;
  width: 100%;
}
.homes_portfolio_section .gallery_img {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.homes_portfolio_section .gallery_img .image_ {
  width: 70px;
  height: 50px;
  background-size: cover;
  background-position: center;
  cursor: pointer
}
 /* === RESTORE ORIGINAL POPUP ARROWS (hard override) === */
.homes_portfolio_section .wrap_gallery_active_img { position: relative; }

/* Base button (same size/feel as before) */
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 12px;
  cursor: pointer;
  z-index: 1001;            /* ensure above image */
  width: 23px;
  height: 42px;
}

/* Positions */
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next { right: 10px; }
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev { left: 10px; }

/* Chevron lines — same angles/placement you had */
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:after {
  background: var(--white_color);
  content: "";
  height: 1px;
  position: absolute;
  right: -1px;
  top: 17px;
  transform: translate(-50%, -50%) rotate(41deg);
  transform-origin: center;
  width: 14px;
}
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:before {
  content: "";
  bottom: 14px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(134deg);
}

.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:after {
  content: "";
  top: 18px;
  left: 12px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:before {
  content: "";
  bottom: 14px;
  width: 14px;
  position: absolute;
  height: 1px;
  background: var(--white_color);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(45deg);
}

@media (max-width: 767px) {
  /* keep single-column layout */
  .homes_portfolio_section .wrap_cards {
    flex-direction: column;
    row-gap: 10px;
    column-gap: 0;
    overflow: visible;
  }

  .homes_portfolio_section .property_card {
    width: 100%;
    flex: 0 0 100%;
  }

  .homes_portfolio_section .property_card .image_container {
    aspect-ratio: 216 / 164;
  }

  /* popup scroll behavior */
  .homes_portfolio_section .wrap_property_popup.active {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 15px;
  }

  .homes_portfolio_section .popup_with_close_btn {
    width: 100%;
    margin: 30px auto;
    padding: 20px;
    border-width: 12px;
  }

  /* gallery sizing */
  .homes_portfolio_section .gallery_active_img {
    height: 220px;
  }

  .homes_portfolio_section .wrap_gallery_img {
    margin-top: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .homes_portfolio_section .gallery_img {
    display: inline-flex;
    gap: 5px;
  }

  .homes_portfolio_section .gallery_img .image_ {
    width: 80px;
    height: 60px;
    background-size: cover;
    background-position: center;
    flex: 0 0 auto;
    border-radius: 3px;
  }

  /* arrows below gallery */
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow {
    background: none;
    height: 42px;
    padding: 12px;
    bottom: -60px;
    top: auto;
    width: 15px;
    z-index: 1001;
  }

  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev { left: -8px; }
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next { right: -8px; }

  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:before,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:before {
    background: var(--quinary_color);
    width: 7px;
  }
}
/* -----------------------------
   MOBILE POPUP + ARROW FIXES
   (safe for desktop)
----------------------------- */
@media (max-width: 767px) {

  /* Center the popup again but allow scrolling */
  .homes_portfolio_section .wrap_property_popup.active {
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    padding: 20px 15px !important;
  }

  /* Keep desktop alignment untouched */
  .homes_portfolio_section .popup_with_close_btn {
    margin: 0 auto;
    width: 100%;
    max-width: 1000px;
  }

  /* Fix arrow vertical alignment only on mobile */
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow {
    background: none !important;
    width: 15px !important;
    height: 40px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    z-index: 1001 !important;
  }

  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev { left: -8px !important; }
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next { right: -8px !important; }

  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:before,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:before {
    background: var(--quinary_color) !important;
    width: 7px !important;
  }
}
/* -----------------------------
   MOBILE CLOSE BUTTON FINAL ALIGNMENT
----------------------------- */
@media (max-width: 767px) {
  .homes_portfolio_section .close_popup {
    top: 10px !important;
    right: 18px !important; /* was 10px — moves it a bit left */
    width: 22px !important;
    height: 22px !important;
  }

  /* maintain spacing below the X */
  .homes_portfolio_section .popup_title_conta {
    margin-top: 25px !important;
  }
}
/* -----------------------------
   MOBILE ARROW FINAL POSITION FIX
----------------------------- */
@media (max-width: 767px) {
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow {
    background: none !important;
    width: 18px !important;
    height: 40px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    z-index: 1001 !important;
  }

  /* Bring arrows fully inside image */
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev {
    left: 8px !important;   /* was -8px */
  }
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next {
    right: 8px !important;  /* was -8px */
  }

  /* Arrow lines remain the same */
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.prev:before,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:after,
  .homes_portfolio_section .wrap_gallery_active_img .slider-arrow.next:before {
    background: var(--quinary_color);
    width: 7px;
  }
}
/* ---- MOBILE GALLERY ARROW FIX: inside image, centered, clickable ---- */
@media (max-width: 767px) {
  /* Make the actual image container the positioning context */
  .homes_portfolio_section .gallery_active_img {
    position: relative !important;
  }

  /* Reset any legacy mobile arrow rules */
  .homes_portfolio_section .slider-arrow {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }

  /* Place arrows INSIDE the active image and increase hit area */
  .homes_portfolio_section .gallery_active_img .slider-arrow {
    position: absolute !important;
    z-index: 5 !important;           /* above the image */
    width: 44px !important;           /* comfortable tap target */
    height: 44px !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.prev {
    left: 6px !important;             /* fully inside image */
    right: auto !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.next {
    right: 6px !important;
    left: auto !important;
  }

  /* Ensure chevrons render and stay visible */
  .homes_portfolio_section .gallery_active_img .slider-arrow::before,
  .homes_portfolio_section .gallery_active_img .slider-arrow::after {
    content: "" !important;
    position: absolute !important;
    width: 10px !important;           /* chevron stroke length */
    height: 1px !important;
    background: var(--quinary_color) !important; /* your mobile color */
    left: 50% !important;
    transform-origin: center !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.prev::before {
    top: 18px !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.prev::after {
    bottom: 18px !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.next::before {
    top: 18px !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }
  .homes_portfolio_section .gallery_active_img .slider-arrow.next::after {
    bottom: 18px !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }
}
/* ---- FIX: Show only correct Load More text ---- */
.load-more-homes .desktop {
  display: inline-block;
}
.load-more-homes .mobile {
  display: none;
}

@media (max-width: 767px) {
  .load-more-homes .desktop {
    display: none;
  }
  .load-more-homes .mobile {
    display: inline-block; 
  }
}
/* === DESKTOP-ONLY modal sizing (leaves ≤1024px untouched) === */
@media (min-width: 1025px) {
  .homes_portfolio_section .popup_with_close_btn {
    max-width: 860px;
    padding: 40px 50px;
  }

  .homes_portfolio_section .gallery_active_img {
    height: 300px; /* was 360px */
  }

  .homes_portfolio_section .wrap_property_popup.active {
    padding: 30px 15px; /* slightly less overlay padding so it sits visually centered */
  }

  /* (Optional polish) */
  .homes_portfolio_section .popup_with_close_btn {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  }
}
