/* ================= LISTINGS PAGE ================= */

:root {
  --navy: #08163b;
  --navy-deep: #050f2d;
  --blue: #0647a8;
  --green: #18a96b;
  --green-dark: #0f8a55;
  --text: #111827;
  --muted: #667085;
  --border: rgba(8, 22, 59, 0.12);
  --shadow: 0 22px 60px rgba(8, 22, 59, 0.09);
}

.listings-page {
  background: #ffffff;
}

.listings-container {
  width: min(1320px, calc(100% - 72px));
  margin: 0 auto;
}

/* ================= INTRO ================= */

.listings-intro {
  padding: 72px 0 36px;
  background:
    radial-gradient(circle at top left, rgba(24, 169, 107, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
}

.listings-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
}

.listings-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.listings-title-row h1 {
  color: #050505;
  font-size: clamp(34px, 3vw, 50px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -1px;
}

.listings-title-row p {
  max-width: 620px;
  margin-top: 12px;
  color: #475467;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 500;
}

.listings-sort {
  min-width: 280px;
}

.listings-sort label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.listings-sort select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--navy);
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  outline: none;
}

/* ================= TABS ================= */

.listing-tabs {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.listing-tab {
  min-width: 145px;
  height: 54px;
  border: none;
  border-radius: 10px;
  background: #ffffff;
  color: var(--navy);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(8, 22, 59, 0.08);
  cursor: pointer;
  transition: 0.25s ease;
}

.listing-tab:hover {
  background: var(--green);
  color: #ffffff;
  transform: translateY(-2px);
}

.listing-tab.active {
  background: var(--blue);
  color: #ffffff;
}

/* ================= FILTER ================= */

.listing-filter {
  margin-top: 34px;
  padding: 26px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(8, 22, 59, 0.08);
  box-shadow: var(--shadow);
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 20px;
}

.filter-title i {
  color: var(--green);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(4, 1fr);
  gap: 14px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(8, 22, 59, 0.13);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: 0.25s ease;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(24, 169, 107, 0.1);
}

.filter-search-btn {
  align-self: end;
  height: 46px;
  border: none;
  border-radius: 9px;
  background: var(--blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.25s ease;
}

.filter-search-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
}

.filter-bottom {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(8, 22, 59, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.filter-bottom p {
  color: #475467;
  font-size: 14px;
  font-weight: 700;
}

.clear-filter-btn {
  border: none;
  background: transparent;
  color: var(--green-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

/* ================= RESULTS ================= */

.listing-results {
  padding: 44px 0 95px;
  background: #ffffff;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px;
}

/* ================= CARD ================= */

.listing-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(8, 22, 59, 0.08);
  box-shadow: 0 16px 45px rgba(8, 22, 59, 0.07);
  transition: 0.28s ease;
}

.listing-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 26px 70px rgba(8, 22, 59, 0.13);
}

.listing-card-image {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
}

.listing-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.45s ease;
}

.listing-card:hover .listing-card-image img {
  transform: scale(1.06);
}

.listing-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 60%);
}

.listing-badges {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.listing-badge {
  padding: 6px 9px;
  border-radius: 5px;
  background: rgba(8, 22, 59, 0.88);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.listing-badge.featured {
  background: var(--green);
}

.listing-price {
  position: absolute;
  left: 18px;
  bottom: 17px;
  z-index: 3;
  color: #ffffff;
  font-size: 19px;
  font-weight: 900;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

.listing-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.listing-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(8, 22, 59, 0.68);
  color: #ffffff;
  cursor: pointer;
  transition: 0.25s ease;
}

.listing-icon-btn:hover {
  background: var(--green);
}

.listing-card-body {
  padding: 20px 20px 22px;
}

.listing-card-body h3 {
  color: #050505;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-location {
  color: #667085;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

.listing-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.listing-meta i {
  color: var(--green);
}

.listing-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.listing-type {
  color: #050505;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.listing-details-btn {
  min-height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  transition: 0.25s ease;
}

.listing-details-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
}

/* ================= EMPTY ================= */

.listing-empty {
  display: none;
  margin-top: 30px;
  padding: 54px 24px;
  border-radius: 18px;
  background: #f8fafc;
  text-align: center;
  border: 1px solid rgba(8, 22, 59, 0.08);
}

.listing-empty.show {
  display: block;
}

.listing-empty i {
  color: var(--green);
  font-size: 42px;
  margin-bottom: 16px;
}

.listing-empty h3 {
  color: var(--navy);
  font-size: 24px;
  font-weight: 900;
}

.listing-empty p {
  margin-top: 8px;
  color: #667085;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1200px) {
  .listing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-field.large {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .listings-container {
    width: min(100% - 40px, 760px);
  }

  .listings-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .listings-sort {
    width: 100%;
  }

  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-search-btn {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .listings-intro {
    padding-top: 52px;
  }

  .listings-container {
    width: min(100% - 32px, 480px);
  }

  .listing-tabs {
    gap: 10px;
  }

  .listing-tab {
    flex: 1;
    min-width: 0;
    height: 48px;
    font-size: 12px;
  }

  .listing-filter {
    padding: 20px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-field.large,
  .filter-search-btn {
    grid-column: span 1;
  }

  .filter-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .listing-card-image {
    height: 235px;
  }
}