@import url("../styles.css");

.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #ffffff;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader::before {
  content: "";
  width: 54px;
  height: 54px;
  border: 5px solid #dbe3ef;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-hero {
  padding: 74px 16px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(3, 31, 76, 0.94), rgba(5, 60, 135, 0.82)),
    url("../images/properties/property-01.jpg") center / cover;
}

.page-hero-inner,
.portal-container {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: #dce8fb;
  font-weight: 700;
}

.breadcrumb a {
  color: #fff;
}

.portal-main {
  padding: 58px 16px 72px;
  background: #f7faff;
}

.portal-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}

.filter-panel,
.sidebar-widget,
.content-panel,
.detail-card,
.compare-panel {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(8, 31, 70, 0.08);
}

.filter-panel {
  padding: 22px;
  margin-bottom: 30px;
}

.filter-panel h2,
.sidebar-widget h3,
.content-panel h2,
.detail-card h2,
.compare-panel h2 {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 24px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.filter-grid input,
.filter-grid select {
  margin-bottom: 0;
}

.filter-grid .submit-btn {
  min-height: 55px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.listing-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(8, 31, 70, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.listing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 44px rgba(8, 31, 70, 0.16);
}

.listing-card figure {
  position: relative;
  height: 218px;
  margin: 0;
  overflow: hidden;
}

.listing-card img,
.gallery-main img,
.related-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.listing-card:hover img,
.related-card:hover img {
  transform: scale(1.06);
}

.badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.badge,
.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.badge {
  background: var(--gold);
  color: #061b3f;
}

.status-available { background: var(--green); }
.status-sold { background: #5f6d83; }
.status-reserved { background: var(--gold); color: #061b3f; }
.status-featured { background: var(--red); }

.favorite-btn,
.compare-btn,
.gallery-btn,
.back-to-top {
  border: 0;
  cursor: pointer;
}

.favorite-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(8, 31, 70, 0.18);
}

.favorite-btn.is-active {
  background: var(--red);
  color: #fff;
}

.listing-body {
  padding: 20px;
}

.listing-body h3 {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 21px;
  line-height: 1.2;
}

.property-id,
.location-line {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.price {
  margin: 10px 0 14px;
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  color: #263a5a;
  font-size: 14px;
  font-weight: 700;
}

.card-actions,
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn,
.outline-btn,
.compare-btn,
.gallery-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  padding: 0 12px;
  font-weight: 900;
  text-align: center;
}

.action-btn {
  background: var(--green);
  color: #fff;
}

.outline-btn,
.compare-btn,
.gallery-btn {
  border: 1px solid var(--blue-2);
  background: #fff;
  color: var(--blue);
}

.compare-btn.is-active {
  background: var(--blue);
  color: #fff;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.sidebar-widget {
  padding: 22px;
}

.mini-list {
  display: grid;
  gap: 14px;
}

.mini-property {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
}

.mini-property img {
  width: 74px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.mini-property b {
  color: var(--blue);
  font-size: 14px;
}

.mini-property small {
  display: block;
  color: var(--red);
  font-weight: 800;
}

.category-links {
  display: grid;
  gap: 9px;
}

.category-links a {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #edf2f8;
  font-weight: 800;
}

.content-panel {
  padding: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.service-card {
  padding: 24px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}

.detail-stack {
  display: grid;
  gap: 24px;
}

.detail-card {
  padding: 24px;
}

.gallery-main {
  position: relative;
  height: 460px;
  overflow: hidden;
  border-radius: 8px;
  background: #dbe3ef;
}

.gallery-controls {
  position: absolute;
  inset: auto 16px 16px;
  display: flex;
  justify-content: space-between;
}

.overview-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.overview-grid div,
.features-grid div {
  padding: 16px;
  border-radius: 6px;
  background: var(--soft);
}

.overview-grid b,
.features-grid b {
  display: block;
  color: var(--blue);
}

.map-placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(3, 31, 76, 0.82), rgba(10, 79, 174, 0.68)),
    repeating-linear-gradient(45deg, #dbe3ef 0 12px, #edf2f8 12px 24px);
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.calculator-result {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-card {
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.related-card img {
  height: 135px;
}

.related-card div {
  padding: 14px;
}

.compare-dock {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 900px;
  margin: 0 auto;
  padding: 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 8px;
  background: #061b3f;
  color: #fff;
  box-shadow: var(--shadow);
}

.compare-dock.is-visible {
  display: flex;
}

.compare-dock a,
.compare-dock button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  background: var(--gold);
  color: #061b3f;
  font-weight: 900;
  cursor: pointer;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.compare-table th,
.compare-table td {
  padding: 14px;
  border: 1px solid #dbe3ef;
  text-align: left;
}

.compare-table th {
  background: var(--blue);
  color: #fff;
}

.empty-state {
  padding: 38px;
  border: 1px dashed #b9c7dc;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 70;
  width: 44px;
  height: 44px;
  display: none;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.back-to-top.is-visible {
  display: block;
}

[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .portal-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .filter-grid,
  .listing-grid,
  .content-grid,
  .overview-grid,
  .features-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .gallery-main {
    height: 320px;
  }

  .compare-dock {
    align-items: stretch;
    flex-direction: column;
  }
}

.hero-bg {
  background:
    linear-gradient(90deg, rgba(3, 22, 55, 0.28), rgba(3, 22, 55, 0.05)),
    url("../images/properties/property-07.jpg") center / cover;
}

.blog-strip {
  background:
    linear-gradient(90deg, rgba(3, 31, 76, 0.92), rgba(3, 31, 76, 0.74)),
    url("../images/properties/property-13.jpg") center / cover;
}
