/* =========================================================================
   Doctors
   ========================================================================= */

.doc {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: color-mix(in srgb, var(--cream) 60%, white 40%);
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.doc:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.doc__photo { position: relative; aspect-ratio: 3 / 3.7; overflow: hidden; background: color-mix(in srgb, var(--sand) 60%, white 40%); }
.doc__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.doc:hover .doc__photo img { transform: scale(1.05); }
.doc__initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: var(--fs-68); color: var(--brand-300);
}
.doc__body { padding: var(--s-24); background: #ffffff; }
.doc__name { font-size: var(--fs-20); font-weight: 600; line-height: 1.3; color: var(--ink-900); }
.doc__role { margin-top: 7px; font-size: var(--fs-15); color: var(--brand-700); line-height: 1.45; font-weight: 600; }
.doc__meta { margin-top: 10px; font-size: var(--fs-14); color: var(--text-muted); line-height: 1.45; }

.doctor-carousel { margin-top: var(--s-40); }
.doctor-carousel__track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 96px) / 4);
  gap: var(--s-32);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 2px 18px;
}
.doctor-carousel__track::-webkit-scrollbar { display: none; }
.doctor-carousel__track:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 5px; border-radius: var(--r-sm); }
.doctor-carousel__slide { scroll-snap-align: start; scroll-snap-stop: normal; min-width: 0; }
.doctor-carousel__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-20); margin-top: var(--s-16); }
.doctor-carousel__status { font-size: var(--fs-14); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.doctor-carousel__controls { display: flex; gap: var(--s-8); }
.doctor-carousel__button {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: #ffffff;
  color: var(--ink-800); font-size: 20px; line-height: 1; cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.doctor-carousel__button:hover { color: #fff; border-color: var(--brand-700); background: var(--brand-700); transform: translateY(-2px); }
.doctor-carousel__button:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 2px; }
@media (max-width: 980px) { .doctor-carousel__track { grid-auto-columns: calc((100% - 32px) / 2); } }
@media (max-width: 620px) {
  .doctor-carousel { margin-top: var(--s-32); }
  .doctor-carousel__track { grid-auto-columns: min(82vw, 310px); gap: var(--s-16); margin-right: calc(var(--shell-pad) * -1); padding-right: var(--shell-pad); }
}
@media (prefers-reduced-motion: reduce) { .doctor-carousel__track { scroll-behavior: auto; } }

/* =========================================================================
   Posts (news / blog)
   ========================================================================= */

.post-card {
  display: flex; flex-direction: column;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.post-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--brand-050) 60%, white 40%), color-mix(in srgb, var(--jade-050) 60%, white 40%)); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-cover { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .7s var(--ease-out); }
.post-card:hover .post-cover { transform: scale(1.05); }
.post-card__body { padding: var(--s-24); display: grid; gap: var(--s-12); flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: var(--s-12); font-size: var(--fs-14); color: var(--text-muted); line-height: 1.4; flex-wrap: wrap; }
.post-card__meta i { width: 4px; height: 4px; border-radius: 50%; background: color-mix(in srgb, var(--ink-200) 60%, white 40%); flex: none; }
.post-card__meta em { font-style: normal; color: var(--brand-700); font-weight: 600; }
.post-card__title { font-size: var(--fs-20); font-weight: 600; line-height: 1.36; color: var(--ink-900); letter-spacing: -.008em; }
.post-card:hover .post-card__title { color: var(--brand-700); }
.post-card__excerpt { font-size: var(--fs-16); color: var(--text-muted); line-height: 1.6; }
.post-card__foot { margin-top: auto; padding-top: var(--s-8); }

.post-card--feature { grid-column: span 2; flex-direction: row; }
.post-card--feature .post-card__media { aspect-ratio: auto; width: 48%; flex: none; }
.post-card--feature .post-card__body { padding: clamp(28px, 3vw, 44px); gap: var(--s-16); justify-content: center; }
.post-card--feature .post-card__title { font-family: var(--font-display); font-size: var(--fs-32); font-weight: 500; line-height: 1.2; }
.post-card--feature .post-card__excerpt { font-size: var(--fs-17); }
@media (max-width: 900px) { .post-card--feature { grid-column: span 1; flex-direction: column; } .post-card--feature .post-card__media { width: 100%; aspect-ratio: 16/10; } }

