/* Shared site header (brand + hamburger nav), used across every
 * customer-facing page. Pulled out of order.css so pages that don't need
 * the rest of order.css's (large) ordering-UI styles can still get the
 * masthead. order.css keeps working unchanged via its own @import of
 * this file, plus order.html-specific rules (scroll-collapse, cart,
 * account button) that only it needs. */

.masthead {
  flex: none;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}
.brand .mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand h1 {
  font-family: var(--font-display, inherit);
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1;
}
.brand .stamp {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
  transform: rotate(-3deg);
}
.brand .logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #0c0c0c;
  flex: none;
}
.brand .logo-badge img {
  width: 20px;
  height: 20px;
  display: block;
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Default state: sits inline in the masthead bar, plain icon matching the
 * header's own colors — looks like part of the header, not an overlay.
 * Once .floating is added (see initMastheadScroll in theme.js, toggled on
 * scroll), it detaches into a fixed circular button over the page content,
 * so it stays reachable after the header has scrolled out of view. */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.menu-btn:not(.floating):hover span {
  background: var(--accent);
}
.menu-btn:not(.floating):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.15s ease;
}
.menu-btn.floating {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  width: 44px;
  height: 44px;
  background: rgba(32, 28, 24, 0.35);
}
.menu-btn.floating:hover {
  background: rgba(32, 28, 24, 0.5);
}
.menu-btn.floating:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.menu-btn.floating span {
  background: #fff;
}
.menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 28, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 290;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  background: var(--card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 295;
  display: flex;
  flex-direction: column;
  padding: 5rem 0 2rem;
}
.menu-panel.open {
  transform: translateX(0);
}
.menu-panel a {
  padding: 1rem 1.75rem;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.menu-panel a:hover {
  background: var(--paper-alt);
}
