/* M57 district pages: /districts/ hub + /districts/{slug}/ view.
   Base typography, .container, .breadcrumbs, .section, .button come from catalog.css. */

.district-page .unit-slide__image { background: #f2f4f7; }
.district-page {
  padding-top: 16px;
}
.district-page__breadcrumbs {
  margin-bottom: 16px;
}
@media (min-width: 1280px) {
  .district-page {
    padding-top: 24px;
  }
  .district-page__breadcrumbs {
    margin-bottom: 24px;
  }
}

/* Layout: content + sidebar */
.district-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 1024px) {
  .district-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
}
@media (min-width: 1280px) {
  .district-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 48px;
  }
}
@media (min-width: 1728px) {
  .district-layout {
    grid-template-columns: minmax(0, 1fr) 512px;
    gap: 120px;
  }
}
.district-main .container { padding: 0; max-width: none; }
.district-page .new-buildings-section .swiper-pagination { position: static; display: flex; justify-content: center; gap: 4px; max-width: 120px; margin: 12px auto 0; overflow: hidden; }
.district-main {
  min-width: 0;
}

/* Intro */
.district__title {
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.02em;
}
@media (min-width: 1280px) {
  .district__title {
    font-size: 36px;
    line-height: 44px;
  }
}
@media (min-width: 1728px) {
  .district__title {
    font-size: 48px;
    line-height: 56px;
  }
}

.district-lead {
  margin-top: 16px;
  max-width: 800px;
  color: #22252f;
  font-size: 16px;
  line-height: 24px;
}

.district-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 0;
  margin-top: 24px;
}
.district-stats__item {
  display: flex;
  flex-direction: column;
  row-gap: 2px;
  padding: 0 20px;
  border-left: 1px solid #e7ecee;
}
.district-stats__item:first-child {
  padding-left: 0;
  border-left: none;
}
.district-stats__value {
  font-weight: 700;
  font-size: 18px;
  line-height: 26px;
  color: #22252f;
}
.district-stats__item:first-child .district-stats__value {
  color: #496ffe;
}
.district-stats__label {
  font-size: 12px;
  line-height: 16px;
  color: #b2b4bd;
}
.district-intro__facts {
  margin-top: 12px;
  font-size: 12px;
  line-height: 16px;
  color: #b2b4bd;
}
@media (max-width: 767px) {
  .district-stats {
    flex-direction: column;
    row-gap: 12px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(34, 37, 47, 0.06);
    padding: 20px;
  }
  .district-stats__item {
    flex-direction: row;
    align-items: baseline;
    column-gap: 8px;
    padding: 0;
    border-left: none;
  }
  .district-stats__label {
    order: 1;
    font-size: 14px;
    line-height: 20px;
    color: #717584;
  }
  .district-stats__item::after {
    content: "";
    order: 2;
    flex: 1;
    border-bottom: 1px dashed #e7ecee;
    align-self: flex-end;
    margin-bottom: 5px;
  }
  .district-stats__value {
    order: 3;
  }
}


/* Gallery */
.district-gallery {
  margin-top: 32px;
}
.district-gallery__main-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 24px;
  display: block;
}
.district-gallery__thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.district-gallery__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: border-color 0.25s ease-in-out;
}
.district-gallery__thumb.is-active {
  border-color: #496ffe;
}
.district-gallery__thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (min-width: 1728px) {
  .district-gallery__thumb {
    width: 96px;
    height: 64px;
  }
}



.district-gallery__main {
  position: relative;
}
.district-gallery__nav {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}
.district-gallery__nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease-in-out;
}
.district-gallery__nav-btn:hover {
  background: #ffffff;
}
.district-gallery__nav-btn .icon {
  width: 20px;
  height: 20px;
}
@media (max-width: 767px) {
  .district-gallery {
    margin-inline: -16px;
  }
  .district-gallery__main-image {
    border-radius: 0;
    aspect-ratio: 3 / 2;
  }
  .district-gallery__thumbnails {
    padding-inline: 16px;
  }
  .district-gallery__nav {
    display: none;
  }
}
@media (min-width: 1728px) {
  .district-gallery__main-image {
    aspect-ratio: 3 / 2;
  }
}


