body.alphaestate-district-catalog {
  --aed-ink: #38474f;
  --aed-muted: #738087;
  --aed-gold: #b8b295;
  --aed-paper: #f7f6f2;
  --aed-line: #e7e3da;
  --aed-shadow: 0 16px 38px rgba(36, 48, 54, 0.11);
}

/* Старите карти се скриват само на шестте районни страници. */
body.alphaestate-district-catalog .elementor-widget-Houzez_elementor_grid_builder,
body.alphaestate-district-catalog .aed-old-grid-section {
  display: none !important;
}

body.alphaestate-district-catalog.aed-loading .elementor-widget-Houzez_elementor_grid_builder {
  display: none !important;
}

.aed-catalog,
.aed-catalog * {
  box-sizing: border-box;
}

.aed-catalog {
  width: min(100% - 36px, 1560px);
  margin: 18px auto 76px;
  color: var(--aed-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.aed-catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 26px;
  padding: 0 2px 18px;
  border-bottom: 1px solid var(--aed-line);
}

.aed-catalog-kicker {
  margin: 0 0 7px;
  color: #948d6d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.aed-catalog-title {
  margin: 0;
  color: var(--aed-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 500;
  line-height: 1.08;
}

.aed-results-count {
  flex: 0 0 auto;
  margin: 0 0 5px;
  color: var(--aed-muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.aed-building-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px 28px;
}

.aed-building-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--aed-line);
  border-radius: 18px;
  box-shadow: var(--aed-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) {
  .aed-building-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 44px rgba(36, 48, 54, 0.16);
  }
}

.aed-card-media {
  position: relative;
  aspect-ratio: 1.36 / 1;
  overflow: hidden;
  background: #e9e7e1;
}

.aed-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.aed-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s ease;
}

@media (hover: hover) {
  .aed-building-card:hover .aed-card-media img {
    transform: scale(1.035);
  }
}

.aed-ref-badge,
.aed-stage-badge {
  position: absolute;
  z-index: 2;
  top: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.aed-ref-badge {
  left: 16px;
  color: #fff;
  background: rgba(56, 71, 79, 0.92);
}

.aed-stage-badge {
  right: 16px;
  max-width: calc(100% - 140px);
  color: #504d3f;
  background: rgba(239, 235, 221, 0.94);
  text-align: right;
}

.aed-card-contact {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: -29px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  color: #d8d1ae;
  background: var(--aed-ink);
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(24, 34, 39, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.aed-card-contact:hover {
  background: #263840;
  transform: scale(1.05);
}

.aed-card-contact svg {
  width: 33px;
  height: 22px;
}

.aed-card-body {
  padding: 30px 24px 20px;
}

.aed-card-title {
  display: block;
  min-height: 58px;
  margin: 0 54px 13px 0;
  color: #28383f;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.36;
  text-decoration: none;
}

.aed-card-title:hover {
  color: #8f8662;
}

.aed-card-location,
.aed-card-availability {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--aed-muted);
  font-size: 14px;
  line-height: 1.45;
}

.aed-card-location svg,
.aed-card-availability svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--aed-gold);
}

.aed-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--aed-line);
}

.aed-card-availability {
  min-width: 0;
  font-weight: 600;
}

.aed-card-availability span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.aed-view-building,
.aed-catalog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  color: #fff !important;
  background: var(--aed-ink);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
}

.aed-view-building:hover,
.aed-catalog-link:hover {
  color: #fff !important;
  background: #273940;
}

.aed-loading-card,
.aed-empty-state {
  grid-column: 1 / -1;
  padding: 52px 26px;
  color: var(--aed-muted);
  background: #fff;
  border: 1px solid var(--aed-line);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(36, 48, 54, 0.08);
}

.aed-empty-state h3 {
  margin: 0 0 10px;
  color: var(--aed-ink);
  font-size: 23px;
}

.aed-empty-state p {
  margin: 0 auto 22px;
  max-width: 680px;
  line-height: 1.6;
}

/* Контактна форма */
body.aed-modal-open {
  overflow: hidden;
}

.aed-contact-overlay {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 32, 36, 0.72);
}

.aed-contact-overlay.is-open {
  display: flex;
}

.aed-contact-modal {
  position: relative;
  width: min(100%, 650px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 34px;
  color: var(--aed-ink);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.aed-modal-close {
  position: absolute;
  top: 14px;
  right: 17px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--aed-ink);
  background: transparent;
  border: 0;
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
}

.aed-modal-kicker {
  margin: 0 45px 7px 0;
  color: #948d6d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.aed-contact-modal h2 {
  margin: 0 40px 6px 0;
  color: var(--aed-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 4vw, 35px);
  line-height: 1.2;
}

.aed-modal-location {
  margin: 0 0 18px;
  color: var(--aed-muted);
}

.aed-modal-phone {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: var(--aed-ink) !important;
  font-weight: 800;
  text-decoration: none !important;
}

.aed-modal-phone svg {
  width: 22px;
  height: 22px;
}

.aed-contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.aed-contact-form label,
.aed-contact-form input,
.aed-contact-form textarea {
  width: 100%;
}

.aed-contact-form input,
.aed-contact-form textarea {
  padding: 13px 15px;
  color: var(--aed-ink);
  background: #fff;
  border: 1px solid #cfd3d4;
  border-radius: 10px;
  font: inherit;
}

.aed-contact-form textarea {
  min-height: 105px;
  resize: vertical;
}

.aed-form-wide {
  grid-column: 1 / -1;
}

.aed-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #59666c;
  font-size: 13px;
  line-height: 1.5;
}

.aed-check input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.aed-form-submit {
  min-height: 50px;
  padding: 13px 20px;
  color: #fff;
  background: var(--aed-ink);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.aed-form-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.aed-form-status {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.aed-form-status.is-success {
  color: #168345;
}

.aed-form-status.is-error {
  color: #b4232c;
}

@media (max-width: 1100px) {
  .aed-building-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .aed-catalog {
    width: min(100% - 28px, 620px);
    margin-top: 8px;
    margin-bottom: 54px;
  }

  .aed-catalog-head {
    display: block;
    margin-bottom: 20px;
  }

  .aed-results-count {
    display: block;
    margin-top: 12px;
  }

  .aed-building-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .aed-card-media {
    aspect-ratio: 1.28 / 1;
  }

  .aed-card-title {
    min-height: 0;
    margin-right: 42px;
    font-size: 20px;
  }

  .aed-card-body {
    padding: 29px 20px 18px;
  }

  .aed-stage-badge {
    top: auto;
    right: auto;
    bottom: 14px;
    left: 14px;
    max-width: calc(100% - 104px);
  }

  .aed-card-contact {
    right: 15px;
    width: 58px;
    height: 58px;
  }

  .aed-contact-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .aed-contact-modal {
    max-height: calc(100vh - 20px);
    padding: 29px 20px 24px;
    border-radius: 18px 18px 10px 10px;
  }

  .aed-contact-form {
    grid-template-columns: 1fr;
  }

  .aed-form-wide {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .aed-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .aed-view-building {
    width: 100%;
  }
}

