/* ==========================================================================
   СантехЕкспрес — єдиний стиль сайту (mobile-first)
   ========================================================================== */

:root {
  --ink: #0b2239;
  --ink-2: #14354f;
  --blue: #14649c;
  --sun: #ffc21a;
  --sun-deep: #f0aa00;
  --paper: #f2f6f9;
  --panel: #dfeaf1;
  --line: #d5e0e8;
  --text: #17283a;
  --muted: #52667a;
  --ok: #0f7a55;
  --warn: #b4452b;
  --white: #fff;

  --h: 64px;                 /* висота шапки */
  --wrap: 1140px;
  --radius: 16px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (min-width: 900px) { :root { --h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--h) + 16px);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }
[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--sun); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--sun); color: var(--ink); font-weight: 700;
  padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - 32px)); margin-inline: auto; }
@media (min-width: 700px) { .wrap { width: min(var(--wrap), calc(100% - 56px)); } }

/* ---------- Типографіка ---------- */
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(1.95rem, 6.2vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.2vw, 2.15rem); font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }

.section { padding: 48px 0; }
@media (min-width: 900px) { .section { padding: 80px 0; } }
.section-head { margin-bottom: 24px; max-width: 640px; }
.section-head p { margin-top: 10px; color: var(--muted); }
.section.alt { background: var(--paper); }

