/* ═══════════════════════════════════════════════════════════════════
   MOBILE REDESIGN — shared stylesheet for inner pages (≤767px)
   Premium dark navy + gold accent aesthetic, mirrors index.html hero.
   Linked from: about, prices, devices, appointment, prostatit, cistit,
   adenoma, erek, besplodie, mochekam (RU/KK/EN copies).
   Desktop ≥768px is untouched.
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ─────────────────────────────────────────────────────────────────
     0. Hard overflow lock — prevents the page from drifting left/right
     and the rubber-band bounce on iOS. Some inner elements (chip strips,
     shadow halos) can poke beyond viewport without this.
     ───────────────────────────────────────────────────────────────── */
  html {
    overflow-x: hidden !important;
    overflow-x: clip !important;          /* stronger; modern browsers */
    max-width: 100vw !important;
    width: 100% !important;
  }
  body {
    overflow-x: hidden !important;
    overflow-x: clip !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    overscroll-behavior-x: none;          /* kill horizontal rubber-band */
  }
  body > * { max-width: 100vw; }
  /* Sections only — nav/header keep normal overflow so dropdowns/tooltips work */
  body > section, body > footer { max-width: 100vw; overflow-x: clip; }

  /* ─────────────────────────────────────────────────────────────────
     1. Section eyebrow — gold dash + tighter type
     ───────────────────────────────────────────────────────────────── */
  .section-eyebrow {
    font-size: 0.66rem !important;
    letter-spacing: 0.22em !important;
    font-weight: 700 !important;
    color: var(--sky, #2A7CC7) !important;
  }
  .section-eyebrow::before {
    content: '';
    display: inline-block;
    width: 22px; height: 2px;
    background: linear-gradient(90deg, #C9A368 0%, rgba(201,163,104,0.30) 100%);
    vertical-align: middle;
    margin-right: 10px;
    margin-top: -3px;
    border-radius: 2px;
  }
  /* Eyebrow on dark background → warm gold instead of sky */
  .hero-bg .section-eyebrow,
  #key-benefits .section-eyebrow,
  #pricing .section-eyebrow,
  footer .section-eyebrow {
    color: rgba(255,255,255,0.78) !important;
  }
  .hero-bg .section-eyebrow::before,
  #key-benefits .section-eyebrow::before,
  #pricing .section-eyebrow::before,
  footer .section-eyebrow::before {
    background: linear-gradient(90deg, #E8C896 0%, rgba(232,200,150,0.30) 100%);
  }

  /* ─────────────────────────────────────────────────────────────────
     2. Section H2 sizing (Cormorant serif)
     ───────────────────────────────────────────────────────────────── */
  section h2.font-display {
    font-size: 2rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.005em;
  }
  #pricing h2.font-display { font-size: 1.65rem !important; }
  #key-benefits .kb-heading { font-size: 1.85rem !important; line-height: 1.15 !important; }

  /* ─────────────────────────────────────────────────────────────────
     3. Tighter section padding on mobile
     ───────────────────────────────────────────────────────────────── */
  #symptom-matcher,
  #diseases,
  #reviews,
  #contact { padding-top: 2.75rem !important; padding-bottom: 2.75rem !important; }
  #faq { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  #key-benefits { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  #pricing { padding-top: 1rem !important; padding-bottom: 1rem !important; }

  section .text-center.mb-14 { margin-bottom: 1.5rem !important; }
  section .text-center.mb-12 { margin-bottom: 1.5rem !important; }
  .section-eyebrow.mb-3 { margin-bottom: 0.75rem !important; }
  section h2.font-display.mb-4 { margin-bottom: 0.5rem !important; }
  section .ornament { margin-bottom: 0.75rem !important; transform: scale(0.85); }

  /* ─────────────────────────────────────────────────────────────────
     4. Inner-page hero (.hero-bg without #hero anchor)
     Disease pages, prices, about, devices, etc. — dark navy treatment
     ───────────────────────────────────────────────────────────────── */
  section.hero-bg {
    background:
      radial-gradient(ellipse 90% 60% at 100% 0%, rgba(42,124,199,0.18) 0%, transparent 65%),
      radial-gradient(ellipse 60% 80% at 0% 100%, rgba(201,163,104,0.10) 0%, transparent 60%),
      linear-gradient(165deg, #0B2D5C 0%, #08203F 55%, #051528 100%) !important;
    color: #ffffff;
    padding: 5.5rem 1.25rem 2rem !important;
    position: relative;
    overflow: hidden;
  }
  /* Breadcrumb / back link */
  section.hero-bg a[href*="index"],
  section.hero-bg .text-sm.text-sky-600 {
    color: rgba(255,255,255,0.65) !important;
    font-size: 0.78rem !important;
  }
  /* H1 inside hero — Cormorant serif, white, smaller on mobile */
  section.hero-bg h1.font-display {
    color: #ffffff !important;
    font-size: 2.1rem !important;
    line-height: 1.08 !important;
    letter-spacing: -0.005em;
    margin-bottom: 0.85rem !important;
  }
  section.hero-bg h1.font-display br + * {
    color: #E8C896 !important;
    font-style: italic;
    font-weight: 600;
  }
  /* Description text */
  section.hero-bg p,
  section.hero-bg p.text-lg.text-slate-600 {
    color: rgba(255,255,255,0.72) !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.25rem !important;
  }
  /* CTAs in hero — adjust outline button to white-on-dark */
  section.hero-bg .btn-primary {
    background: linear-gradient(135deg, #2A7CC7 0%, #1a5ea8 100%) !important;
    box-shadow: 0 6px 20px rgba(42,124,199,0.45);
    border: none;
  }
  section.hero-bg a[style*="border-color:var(--navy)"],
  section.hero-bg .border-2.border-navy {
    border-color: rgba(255,255,255,0.30) !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.06);
  }
  section.hero-bg a[style*="border-color:var(--navy)"]:hover,
  section.hero-bg .border-2.border-navy:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.50);
  }
  /* CTA group full-width on small screens */
  section.hero-bg .flex.flex-wrap.gap-4 {
    flex-direction: column;
    gap: 0.6rem !important;
  }
  section.hero-bg .flex.flex-wrap.gap-4 > a {
    width: 100%;
    justify-content: center;
  }

  /* ─────────────────────────────────────────────────────────────────
     4b. About-page hero (.about-hero) — dark navy + scaled-down photo
     ───────────────────────────────────────────────────────────────── */
  section.about-hero {
    background:
      radial-gradient(ellipse 90% 60% at 100% 0%, rgba(42,124,199,0.18) 0%, transparent 65%),
      radial-gradient(ellipse 60% 80% at 0% 100%, rgba(201,163,104,0.10) 0%, transparent 60%),
      linear-gradient(165deg, #0B2D5C 0%, #08203F 55%, #051528 100%) !important;
    color: #ffffff;
    padding: 5.5rem 1.25rem 2rem !important;
    position: relative;
    overflow: hidden;
  }
  section.about-hero .max-w-6xl > .flex {
    flex-direction: column !important;
    gap: 1.25rem !important;
    align-items: stretch !important;
  }
  section.about-hero .photo-frame {
    padding: 0 !important;
    margin: 0 auto !important;
  }
  section.about-hero .photo-frame::before,
  section.about-hero .photo-frame::after,
  section.about-hero .photo-glow,
  section.about-hero .photo-blob-1,
  section.about-hero .photo-blob-2,
  section.about-hero .photo-blob-3 {
    display: none !important;
  }
  section.about-hero .photo-inner {
    width: 140px !important; height: 175px !important;
    border-radius: 14px !important;
    border: 3px solid rgba(255,255,255,0.18) !important;
    box-shadow: 0 16px 36px rgba(5,21,40,0.40) !important;
  }
  section.about-hero .award-chip {
    background: rgba(201,163,104,0.18) !important;
    border-color: rgba(201,163,104,0.45) !important;
    color: #E8C896 !important;
    font-size: 0.72rem !important;
  }
  section.about-hero .flex-1 {
    text-align: left !important;
    width: 100%;
  }
  /* Breadcrumb */
  section.about-hero .flex.items-center.gap-2 a {
    color: rgba(255,255,255,0.55) !important;
  }
  section.about-hero .flex.items-center.gap-2 .text-navy {
    color: rgba(255,255,255,0.85) !important;
  }
  section.about-hero h1.font-display {
    color: #ffffff !important;
    font-size: 2.4rem !important;
    line-height: 1.04 !important;
  }
  section.about-hero h1 .gradient-text {
    background: linear-gradient(135deg, #F0D5A1 0%, #C9A368 60%, #B0884A 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    font-style: italic;
    font-weight: 600;
  }
  section.about-hero p.text-sky {
    color: rgba(255,255,255,0.78) !important;
    font-size: 0.92rem !important;
  }
  section.about-hero .ornament {
    margin-left: 0 !important;
    margin-bottom: 1rem !important;
    transform: scale(0.8);
    transform-origin: left center;
    filter: brightness(2);
    opacity: 0.5;
  }
  section.about-hero p.text-slate-600 {
    color: rgba(255,255,255,0.72) !important;
    font-size: 0.92rem !important;
    margin-left: 0 !important;
  }

  /* ─────────────────────────────────────────────────────────────────
     5. Navbar — dark navy in BOTH states (transparent at top, solid
     dark with blur when scrolled). Logo text always white on mobile.
     ───────────────────────────────────────────────────────────────── */
  /* Inner-page logo wrapper — used to be `class="hidden sm:block"` which
     Tailwind would hide on mobile. Replaced with `.navbar-logo-text` on all
     21 inner pages (RU+KK+EN) so it's always visible. Defensive rule below
     handles any leftover `hidden sm:block` markup, just in case. */
  #navbar .navbar-logo-text {
    display: block !important;
    visibility: visible !important;
  }
  #navbar a[href="index"] .hidden.sm\:block,
  #navbar a[href="#hero"] .hidden.sm\:block,
  #navbar a[href="/en/"] .hidden.sm\:block,
  #navbar > .max-w-6xl > a:first-child .hidden.sm\:block {
    display: block !important;
  }
  /* Index pages wrap the logo text in <div class="flex flex-col">.
     A previous version of lang-switcher.js injected a rule that hid this
     wrapper on <420px viewports — the customer reported the doctor's name
     was completely missing in the navbar. Force the wrapper visible on all
     mobile widths. The `body` prefix raises specificity above the JS-injected
     rule even if a stale lang-switcher.js is still cached. */
  body #navbar > .max-w-6xl > a:first-child .flex.flex-col,
  body #navbar > div > a:first-child .flex.flex-col,
  body #navbar a[href="#hero"] > .flex.flex-col,
  body #navbar a[href="index"] > .flex.flex-col,
  body #navbar a[href="/en/"] > .flex.flex-col {
    display: flex !important;
    visibility: visible !important;
  }

  /* Navbar — ALWAYS dark navy on mobile, regardless of scroll state.
     Previously transparent at top; user wants identical look across all
     pages (incl. devices.html which has a white first section). */
  body #navbar,
  body #navbar:not(.scrolled),
  body #navbar.scrolled {
    background: rgba(11,45,92,0.94) !important;
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 4px 18px rgba(5,21,40,0.22) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  /* Logo emblem colors on dark — both states */
  #navbar .logo-emblem .kidney-pair path[fill="#0B2D5C"],
  #navbar [aria-label*="Аманжолова"] .kidney-pair path[fill="#0B2D5C"],
  #navbar [aria-label*="Amanzholova"] .kidney-pair path[fill="#0B2D5C"] {
    fill: #ffffff;
  }
  /* Inline-styled kidney emblem on inner pages (no .logo-emblem class, just inline SVG) */
  #navbar a[href="index"] svg path[fill="#0B2D5C"]:not([stroke]),
  #navbar a[href="/en/"] svg path[fill="#0B2D5C"]:not([stroke]) {
    fill: #ffffff;
  }
  #navbar a[href="index"] svg path[stroke="#0B2D5C"],
  #navbar a[href="/en/"] svg path[stroke="#0B2D5C"] {
    stroke: rgba(255,255,255,0.92);
  }

  /* Logo text — name (font-display) white; subtitle (.font-body or inline) muted white.
     Three href variants: "#hero" (root index), "index" (RU/KK inner), "/en/" (EN inner). */
  #navbar a[href="#hero"] .font-display,
  #navbar a[href="index"] .font-display,
  #navbar a[href="/en/"] .font-display,
  #navbar > .max-w-6xl > a:first-child .font-display,
  #navbar > div > a:first-child .font-display {
    color: #ffffff !important;
  }
  #navbar a[href="#hero"] .font-body,
  #navbar a[href="index"] .font-body,
  #navbar a[href="/en/"] .font-body,
  #navbar > .max-w-6xl > a:first-child .font-body,
  #navbar > div > a:first-child .font-body {
    color: rgba(255,255,255,0.72) !important;
  }
  /* Inner-page subtitle uses inline style without .font-body class — target the sibling div.
     Covers both layouts: <div class="flex flex-col"> and <div class="navbar-logo-text">. */
  #navbar a[href="index"] > div > div:last-child,
  #navbar a[href="index"] .navbar-logo-text > div:last-child,
  #navbar a[href="/en/"] > div > div:last-child,
  #navbar a[href="/en/"] .navbar-logo-text > div:last-child {
    color: rgba(255,255,255,0.72) !important;
  }
  /* Override inline color:#5A6E8C on subtitle (inner pages, all locales) */
  #navbar a[href="index"] [style*="color:#5A6E8C"],
  #navbar a[href="index"] [style*="#5A6E8C"],
  #navbar a[href="/en/"] [style*="color:#5A6E8C"],
  #navbar a[href="/en/"] [style*="#5A6E8C"] {
    color: rgba(255,255,255,0.72) !important;
  }
  /* Also override the navy color on the name (inner pages have inline color:#0B2D5C) */
  #navbar a[href="index"] [style*="color:#0B2D5C"]:not(svg):not(path):not(line),
  #navbar a[href="index"] [style*="#0B2D5C"]:not(svg):not(path):not(line),
  #navbar a[href="/en/"] [style*="color:#0B2D5C"]:not(svg):not(path):not(line),
  #navbar a[href="/en/"] [style*="#0B2D5C"]:not(svg):not(path):not(line) {
    color: #ffffff !important;
  }

  /* Hamburger button — dark/transparent both states */
  #navbar #menuBtn {
    background: rgba(255,255,255,0.10) !important;
    border: 1px solid rgba(255,255,255,0.18);
  }
  #navbar #menuBtn .drawer-bar,
  #navbar #menuBtn span {
    background: #ffffff !important;
  }

  /* Lang segment switcher */
  #navbar .lang-seg {
    background: rgba(255,255,255,0.12) !important;
  }
  #navbar .lang-seg-item {
    color: rgba(255,255,255,0.72) !important;
  }
  #navbar .lang-seg-item.is-active {
    background: #ffffff !important;
    color: #0B2D5C !important;
  }

  /* Border separator before CTA cluster */
  #navbar > div > div:last-child,
  #navbar > .max-w-6xl > div:last-child {
    border-left-color: rgba(255,255,255,0.14) !important;
  }
  /* Hide tel button in navbar — sticky bar handles it */
  #navbar a[href^="tel:"].md\:hidden { display: none !important; }
  /* Hide WhatsApp button in inner-page navbars (sticky bar replaces them) */
  #navbar a[href*="wa.me"].md\:hidden { display: none !important; }

  /* ─────────────────────────────────────────────────────────────────
     6. FAQ items — gold accent
     ───────────────────────────────────────────────────────────────── */
  .faq-item {
    border-radius: 14px !important;
    border-color: rgba(201,163,104,0.18) !important;
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .faq-btn { padding: 14px 16px !important; }
  .faq-btn span { font-size: 0.92rem !important; line-height: 1.35; }
  .faq-item.open {
    border-color: rgba(201,163,104,0.55) !important;
    box-shadow: 0 4px 18px rgba(201,163,104,0.10);
  }
  .faq-item.open .faq-icon { color: #C9A368 !important; }
  .faq-answer p { padding: 0 16px 16px !important; font-size: 0.86rem !important; }

  /* ─────────────────────────────────────────────────────────────────
     7. Other section tweaks
     ───────────────────────────────────────────────────────────────── */
  #diseases .max-w-6xl > .grid { gap: 0.75rem !important; }

  #pricing .max-w-4xl { padding: 0 0.5rem; }
  #pricing .rounded-3xl { border-radius: 22px !important; }

  #reviews iframe { border-radius: 18px !important; }

  #contact .max-w-6xl > div { gap: 1rem !important; }

  /* ─────────────────────────────────────────────────────────────────
     8. Footer — gold dash divider, tighter padding, safe-area aware
     ───────────────────────────────────────────────────────────────── */
  footer.quote-strip,
  footer.py-8.px-4 {
    padding-top: 2rem !important;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    position: relative;
  }
  footer.quote-strip::before,
  footer.py-8.px-4::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #C9A368 50%, transparent 100%);
    border-radius: 2px;
  }

  /* ─────────────────────────────────────────────────────────────────
     9. Mid-page CTA section ("Хотите узнать как лечение?") — tighter
     ───────────────────────────────────────────────────────────────── */
  section.px-6.py-10[style*="0B2D5C"] {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  section.px-6.py-10[style*="0B2D5C"] h2 { font-size: 1.5rem !important; }

  /* ─────────────────────────────────────────────────────────────────
     10. Key benefits — 2×2 grid (mainly on index, but if reused elsewhere)
     ───────────────────────────────────────────────────────────────── */
  #key-benefits .kb-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  #key-benefits .kb-card {
    padding: 16px 14px !important;
    border-radius: 16px !important;
  }
  #key-benefits .kb-icon-wrap {
    width: 40px !important; height: 40px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }
  #key-benefits .kb-icon-wrap svg {
    width: 20px !important; height: 20px !important;
  }
  #key-benefits .kb-card-title {
    font-size: 0.9rem !important;
    margin-bottom: 4px !important;
    line-height: 1.25 !important;
  }
  #key-benefits .kb-card.kb-weekend .kb-card-title { font-size: 0.95rem !important; }
  #key-benefits .kb-card-desc { font-size: 0.74rem !important; line-height: 1.4 !important; }
  #key-benefits .kb-badge {
    font-size: 0.6rem !important;
    padding: 3px 9px !important;
    margin-bottom: 8px !important;
    letter-spacing: 0.06em !important;
  }
  #key-benefits .kb-day-pills {
    margin-top: 10px !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  #key-benefits .kb-day-pill {
    padding: 3px 7px !important;
    font-size: 0.65rem !important;
    gap: 3px !important;
  }
  #key-benefits .kb-day-pill-check { width: 9px !important; height: 9px !important; }
  #key-benefits .kb-day-pill-check svg { width: 6px !important; height: 6px !important; }
  #key-benefits .kb-cta { gap: 10px !important; }
  #key-benefits .kb-cta-text { font-size: 0.78rem !important; }

  /* ─────────────────────────────────────────────────────────────────
     11. Sticky bottom bar — WA + Phone + Book (injected via JS)
     ───────────────────────────────────────────────────────────────── */
  #mobileStickyBar {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 46;
    display: grid;
    grid-template-columns: 48px 48px 1fr;
    gap: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-radius: 100px;
    box-shadow:
      0 14px 36px rgba(5,21,40,0.20),
      0 4px 12px rgba(5,21,40,0.10),
      inset 0 1px 0 rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.32s cubic-bezier(0.32,0.72,0,1), opacity 0.25s;
  }
  #mobileStickyBar a {
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: transform 0.18s, filter 0.18s;
  }
  #mobileStickyBar a:active { transform: scale(0.96); }
  #mobileStickyBar .msb-icon { width: 48px; height: 48px; border-radius: 50%; }
  #mobileStickyBar .msb-wa {
    background: #25D366; color: #ffffff;
    box-shadow: 0 4px 12px rgba(37,211,102,0.32);
  }
  #mobileStickyBar .msb-phone {
    background: #ffffff; color: #0B2D5C;
    border: 1.5px solid #DDE3EC;
  }
  #mobileStickyBar .msb-book {
    height: 48px;
    border-radius: 100px;
    background: linear-gradient(135deg, #0B2D5C 0%, #1a4a8a 100%);
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(11,45,92,0.32);
    padding: 0 14px;
    white-space: nowrap;
  }
  body.modal-open #mobileStickyBar,
  body.drawer-on #mobileStickyBar,
  #mobileStickyBar.msb-hidden {
    transform: translateY(160%);
    opacity: 0;
    pointer-events: none;
  }
  body { padding-bottom: 84px; }
  #scrollTop { bottom: 78px !important; }
  #floatWA { display: none !important; }

  /* ─────────────────────────────────────────────────────────────────
     12. Hide legacy mobile FABs if any page still has them
     ───────────────────────────────────────────────────────────────── */
  #mobileFAB-wa, #mobileFAB-phone, #mobileFAB-book {
    display: none !important;
  }
}