/* =========================================================================
   Prices
   ========================================================================= */

.price-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
@media (max-width: 1000px) { .price-layout { grid-template-columns: minmax(0, 1fr); } }

.price-rail { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s-4); }
@media (max-width: 1000px) { .price-rail { position: static; } }
.price-rail__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-12);
  padding: 13px 18px; border-radius: var(--r-sm);
  font-size: var(--fs-16); font-weight: 600; line-height: 1.35; color: var(--ink-600);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.price-rail__link:hover { background: color-mix(in srgb, var(--brand-050) 60%, white 40%); color: var(--brand-700); }
.price-rail__link.is-active { background: var(--ink-900); color: var(--text-invert); }
.price-rail__count { font-size: var(--fs-14); opacity: .7; font-weight: 600; }

.price-search {
  position: relative;
  margin-bottom: var(--s-32);
}
.price-search input {
  width: 100%;
  padding: 19px 22px 19px 56px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: #ffffff;
  font-size: var(--fs-17);
  line-height: 1.3;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.price-search input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-050); }
.price-search svg { position: absolute; left: 22px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--ink-300); }

.price-group { margin-bottom: clamp(40px, 4vw, 64px); scroll-margin-top: calc(var(--header-h) + 32px); }
.price-group__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-24); flex-wrap: wrap; margin-bottom: var(--s-20); }
.price-group__title { font-family: var(--font-display); font-size: var(--fs-32); line-height: 1.2; font-weight: 500; letter-spacing: -.012em; }

.price-list { border-top: 1px solid var(--line); }
.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-24);
  align-items: baseline;
  padding: var(--s-20) var(--s-16);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-xs);
  transition: background-color var(--dur) var(--ease-out);
}
.price-row:hover { background: color-mix(in srgb, var(--brand-050) 60%, white 40%); }
.price-row.is-hidden { display: none; }
.price-row__title { font-size: var(--fs-17); font-weight: 600; line-height: 1.45; color: var(--ink-900); }
.price-row__desc { margin-top: 6px; font-size: var(--fs-15); color: var(--text-muted); line-height: 1.55; }
.price-row__value { font-size: var(--fs-20); font-weight: 700; line-height: 1.2; color: var(--brand-700); white-space: nowrap; text-align: right; }
.price-row__unit { display: block; margin-top: 5px; font-size: var(--fs-14); font-weight: 500; color: var(--text-muted); }
.price-row--hl { background: color-mix(in srgb, var(--amber-050) 60%, white 40%); border-bottom-color: var(--amber-200); }
.price-row--hl:hover { background: color-mix(in srgb, var(--amber-050) 60%, white 40%); }

/* Компактний прайс усередині сторінки послуги */
.price-mini { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #ffffff; }
.price-mini__head { padding: var(--s-20) var(--s-24); background: var(--ink-900); color: var(--text-invert); font-size: var(--fs-17); font-weight: 700; line-height: 1.35; }
.price-mini__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-16); padding: 15px var(--s-24); border-bottom: 1px solid var(--line); font-size: var(--fs-16); line-height: 1.45; }
.price-mini__row:last-of-type { border-bottom: 0; }
.price-mini__row b { color: var(--brand-700); white-space: nowrap; font-size: var(--fs-17); }
.price-mini__foot { padding: var(--s-20) var(--s-24); background: color-mix(in srgb, var(--cream) 60%, white 40%); border-top: 1px solid var(--line); }

/* =========================================================================
   Branch cards
   ========================================================================= */

