:root {
  --blue: #1aa3e0;
  --blue-dark: #0a83c9;
  --blue-soft: #e8f6fd;
  --green: #5aa845;
  --green-soft: #eef7ea;
  --ink: #16191d;
  --muted: #5b6470;
  --line: #d8e6ee;
  --bg: #ffffff;
  --bg-alt: #f5f9fb;
  --star: #f6c90e;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(10, 60, 90, 0.08);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }
.section__lead { color: var(--muted); max-width: 680px; font-size: 18px; margin-bottom: 36px; }
.eyebrow { color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin-bottom: 10px; }

/* ---------- Логотип ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: var(--ink); line-height: 1; }
.logo__mark { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.logo__mark b { color: var(--blue); font-weight: 800; }
.logo__img { height: 30px; width: auto; }
.logo__sub { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: 4px; letter-spacing: .01em; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { border-color: var(--blue); color: var(--blue-dark); background: #fff; }
.btn--ghost:hover { background: var(--blue-soft); }
.btn--sm { padding: 9px 16px; font-size: 14px; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--blue-dark); }
.header__phone { font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--ink); padding: 4px 8px; }

@media (max-width: 980px) {
  .nav, .header__phone { display: none; }
  .menu-btn { display: block; }
  .header .btn { display: none; }
  .header.is-open .nav {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; padding: 16px 20px 24px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .header.is-open .nav a { padding: 8px 0; font-size: 17px; }
}

/* ---------- Перший екран ---------- */
.hero { background: linear-gradient(160deg, var(--blue-soft) 0%, #fff 60%); padding: 72px 0 64px; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 b { color: var(--blue); }
.hero__lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero__card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 28px; border: 1px solid var(--line); }
.hero__card h3 { margin-bottom: 14px; }
.mini-center { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.mini-center:first-of-type { border-top: 0; padding-top: 0; }
.mini-center a { font-weight: 700; color: var(--ink); text-decoration: none; display: block; }
.metro { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; }
.metro--blue { background: var(--blue); }
.metro--green { background: var(--green); }
.muted { color: var(--muted); font-size: 14px; }
.hours-line { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } .hero { padding-top: 48px; } }

/* ---------- Факти ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.fact strong { display: block; font-size: 28px; font-weight: 800; color: var(--blue-dark); }
.fact span { color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Послуги ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.card__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-dark); display: grid; place-items: center; margin-bottom: 16px; }
.card p { color: var(--muted); flex: 1; }
.card__price { font-weight: 800; color: var(--ink); }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Прайс ---------- */
.price-group { margin-bottom: 36px; }
.price-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.price-group__num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: 14px; }
.price-group__head h3 { margin: 0; font-size: 21px; }
.price-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-item { display: flex; align-items: center; gap: 16px; background: #fff; border: 1.5px solid #bfe3f5; border-radius: 14px; padding: 16px 18px; }
.price-item.is-top { border-color: var(--star); background: #fffdf3; }
.price-item__body { flex: 1; min-width: 0; }
.price-item__name { font-weight: 800; color: var(--blue-dark); }
.price-item__desc { font-size: 14px; color: var(--muted); }
.price-tag { flex: none; background: var(--blue); color: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 18px; white-space: nowrap; }
.price-tag small { font-weight: 600; font-size: 13px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin-top: 6px; }
.badge--green { background: var(--green-soft); color: #3b7f2a; }
.badge--star { background: #fff4c2; color: #7a5d00; }
@media (max-width: 760px) { .price-list { grid-template-columns: 1fr; } }

/* ---------- Кроки ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 24px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Центри ---------- */
.centers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.center { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.center__bar { color: #fff; padding: 14px 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.center--blue .center__bar { background: var(--blue); }
.center--green .center__bar { background: var(--green); }
.center__bar .metro { background: #fff; color: #d0312d; width: 26px; height: 26px; font-size: 13px; }
.center__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.center__addr { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.center__phones { margin: 16px 0; }
.center__phones a { display: block; font-size: 20px; font-weight: 800; color: var(--ink); text-decoration: none; }
.center__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.hours { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 24px; padding: 18px 22px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.hours b { margin-right: 6px; }
@media (max-width: 760px) { .centers { grid-template-columns: 1fr; } }

/* ---------- Лікарям ---------- */
.doctors { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; }
.checklist li { padding: 10px 0 10px 34px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before { content: ''; position: absolute; left: 0; top: 13px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%230a83c9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.panel { background: var(--blue-soft); border-radius: 20px; padding: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
@media (max-width: 860px) { .doctors { grid-template-columns: 1fr; } }

/* ---------- Підвал ---------- */
.footer { background: var(--ink); color: #c9d3dc; padding: 48px 0 28px; }
.footer a { color: #fff; }
.footer .logo { color: #fff; }
.footer .logo__sub { color: #9aa6b2; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.footer__big { font-size: 24px; font-weight: 800; color: #fff; text-decoration: none; }
.footer__bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid #2c333a; font-size: 13px; color: #8994a0; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Мобільна панель дзвінка ---------- */
.callbar { display: none; }
@media (max-width: 700px) {
  .callbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; gap: 8px; }
  .callbar .btn { flex: 1; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
  body { padding-bottom: 76px; }
}

/* =====================================================
   Онлайн-направлення
   ===================================================== */
.ref-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 36px 0 20px; border-bottom: 2px solid var(--blue); margin-bottom: 28px; }
.ref-title { text-align: right; }
.ref-title h1 { color: var(--blue); font-size: clamp(30px, 4.5vw, 44px); margin: 0; letter-spacing: .02em; }
.ref-title span { color: var(--blue); font-size: 20px; letter-spacing: .1em; }
.ref-intro { color: var(--muted); max-width: 760px; }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.box { background: var(--blue-soft); border-radius: 16px; padding: 22px; }
.box--plain { background: #fff; border: 1px solid var(--line); }
.box h2 { font-size: 18px; color: var(--blue-dark); margin-bottom: 14px; }
.field { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid #b8cfdc; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,163,224,.18); }
@media (max-width: 760px) { .ref-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .field { grid-template-columns: 1fr; gap: 4px; } }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span { display: inline-block; padding: 8px 14px; border-radius: 10px; border: 1.5px solid #b8cfdc; background: #fff; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.opt input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(26,163,224,.35); }

.ref-item { display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid #bfe3f5; border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.ref-item:hover { border-color: var(--blue); }
.ref-item input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; cursor: pointer; }
.ref-item.is-checked { border-color: var(--blue); background: var(--blue-soft); }
.ref-item.is-disabled { opacity: .45; cursor: not-allowed; }
.ref-item.is-top { border-color: var(--star); }

.teeth { margin-top: 12px; padding: 16px; border: 1.5px dashed #9fd4ee; border-radius: 14px; background: #fff; }
.teeth__label { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.teeth__rows { overflow-x: auto; }
.teeth__row { display: grid; grid-template-columns: repeat(16, minmax(30px, 1fr)); gap: 4px; min-width: 520px; }
.teeth__row + .teeth__row { margin-top: 4px; padding-top: 4px; border-top: 1.5px solid var(--ink); }
.teeth__row > :nth-child(8) { margin-right: 6px; }
.tooth { font: inherit; font-size: 15px; font-weight: 600; padding: 7px 0; border: 1.5px solid #556; border-radius: 6px; background: #fff; cursor: pointer; color: var(--ink); }
.tooth[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.summary { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 2px solid var(--blue); padding: 14px 0; margin-top: 28px; box-shadow: 0 -8px 24px rgba(10,60,90,.08); }
.summary__inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.summary__total { font-size: 22px; font-weight: 800; }
.summary__total b { color: var(--blue-dark); }
.summary__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.notice { font-size: 13px; color: var(--muted); }
.warn { color: #b3261e; font-size: 14px; font-weight: 600; }

/* ---------- Друк направлення ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { padding: 0; font-size: 11pt; }
  .header, .footer, .callbar, .summary__actions, .no-print, .ref-intro { display: none !important; }
  .print-only { display: block; }
  .section, .container { padding: 0; max-width: none; }
  .box { background: none; border: 1px solid #999; padding: 10px; }
  .field input, .field select { border: 0; border-bottom: 1px solid #666; border-radius: 0; padding: 2px 4px; }
  .price-list > div:not(:has(.is-checked)), .ref-item:not(.is-checked), .price-group.is-empty, .opt input:not(:checked) + span { display: none; }
  .ref-item { border: 1px solid #999; padding: 6px 10px; break-inside: avoid; }
  .price-list { gap: 6px; grid-template-columns: 1fr; }
  .teeth__row { min-width: 0; }
  .teeth__rows { overflow: visible; }
  .teeth { display: none; }
  .teeth.has-selection { display: block; break-inside: avoid; }
  .tooth { padding: 3px 0; font-size: 11px; }
  .summary { position: static; box-shadow: none; border-top: 2px solid #000; }
  a { color: inherit; text-decoration: none; }
}

/* Не даємо зубній формулі розширювати сітку на мобільних */
.price-list > * { min-width: 0; }

/* Різні ціни в центрах */
.price-by { display: grid; gap: 6px; justify-items: end; text-align: right; }
.price-by .muted { font-size: 12px; margin-right: 4px; }
.price-by .price-tag { font-size: 16px; padding: 5px 12px; }

/* =====================================================
   Сторінка «Панорамний знімок і КТ зубів»
   ===================================================== */
.mini-price { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mini-price:first-of-type { border-top: 0; padding-top: 0; }
.mini-price b { white-space: nowrap; color: var(--blue-dark); }
.mini-price.is-top { background: #fffdf3; margin: 0 -12px; padding: 11px 12px; border-radius: 10px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.vs__col { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: #fff; }
.vs__col--accent { background: var(--blue-soft); border-color: #bfe3f5; }
.vs__head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; color: var(--blue-dark); }
.vs__head h3 { margin: 0; color: var(--ink); font-size: 22px; }
.vs .checklist li { font-size: 15px; }
.vs .checklist li:last-child { border-bottom: 0; }
@media (max-width: 760px) { .vs { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { background: var(--bg-alt); font-weight: 800; }
.compare tbody th { font-weight: 700; color: var(--muted); width: 28%; }
.compare tr:last-child > * { border-bottom: 0; }
.notice { margin-top: 12px; }
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0; top: 12px; font-size: 24px; color: var(--blue); }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); }
