:root {
  --red: #f13b35;
  --red-dark: #d92620;
  --ink: #191919;
  --muted: #6b717a;
  --line: #e6e8ec;
  --soft: #f4f6f8;
  --white: #ffffff;
  --green: #1f9d63;
  --shadow: 0 18px 48px rgba(18, 24, 36, .11);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  min-height: 88px;
  display: grid;
  grid-template-columns: 310px 1fr auto auto;
  gap: 24px;
  align-items: center;
}

.logo img {
  width: 300px;
}

.header-contact {
  justify-self: end;
  display: grid;
  text-align: right;
  gap: 2px;
}

.phone {
  font-size: 24px;
  font-weight: 800;
}

.header-contact span {
  color: var(--muted);
  font-size: 13px;
}

.messengers {
  display: flex;
  gap: 8px;
}

.messengers a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: var(--white);
  background: #242424;
}

.messengers a:first-child {
  background: #25d366;
}

.messengers a:nth-child(2) {
  background: #27a7e7;
}

.messengers a:nth-child(3) {
  background: #2876d1;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 8px;
  background: var(--ink);
}

.main-nav {
  background: #1d1d1f;
}

.nav-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 26px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.nav-row a {
  opacity: .92;
}

.nav-row a:hover {
  opacity: 1;
  color: #ffcdca;
}

.utility-row {
  background: #f7f7f8;
  border-bottom: 1px solid var(--line);
}

.utility-row__inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: #555;
  font-size: 14px;
}

.telegram-link {
  margin-left: auto;
  color: var(--red-dark);
  font-weight: 700;
}

.search-hero {
  padding: 34px 0 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(244, 246, 248, .96)),
    url("assets/remont-kvartira.jpg") center/cover;
}

.search-hero .container {
  display: flex;
  justify-content: center;
}

.search-card {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 30px;
}

.section-kicker {
  color: var(--red-dark);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1.04;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  margin-bottom: 14px;
}

h3 {
  line-height: 1.2;
}

.mode-tabs,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: #383d44;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
}

.tab.is-active,
.tabs button.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 800;
}

.filter-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) 180px;
  gap: 12px;
  align-items: end;
}

.filter-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-grid input,
.filter-grid select,
.lead-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7dae0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

.primary-btn,
.ghost-btn,
.apartment-list button,
.cookie-note button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

.primary-btn {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(241, 59, 53, .23);
}

.primary-btn:hover {
  background: var(--red-dark);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-filters button,
.quick-filters a,
.collection-links a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 100px;
  padding: 8px 13px;
  color: #4b515a;
  font-size: 14px;
}

.quick-filters button.is-selected {
  border-color: var(--red);
  color: var(--red-dark);
  background: #fff3f2;
}

.intro-band {
  background: #242426;
  color: #fff;
  padding: 42px 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 40px;
  align-items: center;
}

.intro-grid p {
  color: #d9d9de;
  max-width: 680px;
  margin-bottom: 0;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.benefits a {
  min-height: 60px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

.section {
  padding: 58px 0;
}

.soft {
  background: var(--soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.section-head.compact {
  display: block;
  margin-bottom: 16px;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.promo-card {
  min-height: 230px;
  display: grid;
  align-content: end;
  overflow: hidden;
  border-radius: var(--radius);
  background: #161618;
  color: #fff;
  position: relative;
  box-shadow: 0 10px 28px rgba(20, 22, 26, .12);
}

.promo-card.large {
  grid-column: span 2;
}

.promo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .68;
}

.promo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, .72));
}

.promo-card h3,
.promo-card span {
  position: relative;
  z-index: 1;
  margin: 0;
}

.promo-card h3 {
  padding: 0 18px 18px;
  font-size: 20px;
}

.promo-card span {
  display: inline-block;
  margin: 0 18px 8px;
  color: #ffc7c4;
  font-weight: 800;
}

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

.property-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(18, 24, 36, .05);
}

