/* Здрами — брандови цветове от логото и заглавната страница във Figma */
:root {
  --brand: #d2372b;        /* червеното от логото */
  --brand-dark: #a92a21;
  --maroon: #6b1e1e;       /* цветът на заглавието */
  --rose: #f6e4e4;         /* бутоните от макета, по-приглушено */
  --cream: #fbf8ef;        /* кремавият фон, по-неутрален */
  --card: #ffffff;
  --ink: #241b1b;
  --ink-2: #4a3f3f;
  --muted: #7a6f6c;
  --line: #e7dfd6;
  --free: #2f9e5b;
  --reserved: #d79a00;
  --occupied: #c9302c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60,20,20,.05), 0 10px 30px rgba(60,20,20,.07);
  --head: "Ubuntu", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--cream); line-height: 1.65; font-size: 17px; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; color: var(--maroon); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: rgba(251,248,239,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 52px; height: auto; }
.brand b { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: var(--maroon); letter-spacing: .04em; display: block; line-height: 1.1; }
.brand small { font-size: .78rem; color: var(--muted); font-weight: 600; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; padding: 9px 15px; border-radius: 10px; font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.nav a:hover { background: var(--rose); color: var(--maroon); }
.nav a[aria-current="page"] { background: var(--rose); color: var(--maroon); }
.nav a.cta { background: var(--brand); color: #fff; margin-left: 6px; }
.nav a.cta:hover { background: var(--brand-dark); color: #fff; }
.menu-btn { display: none; background: none; border: 0; color: var(--maroon); font-size: 1.7rem; cursor: pointer; padding: 6px; }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 76px; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; display: none; }
  .nav.open { display: flex; }
  .nav a.cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 11px; font-weight: 700; font-family: var(--body); font-size: 1rem; text-decoration: none; border: 0; cursor: pointer; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: #fff; color: var(--maroon); }
.btn-light:hover { background: var(--rose); }
.btn-outline { background: transparent; color: var(--maroon); border: 1.5px solid var(--maroon); }
.btn-outline:hover { background: var(--rose); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- home hero ---------- */
.hero { position: relative; color: #fff; min-height: min(78vh, 680px); display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(36,20,20,.32) 0%, rgba(36,20,20,.5) 50%, rgba(36,20,20,.82) 100%), url("images/hero.jpg") center 35%/cover no-repeat, #7a6b66; }
.hero .wrap { padding-top: 120px; padding-bottom: 72px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(3rem, 9vw, 6rem); letter-spacing: .04em; margin-bottom: .25em; text-shadow: 0 2px 24px rgba(0,0,0,.3); }
.hero .place { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; margin-bottom: 18px; backdrop-filter: blur(6px); }
.hero p { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #f1ebe8; max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; justify-content: center; }

/* ---------- 4 section cards (from the wireframe) ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: -48px; position: relative; z-index: 2; }
.card-link { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .18s, box-shadow .18s; }
.card-link:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(60,20,20,.13); }
.card-link .pic { aspect-ratio: 16/10; background: var(--rose) center/cover no-repeat; position: relative; }
.card-link .pic.icon { display: grid; place-items: center; background: linear-gradient(135deg, #f7e7e6, #fbf3ef); }
.card-link .pic.icon svg { width: 54px; height: 54px; color: var(--brand); }
.card-link .body { padding: 18px 20px 20px; }
.card-link h3 { margin: 0 0 4px; display: flex; justify-content: space-between; align-items: center; }
.card-link h3::after { content: "→"; color: var(--brand); transition: transform .18s; }
.card-link:hover h3::after { transform: translateX(4px); }
.card-link p { margin: 0; color: var(--muted); font-size: .93rem; }
@media (max-width: 980px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; } .card-link .body { padding: 12px 14px 14px; } .card-link p { display: none; } .card-link .pic.icon svg { width: 38px; height: 38px; } }

section { padding: 80px 0; }
.facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 36px; }
.facts div { background: var(--card); padding: 22px; }
.facts b { font-family: var(--head); font-size: clamp(1.35rem, 2.2vw, 1.7rem); color: var(--brand); display: block; line-height: 1.1; }
.facts span { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .facts { grid-template-columns: 1fr 1fr; } .facts div:last-child { grid-column: span 2; } }

.free-banner { background: var(--maroon); color: #fff; border-radius: var(--radius); padding: 30px 34px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.free-banner h2 { color: #fff; margin: 0 0 4px; }
.free-banner p { margin: 0; color: #f0dede; }

/* ---------- inner page header ("Home / Заглавие" from wireframe) ---------- */
.page-head { padding-top: 44px; padding-bottom: 8px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .9rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; background: var(--rose); color: var(--maroon); padding: 4px 12px; border-radius: 8px; }
.crumbs a:hover { background: #efd3d3; }
.page-body { padding-top: 28px; padding-bottom: 80px; }

/* photo + text rows (wireframe: снимка | текст) */
.rows { display: grid; gap: 22px; }
.row { display: grid; grid-template-columns: 300px 1fr; gap: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; align-items: center; }
.row:nth-child(even) { grid-template-columns: 1fr 300px; }
.row:nth-child(even) .row-pic { order: 2; }
.row-pic { aspect-ratio: 4/3; border-radius: 11px; background: var(--rose) center/cover no-repeat; display: grid; place-items: center; color: var(--brand); }
.row-pic svg { width: 56px; height: 56px; }
.row h3 { margin-bottom: 6px; }
.row p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .row, .row:nth-child(even) { grid-template-columns: 1fr; } .row:nth-child(even) .row-pic { order: 0; } }

/* text-only blocks (wireframe: Услуги) */
.blocks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.block .n { font-family: var(--head); font-weight: 700; color: var(--brand); font-size: .95rem; margin-bottom: 8px; display: block; }
.block p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .blocks { grid-template-columns: 1fr; } }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery button:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery button { padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4/3; background: var(--rose); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.04); }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } }
.lightbox { position: fixed; inset: 0; background: rgba(20,10,10,.9); display: grid; place-items: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; border-radius: 10px; }

/* ---------- client zone: list rows → detail panel (wireframe) ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dot-free { background: var(--free); } .dot-reserved { background: var(--reserved); } .dot-occupied { background: var(--occupied); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 7px 15px; border-radius: 999px; font: 700 .88rem var(--body); cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--maroon); color: #fff; border-color: var(--maroon); }

.zone { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .zone { grid-template-columns: 1fr; } }
.unit-list { display: grid; gap: 10px; }
.unit { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 15px 18px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: border-color .15s; }
.unit:hover { border-color: #d3c4bc; }
.unit[aria-selected="true"] { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); }
.unit h3 { margin: 0; font-size: 1rem; color: var(--ink); }
.unit .meta { grid-column: 1; font-size: .88rem; color: var(--muted); }
.unit .badge { grid-row: 1 / span 2; grid-column: 2; }
.badge { font-size: .76rem; font-weight: 800; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.badge.free { background: #e1f3e8; color: #1d6b3c; }
.badge.reserved { background: #fbefcc; color: #7a5a00; }
.badge.occupied { background: #fde3e1; color: #a3231c; }

.detail { position: sticky; top: 96px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.detail h2 { margin-bottom: 6px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 20px 0; }
.detail dt { color: var(--muted); font-size: .9rem; }
.detail dd { margin: 0; font-weight: 700; }
.detail .empty { color: var(--muted); }

.plan-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 22px; }
.plan-card svg { width: 100%; height: auto; display: block; }
.plan-unit { cursor: pointer; }
.plan-unit rect { stroke: #fff; stroke-width: .5; transition: filter .15s; }
.plan-unit:hover rect { filter: brightness(1.08); }
.plan-unit.dim { opacity: .3; }
.plan-unit.sel rect { stroke: var(--maroon); stroke-width: .7; }
.plan-unit text, .plan-road { font-family: var(--body); font-weight: 800; pointer-events: none; }
.plan-unit:focus-visible { outline: none; }
.plan-unit:focus-visible rect { stroke: var(--brand); stroke-width: .7; }

/* ---------- contacts ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.info { display: grid; gap: 12px; }
.info-row { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 15px 18px; display: flex; gap: 14px; align-items: center; }
.info-row svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.info-row small { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.info-row a { text-decoration: none; font-weight: 700; }
.info-row a:hover { color: var(--brand); }
.map { border: 0; width: 100%; height: 280px; border-radius: 13px; }

form.inquiry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
form.inquiry h2 { grid-column: 1 / -1; margin: 0; font-size: 1.5rem; }
form.inquiry .full { grid-column: 1 / -1; }
label { font-size: .86rem; font-weight: 700; display: grid; gap: 6px; color: var(--ink-2); }
input, select, textarea { font: inherit; font-size: 1rem; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fdfbf7; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.unit-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-picks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .88rem; }
.unit-picks input { width: auto; margin: 0; accent-color: var(--brand); }
.unit-picks label:has(input:checked) { background: var(--rose); border-color: var(--maroon); color: var(--maroon); }
.form-msg { grid-column: 1 / -1; padding: 12px 14px; border-radius: 10px; font-weight: 700; margin: 0; }
.form-msg.ok { background: #e1f3e8; color: #1d6b3c; }
.form-msg.err { background: #fde7e4; color: #9b2a1a; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 560px) { form.inquiry { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
footer { background: var(--maroon); color: #e9d6d6; padding: 34px 0; font-size: .92rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: #fff; text-decoration: none; }
footer a:hover { text-decoration: underline; }

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

/* ---------- client zone: conditional plan (Склад А / В / С) ---------- */
.buildings { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.bld { border: 2px solid var(--line); border-radius: 14px; padding: 14px; background: var(--cream); min-width: 0; }
.bld h4 { margin: 0 0 12px; font-family: var(--head); color: var(--maroon); font-size: 1.1rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bld h4 small, .group-title small { font-family: var(--body); font-weight: 700; font-size: .8rem; color: var(--muted); }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.room { aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 9px; color: #fff; font: 800 1.1rem/1.05 var(--body); cursor: pointer; display: grid; place-content: center; transition: opacity .15s, transform .1s; }
.room small { font-weight: 700; font-size: .64rem; opacity: .92; }
.room.free { background: var(--free); }
.room.occupied { background: var(--occupied); }
.room.dim { opacity: .28; }
.room:hover { transform: translateY(-1px); }
.room[aria-pressed="true"] { outline: 3px solid var(--maroon); outline-offset: 2px; }
.room:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.group-title { font-family: var(--head); font-weight: 700; color: var(--maroon); display: flex; justify-content: space-between; align-items: baseline; margin: 10px 4px 0; }
.group-title:first-child { margin-top: 0; }
.detail-empty { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 18px; color: var(--ink-2); }
.pick-filter { margin-bottom: 10px; }
.unit-picks label[hidden] { display: none; }
[aria-invalid] { border-color: var(--brand) !important; background: #fff6f5 !important; }

.row-pic { position: relative; }
.pic-badge { position: absolute; left: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 14px; background: var(--card); color: var(--brand); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(36,20,20,.25); }
.pic-badge svg { width: 30px; height: 30px; }

.map-open { font-weight: 700; color: var(--brand); text-decoration: none; padding: 2px 4px; }
.map-open:hover { text-decoration: underline; }

a.place { color: #fff; text-decoration: none; transition: background .15s; }
a.place:hover { background: rgba(255,255,255,.28); }
a.place:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
