/* header.css — the ONE shared site header (round 43, brief 114), loaded by
   web/public_catalog and every web/customer page: shop name, a single
   language button with a menu, a cart link with a count badge, an account
   link. Positioning stays with each site (the catalog header is fixed and
   measured into --header-h; the customer header sticks to the top).
   Colours: white on the brand green measures 5.42:1 (WCAG AA, round 41);
   the badge's dark green on white measures ~8.2:1. The colours are the
   same in light and dark OS modes — neither site has a dark variant. */

.site-header {
  background: var(--brand, #0f7a3d);
  color: var(--brand-ink, #ffffff);
  padding: 10px 16px 12px;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header .brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Language button + menu ------------------------------------------- */
.lang-menu-wrap {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn svg {
  flex-shrink: 0;
}

.lang-btn .lang-chev {
  transition: transform 0.15s ease;
}

.lang-btn[aria-expanded="true"] .lang-chev {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 190px;
  background: #ffffff;
  color: #1c2733;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 6px;
  z-index: 80;
}

.lang-menu [data-locale] {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.lang-menu [data-locale]:hover {
  background: #eef4f0;
}

.lang-menu [data-locale][aria-checked="true"] {
  background: #e3f2e8;
  color: #0d5c2e;
  font-weight: 700;
}

/* --- Account + cart ----------------------------------------------------- */
.site-header .account-link,
.site-header .cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 8px;
  color: var(--brand-ink, #ffffff);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-header .account-link svg,
.site-header .cart-link svg {
  flex-shrink: 0;
}

.cart-badge {
  background: #ffffff;
  color: #0d5c2e;
  border-radius: 999px;
  min-width: 22px;
  padding: 1px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.cart-badge[hidden] {
  display: none;
}

/* --- Catalog rows inside the header (search + category chips) ---------- */
.site-header .toolbar {
  margin: 10px 0 0;
}

.site-header .search-label {
  color: var(--brand-ink, #ffffff);
  font-weight: 600;
}

.site-header .category-row {
  margin-top: 8px;
}

.site-header .category-label {
  color: var(--brand-ink, #ffffff);
}

.site-header .chip-active {
  background: #0d5c2e;
  border-color: #ffffff;
  color: #ffffff;
}

/* --- Focus + small screens ---------------------------------------------- */
.site-header :focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  border-radius: 8px;
}

.lang-menu :focus-visible {
  outline: 3px solid #0f7a3d;
  outline-offset: -3px;
}

@media (max-width: 520px) {
  .site-header {
    padding: 8px 12px 10px;
  }

  .site-header .brand {
    font-size: 1.15rem;
  }

  .header-actions {
    gap: 2px;
  }

  /* Phones: logo + icons on top (brief 114) — the words go, the icons,
     the badge and the accessible names stay. */
  .site-header .account-link .link-text,
  .site-header .cart-link .link-text {
    display: none;
  }
}
