:root {
  --ink: #19171c;
  --muted: #6d6871;
  --paper: #ffffff;
  --card: #ffffff;
  --soft: #f7f4f9;
  --line: #e7e1ea;
  --purple: #8b2fc9;
  --purple-dark: #6d1e9e;
  --purple-soft: #f1e7f8;
  --green: #1e9b61;
  --shadow: 0 18px 55px rgba(36, 17, 48, 0.11);
  --radius: 22px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7f3fa;
  --muted: #b6aeb9;
  --paper: #0f0d11;
  --card: #19161c;
  --soft: #211d24;
  --line: #37303b;
  --purple: #b657ee;
  --purple-dark: #9436cc;
  --purple-soft: #32203d;
  --shadow: 0 22px 65px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: color .25s ease, background-color .25s ease;
}
body.dialog-open { overflow: hidden; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(231,225,234,.9);
  backdrop-filter: blur(14px);
}
html[data-theme="dark"] .site-header { background: rgba(15,13,17,.94); border-color: rgba(255,255,255,.09); }
.header-inner { min-height: 82px; display: flex; align-items: center; gap: 32px; }
.brand { width: 185px; flex: 0 0 auto; }
.brand img { width: 100%; height: 58px; object-fit: contain; object-position: left center; }
html[data-theme="dark"] .brand img { padding: 5px 8px; border-radius: 10px; background: #fff; }
.desktop-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.desktop-nav a { position: relative; font-weight: 700; font-size: .92rem; }
.desktop-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px;
  background: var(--purple); transition: right .22s ease;
}
.desktop-nav a:hover::after { right: 0; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.theme-toggle {
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--card);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--purple); }
.theme-icon { grid-area: 1 / 1; font-size: 1.25rem; line-height: 1; transition: opacity .2s ease, transform .25s ease; }
.theme-icon-sun, .theme-toggle[data-mode="dark"] .theme-icon-moon { opacity: 0; transform: scale(.65) rotate(-40deg); }
.theme-toggle[data-mode="dark"] .theme-icon-sun { opacity: 1; transform: scale(1) rotate(0); color: #ffd166; }
.compact-select { position: relative; display: block; }
.compact-select select {
  appearance: none; min-width: 66px; min-height: 42px; padding: 5px 12px 13px; border: 1px solid var(--line); border-radius: 11px;
  text-align: center; color: var(--ink); background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238c8490' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center calc(100% - 4px); background-size: 9px 6px;
}
.compact-select:nth-of-type(2) select { min-width: 78px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 12px; font-weight: 800; transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: var(--purple); box-shadow: 0 10px 25px rgba(139,47,201,.25); }
.button-primary:hover { background: var(--purple-dark); }
.header-contact { min-height: 42px; padding-inline: 17px; font-size: .9rem; }
.menu-button { display: none; width: 44px; height: 44px; border: 0; border-radius: 11px; background: var(--soft); }
.menu-button span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--ink); }
.mobile-nav { padding: 5px 20px 20px; border-top: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 12px; font-weight: 700; }

