/* Room kept for the scrollbar on every page, so a short page does not shift sideways against a long one. */
html { scrollbar-gutter: stable; }
html.fw-menu-open, html.fw-menu-open body { overflow: hidden; }

/* The one header: logo left, menu in the middle, search, shop controls and language right. */
.fw-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
  padding: 0.5rem max(1.25rem, calc((100% - var(--container-site, 80rem)) / 2));
  border-bottom: 1px solid var(--color-line, #e4e4e4);
  background: #fff;
  font-family: var(--font-sans, Montserrat, sans-serif);
  box-sizing: border-box;
}
.fw-header *, .fw-header *::before, .fw-header *::after { box-sizing: border-box; }

/* One slot for either logo, so the menu stays put between the site and the shop. */
.fw-header__logo { flex: 0 0 180px; line-height: 0; }
@media (max-width: 60rem) { .fw-header__logo { flex-basis: 120px; } }
.fw-header__logo img { display: block; width: 150px; max-width: none; height: auto; }
/* The wordmark fills the top 47 of the logo's 70 units: it sits on the header's centre line and the "30" hangs over the bottom edge. */
.fw-header__farwell { position: relative; z-index: 1; width: 180px !important; margin-block: -1rem -2.25rem; transform: translateY(0.4rem); }
@media (max-width: 60rem) { .fw-header__farwell { width: 120px !important; margin-block: -0.5rem -1.5rem; transform: translateY(0.25rem); } }
@media (min-width: 60.0625rem) and (max-width: 80rem) {
  .fw-header { gap: 1rem; }
  .fw-header__logo img { width: 120px; }
  .fw-header__menu svg { display: none; }
  .fw-header .fw-search__open { min-width: 0; border-color: transparent; background: none; }
  .fw-header .fw-search__label, .fw-header .fw-search__kbd { display: none; }
  .fw-header .fw-shell__carttotal, .fw-header__lang .fw-lang summary span { display: none; }
  .fw-header .fw-company__button span { max-width: 8rem; }
}

