/* ==========================================================
   WALLACE REALTY – PROPERTY SEARCH PAGE STYLES
   Final Unified Version – Removes bottom gap + keeps all features
========================================================== */

:root {
  --white: #fff;
  --black: #000;
  --gold: #D4AF37;
}

/* ----------------------------------------------------------
   BASE & TYPOGRAPHY
---------------------------------------------------------- */
body, .lux-wrap {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  color: #111;
  background: var(--white);
  margin: 0;
  padding: 0;
}

.lux-title h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--black);
}

.lux-price {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  color: var(--black);
}

.lux-title-link {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  text-decoration: none;
  color: var(--black);
  transition: color 0.2s ease;
}
.lux-title-link:hover { color: var(--gold); }

.lux-chip, .lux-count, .lux-sort, .lux-toggle span, .lux-page {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--black);
}

.lux-address, .lux-meta {
  font-family: 'Libre Baskerville', serif;
  color: #444;
  font-weight: 400;
}

.lux-news h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #111;
}

.lux-news-small {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #666;
}

.lux-brand-accent {
  font-family: 'Dancing Script', cursive;
  font-size: 24px;
  color: var(--gold);
}

/* ----------------------------------------------------------
   LAYOUT STRUCTURE
---------------------------------------------------------- */
.page-template-luxury-homes-for-sale .ast-container,
.site-content > .ast-container {
  max-width: 100% !important;
  padding: 0 !important;
  overflow: visible !important;
}

.lux-wrap {
  width: 100%;
  background: var(--white);
  padding: 40px 2vw 40px; /* Reduced bottom padding */
  overflow: visible !important;
}

.lux-title {
  max-width: 1600px;
  margin: 0 auto 22px;
  position: relative;
  padding-bottom: 12px;
}
.lux-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--gold);
  transition: width 1s ease;
}
body.loaded .lux-title::after { width: 120px; }

/* ----------------------------------------------------------
   FILTER BAR
---------------------------------------------------------- */
.lux-bar {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible !important;
}
.lux-search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.lux-search {
  flex: 1;
  display: flex;
  border: 1px solid var(--gold);
  border-radius: 6px;
  align-items: center;
  overflow: hidden;
}
.lux-search input {
  flex: 1;
  border: 0;
  padding: 12px 16px;
  font-size: 15px;
  outline: none;
  font-family: 'Montserrat', sans-serif;
  background: var(--white);
}
.lux-icon-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  background: var(--white);
  border-left: 1px solid var(--gold);
  cursor: pointer;
  transition: background 0.2s ease;
}
.lux-icon-btn-small:hover { background: #fafafa; }
.lux-icon-btn-small .lux-icon svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  stroke: currentColor;
  fill: none;
}

/* ----------------------------------------------------------
   BUTTON CHIPS
---------------------------------------------------------- */
.lux-chip-group {
  display: inline-flex;
  border: 1px solid var(--gold);
  border-radius: 6px;
  overflow: hidden;
}
.lux-chip-group .lux-chip {
  border: none;
  height: 42px;
  padding: 0 22px;
  background: #fff;
  color: var(--black);
  transition: background 0.2s ease, color 0.2s ease;
}
.lux-chip-group .lux-chip.active { background: var(--gold); }
.lux-chip-group .lux-chip:not(:last-child) { border-right: 1px solid var(--gold); }
.lux-chip-group .lux-chip:hover { background: #f9f6ef; }

.lux-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lux-chip {
  border: 1px solid var(--gold);
  background: #fff;
  border-radius: 6px;
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lux-chip:hover {
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.18);
  transform: translateY(-1px);
}
.lux-chip.active { background: var(--gold); }

/* ----------------------------------------------------------
   TYPE DROPDOWN
---------------------------------------------------------- */
#lux-type-trigger[aria-expanded="true"] {
  background: var(--gold);
  color: var(--black);
}
.lux-type-wrapper { position: relative; z-index: 9999; overflow: visible; }

.lux-type-pop {
  display: none;
  position: absolute;
  top: 52px;
  left: 0;
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 20px 24px;
  min-width: 420px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10000;
}
.lux-type-pop.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.lux-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
  margin-bottom: 0;
}
.lux-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  transition: color 0.2s ease;
}
.lux-type-item:hover { color: var(--gold); }
.lux-type-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}
.lux-type-actions,
.lux-type-clear,
.lux-type-apply { display: none !important; }
/* ----------------------------------------------------------
   PRICE & BEDS DROPDOWNS (Luxury Style)
---------------------------------------------------------- */
.lux-price-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 320px;
}

.lux-price-content input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  background: var(--gold);
  height: 4px;
  border-radius: 3px;
  cursor: pointer;
}

.lux-price-values {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  color: #111;
}
.lux-price-values input {
  border: 1px solid var(--gold);
  border-radius: 4px;
  width: 90px;
  text-align: center;
  padding: 6px;
  font-size: 14px;
  background: #fff;
}

