/* ECS Power — кольори з логотипу і сайту ecs-power.com.ua */
:root {
  --navy: #08425f;
  --ink: #122237;
  --blue: #0f5b80;
  --sun: #f6c157;
  --sun-dark: #e9a92b;
  --bg: #f6f8fa;
  --tint: #eaf1f5;
  --line: #dce5ec;
  --muted: #5a6b7b;
  --white: #ffffff;
  --ok: #1e8a5a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(18, 34, 55, .08);
  --f-head: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--f-body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--white); }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
section { padding-block: 72px; scroll-margin-top: 72px; }
.sec-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; max-width: 760px; }
.sec-head p { color: var(--muted); font-size: 17px; }
.eyebrow { font: 700 13px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.bg-soft { background: var(--bg); }
.bg-navy { background: var(--navy); color: var(--white); }
.bg-navy h2, .bg-navy h3 { color: var(--white); }
.bg-navy .sec-head p { color: #cfe0ea; }
.note { color: var(--muted); font-size: 14px; margin-top: 18px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 120; background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 8px; }
main { scroll-margin-top: 76px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 16px var(--f-head); padding: 14px 22px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: default; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-dark); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--blue); }
.btn-line { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-line:hover { background: var(--tint); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white); border-color: rgba(255,255,255,.4); }
.btn-wide { width: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* Шапка */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.hdr .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.hdr .logo img { height: 30px; width: auto; }
.nav { display: flex; gap: clamp(12px, 1.5vw, 20px); }
.nav a { color: var(--ink); text-decoration: none; font: 600 15px var(--f-head); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hdr-right > .btn { white-space: nowrap; }
.hdr-phone { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font: 800 17px var(--f-head); line-height: 1.2; }
.hdr-phone small { font: 500 12px var(--f-body); color: var(--muted); }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

/* Перший екран */
.hero { padding-block: clamp(32px, 4.6vw, 68px); background: linear-gradient(150deg, #edf4f8, #fff 74%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(24px, 3.6vw, 52px); align-items: center; }
.hero-home { background: radial-gradient(ellipse at 76% 25%, #e1edf4 0, transparent 62%), linear-gradient(150deg, #eef4f7, var(--white) 82%); }
.hero-home .wrap { grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); }
.hero-home h1 { font-size: clamp(36px, 4.15vw, 59px); }
.hero-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero-text .lead { font-size: 19px; color: var(--muted); max-width: 600px; }
.hero-price { font: 700 18px var(--f-head); color: var(--ink); }
.hero-price b { font-size: 26px; color: var(--navy); }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.perks .ic { flex: 0 0 34px; height: 34px; border-radius: 9px; background: var(--tint); color: var(--navy); display: grid; place-items: center; }
.messengers { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--muted); font-size: 15px; }
.messengers a { font-weight: 600; text-decoration: none; }
.messengers a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-media { position: relative; aspect-ratio: 5 / 4; margin: 0; border-radius: 22px; overflow: hidden; background: var(--tint); box-shadow: 0 14px 36px rgba(18, 34, 55, .16); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media--service { aspect-ratio: 16 / 10; }
.hero-media--solar img { object-position: 50% 44%; }
.hero-media--backup img { object-position: 50% 45%; }
.hero-media figcaption, .path-photo figcaption { position: absolute; right: 12px; bottom: 12px; border-radius: 6px; padding: 4px 9px; font: 600 12px var(--f-head); color: var(--white); background: rgba(18,34,55,.88); max-width: calc(100% - 24px); }
.hero .wrap.with-form { align-items: start; }
.hero-intro, .hero-aside { display: grid; gap: clamp(18px, 2.2vw, 30px); min-width: 0; }
.hero-aside .hero-perks { padding: 0 4px; }
.hero-aside .perks li { align-items: center; }
.installation-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px); }
.installation-detail .checks { grid-template-columns: 1fr; }
.installation-detail .hero-media { aspect-ratio: 4 / 3; }

/* Картка форми */
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.form-card .lead-form input[aria-invalid="true"] { border-color: #b42318; }
.form-card h3 { font-size: 22px; }
.form-card .sub { color: var(--muted); font-size: 15px; }
.lead-form { display: flex; flex-direction: column; gap: 12px; }
.lead-form label { display: flex; flex-direction: column; gap: 6px; font: 600 14px var(--f-head); }
.lead-form input, .lead-form textarea { font: 16px var(--f-body); padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); width: 100%; }
.lead-form input:focus, .lead-form textarea:focus { border-color: var(--blue); outline: none; }
.lead-form textarea { min-height: 80px; resize: vertical; }
.lead-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent { font-size: 12.5px; color: var(--muted); }
.form-msg { font-size: 14px; display: none; }
.form-msg.err { display: block; color: #b42318; }
.form-msg.wait { display: block; color: var(--muted); }

/* Дві дороги */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.path { border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.path.dark { background: var(--navy); color: var(--white); }
.path.dark h3 { color: var(--white); }
.path.light { background: #fff4da; }
.path-photo { position: relative; aspect-ratio: 16 / 10; margin: 0; overflow: hidden; background: var(--tint); }
.path-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.path-photo--product img { object-position: 50% 44%; }
.path-photo--solar img { object-position: 50% 42%; }
.path-copy { padding: clamp(20px, 2.6vw, 32px); display: flex; flex: 1; flex-direction: column; gap: 14px; }
.path .tag { font: 700 13px var(--f-head); text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.path h3 { font-size: 28px; }
.path ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.path .foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.path .from { font: 800 26px var(--f-head); }
.path .from small { display: block; font: 500 13px var(--f-body); opacity: .8; }

/* Картки комплектів і товарів */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.card[hidden] { display: none; }
.card .pic { background: #f2f2f2; aspect-ratio: 4 / 3; position: relative; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; }
.card .pic.cover img { object-fit: cover; }
.card .ribbon { position: absolute; top: 12px; left: 12px; background: var(--sun); color: var(--ink); font: 700 12px var(--f-head); padding: 5px 10px; border-radius: 999px; }
.card .photo-label { position: absolute; bottom: 10px; right: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(18,34,55,.88); color: var(--white); font: 600 12px var(--f-head); }
.card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card .kind { font: 700 12px var(--f-head); text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.card .specline { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; font: 600 13px var(--f-head); background: var(--tint); color: var(--navy); padding: 5px 10px; border-radius: 999px; }
.card .comp { font-size: 14px; color: var(--muted); }
.card .hold { font-size: 14.5px; }
.card .hold b { color: var(--navy); }
.card ul.feat { margin: 0; padding-left: 18px; font-size: 14.5px; display: grid; gap: 4px; color: #2b3a48; }
.card .price-row { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font: 800 24px var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.price small { display: block; font: 500 12px var(--f-body); color: var(--muted); }
.price.ask { font-size: 18px; color: var(--navy); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button { font: 600 14px var(--f-head); border: 1.5px solid var(--line); background: var(--white); color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.banner { margin-top: 24px; background: var(--tint); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.banner b { font: 800 19px var(--f-head); }

/* Таблиці */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl th, .tbl td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 700 14px var(--f-head); background: var(--bg); }
.tbl tr:last-child td { border-bottom: 0; }
.card .hold .load { color: var(--muted); white-space: nowrap; }
.tbl-title { margin: 40px 0 14px; }
.kit-tbl { min-width: 860px; }
.kit-tbl td small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.kit-tbl td:last-child b { display: block; white-space: nowrap; margin-bottom: 8px; }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 0; }

/* Режими роботи */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mode { background: var(--white); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.bg-navy .mode { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }
.bg-navy .mode p { color: #d9e6ee; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 13px var(--f-head); }
.flow span { background: var(--tint); color: var(--navy); padding: 4px 9px; border-radius: 6px; }
.bg-navy .flow span { background: rgba(246,193,87,.18); color: var(--sun); }
.flow i { font-style: normal; opacity: .6; }

/* Кроки */
.steps { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 16px; counter-reset: s; }
.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); font: 800 22px var(--f-head); color: var(--sun-dark); }
.step p { color: var(--muted); font-size: 15px; }

/* Переваги */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.why div { background: var(--white); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.why .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--sun); display: grid; place-items: center; color: var(--ink); }
.why p { color: var(--muted); font-size: 15px; }

.why.six { grid-template-columns: repeat(3, 1fr); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.stats div { background: var(--navy); color: var(--white); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stats b { font: 800 26px var(--f-head); color: var(--sun); line-height: 1.1; }
.stats span { font-size: 14px; color: #cfe0ea; }
.cta-row { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; color: var(--muted); }
.cta-row a { font-weight: 600; text-decoration: none; }
@media (max-width: 1080px) { .why.six { grid-template-columns: repeat(2, 1fr); } .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .why.six { grid-template-columns: 1fr; }
  .stats div { padding: 14px; }
  .stats b { font-size: 20px; }
  .stats span { font-size: 12.5px; }
  .cta-row .btn { width: 100%; }
}

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.gallery-link { display: block; aspect-ratio: 4 / 3; overflow: hidden; position: relative; background: var(--tint); cursor: zoom-in; }
.gallery-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.gallery-link:hover img { transform: scale(1.035); }
.gallery-link:focus-visible { outline-offset: -4px; }
.gallery-link::after { content: "↗" / ""; position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--white); color: var(--navy); font-size: 19px; }
.gallery figcaption { color: var(--ink); font: 700 14px var(--f-head); padding: 12px 16px; }
.photo-dialog { max-width: min(940px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.photo-dialog::backdrop { background: rgba(18,34,55,.86); }
.photo-dialog figure { margin: 0; }
.photo-dialog img { width: auto; height: auto; max-height: 80vh; max-height: 80dvh; object-fit: contain; background: var(--tint); }
.photo-dialog figcaption { padding: 12px 16px; font-weight: 600; }
.photo-dialog button { position: absolute; top: 10px; right: 10px; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 50%; font-size: 24px; cursor: pointer; }
body:has(.photo-dialog[open]) { overflow: hidden; }

/* Список "що входить" */
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.checks li::before { content: ""; flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23122237' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; margin-top: 2px; }

/* Квіз */
.quiz { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: start; }
.quiz-q { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.quiz-q + .quiz-q { margin-top: 14px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { font: 600 15px var(--f-head); border: 1.5px solid var(--line); background: var(--white); color: var(--ink); padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.opts button[aria-pressed="true"] { border-color: var(--navy); background: var(--tint); color: var(--navy); }
.quiz-res { position: sticky; top: 92px; }
.quiz-res .kitname { font: 800 24px var(--f-head); color: var(--navy); }

/* Калькулятор */
.calc { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; }
.calc-in { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.calc-in label { display: flex; flex-direction: column; gap: 6px; font: 600 14px var(--f-head); }
.calc-in input { width: 100%; font: 18px var(--f-body); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.calc-out { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; }
.calc-out .k { font-size: 13px; color: #cfe0ea; }
.calc-out .v { font: 800 26px var(--f-head); color: var(--sun); font-variant-numeric: tabular-nums; }
.calc-out .full { grid-column: 1 / -1; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font: 700 17px var(--f-head); padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 18px; color: #33465a; }

/* Фінальна форма */
.final { display: grid; grid-template-columns: 1fr 440px; gap: 40px; align-items: center; }
.final .copy { display: flex; flex-direction: column; gap: 16px; }
.final .copy p { color: #d9e6ee; font-size: 18px; }

/* Бізнес і партнери */
.b2b { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.b2b > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; background: var(--white); }
.b2b p { color: var(--muted); }
.b2b .btn { align-self: flex-start; margin-top: auto; }

/* Підвал */
.ftr { background: var(--ink); color: #c9d6e0; padding-block: 48px 32px; font-size: 15px; }
.ftr .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.ftr h4, .ftr .ftr-h { color: var(--white); font: 700 16px var(--f-head); margin: 0 0 12px; }
.ftr a { color: var(--white); text-decoration: none; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ftr .copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; font-size: 13px; color: #8ea3b3; }

/* Модальне вікно */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(18,34,55,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none !important; }
.modal .form-card { width: 100%; max-width: 440px; position: relative; max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { padding-right: 28px; }
.modal .x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal .subject { font: 700 14px var(--f-head); color: var(--blue); }

/* Мобільна панель */
.mbar { display: none; }

/* Сторінка подяки */
.thanks { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 80px; }
.thanks .box { max-width: 620px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.thanks .ok { width: 72px; height: 72px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; }

.nav a, .hdr-phone { white-space: nowrap; }
@media (max-width: 1160px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-left, 0px)); max-height: calc(100dvh - 72px); overflow: auto; box-shadow: var(--shadow); }
  .nav.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .burger { display: block; }
}
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .why { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hdr-right .btn { display: none; }
  .hero .wrap, .hero-home .wrap, .final, .quiz, .calc { grid-template-columns: minmax(0, 1fr); }
  .hero-home .hero-media { aspect-ratio: 16 / 10; }
  .paths, .b2b { grid-template-columns: 1fr; }
  .grid-3, .modes { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .ftr .wrap { grid-template-columns: 1fr; }
  .quiz-res { position: static; }
  section { padding-block: 52px; }
}
@media (max-width: 760px) { .installation-detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .grid-4, .why, .steps { grid-template-columns: 1fr; }
  .hdr .wrap { min-height: 60px; gap: 12px; }
  .hdr .logo img { height: 24px; }
  .hdr-phone small { display: none; }
  .hdr-phone { font-size: 15px; }
  .lead-form .row2 { grid-template-columns: 1fr; }
  .hero-btns .btn { width: 100%; }
  .calc-out { grid-template-columns: 1fr; }
  .mbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(18,34,55,.08); }
  .mbar a { display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 14px var(--f-head); text-decoration: none; color: var(--ink); }
  .mbar a.call { background: var(--sun); }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

/* ===== Мобільна версія ===== */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  section { padding-block: 40px; scroll-margin-top: 60px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
  .eyebrow { font-size: 11.5px; letter-spacing: .06em; }
  .sec-head { margin-bottom: 20px; gap: 8px; }
  .sec-head p { font-size: 15px; }
  .note { font-size: 13px; }

  /* Перший екран: спершу текст і кнопки, фото нижче і невелике */
  .hero { padding-block: 22px 32px; }
  .hero .wrap { gap: 20px; }
  .hero-text { gap: 14px; }
  .hero-text .lead { font-size: 16px; }
  .hero-home h1 { font-size: clamp(28px, 8.4vw, 38px); }
  .hero-price { font-size: 16px; }
  .hero-price b { font-size: 22px; }
  .hero-media { border-radius: 14px; }
  .hero-media figcaption, .path-photo figcaption { bottom: 8px; right: 8px; }
  .perks { gap: 8px; font-size: 15px; }
  .perks .ic { flex-basis: 30px; height: 30px; }
  .messengers { font-size: 14px; }

  /* Каруселі замість довгих стовпчиків */
  .grid-4, .grid-3, .gallery {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px));
    scroll-padding-inline: max(16px, env(safe-area-inset-left, 0px)); gap: 12px; padding-bottom: 6px; scrollbar-width: none;
  }
  .grid-4::-webkit-scrollbar, .grid-3::-webkit-scrollbar, .gallery::-webkit-scrollbar { display: none; }
  .grid-4 > *, .grid-3 > *, .gallery > * { scroll-snap-align: start; }
  .gallery { grid-auto-columns: 78%; }
  .swipe { display: block; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: 0 0 auto; }

  .card .body { padding: 16px; gap: 10px; }
  .card .comp, .card .hold, .card ul.feat { font-size: 14px; }
  .price { font-size: 21px; }
  .card .price-row .btn { padding: 12px 16px; }

  .path { border-radius: 16px; }
  .path-copy { gap: 12px; }
  .path h3 { font-size: 22px; }
  .path .from { font-size: 22px; }
  .path .foot .btn { width: 100%; }

  /* Компактні переваги і кроки: іконка/номер зліва */
  .why { grid-template-columns: 1fr; gap: 10px; }
  .why div { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; }
  .why .ic { grid-row: span 2; width: 38px; height: 38px; }
  .why div > :not(.ic) { grid-column: 2; }
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .step { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; padding: 14px 16px; }
  .step::before { grid-row: span 2; font-size: 20px; }
  .step > * { grid-column: 2; }
  .modes { gap: 12px; }
  .mode { padding: 18px; }

  /* Таблиця підбору — картками */
  .tbl-wrap { border: 0; background: none; overflow: visible; }
  table.tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl tr { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
  .tbl td { display: block; padding: 2px 0; border: 0; }
  .tbl td:first-child { color: var(--muted); font-size: 14px; }
  .kit-tbl { min-width: 0; }
  .kit-tbl td { padding: 4px 0; }
  .kit-tbl td:first-child { color: var(--ink); font-size: 17px; }
  .kit-tbl td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .kit-tbl td:first-child small { display: inline; margin-left: 6px; }
  .kit-tbl td:last-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
  .kit-tbl td:last-child::before { flex-basis: 100%; }
  .kit-tbl td:last-child b { margin: 0; font-size: 18px; }

  .checks li { font-size: 15px; }
  .faq summary { font-size: 15.5px; padding: 14px 0; }
  .faq details { padding: 0 16px; }
  .banner { padding: 16px; }
  .banner .btn { width: 100%; }
  .b2b > div { padding: 20px; }
  .b2b .btn { align-self: stretch; }
  .final { gap: 20px; }
  .final .copy p { font-size: 16px; }
  .form-card { padding: 20px; border-radius: 16px; }
  .form-card h3 { font-size: 20px; }
  .quiz-q { padding: 16px; }
  .opts button { padding: 10px 12px; font-size: 14px; }
  .calc-in, .calc-out { padding: 18px; }
  .calc-out .v { font-size: 22px; }
  .calc-out .btn { width: 100%; }
  .ftr { padding-block: 32px 24px; }

  /* Вікно заявки — знизу екрана */
  .modal { align-items: end; padding: 0; }
  .modal .form-card { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .modal textarea { min-height: 60px; }
}
@media (max-width: 360px) {
  h1 { font-size: 27px; }
  .hdr-phone { font-size: 13.5px; }
  .hdr .wrap { gap: 8px; }
  .hdr-right { gap: 6px; }
  .hdr .logo img { height: 20px; }
  .mbar a { font-size: 12.5px; gap: 4px; }
}
@media (max-width: 420px) {
  .mbar a { flex-direction: column; gap: 2px; font-size: 11.5px; }
}
.swipe { display: none; font-size: 13px; color: var(--muted); margin: -8px 0 12px; }
.hero-price b, .price, .path .from { white-space: nowrap; }
@media (max-width: 640px) {
  .swipe { display: block; }
  .card .pic { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .gallery-link img { transition: none; } }

/* Телефон і планшет: на посадкових спершу заголовок і форма, фото — нижче */
@media (max-width: 900px) {
  .hero .wrap.with-form { grid-template-columns: minmax(0, 1fr); }
  .with-form .hero-intro, .with-form .hero-aside { display: contents; }
  .with-form .hero-text { order: 1; }
  .with-form .form-card { order: 2; }
  .with-form .hero-media { order: 3; }
  .with-form .hero-perks { order: 4; }
}
@media (max-width: 640px) {
  .with-form .hero-media { aspect-ratio: 16 / 9; min-height: 0; }
  .path-photo { aspect-ratio: 16 / 8; }
}

/* ===== Покращення 01.12: форма, нижня панель, подяка ===== */
.form-card h2.h3 { font-size: 22px; font-weight: 700; letter-spacing: 0; }
.hero-callback { color: var(--muted); font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--navy); }
.lead-form input::placeholder, .lead-form textarea::placeholder { color: #8a99a8; }

/* Вибір способу зв'язку */
.contact-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.contact-pick legend { font: 600 14px var(--f-head); padding: 0; margin-bottom: 6px; width: 100%; }
.contact-pick label { position: relative; display: inline-flex; font: 600 13.5px var(--f-head); cursor: pointer; }
.contact-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.contact-pick span { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); transition: background .12s, border-color .12s; }
.contact-pick input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.contact-pick input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.form-msg.err a { color: inherit; font-weight: 700; }
@media (max-width: 640px) {
  .contact-pick { gap: 5px; flex-wrap: nowrap; }
  .contact-pick legend { font-size: 13px; margin-bottom: 5px; }
  .contact-pick label { flex: 1 1 auto; font-size: 12.5px; }
  .contact-pick span { width: 100%; text-align: center; padding: 7px 4px; }
}

/* Нижня панель: Подзвонити · Написати · Підібрати */
@media (max-width: 640px) {
  .mbar { grid-template-columns: 1fr 1fr 1fr; }
  .mbar a, .mbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 12.5px var(--f-head); text-decoration: none; color: var(--ink); background: var(--white); border: 0; border-left: 1px solid var(--line); cursor: pointer; padding: 0; }
  .mbar > :first-child { border-left: 0; }
  .mbar a.call { background: var(--sun); color: var(--ink); }
  .mbar button.order { background: var(--navy); color: var(--white); }
  .mbar svg { flex: 0 0 auto; }
}
.msheet { position: fixed; left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 61; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 -6px 30px rgba(18,34,55,.18); padding: 14px; display: grid; gap: 8px; }
.msheet[hidden] { display: none; }
.msheet p { font: 600 14px var(--f-head); color: var(--muted); margin: 0 4px 2px; }
.msheet a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font: 700 16px var(--f-head); }
.msheet a:active { background: var(--tint); }

/* Порівняння комплектів на телефоні — коротко: назва, час, ціна */
@media (max-width: 640px) {
  .kit-tbl tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; padding: 12px 14px; }
  .kit-tbl td:nth-child(2), .kit-tbl td:nth-child(3) { display: none; }
  .kit-tbl td:first-child { grid-column: 1; }
  .kit-tbl td:nth-child(4) { grid-column: 1; grid-row: 2; padding: 0; }
  .kit-tbl td:nth-child(4)::before { display: none; }
  .kit-tbl td:nth-child(4) b { font-size: 15px; }
  .kit-tbl td:nth-child(4) small { display: inline; margin-left: 4px; }
  .kit-tbl td:last-child { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; padding: 0; }
  .kit-tbl td:last-child::before { display: none; }
  .kit-tbl td:last-child b { font-size: 17px; }
}

/* Гарантія, монтаж, факти на першому екрані */
.chip-ok { background: #e3f3ea; color: #14613f; }
.price small.mont { margin-top: 2px; }
.kit-tbl td small.mont { margin: -4px 0 8px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.hero-facts span { font: 700 13.5px var(--f-head); color: var(--navy); background: var(--tint); padding: 6px 11px; border-radius: 999px; }
.hero-facts span::before { content: "✓ "; color: var(--ok); }
@media (max-width: 640px) {
  .kit-tbl td small.mont { display: none; }
  .hero-facts { gap: 6px; margin-top: -4px; }
  .hero-text .calc-link { display: none; }
  .hero-facts span { font-size: 12.5px; padding: 5px 9px; }
}

/* Калькулятор «Скільки протримається» */
.calc-link { font: 700 15px var(--f-head); color: var(--blue); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.calc-banner p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.sec-head[id] { scroll-margin-top: 84px; }
.acalc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; align-items: start; }
.acalc-in { display: grid; gap: 14px; min-width: 0; }
.acalc-in .quiz-q + .quiz-q { margin-top: 0; }
.loads { display: flex; flex-wrap: wrap; gap: 8px; }
.loads button { font: 600 14.5px var(--f-head); border: 1.5px solid var(--line); background: var(--white); color: var(--ink); padding: 8px 12px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px; text-align: left; }
.loads button small { font: 500 12px var(--f-body); color: var(--muted); }
.loads button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.loads button[aria-pressed="true"] small { color: #cfe0ea; }
.loads button.heavy[aria-pressed="true"] { background: #8a4b07; border-color: #8a4b07; }
.acalc-res { position: sticky; top: 92px; gap: 12px; }
.acalc-load { font-size: 14.5px; color: var(--muted); }
.acalc-load b { color: var(--ink); }
.acalc-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.acalc-bars button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.acalc-bars button.sel { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.acalc-bars .n { font: 700 15px var(--f-head); }
.acalc-bars .n small { display: block; font: 500 12px var(--f-body); color: var(--muted); }
.acalc-bars .n em { font: 700 11px var(--f-head); font-style: normal; text-transform: uppercase; letter-spacing: .04em; background: var(--sun); color: var(--ink); padding: 2px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }
.acalc-bars .h { font: 800 15px var(--f-head); white-space: nowrap; }
.acalc-bars .ok .h { color: var(--ok); }
.acalc-bars .low .h { color: #b25e00; }
.acalc-bars .bar { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 99px; background: var(--tint); overflow: visible; }
.acalc-bars .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--ok); transition: width .25s; }
.acalc-bars .low .bar i { background: #e9a92b; }
.acalc-bars .bar s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; }
.acalc-rec { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 2px; font-size: 14.5px; color: var(--muted); }
.acalc-rec .kitname { font: 800 22px var(--f-head); color: var(--navy); }
.acalc-rec .hero-price { color: var(--ink); margin-top: 4px; }
.acalc-warn { margin: 0; padding: 10px 12px 10px 28px; background: #fff4da; border-radius: 10px; font-size: 13.5px; color: #5c3d00; display: grid; gap: 6px; }
.acalc-warn[hidden] { display: none; }
.acalc-mini { display: none; }
@media (prefers-reduced-motion: reduce) { .acalc-bars .bar i { transition: none; } }
@media (max-width: 900px) {
  .acalc { grid-template-columns: minmax(0, 1fr); }
  .acalc-res { position: static; scroll-margin-top: 70px; }
  .acalc-mini { display: flex; justify-content: space-between; gap: 10px; align-items: center; position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 5; background: var(--navy); color: var(--white); padding: 12px 14px; border-radius: 12px; font: 700 14px var(--f-head); text-decoration: none; box-shadow: 0 6px 20px rgba(18,34,55,.25); }
  .acalc-mini span { color: var(--sun); white-space: nowrap; }
}
@media (max-width: 640px) {
  .loads { gap: 6px; }
  .loads button { font-size: 13.5px; padding: 7px 10px; }
}

/* Сторінка подяки і 404 */
.thanks h1 { font-size: clamp(28px, 4vw, 40px); }
.thanks .thanks-sub { font-size: 17px; color: var(--muted); }
.thanks .lead-no { font: 600 16px var(--f-head); background: var(--tint); color: var(--navy); padding: 8px 14px; border-radius: 999px; }
.thanks .lead-no[hidden] { display: none; }
.next-steps { list-style: none; counter-reset: ns; padding: 0; margin: 4px 0; display: grid; gap: 10px; text-align: left; width: 100%; max-width: 520px; }
.next-steps li { counter-increment: ns; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.next-steps li::before { content: counter(ns); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font: 800 15px var(--f-head); }
.next-steps b { font: 700 16px var(--f-head); }
.next-steps span { color: var(--muted); font-size: 14.5px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
