/* ==========================================================
   Cardio Med Pro — styles
   Brand: red #E31E24, blue #039BE5 (from logo)
   ========================================================== */

:root {
  --red: #E31E24;
  --red-600: #C9151B;
  --red-50: #FDECEC;
  --blue: #039BE5;
  --blue-700: #0277BD;
  --blue-50: #E6F5FD;

  --ink: #0E1A2B;
  --ink-2: #2B3A4F;
  --muted: #5D6C80;
  --line: #E2E9F1;
  --bg: #FFFFFF;
  --tint: #F4F8FC;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(14, 26, 43, .06), 0 2px 8px rgba(14, 26, 43, .04);
  --shadow: 0 10px 30px -10px rgba(14, 26, 43, .18);
  --shadow-red: 0 10px 24px -8px rgba(227, 30, 36, .5);

  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 820px; }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  border: 2px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn--lg { padding: 16px 28px; font-size: 16px; }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--red { background: var(--red); color: #fff; box-shadow: var(--shadow-red); }
.btn--red:hover { background: var(--red-600); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue-700); }
.btn--white { background: #fff; color: var(--red); }
.btn--white:hover { box-shadow: 0 10px 24px -8px rgba(0,0,0,.35); }

/* ---------- Eyebrow / badges ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--blue-700); background: var(--blue-50);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.badge--red { background: var(--red-50); color: var(--red-600); }
.badge--blue { background: var(--blue-50); color: var(--blue-700); }
.badge--soft { background: var(--tint); color: var(--muted); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: relative; flex: none;
}
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--red); opacity: 0; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- Top bar ---------- */
.topbar { background: var(--ink); color: #C9D4E2; font-size: 13.5px; }
.topbar__inner { display: flex; align-items: center; gap: 28px; min-height: 40px; }
.topbar__item { display: inline-flex; align-items: center; gap: 8px; }
.topbar__item .i { width: 15px; height: 15px; }
.topbar__item--live { color: #fff; font-weight: 600; }
.topbar__phone { margin-left: auto; color: #fff; font-weight: 700; }
.topbar__phone:hover { color: var(--blue); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.header.is-scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo img { height: 48px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--ink-2); transition: color .2s, background-color .2s; }
.nav a:not(.btn):hover { color: var(--red); background: var(--red-50); }
.nav__cta { display: none; }
.header__cta .i { width: 16px; height: 16px; }
.burger { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 88px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% 20%, rgba(3,155,229,.12), transparent 70%),
    radial-gradient(500px 380px at 10% 90%, rgba(227,30,36,.08), transparent 70%),
    linear-gradient(180deg, #F7FAFD 0%, #fff 100%);
  /* fade out at the bottom so the colour never ends in a hard line behind the stats */
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 800; margin-bottom: 20px; }
.hero__lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero__facts { display: flex; gap: 32px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 480px; }
.hero__facts li { display: flex; flex-direction: column; }
.hero__facts strong { font-family: var(--font-head); font-size: 22px; color: var(--ink); }
.hero__facts span { font-size: 14px; color: var(--muted); }

.hero__visual { position: relative; padding: 24px 0; }
.monitor {
  background: #fff; border-radius: 28px; padding: 18px; box-shadow: var(--shadow);
  border: 1px solid var(--line); position: relative;
}
.monitor__head { display: flex; align-items: center; gap: 6px; padding: 2px 6px 14px; }
.monitor__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.monitor__dot:first-child { background: var(--red); }
.monitor__dot:nth-child(2) { background: var(--blue); }
.monitor__label { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.monitor__screen {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(160deg, #F2F8FD, #FFF6F6);
  aspect-ratio: 5 / 4; display: grid; place-items: center;
}
.monitor__heart { width: 52%; height: auto; animation: heartbeat 1.4s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(227,30,36,.18)); }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.06); }
  28% { transform: scale(1); }
  42% { transform: scale(1.04); }
  70% { transform: scale(1); }
}
.ecg { position: absolute; left: 0; right: 0; bottom: 14%; width: 100%; height: 28%; }
.ecg__grid { stroke: rgba(3,155,229,.12); stroke-width: 1; fill: none; }
.ecg__line {
  fill: none; stroke: var(--red); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: ecg 2.8s linear infinite;
}
.ecg__line--white { stroke: rgba(255,255,255,.55); stroke-width: 2.5; }
@keyframes ecg { 0% { stroke-dashoffset: 1400; } 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1400; } }
.monitor__bpm {
  position: absolute; top: 16px; right: 18px;
  font-family: var(--font-head); color: var(--ink); display: flex; align-items: baseline; gap: 6px;
  background: rgba(255,255,255,.85); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.monitor__bpm b { font-size: 22px; }
.monitor__bpm small { font-family: var(--font-body); font-size: 12px; color: var(--muted); }
.beat { color: var(--red); display: inline-block; animation: heartbeat 1.4s ease-in-out infinite; }

.chip {
  position: absolute; display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 16px; padding: 12px 16px 12px 12px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  animation: float 6s ease-in-out infinite;
}
.chip b { display: block; font-size: 14px; color: var(--ink); line-height: 1.2; }
.chip small { font-size: 12px; color: var(--muted); }
.chip__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 13px; color: #fff;
}
.chip__icon--red { background: var(--red); }
.chip__icon--blue { background: var(--blue); }
.chip--a { left: -28px; bottom: 6%; }
.chip--b { right: -20px; top: 4%; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Stats ---------- */
/* Reusable stats strip: icon + number + label + caption.
   Number: <b class="stat__num"><span data-count="N">0</span><small>unit</small></b> */
.stats { margin-top: -48px; position: relative; z-index: 2; }
.stats__card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 1px 2px rgba(14,26,43,.04), 0 24px 48px -24px rgba(14,26,43,.22);
}
/* brand bar along the top edge */
.stats__card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%);
}
/* faint heartbeat line behind the numbers */
.stats__ecg {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 30px; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.stats__ecg path { fill: none; stroke: #F3C4C5; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.stat {
  position: relative; display: flex; align-items: flex-start; gap: 16px; min-width: 0;
  padding: 32px 28px 30px;
}
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 28px; bottom: 28px; width: 1px; background: var(--line);
}
.stat__icon {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  transition: transform .3s ease, background-color .3s ease, color .3s ease;
}
.stat__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat__icon--red { background: var(--red-50); color: var(--red); }
.stat__icon--blue { background: var(--blue-50); color: var(--blue); }
.stat:hover .stat__icon { transform: translateY(-3px) rotate(-4deg); }
.stat:hover .stat__icon--red { background: var(--red); color: #fff; }
.stat:hover .stat__icon--blue { background: var(--blue); color: #fff; }

.stat__body { display: flex; flex-direction: column; min-width: 0; }
.stat__num {
  display: flex; align-items: baseline; gap: 3px;
  font-family: var(--font-head); font-weight: 800; color: var(--ink);
  font-size: clamp(30px, 3vw, 40px); line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 10px;
}
.stat__num small { font-size: .5em; font-weight: 800; letter-spacing: 0; color: var(--red); }
.stat:nth-child(even) .stat__num small { color: var(--blue); }
.stat__label { font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.3; }
.stat__sub { font-size: 13.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section--tint { background: var(--tint); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section__head h2, .symptoms h2, .contact h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; margin-bottom: 12px; }
.section__head p { color: var(--muted); font-size: 17px; }

/* ---------- Doctors ---------- */
/* One doctor per row, identical structure:
   [avatar] [badge · name · role · description] [experience · patients · button] */
.doctors { display: grid; grid-template-columns: 1fr; gap: 20px; }
.doctor {
  --accent: var(--red); --accent-dark: var(--red-600); --accent-soft: var(--red-50);
  display: grid; grid-template-columns: 120px minmax(0, 1fr) 300px; align-items: center; gap: 32px;
  padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(110deg, #fff 60%, var(--accent-soft));
  transition: transform .25s ease, box-shadow .25s ease;
}
.doctor--blue { --accent: var(--blue); --accent-dark: var(--blue-700); --accent-soft: var(--blue-50); }
.doctor:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.doctor__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.doctor__side { display: flex; flex-direction: column; gap: 14px; }
.doctor__side .btn { width: 100%; }
.doctor .badge { background: var(--accent-soft); color: var(--accent-dark); }
/* grid/flex children may shrink below their content width — prevents sideways page scroll */
.doctors > *, .services > *, .why > *, .steps > *, .stats__card > *, .hero__inner > *, .symptoms > *, .contact > *, .footer__inner > * { min-width: 0; }
.doctor h3 { font-size: clamp(20px, 2.2vw, 24px); margin-bottom: 4px; }
.doctor__role { font-weight: 700; color: var(--accent-dark); font-size: 16px; margin-bottom: 10px; }
.doctor__desc { color: var(--muted); font-size: 15.5px; max-width: 560px; }
.doctor__meta { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.doctor__meta li { flex: 1 1 96px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.doctor__meta b { display: block; font-family: var(--font-head); font-size: 18px; color: var(--ink); white-space: nowrap; }
.doctor__meta span { font-size: 13px; color: var(--muted); }

.avatar {
  width: 88px; height: 88px; border-radius: 24px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, var(--red), #FF5A5F);
  box-shadow: 0 12px 24px -10px rgba(227,30,36,.6);
  position: relative; overflow: hidden;
}
.avatar::after {
  content: ""; position: absolute; width: 140%; height: 140%; right: -70%; bottom: -70%;
  border-radius: 50%; border: 10px solid rgba(255,255,255,.18);
}
.avatar--blue { background: linear-gradient(135deg, var(--blue), #4FC3F7); box-shadow: 0 12px 24px -10px rgba(3,155,229,.6); }
.doctor .avatar { width: 120px; height: 120px; border-radius: 30px; font-size: 40px; }
/* Doctor photos — replace the initials div with:
   <img class="avatar avatar--photo" src="images/doctors/name.jpg" alt="Full name" width="480" height="592">
   Best source: portrait 3:4 or taller, at least 480×592, face filling about half the width, plain background. */
.avatar--photo { object-fit: cover; object-position: 50% 0; background: var(--tint); }
/* transparent cut-out photos sit on a soft tint that matches the card colour */
.doctor .avatar--photo { background: linear-gradient(165deg, #fff 10%, var(--accent-soft) 100%); }
.avatar--photo::after { content: none; }
.doctor .avatar--photo {
  width: 160px; height: 197px; border-radius: 24px;
  box-shadow: 0 0 0 4px #fff, 0 16px 30px -14px rgba(14, 26, 43, .4);
}
.doctor:has(.avatar--photo) { grid-template-columns: 160px minmax(0, 1fr) 300px; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
  background: #fff; border-radius: var(--radius); padding: 30px; border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
/* 3D illustrated icons (images/services/*.webp, transparent, 240×240) */
.service__img {
  display: block; width: 112px; height: 112px; margin: -10px 0 14px -10px;
  transition: transform .35s cubic-bezier(.2, .8, .3, 1.3);
}
.service:hover .service__img { transform: translateY(-4px) rotate(-4deg) scale(1.04); }
.service h3 { font-size: 19px; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: 15.5px; }
.service--accent { background: var(--ink); border-color: var(--ink); }
.service--accent h3 { color: #fff; }
.service--accent p { color: #B6C3D4; }

/* ---------- Symptoms ---------- */
.symptoms { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.symptoms__text > p { color: var(--muted); font-size: 17px; }
.symptoms__list { display: grid; gap: 12px; }
.symptoms__list li {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; font-weight: 600; color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.symptoms__list li:hover { border-color: var(--red); transform: translateX(4px); }
.symptoms__list span { font-family: var(--font-head); font-weight: 800; color: var(--red); font-size: 14px; min-width: 24px; }

/* ---------- 24/7 band ---------- */
.band { padding: 0 0 96px; }
.band__inner {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--red) 0%, #EB3B40 55%, #F2555A 100%);
  border-radius: 28px; padding: 48px 56px; color: #fff;
  display: flex; align-items: center; gap: 32px;
}
.band__ecg { position: absolute; inset: auto 0 0 0; height: 60%; opacity: .9; pointer-events: none; }
.band__ecg svg { width: 100%; height: 100%; }
.band__text { position: relative; flex: 1; }
.band h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin-bottom: 8px; }
.band p { color: rgba(255,255,255,.9); max-width: 560px; }
.band .btn { position: relative; }

/* ---------- Why ---------- */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.why__item { background: #fff; padding: 32px; transition: background-color .2s; }
.why__item:hover { background: var(--tint); }
.why__num { display: inline-block; font-family: var(--font-head); font-weight: 800; font-size: 14px; color: var(--blue); margin-bottom: 14px; }
.why__item h3 { font-size: 19px; margin-bottom: 8px; }
.why__item p { color: var(--muted); font-size: 15.5px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: none; }
.step { background: #fff; border-radius: var(--radius); padding: 32px; border: 1px solid var(--line); position: relative; }
.step__n {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 20px; color: #fff; background: var(--blue);
  margin-bottom: 18px;
}
.step:first-child .step__n { background: var(--red); }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--muted); }
.step a { color: var(--red); font-weight: 700; white-space: nowrap; }
.steps-dots { display: none; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative;
  font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  border-radius: 50%; background: var(--blue-50)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230277BD' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 12px no-repeat;
  transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 24px 22px; color: var(--muted); }
.faq a { color: var(--red); font-weight: 700; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: stretch; }
.contact__list { display: grid; gap: 20px; margin: 28px 0 32px; }
.contact__list li { display: flex; gap: 16px; align-items: flex-start; }
.contact__icon { width: 48px; height: 48px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--red); flex: none; }
.contact__icon .i { width: 22px; height: 22px; }
.contact__list div { display: flex; flex-direction: column; }
.contact__list small { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.contact__list a { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--ink); }
.contact__list a:hover { color: var(--red); }
.contact__list b { color: var(--ink); font-size: 16px; }
.contact__list span { color: var(--muted); font-size: 15px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact__map {
  position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 4px solid #fff; min-height: 420px; background: #EEF3F8;
}
.contact__map iframe {
  position: relative; z-index: 1; width: 100%; height: 100%; min-height: 420px; border: 0; display: block;
  opacity: 0; transition: opacity .4s ease;
}
.contact__map.is-loaded iframe { opacity: 1; }
/* map-like placeholder: soft street grid + pulsing pin */
.map-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600;
  background:
    linear-gradient(115deg, transparent 47%, #fff 47% 50%, transparent 50%),
    linear-gradient(20deg, transparent 62%, #fff 62% 64%, transparent 64%),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(255,255,255,.75) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(255,255,255,.75) 58px 60px),
    #E8EEF4;
}
.map-placeholder__pin {
  width: 44px; height: 44px; fill: var(--red); stroke: #fff; stroke-width: 1.5;
  filter: drop-shadow(0 6px 8px rgba(227,30,36,.35)); animation: pin-bounce 1.2s ease-in-out infinite;
}
.map-placeholder__pin circle { fill: #fff; stroke: none; }
@keyframes pin-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.contact__map.is-loaded .map-placeholder { visibility: hidden; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #A9B6C8; padding: 64px 0 0; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer__brand img { height: 52px; width: auto; background: #fff; padding: 8px 14px; border-radius: 12px; margin-bottom: 16px; box-sizing: content-box; }
.footer__brand p { max-width: 320px; }
.footer__address { margin-top: 8px; font-size: 14px; color: #8C9AAE; }
.footer__nav, .footer__contact { display: flex; flex-direction: column; gap: 10px; }
.footer__nav a:hover { color: #fff; }
.footer__contact a { font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 20px; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 20px 24px; font-size: 14px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
}
.footer__credit a { color: #fff; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.3); transition: color .2s, border-color .2s; }
.footer__credit a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Floating call button (mobile) ---------- */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: #fff;
  display: none; place-items: center; box-shadow: var(--shadow-red);
}
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); animation: ping 2s ease-out infinite; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1080px) {
  .nav a:not(.btn) { padding: 8px 8px; font-size: 14.5px; }
  .chip--a { left: -8px; }
  .chip--b { right: -8px; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .header__cta { display: none; }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 46px; margin-left: auto; border: 1px solid var(--line); border-radius: 12px;
    background: #fff; cursor: pointer; padding: 0 12px;
  }
  .burger span { height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; padding: 16px 20px 24px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: 14px 12px; font-size: 16px; border-bottom: 1px solid var(--tint); border-radius: 0; }
  .nav__cta { display: inline-flex; margin-top: 12px; }

  .hero { padding: 40px 0 80px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { max-width: 520px; margin: 0 auto; width: 100%; }

  .stats__card { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }           /* 3rd stat starts a new row */
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }

  /* tablet: stats + button drop under the description */
  .doctor { grid-template-columns: 96px minmax(0, 1fr); gap: 20px 24px; align-items: start; }
  .doctor .avatar { width: 96px; height: 96px; font-size: 32px; border-radius: 24px; }
  .doctor__side { grid-column: 2; flex-direction: row; align-items: stretch; }
  .doctor__side .doctor__meta { flex: 1; }
  .doctor__side .btn { width: auto; align-self: center; }
  .doctor:has(.avatar--photo) { grid-template-columns: 124px minmax(0, 1fr); }
  .doctor .avatar--photo { width: 124px; height: 153px; border-radius: 22px; }
  .services, .why, .steps { grid-template-columns: 1fr 1fr; }
  .symptoms, .contact { grid-template-columns: 1fr; gap: 40px; }
  .band__inner { flex-direction: column; align-items: flex-start; padding: 40px 32px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .fab { display: grid; }
  .footer__bottom { padding-bottom: 96px; }   /* keep the credit clear of the floating call button */
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar { font-size: 13px; }
  .topbar__inner { justify-content: center; }
  .topbar__item:first-child, .topbar__phone { display: none; }
  .logo img { height: 40px; }

  .hero h1 { font-size: 36px; }
  .hero__lead { font-size: 16.5px; }
  .hero__actions { margin-bottom: 0; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__facts { display: none; }
  .chip { padding: 8px 12px 8px 8px; gap: 10px; }
  .chip__icon { width: 38px; height: 38px; font-size: 11px; border-radius: 10px; }
  .chip b { font-size: 13px; }
  .chip--a { left: -4px; bottom: -2%; }
  .chip--b { right: -4px; top: -2%; }

  .stats { margin-top: -40px; }
  .stats__card { border-radius: 20px; padding-bottom: 14px; }
  .stat { flex-direction: column; gap: 12px; padding: 22px 16px 20px; }
  .stat + .stat::before { top: 20px; bottom: 20px; }
  .stat__icon { width: 40px; height: 40px; border-radius: 12px; }
  .stat__icon svg { width: 20px; height: 20px; }
  .stat__num { font-size: 28px; margin-bottom: 6px; }
  .stat__label { font-size: 14px; }
  .stat__sub { font-size: 12.5px; }

  .section { padding: 72px 0; }
  .band { padding-bottom: 72px; }
  .section__head { margin-bottom: 36px; }

  .doctors, .services, .why, .steps { grid-template-columns: 1fr; }
  /* phone: icon on the left, title + text on the right — keeps the list compact */
  .service { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 2px 16px; align-items: start; padding: 20px 20px 20px 14px; }
  .service__img { grid-row: 1 / span 2; width: 84px; height: 84px; margin: -6px 0 0 -4px; }
  .service h3 { font-size: 17px; margin: 6px 0 6px; }
  .service p { font-size: 14.5px; }
  /* phone: same card for everyone, stacked top-to-bottom */
  .doctor { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 24px 20px; }
  .doctor .avatar { width: 72px; height: 72px; font-size: 24px; border-radius: 20px; }
  .doctor h3 { font-size: 20px; }
  .doctor__role { font-size: 15px; margin-bottom: 8px; }
  .doctor__desc { font-size: 15px; }
  .doctor__side { flex-direction: column; }
  .doctor__side .btn { width: 100%; }
  .doctor__meta { gap: 8px; }
  .doctor__meta li { padding: 10px 12px; }
  .doctor__meta b { font-size: 16px; }

  /* phone + photo: portrait on the left, badge/name/role beside it, rest full width */
  .doctor:has(.avatar--photo) { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .doctor:has(.avatar--photo) .doctor__body { display: contents; }
  .doctor .avatar--photo { grid-column: 1; grid-row: 1 / span 3; width: 108px; height: 133px; border-radius: 20px; }
  .doctor:has(.avatar--photo) .badge { grid-column: 2; grid-row: 1; justify-self: start; align-self: start; }
  .doctor:has(.avatar--photo) h3 { grid-column: 2; grid-row: 2; font-size: 18px; }
  .doctor:has(.avatar--photo) .doctor__role { grid-column: 2; grid-row: 3; font-size: 14px; margin-bottom: 0; }
  .doctor:has(.avatar--photo) .doctor__desc { grid-column: 1 / -1; margin-top: 16px; }
  .doctor:has(.avatar--photo) .doctor__side { grid-column: 1 / -1; margin-top: 16px; }

  /* Stacking cards: each card sticks under the header, the next one slides up over it.
     script.js sets --cover (0 → 1) on a card as the next card covers it. */
  .doctors { display: flex; flex-direction: column; gap: 0; }
  .doctors > .doctor {
    position: sticky; top: calc(var(--header-h) + 12px);
    margin-bottom: 20px; transform-origin: 50% 0;
    box-shadow: 0 -10px 28px -14px rgba(14, 26, 43, .25), 0 1px 2px rgba(14, 26, 43, .04);
    transition: opacity .6s ease;      /* no transform transition — scale follows the finger */
  }
  .doctors > .doctor:nth-child(2) { top: calc(var(--header-h) + 22px); }
  .doctors > .doctor:nth-child(3) { top: calc(var(--header-h) + 32px); }
  .doctors > .doctor:nth-child(4) { top: calc(var(--header-h) + 42px); }
  .doctors > .doctor:last-child { margin-bottom: 0; }
  .doctors > .doctor.reveal.is-visible,
  .doctors > .doctor:hover { transform: scale(calc(1 - var(--cover, 0) * .06)); }
  .doctors > .doctor::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: var(--ink); opacity: calc(var(--cover, 0) * .14);
  }

  .band__inner { padding: 32px 22px; border-radius: 22px; }
  .band .btn { width: 100%; }
  .contact__map, .contact__map iframe { min-height: 320px; }
  .contact__actions .btn { flex: 1 1 100%; }
  .footer__inner { grid-template-columns: 1fr; }
  .faq summary { font-size: 16px; padding: 18px 52px 18px 18px; }
  .faq details p { padding: 0 18px 18px; }
}

/* Very small phones (< 360px): stack stats and doctor cards */
@media (max-width: 359px) {
  .stats__card { grid-template-columns: 1fr; }
  .stat { flex-direction: row; align-items: center; gap: 16px; padding: 18px 20px; }
  .stat + .stat::before { display: none; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .stat__num { margin-bottom: 4px; }
  .doctor { flex-direction: column; gap: 16px; }
}

/* Phone: "3 qadam" cards stack sideways. script.js adds .is-stacking to the track and sets
   --enter (0→1, slides the card in from the right) and --cover (0→1, shrinks/dims the card underneath).
   Without JS the cards simply stay in a normal vertical list. */
@media (max-width: 640px) {
  /* scroll distance for the 2 slides — a spacer, not padding: a sticky child can't move into its parent's padding */
  .steps-track.is-stacking::after { content: ""; display: block; height: 110vh; height: 110svh; }
  .steps-track.is-stacking .steps-pin {
    position: sticky; top: calc(var(--header-h) + 8px);
    overflow: hidden; margin: 0 -16px; padding: 4px 16px 24px;                   /* clip cards waiting off-screen */
  }
  .steps-track.is-stacking .section__head { margin-bottom: 24px; }
  .steps-track.is-stacking .steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps-track.is-stacking .step {
    grid-area: 1 / 1; min-height: 210px;
    box-shadow: -14px 0 28px -16px rgba(14, 26, 43, .28), 0 1px 2px rgba(14, 26, 43, .04);
    transform-origin: 50% 50%;
    transform: translateX(calc((1 - var(--enter, 1)) * 112%)) scale(calc(1 - var(--cover, 0) * .06));
    opacity: 1; transition: none; will-change: transform;
  }
  .steps-track.is-stacking .step::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: var(--ink); opacity: calc(var(--cover, 0) * .14);
  }
  .steps-track.is-stacking .steps-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
  .steps-dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .3s ease, background-color .3s ease; }
  .steps-dots span.is-active { width: 24px; background: var(--red); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .ecg__line { stroke-dashoffset: 0; }
}