.lux-beds-options {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.lux-bed-btn {
  border: 1px solid var(--gold);
  background: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lux-bed-btn:hover {
  background: #f9f6ef;
}
.lux-bed-btn.active {
  background: var(--gold);
  color: var(--black);
}

/* ----------------------------------------------------------
   SORT + MAP
---------------------------------------------------------- */
.lux-below-bar {
  max-width: 1600px;
  margin: 6px auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.lux-count { font-weight: 600; }
.lux-right { display: flex; align-items: center; gap: 18px; }
.lux-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
}
.lux-caret { width: 12px; height: 12px; stroke: var(--gold); stroke-width: 2; }
.lux-toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.lux-switch {
  width: 46px;
  height: 24px;
  border-radius: 50px;
  background: #cfd2d6;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}
.lux-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.lux-switch.is-on { background: var(--gold); }
.lux-switch.is-on::after { left: 25px; }

/* ----------------------------------------------------------
   LAYOUT: MAP + GRID
---------------------------------------------------------- */
.lux-layout {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  transition: 0.3s;
}
.lux-layout.has-map {
  grid-template-columns: 2fr 1fr;
  align-items: start;
}
.lux-layout,
.lux-layout > * {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.lux-map-box {
  width: 100%;
  height: 500px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: linear-gradient(0deg, #e9ecef, #f7f7f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lux-map-box.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1023px) {
  .lux-layout.has-map { grid-template-columns: 1fr; }
  .lux-map-box { height: 400px; }
}

/* ----------------------------------------------------------
   PROPERTY GRID + CARDS
---------------------------------------------------------- */
.lux-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, 1fr);
  transition: 0.3s;
  margin-bottom: 0;
  padding-bottom: 0;
}
@media (max-width: 1024px) { .lux-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lux-grid { grid-template-columns: 1fr; } }

.lux-card {
  background: #fff;
  border: 1px solid #eaeaea;
  overflow: hidden;
  transition: 0.3s;
  position: relative;
}
.lux-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(212,175,55,0.18);
}
.lux-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.lux-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.lux-card:hover .lux-media img { transform: scale(1.05); }

/* ----------------------------------------------------------
   CARD ACTIONS
---------------------------------------------------------- */
.lux-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.lux-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.lux-btn:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Heart & Share */
.lux-btn.js-fav {
  background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3c3.08 0 5.5 2.42 5.5 5.5 0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}
.lux-btn.js-share {
  background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='18' cy='5' r='3'/><circle cx='6' cy='12' r='3'/><circle cx='18' cy='19' r='3'/><line x1='8.59' y1='13.51' x2='15.42' y2='17.49'/><line x1='15.41' y1='6.51' x2='8.59' y2='10.49'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

/* ----------------------------------------------------------
   BODY + PAGINATION
---------------------------------------------------------- */
.lux-body { padding: 14px 18px 18px; display: grid; gap: 8px; }
.lux-meta { font-size: 15px; }

.lux-pagination {
  max-width: 1600px;
  margin: 10px auto 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lux-page {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  color: #000;
  font-weight: 600;
}
.lux-page.active { border-color: var(--gold); }

/* ----------------------------------------------------------
   NEWSLETTER + ALERTS
---------------------------------------------------------- */
.lux-layout + .lux-news { margin-top: 10px !important; }
.lux-news {
  max-width: 1600px;
  margin: 10px auto 0 !important;
  text-align: center;
}
.lux-news h3 { font-size: clamp(20px, 2.4vw, 28px); }
.lux-news-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 14px;
}
.lux-news-input {
  width: min(480px, 75%);
  height: 48px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0 14px;
  font-size: 15px;
}
.lux-news-btn {
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gold);
  color: var(--black);
  cursor: pointer;
  transition: 0.2s;
}
.lux-news-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 22px rgba(212,175,55,0.25);
}
.lux-alert {
  width: min(680px, 95%);
  margin: 16px auto 0;
  border: 1.5px solid var(--gold);
  background: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  font-weight: 600;
  color: #000;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.lux-alert.is-visible { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------
   RESPONSIVE FIXES & DROPDOWN VISIBILITY (DESKTOP)
---------------------------------------------------------- */
.lux-bar, .lux-search-row, .lux-wrap, .lux-chips { overflow: visible !important; }
.lux-type-wrapper {
  position: relative !important;
  z-index: 9999 !important;
  overflow: visible !important;
}
.lux-type-pop { z-index: 10000 !important; pointer-events: auto; }

@media (min-width: 769px) {
  #lux-type-pop {
    display: none !important;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    position: absolute !important;
    top: 52px !important;
    left: 0 !important;
    background: #fff;
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 999999 !important;
    pointer-events: none;
  }

  /* When open on desktop */
  #lux-type-pop.is-open {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Wrapper ensures dropdown stays above all elements */
  .lux-type-wrapper {
    position: relative !important;
    overflow: visible !important;
    z-index: 999999 !important;
  }

  /* Prevent Astra container from clipping dropdown */
  .lux-wrap,
  .site-content,
  .ast-container {
    overflow: visible !important;
  }
}

/* ----------------------------------------------------------
   FINAL POLISH – Balanced spacing between listings & newsletter
---------------------------------------------------------- */
.lux-layout + .lux-news {
  margin-top: 36px !important; /* Adds just enough breathing room */
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06); /* Subtle divider line for luxury look */
}

.lux-news {
  padding-bottom: 30px;
}

.lux-news h3 {
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

/* ----------------------------------------------------------
   END OF FINAL UPDATED CSS
   ✅ Fixes large gap between grid & newsletter
   ✅ Keeps dropdown, filters, and animations working
   ✅ Compatible with Astra and all devices
---------------------------------------------------------- */