/* ---------- Верхня смуга (тільки десктоп) ---------- */
.topbar { display: none; background: var(--ink); color: #c5d3df; font-size: 14px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 16px; }
.topbar a { color: #fff; font-weight: 600; }
.topbar a:hover { color: var(--sun); }
.topbar small { color: #8fa6b8; font-weight: 500; margin-left: 4px; }
.topbar .phones { display: flex; gap: 22px; }
@media (min-width: 760px) { .topbar { display: block; } }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--h); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }
.brand svg { width: 38px; height: 38px; flex-shrink: 0; }

.nav-toggle {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s, opacity .2s; content: '';
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(11, 34, 57, .12);
  padding: 8px 16px 16px;
  display: none;
}
.site-nav.open { display: block; }
.site-nav a { display: block; padding: 14px 4px; font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav .nav-call { display: none; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; display: flex; align-items: center; gap: 28px; padding: 0; box-shadow: none; border: 0; background: none; }
  .site-nav ul { display: flex; gap: 28px; }
  .site-nav a { padding: 6px 0; border: 0; font-size: .95rem; color: var(--text); position: relative; }
  .site-nav a:hover { color: var(--blue); }
  .site-nav a[aria-current="page"]::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 3px; background: var(--sun);
  }
  .site-nav .nav-call { display: inline-flex; }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid transparent; border-radius: 12px;
  font-weight: 700; font-size: 1rem; line-height: 1.2;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-line { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .92rem; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Статус «працюємо / не працюємо» ---------- */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: #e6eef5;
  font-size: .9rem; font-weight: 600;
}
.status::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: #8fa6b8; flex-shrink: 0;
}
.status[data-open="yes"]::before { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, .22); }
.status[data-open="no"]::before { background: #ff9a7a; }
.status.light { background: var(--paper); color: var(--text); border: 1px solid var(--line); }
.status.light[data-open="yes"]::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(15, 122, 85, .16); }
.status.light[data-open="no"]::before { background: var(--warn); }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; gap: 28px; padding-block: 32px 0; }
.hero h1 { color: #fff; margin-top: 18px; max-width: 14ch; }
.hero-sub { margin-top: 14px; font-size: 1.1rem; color: #c5d3df; max-width: 34ch; }

.call-stack { margin-top: 26px; display: grid; gap: 12px; max-width: 420px; }
.call-btn {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 18px; border-radius: 14px;
  background: var(--sun); color: var(--ink);
  transition: background-color .15s, transform .15s;
}
.call-btn:hover { background: var(--sun-deep); }
.call-btn:active { transform: scale(.99); }
.call-btn.alt { background: #fff; }
.call-btn.alt:hover { background: #e9f0f5; }
.call-btn svg { width: 26px; height: 26px; flex-shrink: 0; }
.call-btn b { display: block; font-size: 1.28rem; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.call-btn small { display: block; font-size: .85rem; font-weight: 600; color: #3d546a; }

.hero-link { display: inline-block; margin-top: 18px; font-weight: 600; color: #fff; border-bottom: 2px solid var(--sun); padding-bottom: 2px; }
.hero-link:hover { color: var(--sun); }

.hero-photo {
  background: var(--panel); border-radius: 24px 24px 0 0;
  overflow: hidden; align-self: end;
  height: 300px;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; mix-blend-mode: multiply; }

@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: 56px; padding-block: 64px 0; align-items: end; }
  .hero-text { padding-bottom: 72px; align-self: center; }
  .hero-photo { height: 480px; border-radius: 32px 32px 0 0; }
}

/* ---------- Послуги ---------- */
.services { display: grid; gap: 12px; }
.service {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; transition: border-color .15s, box-shadow .15s;
}
.service:hover { border-color: var(--blue); box-shadow: 0 10px 26px rgba(11, 34, 57, .1); }
.service-img { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--panel); }
.service-img img { width: 100%; height: 100%; object-fit: cover; }
.service-img.heat { display: grid; place-items: center; background: linear-gradient(160deg, #1b4f7a, #0b2239); }
.service-img.heat svg { width: 52px; height: 52px; }
.service h3 { margin-bottom: 2px; }
.service p { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.service .more { display: none; margin-top: 12px; font-weight: 700; font-size: .92rem; color: var(--blue); }

@media (min-width: 640px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .services { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .service { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 14px; }
  .service-img { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 14px; }
  .service-img.heat svg { width: 30%; height: auto; }
  .service p { flex: 1; }
  .service .more { display: block; }
}

/* ---------- Чому ми ---------- */
.why { display: grid; gap: 22px 18px; grid-template-columns: 1fr 1fr; }
.why-item img { width: 64px; height: 64px; border-radius: 14px; margin-bottom: 12px; }
.why-item h3 { margin-bottom: 4px; font-size: 1rem; }
.why-item p { font-size: .92rem; color: var(--muted); line-height: 1.45; }
@media (min-width: 900px) {
  .why { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .why-item img { width: 76px; height: 76px; }
  .why-item p { font-size: .98rem; }
}
@media (max-width: 400px) { .why { grid-template-columns: 1fr; } }

/* ---------- Заголовок внутрішніх сторінок ---------- */
.page-head { background: var(--ink); color: #fff; padding: 32px 0 36px; }
.page-head h1 { color: #fff; font-size: clamp(1.7rem, 5.2vw, 2.6rem); max-width: 22ch; }
.page-head p { margin-top: 10px; color: #c5d3df; max-width: 52ch; }
@media (min-width: 900px) { .page-head { padding: 52px 0 56px; } }

/* ---------- Прайс ---------- */
.price-layout { display: grid; gap: 0; padding-block: 8px 56px; }
.price-side { display: contents; }

.search { display: block; position: relative; margin: 16px 0 14px; }
.search input {
  width: 100%; min-height: 50px; padding: 12px 16px 12px 46px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--white);
  font-size: 1rem; -webkit-appearance: none; appearance: none;
}
.search input:focus { border-color: var(--blue); outline: 0; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; color: var(--muted); pointer-events: none; }

.tabs {
  position: sticky; top: var(--h); z-index: 50;
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  margin-inline: -16px; padding: 10px 16px;
  background: var(--white); border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.tab span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab[aria-selected="true"] span { color: #9fb6c9; }

.price-panels { padding-top: 22px; min-width: 0; }
.price-block + .price-block { margin-top: 36px; }
.price-block { scroll-margin-top: 90px; }
.price-block[hidden] { display: none; }
.price-block h2 { font-size: clamp(1.3rem, 3.6vw, 1.7rem); margin-bottom: 8px; }

.price-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.price-list .n { flex: 0 1 auto; min-width: 0; font-size: .98rem; line-height: 1.35; }
.price-list .dots { flex: 1 1 14px; min-width: 14px; border-bottom: 2px dotted #b9c9d6; translate: 0 -4px; }
.price-list .p { flex: 0 0 auto; text-align: right; line-height: 1.2; }
.price-list .p b { display: block; font-size: 1.02rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.price-list .p small { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.price-list li[hidden] { display: none; }

.price-empty { padding: 28px 0; color: var(--muted); }
.price-empty a { color: var(--blue); font-weight: 700; }
.price-note { margin-top: 28px; padding: 16px 18px; border-radius: 12px; background: var(--paper); color: var(--muted); font-size: .92rem; }

@media (min-width: 900px) {
  .price-layout { grid-template-columns: 260px 1fr; gap: 56px; padding-top: 40px; }
  .price-side { display: block; position: sticky; top: calc(var(--h) + 24px); align-self: start; }
  .search { margin: 0 0 16px; }
  .tabs {
    position: static; flex-direction: column; gap: 4px; overflow: visible;
    margin: 0; padding: 0; background: none; border: 0;
  }
  .tab { justify-content: space-between; border-radius: 12px; border-color: transparent; background: none; padding: 10px 14px; }
  .tab:hover { background: var(--paper); border-color: transparent; }
  .tab[aria-selected="true"] { background: var(--ink); }
  .price-panels { padding-top: 0; }
  .price-block { scroll-margin-top: 0; }
  .price-list .n { font-size: 1.02rem; }
}

body.searching .tabs { opacity: .45; pointer-events: none; }

/* ---------- Контакти ---------- */
.contact-grid { display: grid; gap: 28px; padding-block: 40px 56px; }
.phone-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px; background: var(--paper); border: 2px solid transparent; border-radius: 18px;
  transition: border-color .15s, background-color .15s;
}
.phone-card:hover { border-color: var(--ink); background: var(--white); }
.phone-card + .phone-card { margin-top: 12px; }
.phone-card b { display: block; font-size: clamp(1.3rem, 5.4vw, 1.7rem); font-weight: 800; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.phone-card small { display: block; margin-top: 2px; color: var(--muted); font-weight: 600; }
.phone-card .go {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--sun); color: var(--ink); flex-shrink: 0;
}
.phone-card .go svg { width: 24px; height: 24px; }

.info-list { display: grid; gap: 18px; align-content: start; }
.info-list dt { font-size: .88rem; color: var(--muted); font-weight: 600; }
.info-list dd { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-top: 2px; }
.info-list dd a { color: var(--blue); border-bottom: 1px solid currentColor; word-break: break-all; }

@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.1fr .9fr; gap: 64px; padding-block: 64px 80px; } }

/* ---------- Футер ---------- */
.site-footer { background: var(--ink); color: #b8c8d6; padding: 44px 0 24px; margin-top: auto; }
.footer-grid { display: grid; gap: 28px; margin-bottom: 28px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: #fff; }
.footer-logo svg { width: 34px; height: 34px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--sun); }
.site-footer small { color: #8fa6b8; margin-left: 4px; }
.site-footer .about { margin-top: 12px; max-width: 34ch; }
.copyright { border-top: 1px solid #22425d; padding-top: 18px; font-size: .86rem; color: #8fa6b8; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.copyright a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; } }

/* ---------- Нижня панель дзвінка (телефон) ---------- */
.call-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11, 34, 57, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px rgba(11, 34, 57, .25);
}
.call-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border-radius: 12px; font-weight: 800; font-size: .98rem; line-height: 1.1;
  background: var(--sun); color: var(--ink); text-align: center;
}
.call-bar a + a { background: #fff; }
.call-bar svg { width: 20px; height: 20px; flex-shrink: 0; }
.call-bar small { display: block; font-size: .72rem; font-weight: 600; color: #3d546a; }
@media (max-width: 759px) { body.has-callbar { padding-bottom: 76px; } }
@media (min-width: 760px) { .call-bar { display: none; } }

/* ---------- Вхід / реєстрація ---------- */
.auth-page { background: var(--paper); }
.auth { display: grid; place-items: center; padding: 28px 16px 56px; flex: 1; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--white);
  border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px;
  box-shadow: 0 16px 40px rgba(11, 34, 57, .08);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--white);
  font-size: 1rem; /* 16px — iOS не збільшує сторінку при фокусі */
}
.field input:focus, .field select:focus { border-color: var(--blue); outline: 0; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.alert { display: none; padding: 12px 14px; border-radius: 10px; font-size: .92rem; margin-bottom: 16px; }
.alert.show { display: block; }
.alert.err { background: #fdeee9; color: #8f2d17; }
.alert.ok { background: #e4f6ee; color: #0b5a3f; }
.alert.info { background: var(--paper); color: var(--text); }
.auth-switch { text-align: center; margin-top: 18px; font-size: .94rem; color: var(--muted); }
.auth-switch a { color: var(--blue); font-weight: 700; }
.auth-note { font-size: .84rem; color: var(--muted); margin-top: 14px; line-height: 1.45; }

/* ---------- Друк ---------- */
@media print {
  .topbar, .site-header, .call-bar, .tabs, .search, .site-footer { display: none !important; }
  .page-head { background: none; color: #000; padding: 0 0 12px; }
  .page-head h1, .page-head p { color: #000; }
  .price-block[hidden] { display: block !important; }
}

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