/* Tall phones — slight upgrades */
@media (max-width: 767px) and (max-height: 700px) {
  section.hero-bg { padding-top: 5rem !important; }
  section.hero-bg h1.font-display { font-size: 1.95rem !important; }
}

/* ─────────────────────────────────────────────────────────────────
   Navbar layout fix — ensure burger ALWAYS fits on viewport. Original
   navbar uses px-6 (24px) + cluster padding-left:16px + border-left,
   which combined with logo text + lang dropdown overflows on ≤390px
   phones. We tighten everything for mobile.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Asymmetric padding — slightly more breathing on the right so burger
     doesn't sit flush against the screen edge. */
  #navbar {
    padding-left: 0.875rem !important;
    padding-right: 1.25rem !important;
  }
  /* Inner pages (about, prices, disease pages, etc.) wrap navbar content
     in <div class="max-w-6xl mx-auto px-4 sm:px-6 ...">, which adds an
     EXTRA 1rem (or 1.5rem on sm+) of horizontal padding on top of the
     <nav>'s own padding. Zero it out so all pages match index.html exactly. */
  #navbar > .max-w-6xl {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  /* CTA cluster — drop desktop separator line + balanced gap */
  #navbar > .max-w-6xl > div:last-child,
  #navbar > div > div:last-child {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    gap: 12px !important;
  }
  /* Burger — guaranteed visible, tappable, never compressed */
  #navbar #menuBtn {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
  }
  /* Compact logo emblem — 40px frees ~16px vs the desktop 56px so the
     lang dropdown + burger always anchor cleanly on the right.
     Name/subtitle sizing is set in the dedicated block below. */
  #navbar a[href="#hero"] .logo-emblem,
  #navbar a[href="index"] > div:first-child,
  #navbar a[href="/en/"] > div:first-child {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
  }
  /* Lang dropdown + burger — never shrink so they always fit at the right edge */
  #navbar .lang-switch-wrap,
  #navbar #menuBtn {
    flex-shrink: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Logo name + subtitle — sized so name + "● Уролог-андролог" (or the
   longer EN equivalent "● Urologist-Andrologist") fits comfortably on a
   360px viewport without pushing the lang switcher or burger off the
   right edge. The city is intentionally NOT appended — the customer
   prefers a clean two-line block: «Аманжолова Ш.К.» + profession.
   Three href variants covered: "#hero" (root), "index" (RU/KK inner),
   "/en/" (EN inner). */