.property-photo {
  height: 170px;
  background:
    linear-gradient(135deg, rgba(22, 22, 24, .1), rgba(241, 59, 53, .3)),
    linear-gradient(145deg, #d9dde5, #fff);
  position: relative;
  overflow: hidden;
}

.property-photo.has-image::before,
.property-photo.has-image::after {
  display: none;
}

.property-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.property-photo::before,
.property-photo::after {
  content: "";
  position: absolute;
  bottom: 0;
  background: #b9c1ce;
  border-top: 8px solid rgba(255, 255, 255, .35);
}

.property-photo::before {
  left: 15%;
  width: 28%;
  height: 72%;
}

.property-photo::after {
  right: 13%;
  width: 34%;
  height: 88%;
  background: #9fa8b7;
}

.photo-peak { background-color: #e6edf1; }
.photo-seasons { background-color: #e8f2e7; }
.photo-samolet { background-color: #e7edf8; }
.photo-record { background-color: #eee8df; }
.photo-dogma { background-color: #e9e4ee; }

.property-body {
  padding: 18px;
}

.property-body h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.price {
  margin-bottom: 2px;
  color: var(--red-dark);
  font-size: 20px;
  font-weight: 800;
}

.meter,
.address {
  color: var(--muted);
}

.address {
  min-height: 42px;
}

.rating {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  font-size: 13px;
}

.rating strong {
  color: var(--green);
  font-size: 22px;
}

.rating a {
  color: var(--red-dark);
  font-weight: 700;
}

.center {
  text-align: center;
  margin: 26px 0;
}

.ghost-btn {
  background: #fff;
  border: 1px solid #cfd3da;
  color: #222;
}

.collection-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-form-band {
  padding: 38px 0;
  background: var(--red);
  color: #fff;
}

.lead-form {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 34px;
  align-items: center;
}

.lead-form p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, .86);
}

.lead-form form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.lead-form .primary-btn {
  background: #1e1f22;
  white-space: nowrap;
}

.consent {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.35;
}

.consent-box {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  flex: 0 0 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  position: relative;
}

.consent-box::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 2px;
  background: transparent;
}

.consent-box.is-checked {
  background: #1e1f22;
  border-color: #1e1f22;
}

.consent-box.is-checked::after {
  background:
    linear-gradient(135deg, transparent 44%, #fff 44% 55%, transparent 55%) left 40% top 46% / 45% 45% no-repeat,
    linear-gradient(225deg, transparent 58%, #fff 58% 68%, transparent 68%) left 58% top 34% / 45% 45% no-repeat;
}

.consent a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
  color: #fff;
  font-size: 14px;
}

.lead-message.is-error {
  background: rgba(17, 17, 19, .28);
}

.lead-message.is-success {
  background: rgba(255, 255, 255, .18);
}

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

.blog-card {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  align-content: end;
  background: #fff;
}

.blog-card.with-image {
  padding: 0;
  overflow: hidden;
}

.blog-card.with-image img {
  width: 100%;
  height: 138px;
  object-fit: cover;
}

.blog-card.with-image time,
.blog-card.with-image h3 {
  margin-left: 18px;
  margin-right: 18px;
}

.blog-card time {
  color: var(--red-dark);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
}

.blog-card h3 {
  margin-bottom: 0;
}

.two-column {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
}

.apartment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.apartment-list article {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(20, 26, 42, 0.04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.apartment-list article:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 83, 83, 0.35);
  box-shadow: 0 16px 34px rgba(20, 26, 42, 0.08);
}

.apartment-list article span {
  font-size: 14px;
  color: var(--muted);
}

.apartment-list a,
.text-link {
  color: var(--red-dark);
  font-weight: 800;
  line-height: 1.25;
}

.apartment-list strong {
  font-size: 18px;
  line-height: 1.2;
  margin-top: auto;
}

.apartment-list button {
  width: fit-content;
  min-height: 40px;
  padding: 0 18px;
  background: var(--red);
  color: #fff;
  margin-top: 2px;
}

.apartment-list article:last-child {
  grid-column: 1 / -1;
}

.reviews {
  display: grid;
  align-content: start;
  gap: 12px;
}

.reviews article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.reviews p {
  margin: 8px 0;
  color: #555;
}

.reviews time {
  color: var(--muted);
  font-size: 13px;
}

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

.cottage-grid article {
  min-height: 190px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #222 0%, #363636 100%);
  color: #fff;
}

.cottage-grid h3 {
  font-size: 22px;
}

.cottage-grid p {
  color: #ffcdca;
  font-weight: 800;
}

.cottage-grid span {
  color: #d4d5d8;
}

.seo-section {
  background: #fff;
}

.seo-section .container {
  max-width: 920px;
}

.seo-section p {
  color: #555b64;
  font-size: 17px;
}

.site-footer {
  padding: 38px 0;
  background: #191919;
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 28px;
  align-items: center;
}

.footer-grid img {
  width: 230px;
  filter: invert(1) grayscale(1) contrast(1.4);
  margin-bottom: 12px;
}

.footer-grid nav {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-grid p {
  color: #c7c8cc;
  margin: 0;
  font-size: 13px;
}

.cookie-note {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: min(720px, calc(100% - 36px));
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #1d1d1f;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.cookie-note button {
  min-height: 38px;
  background: var(--red);
  color: #fff;
}

.cookie-note.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .topbar__inner {
    grid-template-columns: 240px 1fr auto;
  }

  .logo img {
    width: 236px;
  }

  .messengers {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }

  .main-nav.is-open {
    display: block;
  }

  .nav-row,
  .utility-row__inner {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 0;
    gap: 12px;
  }

  .telegram-link {
    margin-left: 0;
  }

  .filter-grid,
  .lead-form,
  .two-column,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    align-items: stretch;
  }

  .property-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .promo-grid,
  .cottage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .lead-form .primary-btn {
    grid-column: 1 / -1;
  }
}

@media (min-width: 981px) and (max-width: 1199px) {
  .two-column {
    grid-template-columns: 1.02fr .98fr;
    gap: 18px;
    align-items: stretch;
  }

  .apartment-list article {
    min-height: 176px;
  }

  .apartment-list article button {
    align-self: flex-start;
  }

  .reviews {
    align-content: stretch;
  }

  .reviews article {
    min-height: 142px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

  .topbar__inner {
    min-height: 72px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .header-contact {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .phone {
    font-size: 20px;
  }

  .search-card {
    padding: 20px;
  }

  .section {
    padding: 42px 0;
  }

  .section-head {
    display: block;
  }

  .tabs {
    margin-top: 12px;
  }

  .promo-grid,
  .property-grid,
  .blog-grid,
  .cottage-grid,
  .apartment-list,
  .lead-form form,
  .benefits {
    grid-template-columns: 1fr;
  }

  .promo-card.large {
    grid-column: auto;
  }

  .apartment-list article {
    grid-column: auto;
  }

  .cookie-note {
    align-items: stretch;
    flex-direction: column;
  }
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 18, 26, .58);
  animation: popup-fade .2s ease;
}

.popup-overlay[hidden] {
  display: none;
}

body.popup-open {
  overflow: hidden;
}

.popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px 28px;
  animation: popup-rise .24s ease;
}

.popup h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.popup p {
  color: var(--muted);
  margin-bottom: 20px;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.popup-close:hover {
  background: var(--soft);
}

.popup-form {
  display: grid;
  gap: 12px;
}

.popup-form .consent {
  color: var(--muted);
}

.popup-form .consent-box {
  border-color: #c2c6cd;
  background: #fff;
}

.popup-form .consent-box.is-checked {
  background: var(--red);
  border-color: var(--red);
}

.popup-form .consent a {
  color: var(--red-dark);
}

.popup-form .lead-message {
  background: var(--soft);
  color: var(--ink);
}

.popup-form .lead-message.is-error {
  background: #fdecec;
  color: var(--red-dark);
}

.popup-form .lead-message.is-success {
  background: #e9f7ef;
  color: var(--green);
}

@keyframes popup-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popup-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .popup {
    padding: 26px 20px 22px;
  }

  .popup h2 {
    font-size: 22px;
  }
}
