/* Factory-process header aligned with the shared storefront header. */
.header {
  --page: min(calc(100% - 120px), 1600px);
  position: sticky;
  top: 0;
  z-index: 20;
  color: #0a0d12;
  background: rgba(248, 247, 244, .96);
  border-bottom: 2px solid #0a0d12;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

.header * { box-sizing: border-box; }
.header a { color: inherit; text-decoration: none; }
.header button { color: inherit; font: inherit; cursor: pointer; }

.header-inner {
  display: grid;
  width: var(--page);
  min-height: 88px;
  margin-inline: auto;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
}

.header .brand {
  width: max-content;
  flex-shrink: 0;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.header .brand:hover { transform: scale(1.05); }
.header .nav,
.header .header-tools { display: flex; align-items: center; }
.header .nav { justify-content: center; gap: clamp(16px, 2.25vw, 30px); }
.header .nav a,
.header .header-tools button,
.header .header-tools a,
.header .mobile-nav a {
  position: relative;
  padding: 12px 0;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.35;
  white-space: nowrap;
  transition: color .2s ease;
}

.header .nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #ff4d00;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s ease;
}
.header .nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.header .nav a:hover,
.header .header-tools button:hover,
.header .header-tools a:hover { color: #ff4d00; }

.header .header-tools { justify-content: flex-end; gap: clamp(16px, 2.25vw, 30px); }
.header .header-tools .header-search {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
}
.header .header-tools .header-search:hover { background: rgba(255, 77, 0, .07); }
.header .header-search svg { width: 19px; height: 19px; }
.header .header-tools #langToggle {
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}
.header .header-tools .bag-trigger {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 3px 11px 3px 13px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  font-size: 13px;
  letter-spacing: .02em;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.header .header-tools .bag-trigger:hover { border-color: #ff4d00; background: #fff; }
.header .header-tools .bag-count {
  display: inline-flex;
  min-width: 0;
  height: auto;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  border-left: 1px solid #e5e7eb;
  color: #ff4d00;
  font-size: 13px;
  line-height: 1.2;
}
.header .header-tools .menu-trigger { display: none; }
.header .mobile-nav { display: none; }

@media (max-width: 900px) {
  .header { --page: calc(100% - 52px); }
  .header-inner { gap: 18px; }
  .header .nav { gap: clamp(10px, 1.5vw, 16px); }
  .header .header-tools { gap: 10px; }
  .header .nav a,
  .header .header-tools button,
  .header .header-tools a { font-size: 12px; }
  .header .header-tools .bag-trigger,
  .header .header-tools .bag-count { font-size: 12px; }
}

@media (max-width: 760px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .header-inner > .nav { display: none; }
  .header .header-tools { grid-column: 2; gap: 9px; }
  .header .header-tools .menu-trigger {
    display: inline-flex;
    min-width: 34px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    border: 0;
    background: transparent;
  }
  .header .mobile-nav {
    display: none;
    padding: 4px 18px 15px;
    border-top: 2px solid #0a0d12;
    background: #f8f7f4;
  }
  .header .mobile-nav.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .header .mobile-nav a { padding: 13px 0; border-bottom: 1px solid #e5e7eb; }
  .header .mobile-nav .mobile-selection-link {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .header .mobile-selection-count { margin-left: auto; color: #ff4d00; font-size: 12px; font-weight: 700; }
}

@media (max-width: 640px) {
  .header { --page: calc(100% - 36px); }
  .header-inner { min-height: 65px; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .header .header-tools { gap: 7px; }
  .header .header-tools button,
  .header .header-tools a { font-size: 12px; }
  .header .header-tools .header-search { flex-basis: 34px; width: 34px; height: 34px; }
  .header .header-tools > .bag-trigger { display: none; }
}

@media (max-width: 390px) {
  .header .header-tools { gap: 5px; }
  .header .header-tools .header-search { flex-basis: 32px; width: 32px; height: 32px; }
}
