/* Provo customer header (v2). Scoped to .site-header.hd; uses the site's own tokens, no libraries, no backdrop-filter (cheap in WebViews).
   Desktop (>=900px): a flat bar on the page background:  [logo] [nav]  ...  [language] [location] [theme] [account | Log in].
   Mobile (<900px):   [logo] ... [language] [location] [menu]; the menu opens a drawer (theme, account, nav). Search stays in the bottom bar. */

.site-header.hd{position:relative;z-index:100;background:transparent;border-bottom:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
/* the home hero is a white (surface) section: the header takes the same colour there so no band shows; other pages use the page background */
.site-header.hd--home{background:var(--surface)}
.hd .hd-wrap{padding-block:2px}
.hd .hd-bar{display:flex;align-items:center;gap:6px;height:64px;min-width:0}
.hd .brand{flex:none;gap:9px;font-size:1.22rem;margin-right:10px}
.hd .brand-mark{width:32px;height:32px;border-radius:10px;box-shadow:0 4px 10px -4px rgba(220,38,38,.55)}
html[data-tr] .hd .brand{white-space:nowrap}

/* location + language chips */
.hd .hd-ctx{display:flex;align-items:center;gap:6px;min-width:0;flex:0 1 auto;margin-left:auto}
.hd .loc-slot,.hd .lang-slot{min-width:0;flex:0 1 auto}
.hd .lang-slot{flex:none}
.hd .loc-btn,.hd .lang-btn{min-height:38px;height:38px;padding:0 12px;border:1px solid var(--border);border-radius:999px;background:transparent;color:var(--text);font-size:.84rem;font-weight:700;gap:7px;transition:background-color .18s,border-color .18s}
.hd .loc-btn{max-width:176px}
.hd .lang-btn{max-width:150px}
.hd .loc-btn:hover,.hd .lang-btn:hover{background:var(--surface-2);border-color:var(--border-strong)}
.hd .lang-btn[aria-expanded="true"]{background:var(--tint);border-color:transparent;color:var(--tint-ink)}
.hd .loc-btn svg:first-child{width:17px;height:17px}
.hd .loc-btn::after{left:16px;right:16px;bottom:2px}

/* navigation */
.hd .hd-nav{display:flex;align-items:center;gap:2px;flex:0 1 auto;min-width:0}
.hd .hd-nav a{display:inline-flex;align-items:center;height:38px;padding:0 14px;border-radius:999px;color:var(--text-2);font-weight:600;font-size:.9rem;text-decoration:none!important;white-space:nowrap;max-width:16ch;overflow:hidden;text-overflow:ellipsis;transition:background-color .18s,color .18s}
.hd .hd-nav a:hover{background:var(--surface-2);color:var(--text)}
.hd .hd-nav a[aria-current="page"]{background:var(--tint);color:var(--tint-ink);font-weight:700}

/* right side */
.hd .hd-actions{display:flex;align-items:center;gap:4px;flex:none;margin-left:2px}
.hd .hd-icon{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-2);cursor:pointer;transition:background-color .18s,color .18s,transform .15s}
.hd .hd-icon:hover{background:var(--surface-2);color:var(--text)}
.hd .hd-icon:active{transform:scale(.93)}
.hd .hd-avatar-btn{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer}
.hd .hd-avatar-btn .avatar{width:34px;height:34px;border-radius:50%;box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--border)}
.hd .hd-avatar-btn:hover .avatar,.hd .hd-avatar-btn[aria-expanded="true"] .avatar{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ring)}
.hd .hd-login{display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 18px;margin-left:2px;border-radius:999px;background:var(--grad);color:#fff!important;font-weight:700;font-size:.88rem;text-decoration:none!important;white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis;box-shadow:0 8px 18px -10px rgba(220,38,38,.7);transition:filter .18s,transform .15s}
.hd .hd-login:hover{filter:brightness(1.07)}
.hd .hd-login:active{transform:scale(.97)}
.hd .hd-burger,.hd .hd-drawer{display:none}
.hd .menu:not(.open) .menu-panel{display:none}
.hd .menu-panel{top:calc(100% + 12px);min-width:244px;border-radius:18px;padding:8px}
.hd .menu-panel .who{padding:10px 12px 12px}
.hd .menu-panel a,.hd .menu-panel button{border-radius:12px}

/* keyboard focus */
.hd :is(.hd-nav a,.hd-icon,.hd-avatar-btn,.hd-login,.loc-btn,.lang-btn):focus-visible{outline:2px solid var(--red-primary);outline-offset:2px}

/* language dropdown opens under the language button towards the right (never off the left edge) */
.hd .lang-panel{right:0;left:auto}

/* ---- desktop width steps */
@media (min-width:900px) and (max-width:1099px){
  .hd .lang-btn .lang-name,.hd .lang-btn .lang-chev{display:none}
  .hd .lang-btn .lang-short{display:inline;font-size:.8rem}
  .hd .lang-btn{padding:0 11px;gap:6px}
  .hd .loc-btn{max-width:150px;padding:0 10px}
  .hd .loc-btn .loc-chev{display:none}
  .hd .hd-nav a{padding:0 11px;font-size:.88rem}
}
@media (min-width:1100px){.hd .hd-nav a{padding:0 16px}}
@media (min-width:1500px){.hd .loc-btn{max-width:220px}}
html[data-tr] .hd .hd-nav a{max-width:15ch}
html[data-tr] .hd .loc-btn,html[data-tr] .hd .lang-btn{max-width:150px}
@media (min-width:900px) and (max-width:1199px){html[data-tr] .hd .hd-nav a{padding:0 9px;font-size:.84rem;max-width:12ch}}
@media (min-width:900px){html[data-tr] .hd .lang-btn .lang-name,html[data-tr] .hd .lang-btn .lang-chev{display:none}html[data-tr] .hd .lang-btn .lang-short{display:inline;font-size:.8rem}}
/* ---- mobile / tablet (<900px): compact bar, drawer */
@media (max-width:899px){
  .hd .hd-wrap{padding-block:0}
  .hd .hd-bar{height:56px;gap:6px}
  .hd .brand{margin-right:0;font-size:1.16rem}
  .hd .hd-ctx{margin-left:auto;gap:5px}
  .hd .hd-nav,.hd .hd-actions .theme-toggle,.hd .hd-account,.hd .hd-login{display:none}
  .hd .hd-actions{margin-left:0}
  .hd .hd-burger{display:inline-grid;width:44px;height:44px;margin-right:-6px}
  .hd .loc-btn,.hd .lang-btn{height:40px;min-height:40px;padding:0 11px}
  .hd .loc-btn{max-width:min(200px,calc(100vw - 292px))}
  .hd .loc-btn .loc-chev{display:none}
  .hd .lang-btn .lang-name,.hd .lang-btn .lang-chev{display:none}
  .hd .lang-btn .lang-short{display:inline;font-size:.8rem}
  .hd .lang-btn{padding:0 11px;gap:5px}
}
@media (max-width:359px){
  .hd .loc-btn{max-width:40px;padding:0;justify-content:center;width:40px}
  .hd .loc-btn [data-loc-text],.hd .loc-btn .loc-chev{display:none}
  .hd .lang-btn{padding:0 9px}
  .hd .brand{font-size:1.1rem;gap:7px}
  .hd .hd-bar{gap:4px}
}
@media (min-width:360px) and (max-width:389px){.hd .loc-btn{max-width:min(130px,calc(100vw - 268px));padding:0 9px;gap:5px}}
@media (min-width:900px) and (hover:none){.hd .hd-nav a,.hd .hd-icon{min-height:44px}}

/* ---- drawer */
@media (max-width:899px){
  .hd .hd-drawer{position:fixed;inset:0 0 0 auto;display:none;flex-direction:column;width:min(86vw,340px);max-width:100%;height:100vh;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:22px 0 0 22px;background:var(--surface);color:var(--text);box-shadow:-18px 0 50px -20px rgba(20,8,12,.45);overflow:hidden}
  .hd .hd-drawer[open]{display:flex;animation:hd-in .26s var(--ease-out,ease-out)}
  .hd .hd-drawer::backdrop{background:rgba(20,10,12,.5)}
  html.hd-lock{overflow:hidden}
  .hd .hd-d-head{display:flex;align-items:center;justify-content:space-between;height:58px;padding:0 10px 0 16px;border-bottom:1px solid var(--border);flex:none}
  .hd .hd-d-body{display:flex;flex-direction:column;gap:14px;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px}
  .hd .hd-d-me{display:flex;align-items:center;gap:12px;padding:14px;border-radius:18px;background:linear-gradient(135deg,var(--tint),var(--surface-2));color:var(--text);text-decoration:none!important}
  .hd .hd-d-me .avatar.lg{width:46px;height:46px;border-radius:50%;font-size:1.15rem;flex:none;box-shadow:none}
  .hd .hd-d-who{display:grid;min-width:0;flex:1}
  .hd .hd-d-who strong,.hd .hd-d-who span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hd .hd-d-who strong{font-size:.98rem}
  .hd .hd-d-who span{font-size:.8rem;color:var(--muted);font-weight:600}
  .hd .hd-d-me > svg{flex:none;color:var(--muted)}
  .hd .hd-d-guest{display:grid;gap:4px;padding:16px;border-radius:18px;background:linear-gradient(135deg,var(--tint),var(--surface-2))}
  .hd .hd-d-guest strong{font-size:1.02rem;color:var(--text)}
  .hd .hd-d-guest > span{font-size:.84rem;color:var(--text-2);font-weight:500}
  .hd .hd-d-cta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
  .hd .hd-d-btn{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface);color:var(--text)!important;font-weight:700;font-size:.86rem;line-height:1.2;text-align:center;text-decoration:none!important}
  .hd .hd-d-btn.is-main{border-color:transparent;background:var(--grad);color:#fff!important;box-shadow:0 8px 18px -10px rgba(220,38,38,.7)}
  .hd .hd-d-nav{display:grid;gap:2px}
  .hd .hd-d-nav a,.hd .hd-d-theme,.hd .hd-d-foot button{display:flex;align-items:center;gap:14px;width:100%;min-height:50px;padding:0 14px;border:0;border-radius:14px;background:transparent;color:var(--text);font:inherit;font-weight:600;font-size:.96rem;text-align:left;text-decoration:none!important;cursor:pointer}
  .hd .hd-d-nav a svg,.hd .hd-d-theme svg,.hd .hd-d-foot svg{flex:none;color:var(--muted)}
  .hd .hd-d-nav a:hover,.hd .hd-d-theme:hover,.hd .hd-d-foot button:hover{background:var(--surface-2)}
  .hd .hd-d-nav a[aria-current="page"]{background:var(--tint);color:var(--tint-ink);font-weight:700}
  .hd .hd-d-nav a[aria-current="page"] svg{color:var(--red-primary)}
  .hd .hd-d-nav a,.hd .hd-d-lbl{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hd .hd-d-theme{border-top:1px solid var(--border);border-radius:0 0 14px 14px;margin-top:2px;padding-top:2px}
  .hd .hd-d-ico{display:inline-grid;flex:none}
  .hd .hd-d-lbl{flex:1}
  .hd .hd-sw{position:relative;flex:none;width:44px;height:26px;border-radius:999px;background:var(--border-strong);transition:background-color .2s}
  .hd .hd-sw::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .2s var(--ease,ease)}
  :root[data-theme=dark] .hd .hd-sw{background:var(--grad)}
  :root[data-theme=dark] .hd .hd-sw::after{transform:translateX(18px)}
  .hd .hd-d-foot{flex:none;margin:0;padding:8px 14px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--border)}
  .hd .hd-d-foot button{color:var(--red-deep)}
  .hd .hd-d-foot button svg{color:var(--red-deep)}
  .hd .hd-d-body{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
  .hd .hd-d-head .hd-icon{margin-right:0}
  .hd .hd-drawer :is(a,button):focus-visible{outline:2px solid var(--red-primary);outline-offset:-2px}
}
@media (max-width:899px) and (prefers-color-scheme:dark){
  :root:not([data-theme]) .hd .hd-sw{background:var(--grad)}
  :root:not([data-theme]) .hd .hd-sw::after{transform:translateX(18px)}
}
@keyframes hd-in{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.hd .hd-drawer[open]{animation:none}.hd .hd-icon,.hd .hd-login{transition:none}}
