/* ============================================
   LISTINGS PAGE STYLES
   D'Arcy Harris — Victoria Real Estate
   ============================================ */

/* NAV SOLID STATE */
.nav-solid {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

/* LISTINGS HERO */
.listings-hero {
  padding: 140px 0 60px;
  background: var(--navy);
  text-align: center;
  color: #fff;
}
.listings-hero .section-eyebrow {
  color: var(--gold);
}
.listings-hero .section-title {
  color: #fff;
  margin-bottom: 0.5rem;
}
.listings-hero .section-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
}
#listingCount {
  color: var(--gold);
  font-weight: 700;
}

/* FILTERS */
.filters-section {
  padding: 1.5rem 0;
  background: #f8f8f6;
  border-bottom: 1px solid #e8e6e0;
  position: sticky;
  top: 70px;
  z-index: 90;
}
.filters-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 130px;
}
.filter-group.search-group {
  flex: 2;
  min-width: 200px;
}
.filter-group label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}
.filter-group input,
.filter-group select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #d4d0c8;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--navy);
  transition: border-color 0.2s;
  font-family: inherit;
}
.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(183,145,62,0.1);
}
.filters-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #666;
}
.clear-filters {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}
.clear-filters:hover {
  text-decoration: underline;
}

/* LISTINGS GRID */
.listings-results {
  padding: 2rem 0 4rem;
  min-height: 60vh;
}
.listings-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* LISTING CARD */
.listing-card-full {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.listing-card-full:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Card Image */
.card-image-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: #e8e6e0;
  overflow: hidden;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.listing-card-full:hover .card-image-wrap img {
  transform: scale(1.05);
}
.card-price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--navy);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
.card-photos-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
}
.card-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold);
  color: var(--navy);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.9rem;
}

/* Card Info */
.card-info {
  padding: 1rem 1.25rem 1.25rem;
}
.card-address {
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}
.card-city {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 0.75rem;
}
.card-details {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #555;
  flex-wrap: wrap;
}
.card-detail {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.card-detail svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}
.card-mls {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #aaa;
}

/* LOAD MORE */
.load-more {
  text-align: center;
  margin-top: 2.5rem;
}

/* NO RESULTS */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}
.no-results h3 {
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.no-results a {
  color: var(--gold);
}

/* LISTINGS CTA */
.listings-cta {
  background: var(--navy);
  padding: 4rem 0;
  text-align: center;
  color: #fff;
}
.listings-cta h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}
.listings-cta p {
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* DDF ATTRIBUTION */
.ddf-attribution {
  padding: 1.5rem 0;
  background: #f8f8f6;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}
.ddf-disclaimer {
  max-width: 800px;
  margin: 0.5rem auto 0;
  font-size: 0.7rem;
  line-height: 1.5;
}

/* MODAL */
.listing-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--navy);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  margin: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.modal-close:hover {
  background: var(--gold);
  color: var(--navy);
}

/* Modal Gallery */
.modal-gallery {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}
.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: background 0.2s;
}
.gallery-nav:hover {
  background: var(--gold);
  color: #fff;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.gallery-thumbs {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  background: #111;
}
.gallery-thumb {
  width: 60px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.gallery-thumb.active,
.gallery-thumb:hover {
  opacity: 1;
}

/* Modal Details */
.modal-details {
  padding: 1.5rem 2rem 2rem;
}
.modal-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.25rem;
}
.modal-address {
  font-size: 1.1rem;
  color: #555;
  margin: 0 0 1.25rem;
}
.modal-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 1.25rem;
}
.modal-stat {
  text-align: center;
}
.modal-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
}
.modal-stat-label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-description {
  line-height: 1.7;
  color: #444;
  margin-bottom: 1.5rem;
}
.modal-mls {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.modal-actions .btn {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .listings-hero {
    padding: 120px 0 40px;
  }
  .filters-bar {
    gap: 0.5rem;
  }
  .filter-group {
    min-width: calc(50% - 0.5rem);
  }
  .filter-group.search-group {
    min-width: 100%;
  }
  .listings-grid-full {
    grid-template-columns: 1fr;
  }
  .modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .modal-details {
    padding: 1rem 1.25rem 1.5rem;
  }
  .modal-price {
    font-size: 1.4rem;
  }
  .modal-stats {
    gap: 1rem;
  }
}