/* Location */
.district-location {
  margin-top: 48px;
}
.district-location__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (min-width: 1280px) {
  .district-location__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}
.district-location__subtitle {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  margin-bottom: 8px;
}
.district-location__text {
  color: #717584;
  font-size: 14px;
  line-height: 22px;
}

/* Sidebar: all districts */
.district-aside {
  min-width: 0;
}
.district-aside__card {
  background: #f8fafb;
  border-radius: 24px;
  padding: 16px;
}
@media (min-width: 1024px) {
  /* Stick the sidebar itself (not the inner card): the grid item must stay
     shorter than its row (align-self: start) so sticky has room to travel.
     top clears the 57px fixed header (+16px breathing room). */
  .district-aside {
    position: sticky;
    top: 73px;
    align-self: start;
  }
}
@media (min-width: 1728px) {
  /* Header grows to 77px on wide screens. */
  .district-aside {
    top: 93px;
  }
}
.district-aside__search {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' viewBox=\'0 0 24 24\' fill=\'none\' stroke=\'%23b2b4bd\' stroke-width=\'2\'%3E%3Ccircle cx=\'11\' cy=\'11\' r=\'7\'/%3E%3Cpath d=\'m21 21-4.3-4.3\'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  border-radius: 30px;
  border: 1px solid #e7ecee;
  background-color: #ffffff;
  font: inherit;
  font-size: 14px;
  line-height: 22px;
  color: #22252f;
  outline: none;
  transition: border-color 0.25s ease-in-out;
}
.district-aside__search::placeholder {
  color: #b2b4bd;
}
.district-aside__search:focus {
  border-color: #496ffe;
}
.district-aside__list {
  display: flex;
  flex-direction: column;
  row-gap: 8px;
  margin-top: 12px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
}
@media (min-width: 1024px) {
  .district-aside__list {
    max-height: 640px;
  }
}
.district-aside__item {
  display: flex;
  align-items: center;
  column-gap: 12px;
  padding: 8px;
  border-radius: 16px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease-in-out;
}
@media (hover: hover) and (pointer: fine) {
  a.district-aside__item:hover {
    background-color: #eff2f6;
  }
}
.district-aside__item.is-active {
  box-shadow: inset 0 0 0 2px #496ffe;
}
.district-aside__item-image {
  width: 72px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.district-aside__item-content {
  display: flex;
  flex-direction: column;
  row-gap: 2px;
  min-width: 0;
}
.district-aside__item-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}
.district-aside__item-meta {
  font-size: 12px;
  line-height: 16px;
  color: #717584;
}
.district-aside__item-live {
  font-size: 12px;
  line-height: 16px;
  color: #496ffe;
}

@media (min-width: 1280px) {
  .district-aside__card {
    padding: 20px;
  }
  .district-aside__item {
    padding: 12px;
  }
  .district-aside__item-image {
    width: 96px;
    height: 72px;
  }
  .district-aside__item-name {
    font-size: 16px;
    line-height: 24px;
  }
}


/* Object types */
.district-object-types__grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.district-object-types__card {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  row-gap: 6px;
  padding: 20px;
  border-radius: 20px;
  background: #f8fafb;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease-in-out;
}
@media (hover: hover) and (pointer: fine) {
  .district-object-types__card:hover {
    background-color: #eff2f6;
  }
}
.district-object-types__label {
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
}
.district-object-types__price {
  font-weight: 700;
  font-size: 18px;
  line-height: 26px;
  color: #ff9900;
}
.district-object-types__count {
  font-size: 13px;
  line-height: 18px;
  color: #717584;
}