@media (max-width: 767px) {
  /* Logo block — clamp width so name+subtitle never push right cluster off-screen.
     min-width:0 lets the inner spans actually shrink inside the parent flex row. */
  #navbar a[href="#hero"],
  #navbar a[href="index"],
  #navbar a[href="/en/"] {
    gap: 8px !important;
    margin-right: 8px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #navbar a[href="#hero"] > .flex.flex-col,
  #navbar a[href="index"] > .flex.flex-col,
  #navbar a[href="/en/"] > .flex.flex-col,
  #navbar a[href="index"] .navbar-logo-text,
  #navbar a[href="/en/"] .navbar-logo-text {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Logo NAME — tightened to 0.95rem so even "Amanzholova Sh.K." (17 chars
     in EN) fits inside the available 140-150px text-block window. */
  #navbar a[href="#hero"] .font-display,
  #navbar a[href="index"] .font-display,
  #navbar a[href="/en/"] .font-display {
    font-size: 0.95rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Logo SUBTITLE — 0.56rem with restrained letter-spacing.
     Calculated to keep "● Urologist-Andrologist" (the widest variant)
     under ~140px so the right cluster (lang dropdown + burger) stays
     anchored to the viewport edge without overlap. */
  #navbar a[href="#hero"] .font-body,
  #navbar a[href="index"] [style*="color:#5A6E8C"],
  #navbar a[href="index"] [style*="#5A6E8C"],
  #navbar a[href="/en/"] [style*="color:#5A6E8C"],
  #navbar a[href="/en/"] [style*="#5A6E8C"] {
    display: inline-flex !important;
    align-items: center !important;
    visibility: visible !important;
    font-size: 0.56rem !important;
    letter-spacing: 0.06em !important;
    margin-top: 2px !important;
    gap: 5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
}