.hero { position: relative; min-height: 620px; display: grid; align-items: center; overflow: hidden; background: #241a29; }
.hero-media {
  position: absolute; inset: 0;
  background: url("assets/property-5.jpg") center 54%/cover no-repeat;
  transform: scale(1.02);
}
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,10,21,.88) 0%, rgba(24,12,28,.64) 48%, rgba(24,12,28,.18) 100%); }
.hero-content { position: relative; z-index: 1; padding-block: 82px; color: #fff; }
.eyebrow { margin: 0 0 12px; color: rgba(255,255,255,.78); font-size: .82rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.purple { color: var(--purple); }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.7rem, 6vw, 5.1rem); line-height: 1.02; letter-spacing: -.055em; }
.hero-copy { max-width: 650px; margin: 22px 0 34px; color: rgba(255,255,255,.84); font-size: clamp(1rem, 2vw, 1.2rem); }
.search-panel {
  display: grid; grid-template-columns: minmax(230px, 1.7fr) repeat(2, minmax(150px, .75fr)) auto;
  gap: 10px; max-width: 1050px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
}
.search-field { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px; border-right: 1px solid var(--line); color: var(--ink); }
.search-field span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.search-field input, .search-field select { width: 100%; border: 0; outline: 0; color: var(--ink); background-color: transparent; font-weight: 650; }
.search-field select, .sort-control select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238c8490' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 6px; padding-right: 28px;
}
.search-field input::placeholder { color: #a39da7; font-weight: 500; }
.search-button { min-width: 128px; border-radius: 13px; }

.catalog { padding-block: 88px 102px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading h2, .about h2, .contact h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.1; letter-spacing: -.04em; }
.result-meta { display: flex; align-items: baseline; gap: 7px; color: var(--muted); white-space: nowrap; }
.result-meta strong { color: var(--purple); font-size: 1.7rem; }
.filter-row { display: flex; align-items: center; gap: 9px; margin: 34px 0 28px; }
.chip { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--card); font-weight: 700; }
.chip.active, .chip:hover { color: #fff; border-color: var(--purple); background: var(--purple); }
.sort-control { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--muted); font-size: .85rem; }
.sort-control select { min-height: 42px; padding-left: 13px; border: 1px solid var(--line); border-radius: 11px; background-color: var(--card); color: var(--ink); }
.property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.property-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: transform .24s ease, box-shadow .24s ease; }
.property-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.property-image-button { position: relative; display: block; width: 100%; height: 260px; padding: 0; overflow: hidden; border: 0; background: #ddd; }
.property-image { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.property-card:hover .property-image { transform: scale(1.035); }
.property-badge, .featured-badge { position: absolute; top: 16px; padding: 7px 11px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.property-badge { left: 16px; color: #fff; background: var(--purple); }
.featured-badge { right: 16px; color: #5c3b06; background: #ffd983; }
.property-photo-count { position: absolute; right: 14px; bottom: 14px; padding: 7px 10px; border-radius: 999px; color: #fff; background: rgba(14,10,16,.72); backdrop-filter: blur(8px); font-size: .72rem; font-weight: 800; }
.property-content { padding: 20px; }
.property-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.property-type { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.property-price { color: var(--purple); font-size: 1.16rem; font-weight: 800; white-space: nowrap; }
.property-title { margin: 12px 0 7px; min-height: 52px; font-size: 1.08rem; line-height: 1.42; }
.property-location { margin: 0; color: var(--muted); font-size: .9rem; }
.property-features { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 19px; }
.property-features span { padding: 6px 9px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: .78rem; font-weight: 700; }
.property-actions { display: flex; gap: 10px; }
.details-button, .whatsapp-button { min-height: 42px; flex: 1; border-radius: 10px; font-size: .85rem; font-weight: 800; }
.details-button { border: 1px solid var(--line); color: var(--ink); background: var(--card); }
.details-button:hover { border-color: var(--purple); color: var(--purple); }
.whatsapp-button { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--green); }
.empty-state { padding: 75px 20px; text-align: center; border: 1px dashed #d7cddd; border-radius: var(--radius); background: var(--soft); }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; color: var(--purple); background: var(--purple-soft); font-size: 2rem; }
.empty-state h3 { margin: 0; font-size: 1.5rem; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); }
.button-secondary { border-color: var(--purple); color: var(--purple); background: var(--card); }

.about { padding-block: 95px; background: var(--soft); }
.about-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 70px; align-items: center; }
.about-copy > p:not(.eyebrow) { max-width: 700px; color: var(--muted); font-size: 1.08rem; }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 35px; }
.trust-row div { padding: 18px; border-left: 3px solid var(--purple); background: var(--card); }
.trust-row strong, .trust-row span { display: block; }
.trust-row strong { font-size: 1.55rem; }
.trust-row span { color: var(--muted); font-size: .8rem; }
.about-card { position: relative; min-height: 330px; padding: 42px; overflow: hidden; border-radius: 28px; color: #fff; background: linear-gradient(145deg, #9c3ed8, #6d1e9e); box-shadow: var(--shadow); }
.about-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -70px; bottom: -60px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; }
.about-number { color: rgba(255,255,255,.45); font-size: 4rem; font-weight: 800; line-height: 1; }
.about-card h3 { margin: 50px 0 10px; font-size: 1.6rem; line-height: 1.25; }
.about-card p { color: rgba(255,255,255,.8); }
.text-link { display: inline-block; margin-top: 12px; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,.7); font-weight: 800; }
.contact { padding-block: 90px; }
.contact-card { display: flex; align-items: center; justify-content: space-between; gap: 45px; padding: 54px 60px; border-radius: 28px; color: #fff; background: #1d1820; }
.contact-card p:not(.eyebrow) { margin-bottom: 0; color: rgba(255,255,255,.68); }
.contact-actions { display: flex; gap: 12px; flex: 0 0 auto; }
.button-light { color: var(--purple-dark); background: #fff; }
.button-outline-light { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }

.site-footer { padding: 65px 0 25px; color: rgba(255,255,255,.72); background: #110f12; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .65fr 1fr; gap: 65px; }
.footer-brand { color: #fff; font-size: 1.9rem; font-weight: 800; }
.footer-brand span { margin-left: 5px; font-size: .72rem; letter-spacing: .16em; }
.footer-grid h3 { margin: 0 0 13px; color: #fff; font-size: .95rem; }
.footer-grid a, .footer-grid p { display: block; margin: 8px 0; font-size: .9rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 45px; padding-top: 23px; border-top: 1px solid rgba(255,255,255,.1); font-size: .78rem; }

.property-dialog { position: relative; width: min(940px, calc(100% - 24px)); max-height: min(92vh, 900px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--card); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.property-dialog::backdrop { background: rgba(13, 8, 15, .72); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; float: right; top: 14px; z-index: 5; width: 42px; height: 42px; margin: 14px 14px -56px 0; border: 0; border-radius: 50%; color: #fff; background: rgba(20,13,22,.76); font-size: 1.7rem; line-height: 1; }
.dialog-gallery { position: relative; padding: 0 0 12px; background: #100d12; }
.gallery-main { display: block; width: 100%; height: 500px; padding: 0; border: 0; background: #100d12; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-expand { position: absolute; right: 18px; top: 454px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: rgba(12,8,14,.7); font-size: 1rem; pointer-events: none; }
.gallery-arrow { position: absolute; z-index: 2; top: 230px; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: #fff; background: rgba(15,10,17,.62); backdrop-filter: blur(8px); font-size: 2rem; line-height: 1; }
.gallery-arrow:hover { background: var(--purple); }
.gallery-arrow-prev { left: 16px; }
.gallery-arrow-next { right: 16px; }
.gallery-counter { position: absolute; left: 18px; top: 456px; padding: 6px 10px; border-radius: 999px; color: #fff; background: rgba(12,8,14,.7); font-size: .75rem; font-weight: 800; }
.gallery-thumbnails { display: flex; gap: 9px; padding: 12px 14px 0; overflow-x: auto; scrollbar-width: thin; }
.gallery-thumb { flex: 0 0 88px; width: 88px; height: 64px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: #211b24; opacity: .65; transition: opacity .2s ease, border-color .2s ease, transform .2s ease; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border-color: var(--purple); transform: translateY(-1px); }
.dialog-body { padding: 28px 32px 34px; }
.dialog-head { display: flex; justify-content: space-between; gap: 30px; }
.dialog-body h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.15; }
.dialog-price { color: var(--purple); font-size: 1.45rem; font-weight: 800; white-space: nowrap; }
.dialog-location { margin: 10px 0 18px; color: var(--muted); }
.dialog-description { color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; margin-top: 25px; }
.dialog-actions .button { min-width: 150px; }
.telegram-button { color: #fff; background: #2188c9; }

.gallery-lightbox:not([open]) { display: none; }
.gallery-lightbox[open] { position: fixed; z-index: 100; inset: 0; display: grid; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; place-items: center; padding: 72px; border: 0; color: #fff; background: rgba(5,4,6,.96); backdrop-filter: blur(12px); }
.gallery-lightbox::backdrop { background: rgba(5,4,6,.9); }
.gallery-lightbox img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 25px 80px rgba(0,0,0,.5); }
.lightbox-close, .lightbox-arrow { position: absolute; z-index: 2; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.lightbox-close { top: 22px; right: 22px; width: 46px; height: 46px; font-size: 1.8rem; }
.lightbox-arrow { top: 50%; width: 54px; height: 54px; transform: translateY(-50%); font-size: 2.2rem; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-close:hover, .lightbox-arrow:hover { background: var(--purple); }
.lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 7px 12px; border-radius: 999px; color: #fff; background: rgba(255,255,255,.1); font-size: .8rem; font-weight: 800; }

@media (max-width: 1020px) {
  .desktop-nav { display: none; }
  .header-actions { margin-left: auto; }
  .menu-button { display: block; }
  .mobile-nav:not([hidden]) { display: block; }
  .property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-panel { grid-template-columns: 1fr 1fr; }
  .search-field-wide { grid-column: 1 / -1; }
  .search-field { border-right: 0; }
  .about-grid { grid-template-columns: 1fr; gap: 38px; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 70px; gap: 10px; }
  .brand { width: 125px; }
  .brand img { height: 48px; }
  .header-contact { display: none; }
  .theme-toggle { width: 38px; height: 38px; }
  .compact-select select { min-width: 54px; min-height: 38px; padding: 4px 8px 12px; font-size: .78rem; }
  .compact-select:nth-of-type(2) select { min-width: 64px; }
  .hero { min-height: 670px; }
  .hero-content { padding-block: 62px; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.6rem); }
  .hero-copy { margin-bottom: 26px; }
  .search-panel { grid-template-columns: 1fr; }
  .search-field-wide { grid-column: auto; }
  .search-field { border-bottom: 1px solid var(--line); }
  .search-button { min-height: 54px; }
  .catalog { padding-block: 66px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .filter-row { flex-wrap: wrap; }
  .sort-control { width: 100%; margin: 8px 0 0; justify-content: space-between; }
  .sort-control select { flex: 1; }
  .property-grid { grid-template-columns: 1fr; }
  .property-image-button { height: 250px; }
  .trust-row { grid-template-columns: 1fr; }
  .about { padding-block: 65px; }
  .about-card { padding: 30px; }
  .contact { padding-block: 60px; }
  .contact-card { align-items: stretch; flex-direction: column; padding: 34px 24px; }
  .contact-actions { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; }
  .gallery-main { height: 280px; }
  .gallery-arrow { top: 118px; width: 42px; height: 42px; }
  .gallery-counter { top: 238px; }
  .gallery-expand { top: 236px; }
  .gallery-thumb { flex-basis: 74px; width: 74px; height: 54px; }
  .dialog-body { padding: 24px 20px 28px; }
  .dialog-head { flex-direction: column; gap: 10px; }
  .dialog-actions { flex-direction: column; }
  .gallery-lightbox { padding: 60px 14px; }
  .lightbox-arrow { width: 44px; height: 44px; background: rgba(0,0,0,.58); }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