.district-object-types__price-prefix,
.district-object-types__price-currency {
  font-size: 13px;
  font-weight: 600;
}

@media (min-width: 1728px) {
  .district-object-types__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    overflow: visible;
  }
  .district-object-types__card {
    flex: initial;
  }
}



.district-objects .section__head-top {
  justify-content: space-between;
}
.district-objects__link {
  margin-left: auto;
}
/* District objects */
.district-objects__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.district-objects__card {
  padding: 10px 20px;
  border-radius: 30px;
  background: #f4f7fa;
  font-weight: 600;
  font-size: 14px;
  line-height: 22px;
  color: #22252f;
  text-decoration: none;
  transition: background-color 0.25s ease-in-out;
}
@media (hover: hover) and (pointer: fine) {
  .district-objects__card:hover {
    background-color: #e7ecee;
  }
}


@media (max-width: 767px) {
  .district-objects__link {
    margin-left: 0;
    align-self: flex-start;
  }
}
/* Metrics */
.district-metrics__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.district-metrics__card {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  padding: 24px;
  border-radius: 20px;
  background: #f8fafb;
}
.district-metrics__value {
  font-weight: 700;
  font-size: 28px;
  line-height: 36px;
}
.district-metrics__value.--up {
  color: #22a06b;
}
.district-metrics__value.--down {
  color: #ff3700;
}
.district-metrics__label {
  font-size: 13px;
  line-height: 18px;
  color: #717584;
}
.district-metrics__hint {
  font-size: 12px;
  line-height: 16px;
  color: #b2b4bd;
}

/* Facet links */
.district-facets {
  padding: 8px 0;
}
.district-facets__text {
  font-size: 14px;
  line-height: 22px;
  color: #717584;
}
.district-facets__text a {
  color: #496ffe;
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .district-facets__text a:hover {
    color: #2d50d0;
  }
}

/* CTA */
.district-cta {
  padding: 32px 0 64px;
}
.district-cta__banner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border-radius: 24px;
  background: #fef2e0;
}
@media (min-width: 768px) {
  .district-cta__banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 40px;
  }
}
.district-cta__title {
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.02em;
}
.district-cta__subtitle {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  color: #717584;
  max-width: 560px;
}
.district-cta__link {
  flex-shrink: 0;
  align-self: flex-start;
}

@media (max-width: 767px) {
  .district-cta__link {
    align-self: stretch;
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .district-cta__link {
    align-self: center;
  }
}

/* Districts hub */
.districts-index__title {
  margin-bottom: 32px;
}
.districts-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
@media (min-width: 1280px) {
  .districts-index__grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
  }
}
.districts-index__card {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: #f8fafb;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.25s ease-in-out;
}
@media (hover: hover) and (pointer: fine) {
  .districts-index__card:hover {
    box-shadow: 0 8px 24px rgba(34, 37, 47, 0.08);
  }
}
.districts-index__image-wrapper {
  display: block;
  aspect-ratio: 3 / 2;
  background: #e7ecee;
}
.districts-index__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.districts-index__content {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  padding: 16px;
}
.districts-index__name {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
}
.districts-index__meta {
  font-size: 13px;
  line-height: 18px;
  color: #717584;
}
.districts-index__price {
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #ff9900;
}
.districts-index__description {
  margin: 48px 0 64px;
  max-width: 800px;
  color: #717584;
  font-size: 14px;
  line-height: 22px;
}

.district-page .catalog-qa__item {
  border-bottom: 1px solid #e7ecee;
  padding: 16px 0;
}
.district-page .catalog-qa__question {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.district-page .catalog-qa__question::-webkit-details-marker {
  display: none;
}
.district-page .catalog-qa__question::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #496ffe;
}
.district-page details[open] .catalog-qa__question::after {
  content: "–";
}
.district-page .catalog-qa__answer {
  margin-top: 8px;
  color: #717584;
  font-size: 14px;
  line-height: 22px;
}
