/* HIDAVI mobile reliability patch */
html,body{max-width:100%;overflow-x:hidden}

@media (max-width:1050px){
  .page-shell{width:100%;max-width:100%;margin:0;border:0;border-radius:0;overflow:hidden}
  .site-header{height:76px;padding:0 14px;display:flex!important;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:0;background:rgba(255,255,255,.97);z-index:1000;box-shadow:0 5px 20px rgba(50,30,38,.08)}
  .brand{display:flex!important;min-width:0;max-width:calc(100% - 58px);gap:9px;align-items:center}
  .brand-symbol{width:38px;height:44px;font-size:30px;flex:0 0 auto}
  .brand-copy{display:flex!important;min-width:0}
  .brand-copy small{font-size:8px}
  .brand-copy strong{font-size:17px;white-space:nowrap}
  .brand-copy span{font-size:6px;letter-spacing:1px;white-space:nowrap}
  .menu-toggle{display:block!important;flex:0 0 44px;margin:0!important;position:relative;z-index:1002}
  .header-cta{display:none!important}
  .main-nav{position:fixed!important;top:76px!important;right:12px!important;left:12px!important;width:auto!important;max-height:calc(100dvh - 90px);overflow:auto;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;padding:10px!important;background:#fff!important;border:1px solid #eadfdb!important;border-radius:16px!important;box-shadow:0 20px 55px rgba(52,30,38,.18)!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(-10px)!important;transition:.2s ease!important;z-index:1001!important}
  .main-nav.open{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important}
  .main-nav a{display:block!important;padding:11px 13px!important;color:#2d2930!important;text-decoration:none!important;border-bottom:1px solid #f1e8ea;font-size:14px!important}
  .main-nav a:last-child{border-bottom:0}

  .hero{display:flex!important;flex-direction:column!important;min-height:0!important;margin:12px!important;border-radius:20px!important;overflow:hidden!important;background:#fff!important}
  .hero-background{position:relative!important;inset:auto!important;width:100%!important;height:clamp(230px,62vw,430px)!important;min-height:230px!important;background-position:center!important;background-size:cover!important;border-radius:0!important;order:1}
  .hero-fade{display:none!important}
  .hero-content{position:relative!important;width:100%!important;margin:0!important;padding:28px 20px 30px!important;order:2;background:#fff!important}
  .eyebrow{font-size:13px!important;line-height:1.8}
  .hero h1{font-size:clamp(34px,10vw,48px)!important;line-height:1.35!important;letter-spacing:-1px!important;margin:12px 0!important;overflow-wrap:anywhere}
  .hero-description{font-size:14px!important;line-height:2!important;max-width:none!important}
  .hero-actions{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;margin-top:22px!important}
  .button{width:100%!important;min-width:0!important;padding-inline:16px!important}
  .social-proof{width:100%!important;max-width:100%!important;margin-top:20px!important;padding:12px!important;display:block!important}

  .trust-strip{margin:0 12px 15px!important;grid-template-columns:1fr!important}
  .section{padding:58px 18px!important}
  .section-heading{margin-bottom:30px!important}
  .section-heading h2,.about-copy h2,.booking h2{font-size:clamp(27px,8vw,34px)!important;line-height:1.5!important}
  .service-grid,.doctor-grid,.article-grid,.about,.booking,.footer-main{grid-template-columns:minmax(0,1fr)!important}
  .service-card,.doctor-grid article,.article-grid article{min-width:0!important}
  .service-card p{min-height:0!important}
  .about{gap:32px!important}
  .about-visual{padding:0!important}
  .about-image{height:330px!important}
  .quality-card{right:10px!important;top:10px!important;max-width:calc(100% - 20px)}
  .experience-badge{left:10px!important;bottom:-20px!important}
  .about-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  .about-stats div{padding:12px 4px!important}
  .about-stats strong{font-size:20px!important}
  .doctor-photo{height:350px!important}
  .gallery-grid{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:none!important}
  .gallery-grid figure,.gallery-large{grid-column:auto!important;grid-row:auto!important;height:230px!important}
  .booking{gap:30px!important}
  .booking form{grid-template-columns:1fr!important}
  .booking button,.form-message{grid-column:auto!important}
  .footer-main{gap:28px!important}
  .footer-brand{grid-column:auto!important}
  .footer-bottom{flex-direction:column!important;align-items:center!important;text-align:center!important;padding-inline:18px!important}
  .social-icons{flex-wrap:wrap}
}

@media (max-width:390px){
  .site-header{padding-inline:10px}
  .brand-symbol{width:34px;height:40px;font-size:27px}
  .brand-copy strong{font-size:15px}
  .hero{margin:8px!important}
  .hero-content{padding:24px 16px 26px!important}
  .hero-background{height:235px!important}
  .section{padding-inline:14px!important}
  .about-stats span{font-size:9px!important}
}

/* Fix initial blank viewport on RTL mobile pages */
html,
body {
  width: 100%;
  min-width: 0;
  overflow-x: clip !important;
  overscroll-behavior-x: none;
}

body,
.page-shell,
.site-header,
main,
section,
footer {
  max-width: 100%;
}

/* Keep the anti-spam field accessible to the form without placing it
   thousands of pixels outside the RTL document canvas. */
.hp-field {
  position: fixed !important;
  inset: 0 auto auto 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@supports not (overflow: clip) {
  html,
  body { overflow-x: hidden !important; }
}

/* Sage theme mobile consistency */
@media (max-width:1050px){
  .site-header{box-shadow:0 5px 20px rgba(61,76,54,.09)}
  .main-nav{border-color:#dce2d2!important;box-shadow:0 20px 55px rgba(55,70,49,.16)!important}
  .main-nav a{color:#30372d!important;border-bottom-color:#edf0e8}
}

/* Dark-mode mobile navigation contrast (must come after mobile !important rules). */
@media (max-width:1050px){
  html[data-theme="dark"] .main-nav{
    background:#232a21 !important;
    border-color:#465340 !important;
    box-shadow:0 20px 55px rgba(0,0,0,.28) !important;
  }
  html[data-theme="dark"] .main-nav a{
    color:#edf2e9 !important;
    border-bottom-color:#3f4c3a !important;
  }
  html[data-theme="dark"] .main-nav a:hover,
  html[data-theme="dark"] .main-nav a.active{color:#fff !important}
}