.branch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #ffffff;
  transition: box-shadow var(--dur) var(--ease-out);
}
.branch:hover { box-shadow: var(--shadow-lg); }
.branch__media { position: relative; min-height: 320px; background: linear-gradient(150deg, color-mix(in srgb, var(--brand-100) 60%, white 40%), color-mix(in srgb, var(--sand) 60%, white 40%)); overflow: hidden; }
.branch__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.branch__body { padding: clamp(28px, 3vw, 48px); display: grid; gap: var(--s-20); align-content: center; }
.branch__title { font-family: var(--font-display); font-size: var(--fs-32); line-height: 1.18; font-weight: 500; letter-spacing: -.012em; }
.branch__rows { display: grid; gap: var(--s-16); }
.branch__row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s-16); align-items: start; font-size: var(--fs-16); line-height: 1.55; }
.branch__row svg { width: 20px; height: 20px; color: var(--brand-600); margin-top: 3px; }
.branch__row dt { font-size: var(--fs-14); color: var(--text-soft); line-height: 1.4; }
.branch__row dd { margin: 2px 0 0; color: var(--ink-800); font-weight: 600; }
@media (max-width: 900px) { .branch { grid-template-columns: minmax(0, 1fr); } .branch__media { min-height: 220px; } }

.schedule { width: 100%; border-collapse: collapse; font-size: var(--fs-16); }
.schedule td { padding: 12px 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
.schedule td:last-child { text-align: right; font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.schedule tr:last-child td { border-bottom: 0; }
.schedule tr.is-today td { color: var(--brand-700); }

/* =========================================================================
   Before / after slider
   ========================================================================= */

.ba { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); user-select: none; touch-action: pan-y; }
.ba img { width: 100%; display: block; pointer-events: none; }
.ba__after { position: absolute; inset: 0; overflow: hidden; width: 50%; }
.ba__after img { position: absolute; inset: 0; width: auto; height: 100%; max-width: none; }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  background: #ffffff; transform: translateX(-50%); cursor: ew-resize;
  box-shadow: 0 0 0 1px rgba(23,17,16,.12);
}
.ba__knob {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 58px; height: 58px; border-radius: 50%;
  background: #ffffff; box-shadow: var(--shadow-md);
  display: grid; place-items: center; color: var(--brand-600);
}
.ba__knob svg { width: 22px; height: 22px; }
/* Підписи «до / після» — простий текст із рискою, без плашки */
.ba__tag {
  position: absolute; bottom: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff;
  font-size: var(--fs-14); font-weight: 700; letter-spacing: .16em; text-transform: none;
  line-height: 1.3;
  text-shadow: 0 1px 10px rgba(23, 17, 16, .85);
}
.ba__tag::before {
  content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  box-shadow: 0 1px 6px rgba(23, 17, 16, .7);
}
.ba__tag--l { left: 22px; }
.ba__tag--r { right: 22px; flex-direction: row-reverse; }

/* =========================================================================
   Quiz
   ========================================================================= */

.quiz {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.quiz__head {
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-24); flex-wrap: wrap;
}
.quiz__progress-label { font-size: var(--fs-15); color: var(--text-muted); line-height: 1.4; }
.quiz__progress-label b { color: var(--ink-900); font-size: var(--fs-17); }
.quiz__bar { flex: 1; min-width: 180px; height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink-100) 60%, white 40%); overflow: hidden; }
.quiz__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); border-radius: inherit; transition: width .45s var(--ease-out); }
.quiz__body { padding: clamp(28px, 3.5vw, 52px) clamp(24px, 3vw, 44px); }
.quiz__q { font-family: var(--font-display); font-size: var(--fs-32); line-height: 1.24; font-weight: 500; letter-spacing: -.012em; margin-bottom: var(--s-16); }
.quiz__hint { font-size: var(--fs-16); color: var(--text-muted); line-height: 1.6; margin-bottom: var(--s-32); }
.quiz__answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-16); }
@media (max-width: 620px) { .quiz__answers { grid-template-columns: minmax(0, 1fr); } }
.quiz__answer {
  display: flex; align-items: center; justify-content: center; gap: var(--s-12);
  padding: 22px 26px; min-height: 72px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  background: #ffffff; cursor: pointer;
  font-size: var(--fs-18); font-weight: 600; line-height: 1.3;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
              background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.quiz__answer:hover { transform: translateY(-3px); border-color: var(--brand-500); color: var(--brand-700); box-shadow: var(--shadow-md); }
.quiz__answer--yes:hover { border-color: var(--brand-600); background: color-mix(in srgb, var(--brand-050) 60%, white 40%); }
.quiz__answer--no:hover  { border-color: var(--jade-500); background: color-mix(in srgb, var(--jade-050) 60%, white 40%); color: var(--jade-700); }
.quiz__foot { padding: var(--s-24) clamp(24px, 3vw, 44px); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--cream) 60%, white 40%); display: flex; align-items: center; justify-content: space-between; gap: var(--s-16); flex-wrap: wrap; }
.quiz__back { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-16); font-weight: 600; color: var(--ink-600); background: none; border: 0; cursor: pointer; padding: 8px 0; }
.quiz__back:hover { color: var(--brand-700); }
.quiz__back svg { width: 13px; height: 13px; transform: rotate(180deg); }
.quiz__back[hidden] { visibility: hidden; }