/* Tiny phones (≤340px) — drop subtitle entirely so the name still has
   room to breathe and the right cluster never touches the logo. */
@media (max-width: 340px) {
  #navbar a[href="#hero"] .font-body,
  #navbar a[href="index"] [style*="color:#5A6E8C"],
  #navbar a[href="index"] [style*="#5A6E8C"],
  #navbar a[href="/en/"] [style*="color:#5A6E8C"],
  #navbar a[href="/en/"] [style*="#5A6E8C"] {
    display: none !important;
  }
  #navbar a[href="#hero"] .font-display,
  #navbar a[href="index"] .font-display,
  #navbar a[href="/en/"] .font-display {
    font-size: 0.9rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Language switcher — keep ONLY the dropdown on mobile. Segmented pill
   gets fully hidden + removed-from-flow so it can't take space or
   intercept clicks. All 3 dropdown items (RU/KZ/EN) forced visible.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Hide segmented hard — multiple selectors + remove from layout */
  body #navbar .lang-seg,
  body #navbar [data-lang-switcher="mobile"] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  /* Show dropdown wrap (lang-switcher.js hides it via `body.has-mobile-bar` rule) */
  body.has-mobile-bar #navbar .lang-switch-wrap,
  body #navbar .lang-switch-wrap {
    display: inline-flex !important;
    visibility: visible !important;
  }
  /* Restyle dropdown trigger for dark mobile navbar */
  #navbar .lang-switch {
    background: rgba(255,255,255,0.10) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    color: #ffffff !important;
    padding: 8px 11px !important;
    font-size: 0.78rem !important;
    gap: 5px !important;
  }
  #navbar .lang-switch:hover,
  #navbar .lang-switch[aria-expanded="true"] {
    border-color: rgba(255,255,255,0.42) !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.16) !important;
  }
  #navbar .lang-switch .lang-globe { color: rgba(255,255,255,0.85); }
  /* Dropdown menu — dark themed for mobile, all 3 langs guaranteed visible */
  #navbar .lang-menu {
    min-width: 168px;
    max-height: none !important;
    overflow: visible !important;
    background: #0B2D5C !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,0.45);
  }
  /* ULTRA-defensive: each menu item (RU, KZ, EN) explicitly forced visible.
     Multiple !important + multiple selectors so no single rule can hide
     any one item — particularly EN which has been intermittently absent. */
  #navbar #langMenu > a,
  #navbar #langMenu > *,
  #navbar .lang-menu > a,
  #navbar .lang-menu .lang-item,
  #navbar .lang-menu [data-lang] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 38px !important;
    width: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
    text-decoration: none !important;
  }
  /* And ensure EN specifically (last child) renders */
  #navbar .lang-menu [data-lang="en"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  #navbar .lang-item { color: rgba(255,255,255,0.88) !important; }
  #navbar .lang-item:hover { background: rgba(255,255,255,0.08) !important; }
  #navbar .lang-item.is-active {
    background: rgba(201,163,104,0.16) !important;
    color: #E8C896 !important;
  }
  #navbar .lang-item-code {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.70);
  }
  #navbar .lang-item.is-active .lang-item-code {
    background: #C9A368;
    color: #0B2D5C;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Hero chips — auto-scrolling marquee. JS (mobile-sticky-bar.js) wraps
   chips in .hero-m-chips-track and duplicates the content so the loop
   is seamless. Animation pauses on hover/touch.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-m-chips {
    display: block !important;
    overflow: hidden !important;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
  }
  .hero-m-chips-track {
    display: inline-flex;
    gap: 8px;
    width: max-content;
    padding-left: 1.25rem;
    animation: hero-m-chips-marquee 26s linear infinite;
    will-change: transform;
  }
  @keyframes hero-m-chips-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }
  .hero-m-chips:hover .hero-m-chips-track,
  .hero-m-chips:active .hero-m-chips-track,
  .hero-m-chips:focus-within .hero-m-chips-track {
    animation-play-state: paused;
  }
  /* Reduced motion — disable marquee, fall back to manual scroll */
  @media (prefers-reduced-motion: reduce) {
    .hero-m-chips { overflow-x: auto !important; }
    .hero-m-chips-track {
      animation: none !important;
      padding-left: 0 !important;
    }
  }
}

