/* Shared header, footer and mobile bar: used by the shop (React) and the website subpages. */

/* === Header === */
/* Header from the design draft: green band, seal and word mark left, menu and status right. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ww-color-green);
  color: var(--ww-color-plaster);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--ww-space-4);
  min-height: 74px;
  max-width: var(--ww-content-width);
  margin: 0 auto;
  padding: 0 var(--ww-space-3);
}

.site-header__mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  line-height: 1;
  text-decoration: none;
}

.site-header__seal {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ww-color-brass-soft);
}

.site-header__wordmark {
  display: flex;
  flex-direction: column;
}

.site-header__name {
  font-family: var(--ww-font-serif);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-header__trade {
  margin-top: 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ww-color-plaster) 78%, var(--ww-color-green));
}

.site-header__nav {
  display: flex;
  gap: 1.3rem;
  margin-left: auto;
  font-size: 0.92rem;
}

.site-header__nav a {
  color: color-mix(in srgb, var(--ww-color-plaster) 78%, var(--ww-color-green));
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current='page'] {
  color: var(--ww-color-plaster);
}

/* Underline as a border, not a box-shadow: the global :focus-visible halo is a box-shadow. */
.site-header__nav a[aria-current='page'] {
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--ww-color-brass);
}

.site-header__menu {
  /* mobile first: shown by default, hidden above 900 px */
  margin-left: auto;
  padding: 0.6rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--ww-color-plaster) 78%, var(--ww-color-green));
  border-radius: var(--ww-radius);
  background: transparent;
  color: var(--ww-color-plaster);
  font: 600 0.85rem/1 var(--ww-font-sans);
  cursor: pointer;
}

.site-header__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ww-color-plaster) 78%, var(--ww-color-green));
}

.site-header__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ww-color-plaster) 50%, var(--ww-color-green));
}

.site-header__dot--open {
  background: var(--ww-color-brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ww-color-brass) 25%, transparent);
}

/* Cart symbol in the green header: plaster outline, brass count badge from the first article on. */
.site-header__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: var(--ww-radius);
  color: var(--ww-color-plaster);
  text-decoration: none;
}

.site-header__cart:hover,
.site-header__cart[aria-current='page'] {
  background: var(--ww-color-line-on-green);
}

.site-header__cart-count {
  position: absolute;
  top: 0.1rem;
  right: 0.05rem;
  min-width: 1.15rem;
  padding: 0.1rem 0.25rem;
  border-radius: 999px;
  background: var(--ww-color-brass);
  color: var(--ww-color-anthracite);
  font: 700 0.7rem/1 var(--ww-font-sans);
  text-align: center;
}

.site-header__cart-count[hidden] {
  display: none;
}

.site-header__band {
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ww-color-brass-soft) 15%,
    var(--ww-color-brass-soft) 85%,
    transparent
  );
}

@media (max-width: 900px) {
  .site-header__inner {
    flex-wrap: wrap;
  }

  .site-header__nav {
    order: 10;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-left: 0;
    padding-bottom: var(--ww-space-3);
  }

  /* Collapse only when JavaScript can reopen it; without .js the list stays expanded. */
  html.js .site-header__nav {
    display: none;
  }

  html.js .site-header__nav--open {
    display: flex;
  }

  .site-header__nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ww-color-plaster) 8%, transparent);
  }

  .site-header__nav a[aria-current='page'] {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid color-mix(in srgb, var(--ww-color-plaster) 8%, transparent);
    color: var(--ww-color-brass);
  }
}

@media (min-width: 900.02px) {
  .site-header__menu {
    display: none;
  }

  /* The word mark keeps its size; the menu and the status give way. */
  .site-header__mark {
    flex-shrink: 0;
  }
}

/* Between the mobile breakpoint and 1100 px the full header (with the cart icon in the shop) is
   wider than the screen: smaller gaps and menu text keep every menu entry on one line. */
@media (min-width: 900.02px) and (max-width: 1100px) {
  .site-header__inner {
    gap: var(--ww-space-3);
  }

  .site-header__nav {
    gap: 1rem;
    font-size: 0.88rem;
  }

  /* Only just above 900 px the status needs a second line. */
  .site-header__status {
    white-space: normal;
  }
}

@media (min-width: 900.02px) and (max-width: 1060px) {
  .site-header__name {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
  }

  .site-header__nav {
    gap: 0.8rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .site-header__name {
    font-size: 1.1rem;
  }

  .site-header__status {
    white-space: normal;
  }
}

/* === Footer === */
/* Footer from the design draft: green band, muted plaster text. */
.site-footer {
  background: var(--ww-color-green);
  color: color-mix(in srgb, var(--ww-color-plaster) 78%, var(--ww-color-green));
  font-size: 0.82rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ww-space-4);
  max-width: var(--ww-content-width);
  margin: 0 auto;
  padding: var(--ww-space-5) var(--ww-space-3);
}

.site-footer__copy {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
}

.site-footer__seal {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ww-color-brass-soft);
}

.site-footer__links {
  display: flex;
  gap: var(--ww-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  color: var(--ww-color-plaster);
}

/* Room for the fixed mobile bar. */
@media (max-width: 599.98px) {
  .site-footer__inner {
    padding-bottom: calc(var(--ww-space-6) + var(--ww-space-4) + env(safe-area-inset-bottom, 0px));
  }
}

/* === Mobile bar === */
/* Mobile bar from the design draft: fixed at the bottom, green with a brass top line.
   Mobile first: shown by default, hidden from 600 px on. */
.mobile-bar {
  display: flex;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding: var(--ww-space-2) max(var(--ww-space-3), env(safe-area-inset-right, 0px))
    calc(var(--ww-space-2) + env(safe-area-inset-bottom, 0px)) max(var(--ww-space-3), env(safe-area-inset-left, 0px));
  border-top: 3px solid var(--ww-color-brass-soft);
  background: var(--ww-color-green);
}

.mobile-bar a {
  flex: 1;
  padding: var(--ww-space-2);
  color: var(--ww-color-plaster);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

@media (min-width: 600px) {
  .mobile-bar {
    display: none;
  }
}