.quiz__result { display: none; padding: clamp(28px, 3.5vw, 52px) clamp(24px, 3vw, 44px); }
.quiz__result.is-shown { display: block; animation: fadeUp .6s var(--ease-out) both; }
.quiz__score { display: grid; justify-items: center; gap: var(--s-12); margin-bottom: var(--s-32); }
.quiz__ring { display: grid; place-items: center; width: 168px; height: 168px; position: relative; }
.quiz__ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.quiz__ring-track { fill: none; stroke: var(--ink-100); stroke-width: 10; }
.quiz__ring-bar { fill: none; stroke: var(--brand-600); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease-out), stroke .4s; }
.quiz__ring-num { display: block; font-family: var(--font-display); font-size: var(--fs-52); line-height: 1; color: var(--ink-900); }
.quiz__ring-sub { display: block; font-size: var(--fs-15); color: var(--text-muted); line-height: 1.4; }
.quiz__outcome-title { font-family: var(--font-display); font-size: var(--fs-40); line-height: 1.16; font-weight: 500; text-align: center; letter-spacing: -.014em; margin-bottom: var(--s-24); }
.quiz--level-good  .quiz__ring-bar { stroke: var(--jade-600); }
.quiz--level-warn  .quiz__ring-bar { stroke: var(--amber-500); }
.quiz--level-alert .quiz__ring-bar { stroke: var(--brand-600); }

/* =========================================================================
   Forms
   ========================================================================= */

.field { display: grid; gap: 9px; }
.field__label { font-size: var(--fs-15); font-weight: 600; color: var(--ink-700); line-height: 1.4; }
.field__label span { color: var(--brand-600); }
.field__hint { font-size: var(--fs-14); color: var(--text-muted); line-height: 1.45; }
.field__error { font-size: var(--fs-14); color: var(--brand-700); font-weight: 600; line-height: 1.45; }

.input, .select, .textarea {
  width: 100%;
  padding: 17px 20px;
  min-height: 58px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #ffffff;
  font-size: var(--fs-17);
  line-height: 1.4;
  color: var(--ink-900);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-050); }
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--brand-600); }
.textarea { min-height: 132px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%238C7871' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 50px;
}
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s-12); align-items: start; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--brand-600); cursor: pointer; }
.check span { font-size: var(--fs-15); color: var(--text-muted); line-height: 1.55; }
.check a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }

.form-note {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s-12); align-items: start;
  font-size: var(--fs-14); color: var(--text-muted); line-height: 1.55;
}
.form-note svg { width: 18px; height: 18px; color: var(--jade-600); margin-top: 2px; }

.alert {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--s-16); align-items: start;
  padding: var(--s-20) var(--s-24);
  border-radius: var(--r-md);
  font-size: var(--fs-16);
  line-height: 1.6;
}
.alert svg { width: 22px; height: 22px; margin-top: 2px; }
.alert--ok { background: color-mix(in srgb, var(--jade-050) 60%, white 40%); color: var(--jade-900); border: 1px solid var(--jade-100); }
.alert--ok svg { color: var(--jade-600); }
.alert--warn { background: color-mix(in srgb, var(--amber-050) 60%, white 40%); color: #6B4A0F; border: 1px solid var(--amber-200); }
.alert--warn svg { color: var(--amber-600); }
.alert--info { background: color-mix(in srgb, var(--brand-050) 60%, white 40%); color: var(--brand-900); border: 1px solid var(--brand-100); }
.alert--info svg { color: var(--brand-600); }
.alert b { display: block; margin-bottom: 4px; font-size: var(--fs-17); }
