/* SOFON Calculator PHASE02 — Convertor-inspired glass header and hover/focus language menu.
   Scoped to the existing header. Calculator tools, modal layouts and API unaffected. */
.site-header.shell {
  position: relative;
  z-index: 30;
  width: min(1180px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
.site-header .brand { min-width: 0; }
.site-header .brand__logo { width: 48px; height: 48px; flex: 0 0 auto; }
.site-header .brand strong { letter-spacing: -.025em; }
.site-header .header-actions { flex: 0 0 auto; }
.site-header .header-actions > .button,
.site-header .header-actions > .icon-button {
  min-height: 44px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.site-header .header-actions > .button { border-radius: 14px; }
.site-header .header-actions > .button > span[aria-hidden="true"] {
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--primary); color: white;
  font-size: .8rem;
}
.site-header .header-actions > .button:hover,
.site-header .header-actions > .icon-button:hover { background: var(--surface-strong); }
.sofon-locale { position: relative; flex: 0 0 auto; font-weight: 750; }
.sofon-locale__trigger,
.sofon-locale__choice {
  display: inline-flex; justify-content: center; align-items: center;
  gap: 7px; min-height: 44px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-strong); color: var(--text);
  font-size: .84rem; font-weight: 750; line-height: 1.2; cursor: pointer;
}
.sofon-locale__trigger:hover,.sofon-locale__choice:hover { background: var(--surface); }
.sofon-locale__trigger:focus-visible,.sofon-locale__choice:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.sofon-locale__flag { font-size: 1.16rem; line-height: 1; }
.sofon-locale__chevron { width: 10px; height: 10px; opacity: .7; transition: transform .18s ease; }
.sofon-locale__menu {
  position: absolute; right: 0; top: 100%;
  min-width: 100%; padding: 5px; border: 1px solid var(--border);
  border-radius: 15px; background: var(--surface-strong);
  box-shadow: 0 17px 42px rgba(10, 35, 65, .18);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-4px); transition: opacity .16s ease,transform .16s ease;
}
.sofon-locale__choice { width: 100%; border: 0; justify-content: flex-start; white-space: nowrap; }
.sofon-locale.is-open .sofon-locale__menu,
.sofon-locale:focus-within .sofon-locale__menu {
  visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0);
}
.sofon-locale.is-open .sofon-locale__chevron { transform: rotate(180deg); }
@media (hover: hover) and (pointer:fine) {
  .sofon-locale:hover .sofon-locale__menu {
    visibility:visible; opacity:1; pointer-events:auto; transform:translateY(0);
  }
  .sofon-locale:hover .sofon-locale__chevron { transform: rotate(180deg); }
}
@media (max-width: 620px) {
  .site-header.shell { width:calc(100% - 24px); margin-top:12px; padding: 10px 12px; gap:10px; }
  .site-header .brand small { display:none; }
  .site-header .brand { gap:7px; }
  .site-header .brand__logo { width:40px; height:40px; }
  .site-header .brand strong { font-size:.84rem; }
  .site-header .header-actions { gap:5px; }
  .site-header .header-actions > .button { padding: 0 9px; font-size:.82rem; }
  .site-header .header-actions > .icon-button { width:40px; min-height:40px; height:40px; }
  .sofon-locale__trigger { min-height:40px; padding:0 7px; gap:4px; font-size:.78rem; }
  .sofon-locale__flag { font-size:1.05rem; }
}
@media (max-width: 390px) {
  .site-header.shell { flex-wrap:wrap; }
  .site-header .header-actions { margin-left:auto; }
}
@media (prefers-reduced-motion:reduce) {
  .sofon-locale__menu,.sofon-locale__chevron { transition:none; }
}