/* ─────────────────────────────────────────────────────────────────
   Logo emblem — fully visible on dark navbar in BOTH states (the old
   :not(.scrolled) version left the outline navy when scrolled, which
   merged into the new dark scrolled navbar).
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Universal — match by attribute value, applies to index AND inner pages */
  #navbar svg path[fill="#0B2D5C"]:not([stroke]) { fill: #ffffff !important; }
  #navbar svg path[stroke="#0B2D5C"] { stroke: rgba(255,255,255,0.92) !important; }
  #navbar svg line[stroke="#0B2D5C"] { stroke: rgba(255,255,255,0.55) !important; }
  /* Gold paths/strokes stay gold — leave [fill="#C9A368"] and [stroke="#C9A368"] alone */
}

/* ─────────────────────────────────────────────────────────────────
   Sticky bar — hide when symptom-matcher result pill (#sm-float) is
   visible, so they don't stack at bottom.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  body:has(#sm-float.visible) #mobileStickyBar {
    transform: translateY(160%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Footer + sticky bar overlap fix — remove body padding (was causing
   white block under footer); push the sticky-bar-clearance into the
   footer itself, which is dark navy and looks intentional.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  body { padding-bottom: 0 !important; }
  footer.quote-strip,
  footer.py-8.px-4 {
    padding-bottom: calc(2rem + 84px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
