/* CHA v12 — responsive public navigation based on uploaded navigation-system package.
   Scope: public pages only. Patient/Admin/Partner portal pages do not load this file. */
:root{
  --cha-primary:#0E7C7B;
  --cha-primary-hover:#0c6e6d;
  --cha-teal-soft:#E8F4F4;
  --cha-fg:#1E293B;
  --cha-muted:#64748B;
  --cha-border:#E2E8F0;
  --cha-success:#16A34A;
  --cha-surface:#F8FAFB;
  --cha-mobile-menu-top:88px;
}
body.cha-menu-open{overflow:hidden!important;}
.cha-mobile-backdrop,.cha-mobile-drawer{display:none;}
.cha-menu-toggle svg{width:20px;height:20px;}
@media (min-width:1024px){.cha-mobile-backdrop,.cha-mobile-drawer{display:none!important}.cha-menu-toggle{display:none!important;}}
@media (max-width:1023px){
  /* Keep existing header visible; this file only normalizes the public mobile menu behaviour. */
  button[aria-label="Open menu"],button[aria-label="Close menu"],.cha-menu-toggle{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:44px!important;height:44px!important;border-radius:9999px!important;
    border:1px solid var(--cha-border)!important;background:#fff!important;color:var(--cha-fg)!important;
    box-shadow:0 4px 14px rgba(15,23,42,.06)!important;flex:0 0 auto!important;
  }
  .cha-mobile-backdrop{
    display:block;position:fixed;inset:0;background:rgba(30,41,59,.16);
    backdrop-filter:blur(2px);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,visibility .18s ease;z-index:998;
  }
  .cha-mobile-drawer{
    display:block;position:fixed;left:18px;right:18px;top:var(--cha-mobile-menu-top);
    max-height:calc(100svh - var(--cha-mobile-menu-top) - 18px);
    background:#fff;color:var(--cha-fg);border:1px solid var(--cha-border);border-radius:24px;
    box-shadow:0 24px 60px -20px rgba(15,23,42,.18);overflow:hidden;z-index:999;
    transform:translateY(-8px);opacity:0;visibility:hidden;pointer-events:none;
    transition:opacity .18s ease,transform .2s ease,visibility .18s ease;
  }
  body.cha-menu-open .cha-mobile-backdrop{opacity:1;visibility:visible;pointer-events:auto;}
  body.cha-menu-open .cha-mobile-drawer{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);}
  .cha-mobile-drawer__body{display:flex;flex-direction:column;padding:16px;max-height:inherit;overflow-y:auto;-webkit-overflow-scrolling:touch;}
  .cha-mobile-link,.cha-mobile-acc__summary{
    display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;padding:8px 14px;
    border-radius:12px;color:var(--cha-fg);text-decoration:none;font-size:16px;font-weight:500;line-height:1.25;background:transparent;
  }
  .cha-mobile-link:hover,.cha-mobile-acc__summary:hover{background:var(--cha-surface);color:var(--cha-primary);}
  .cha-mobile-acc{display:block;}
  .cha-mobile-acc summary{list-style:none;cursor:pointer;}
  .cha-mobile-acc summary::-webkit-details-marker{display:none;}
  .cha-mobile-acc__summary svg{transition:transform .18s ease;color:var(--cha-muted);}
  .cha-mobile-acc[open] .cha-mobile-acc__summary svg{transform:rotate(180deg);}
  .cha-mobile-sub{display:flex;flex-direction:column;gap:2px;padding:2px 0 6px 8px;}
  .cha-mobile-sub a{display:flex;align-items:center;gap:10px;min-height:40px;padding:8px 12px;border-radius:12px;color:var(--cha-fg);font-size:14px;font-weight:500;text-decoration:none;}
  .cha-mobile-sub a:hover{background:var(--cha-surface);color:var(--cha-primary);}
  .cha-mobile-sub-ico{width:30px;height:30px;border-radius:999px;background:var(--cha-teal-soft);color:var(--cha-primary);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;}
  .cha-mobile-divider{height:1px;background:var(--cha-border);margin:12px 0;}
  .cha-mobile-whatsapp{display:flex;align-items:center;gap:12px;text-decoration:none;padding:12px;border-radius:12px;background:rgba(22,163,74,.10);color:var(--cha-success);}
  .cha-mobile-whatsapp__icon{width:36px;height:36px;border-radius:999px;background:rgba(22,163,74,.16);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;}
  .cha-mobile-whatsapp__txt{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;}
  .cha-mobile-whatsapp__txt strong{font-size:14px;color:#0ca376;font-weight:700;}
  .cha-mobile-whatsapp__txt small{font-size:13px;color:#14a77e;}
  .cha-mobile-email{display:flex;align-items:center;gap:12px;color:#334155;text-decoration:none;font-size:14px;padding:10px 12px;border-radius:12px;margin-top:6px;}
  .cha-mobile-email:hover{background:var(--cha-surface);}
  .cha-mobile-lang-label{text-transform:uppercase;letter-spacing:.14em;font-size:11px;font-weight:700;color:var(--cha-muted);padding:0 4px 9px;}
  .cha-mobile-lang-pill{display:inline-flex;align-items:center;gap:8px;width:max-content;height:42px;padding:0 14px;border:1px solid var(--cha-border);border-radius:999px;background:#fff;color:#334155;font-weight:500;box-shadow:0 1px 2px rgba(15,23,42,.04);}
  .cha-mobile-actions{display:flex;flex-direction:column;gap:8px;margin-top:2px;}
  .cha-mobile-actions a{height:50px;border-radius:999px;display:flex;align-items:center;justify-content:center;text-decoration:none;font-weight:700;font-size:15px;gap:9px;}
  .cha-mobile-signin{background:#fff;border:1px solid var(--cha-border);color:var(--cha-fg);box-shadow:0 2px 8px rgba(15,23,42,.03);}
  .cha-mobile-cta{background:var(--cha-primary);border:1px solid var(--cha-primary);color:#fff;box-shadow:0 14px 24px rgba(14,124,123,.18);}
  .cha-mobile-cta:hover{background:var(--cha-primary-hover);}
}
@media (max-width:380px){
  .cha-mobile-drawer{left:12px;right:12px;border-radius:22px;}
  .cha-mobile-drawer__body{padding:14px;}
  .cha-mobile-link,.cha-mobile-acc__summary{font-size:15.5px;min-height:44px;}
  .cha-mobile-actions a{height:48px;}
}

/* v28 iPhone/mobile drawer stabilization */
html,body{max-width:100%;overflow-x:hidden;}
@media (max-width:1023px){
  header#top,.site-nav{max-width:100vw!important;overflow:visible!important;}
  header#top .container-page,.site-nav .container-page{max-width:100%!important;width:100%!important;padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important;}
  header#top .container-page>div,.site-nav__row{max-width:100%!important;min-width:0!important;}
  .cha-menu-toggle{position:relative!important;z-index:1000!important;}
  .cha-mobile-backdrop{z-index:100!important;background:rgba(30,41,59,.24)!important;}
  .cha-mobile-drawer{z-index:200!important;left:max(12px,env(safe-area-inset-left))!important;right:max(12px,env(safe-area-inset-right))!important;top:calc(var(--cha-mobile-menu-top) + env(safe-area-inset-top))!important;width:auto!important;max-width:none!important;border-radius:16px!important;max-height:calc(100dvh - var(--cha-mobile-menu-top) - env(safe-area-inset-top) - 16px)!important;}
  .cha-mobile-drawer__body{padding:14px!important;}
  .cha-mobile-link,.cha-mobile-acc__summary{min-height:44px!important;font-size:15px!important;border-radius:8px!important;}
  .cha-mobile-sub a{min-height:40px!important;font-size:13.5px!important;border-radius:8px!important;}
  .cha-mobile-whatsapp,.cha-mobile-email{border-radius:8px!important;}
  .cha-mobile-actions a{height:44px!important;border-radius:9999px!important;font-size:14px!important;}
}
@media (max-width:390px){
  .cha-mobile-drawer{left:10px!important;right:10px!important;}
  .cha-mobile-drawer__body{padding:12px!important;}
  .cha-mobile-link,.cha-mobile-acc__summary{font-size:14.5px!important;padding-left:10px!important;padding-right:10px!important;}
}