/* Centred in the room between logo and tools, so the three never overlap. */
.fw-header__nav { display: flex; align-items: center; gap: 0.25rem; margin-inline: auto; min-width: 0; }
/* In the bar it is centred on the page instead, so a shop's cart or logo never moves it; header.js folds it if it would touch either. */
@media (min-width: 60.0625rem) {
  .fw-header:not(.is-folded) .fw-header__nav { position: absolute; left: 50%; transform: translateX(-50%); }
  .fw-header__tools { margin-left: auto; }
}
.fw-header__menu { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.fw-header__menu > li { position: relative; }
.fw-header__menu a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-muted, #6b6b6b);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.fw-header__menu .sub-menu a { text-transform: none; }
/* The shop's item, red as its tile in the ribbon. */
/* Its own padding wins over the phone panel's flush links (li in the selector), and it stays the width of its word there. */
.fw-header .fw-header__menu > li.fw-header__shop { align-self: flex-start; }
.fw-header .fw-header__menu > li.fw-header__shop > a { margin-right: 0.5rem; padding-inline: 0.85rem; background: var(--color-brand, #e1001a); color: #fff; }
.fw-header .fw-header__menu > li.fw-header__shop > a:hover { background: #b80015; color: #fff; }
/* A dropdown item that leads into the shop carries a small red mark, as the shop's own button. */
/* Capitals only: line-height 1 and this padding, measured, keep the letters centred in the red. */
.fw-header__badge { display: inline-block; margin-left: 0.4rem; padding: 0.2rem 0.35rem 0.18rem; background: var(--color-brand, #e1001a); color: #fff; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1; text-transform: uppercase; vertical-align: 0.1em; }
/* Inside the shop the item turns black: you are there. */
.fw-header .fw-header__menu > li.fw-header__shop.current-menu-item > a { background: var(--color-ink, #111); color: #fff; box-shadow: none; }
/* The current section is underlined in the bar; the phone panel shows it by colour alone. */
@media (min-width: 60.0625rem) {
  .fw-header:not(.is-folded) .fw-header__menu > :is(.current-menu-item, .current-menu-ancestor) > a { box-shadow: inset 0 -3px 0 var(--color-brand, #e1001a); }
}
.fw-header__menu a:hover,
.fw-header__menu .current-menu-item > a,
.fw-header__menu .current-menu-ancestor > a { color: var(--color-ink, #111); }
.fw-header__menu svg { flex: 0 0 auto; }

/* The main menu's second level opens under its item. */
.fw-header__menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  display: none;
  min-width: 15rem;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  border: 1px solid var(--color-line, #e4e4e4);
  background: #fff;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.08);
}
.fw-header__menu li:hover > .sub-menu,
.fw-header__menu li:focus-within > .sub-menu { display: block; }
.fw-header__menu .sub-menu a { display: block; padding: 0.45rem 1rem; font-weight: 400; white-space: nowrap; }

.fw-header__tools { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 0.75rem; }
/* Search keeps one place and size on every page; a signed-in company's extra controls take room from the menu's icons. */
@media (min-width: 60.0625rem) {
  .fw-header--ekspress:has(.fw-acting) .fw-header__menu svg { display: none; }
  .fw-header .fw-company__button span { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.fw-header__menubtn { display: none; padding: 0; border: 0; background: none; color: var(--color-ink, #111); cursor: pointer; }
.fw-header__panel-lang { display: none; }

.fw-lang { position: relative; }
.fw-lang summary { display: flex; align-items: center; gap: 0.35rem; padding: 0.35rem; list-style: none; color: var(--color-muted, #6b6b6b); font-size: 0.9rem; cursor: pointer; }
.fw-lang summary::-webkit-details-marker { display: none; }
.fw-lang summary:hover, .fw-lang[open] summary { color: var(--color-ink, #111); }
.fw-lang__list { position: absolute; top: calc(100% + 0.35rem); right: 0; z-index: 60; min-width: 8rem; margin: 0; padding: 0.35rem 0; list-style: none; border: 1px solid var(--color-line, #e4e4e4); background: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / 0.08); }
.fw-lang__list a { display: block; padding: 0.35rem 1rem; color: var(--color-ink, #111); font-size: 0.9rem; text-decoration: none; }
.fw-lang__list a:hover { background: var(--color-surface, #fafafa); }

/* Folded: the menu and language move behind the button. Always on a phone; on a wider screen when
   header.js finds that menu and tools do not fit side by side (a long company name, a longer language). */
@media (max-width: 60rem) {
  .fw-header { gap: 0.5rem; min-height: 3.75rem; }
  .fw-header__logo img { width: 110px; }
  .fw-header__tools { gap: 0.25rem; }
  .fw-header__menubtn { display: grid; place-items: center; width: 44px; height: 44px; }
  .fw-header__lang { display: none; }
  .fw-header__nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 4rem);
    margin: 0;
    overflow-y: auto;
    padding: 0.5rem max(1.25rem, calc((100% - var(--container-site, 80rem)) / 2)) 1rem;
    border-bottom: 1px solid var(--color-line, #e4e4e4);
    background: #fff;
    box-shadow: 0 12px 24px rgb(0 0 0 / 0.08);
  }
  .fw-header.is-open .fw-header__nav { display: flex; }
  .fw-header__menu { flex-direction: column; align-items: stretch; }
  .fw-header__menu a { padding: 0.75rem 0; font-size: 1rem; white-space: normal; }
  .fw-header__menu svg { display: inline; }
  .fw-header__menu .sub-menu { position: static; display: block; padding: 0 0 0.25rem 1rem; border: 0; box-shadow: none; }
  .fw-header__menu .sub-menu a { padding: 0.5rem 0; }
  .fw-header__panel-lang { display: block; padding-top: 0.5rem; border-top: 1px solid var(--color-line, #e4e4e4); }
  .fw-header__panel-lang .fw-lang__list { right: auto; left: 0; }
  .fw-header__tools { margin-left: auto; }
}
  .fw-header.is-folded .fw-header__menubtn { display: grid; place-items: center; width: 44px; height: 44px; }
  .fw-header.is-folded .fw-header__lang { display: none; }
  .fw-header.is-folded .fw-header__nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 4rem);
    margin: 0;
    overflow-y: auto;
    padding: 0.5rem max(1.25rem, calc((100% - var(--container-site, 80rem)) / 2)) 1rem;
    border-bottom: 1px solid var(--color-line, #e4e4e4);
    background: #fff;
    box-shadow: 0 12px 24px rgb(0 0 0 / 0.08);
  }
  .fw-header.is-folded.is-open .fw-header__nav { display: flex; }
  .fw-header.is-folded .fw-header__menu { flex-direction: column; align-items: stretch; }
  .fw-header.is-folded .fw-header__menu a { padding: 0.75rem 0; font-size: 1rem; white-space: normal; }
  .fw-header.is-folded .fw-header__menu .sub-menu { position: static; display: block; padding: 0 0 0.25rem 1rem; border: 0; box-shadow: none; }
  .fw-header.is-folded .fw-header__menu .sub-menu a { padding: 0.5rem 0; }
  .fw-header.is-folded .fw-header__panel-lang { display: block; padding-top: 0.5rem; border-top: 1px solid var(--color-line, #e4e4e4); }
  .fw-header.is-folded .fw-header__panel-lang .fw-lang__list { right: auto; left: 0; }
  .fw-header.is-folded .fw-header__tools { margin-left: auto; }

.fw-header__panel-links { display: none; margin: 0; padding: 0.5rem 0; list-style: none; border-top: 1px solid var(--color-line, #e4e4e4); }
.fw-header__panel-links a { display: block; padding: 0.6rem 0; color: var(--color-ink, #111); font-size: 1rem; text-decoration: none; }
/* A phone has no room for the company, account and sign-out in the bar: they wait in the menu. */
@media (max-width: 40rem) {
  .fw-header__panel-links { display: block; }
  .fw-header .fw-shell__context:has(.fw-acting) { display: none; }
}
/* The shop's own row under the shared header and its notice bar: menu left, company and account right. */
.fw-shopbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.25rem;
  padding: 0.35rem max(1.25rem, calc((100% - var(--container-site, 80rem)) / 2));
  border-bottom: 1px solid var(--color-line, #e4e4e4);
  background: #fff;
  font-family: var(--font-sans, Montserrat, sans-serif);
}
.fw-shopbar__nav { min-width: 0; }
.fw-shopbar__menu { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.fw-shopbar__menu a { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.65rem; color: var(--color-muted, #6b6b6b); font-size: 0.85rem; font-weight: 500; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.fw-shopbar__menu a:hover, .fw-shopbar__menu .is-current > a { color: var(--color-ink, #111); }
/* The first icon on the content's edge, in line with the page title under it. */
.fw-shopbar__menu > li:first-child > a { margin-left: -0.65rem; }
.fw-shopbar__menu svg { flex: 0 0 auto; }
.fw-shopbar__tools { display: flex; flex: 0 0 auto; align-items: center; gap: 0.75rem; margin-left: auto; }
.fw-shopbar .fw-company__button span { display: inline-block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* A phone keeps one line: the shop menu by its icons, the company by a building, the header's cart without its total. */
@media (max-width: 40rem) {
  .fw-shopbar { gap: 0.5rem; }
  .fw-shopbar__menu a { padding: 0.6rem 0.5rem; }
  .fw-shopbar__menu span { display: none; }
  .fw-shopbar__tools { gap: 0.4rem; }
  /* The company button keeps its arrow and shows a building for the name. */
  .fw-shopbar .fw-company__button span { display: none; }
  .fw-shopbar .fw-company__button::before { content: ""; width: 20px; height: 20px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16M16 9h2a2 2 0 0 1 2 2v10M3 21h18M8 7h4M8 11h4M8 15h4'/%3E%3C/svg%3E") center / contain no-repeat; }
  .fw-header .fw-shell__carttotal { display: none; }
}

@media print { .fw-header__nav, .fw-header__tools, .fw-shopbar { display: none; } }
