.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background-color: var(--color-bg-base);
  border-bottom: 1px solid var(--color-border-base);
  transition: background-color 200ms ease, border-color 200ms ease;
}

/* Glassmorphism -- lets the fixed globe background show through instead of
   being hidden behind an opaque bar. Same base color, just translucent +
   blurred rather than solid. Light mode needs a higher alpha than dark:
   dark text over saturated green dots loses contrast faster. */
/* header.html wraps <header class="site-header"> in a <div class="site-header">
   -- targeting the tag specifically so this rule applies once, not twice
   (two stacked alpha layers compound into something much more opaque than
   intended; invisible with solid colors, very visible with alpha). */
header.site-header {
  background-color: rgba(247, 247, 243, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

html.dark header.site-header {
  background-color: rgba(10, 10, 15, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* The wrapper div still picks up the base rule's opaque background-color --
   left solid it would sit behind the now-glass <header> and block the view
   either way, so it needs to go fully transparent. */
div.site-header {
  background-color: transparent;
}

.site-nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--color-fg-subtle);
}

.site-nav__brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  flex-shrink: 0;
}

.site-nav__logo {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

@media (max-width: 639px) {
  .site-nav {
    gap: 8px;
  }
  .site-nav__brand-group {
    gap: 4px;
  }
  .site-nav__actions {
    gap: 12px;
  }
  .site-nav__logo {
    font-size: 15px;
    max-width: 40vw;
  }
  /* Secondary action -- moved into the side menu on small screens so the
     bar only has to fit what's essential: menu, logo, search, cart. */
  .site-nav__actions > .theme-toggle {
    display: none;
  }
}
.site-nav__logo:hover {
  color: var(--color-fg-base);
}

.site-nav__search-slot {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  flex-shrink: 0;
}

.site-nav__account-link {
  display: none;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.site-nav__account-link:hover {
  color: var(--color-fg-base);
}

.site-nav__account-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.site-nav__account-line {
  font-size: var(--text-xsmall-regular-size);
}
.site-nav__account-line--bold {
  font-weight: 600;
  color: var(--color-fg-base);
}

@media (min-width: 1024px) {
  .site-nav__account-link {
    display: flex;
  }
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-large);
}
.icon-button:hover {
  background-color: var(--color-bg-subtle);
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.theme-toggle__icon--moon {
  display: none;
}
html.dark .theme-toggle__icon--sun {
  display: none;
}
html.dark .theme-toggle__icon--moon {
  display: block;
}

.category-nav {
  background-color: #2e7d32;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Fade the trailing edge so a scrollable row that's cut off mid-item
     reads as "more this way" instead of looking like the list just ends. */
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
}

/* Same glass treatment as .site-header, same green, just translucent. */
.category-nav {
  background-color: rgba(46, 125, 50, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html.dark .category-nav {
  background-color: rgba(46, 125, 50, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.category-nav__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding-block: 12px;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .category-nav__inner {
    justify-content: center;
    gap: 24px;
  }
}

.category-nav__link {
  color: #ffffff;
  font-weight: 600;
  font-size: var(--text-small-semi-size);
  flex-shrink: 0;
}
.category-nav__link:hover {
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--color-border-base);
  width: 100%;
  background-color: var(--color-bg-base);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding-block: 56px 40px;
}

.site-footer__brand-link {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-fg-base);
}
.site-footer__brand-link:hover {
  color: var(--color-in-cart);
}

.site-footer__tagline {
  margin: 10px 0 0;
  max-width: 36ch;
  color: var(--color-fg-subtle);
}

.site-footer__heading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-fg-base);
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  color: var(--color-fg-subtle);
}
.site-footer__list a:hover {
  color: var(--color-fg-base);
}

.site-footer__address {
  white-space: pre-line;
}

.site-footer__base {
  border-top: 1px solid var(--color-border-base);
  padding-block: 16px;
  color: var(--color-fg-subtle);
}
.site-footer__base p {
  margin: 0;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.button--primary {
  background-color: #000000;
  color: #ffffff;
}
.button--primary:hover {
  background-color: #1f2937;
}

.button--cta {
  background-color: #c2410c;
  color: #ffffff;
  font-weight: 600;
}
.button--cta:hover:not(:disabled) {
  background-color: #9a3412;
}

.button--secondary {
  background-color: var(--color-bg-base);
  color: var(--color-fg-base);
  border: 1px solid var(--color-border-base);
}
.button--secondary:hover {
  background-color: var(--color-bg-subtle);
}

.button--large {
  height: 48px;
  padding-inline: 24px;
  font-size: 18px;
}

.inquiry-cart-widget {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.cart-button {
  display: flex;
  align-items: stretch;
  height: 36px;
  border-radius: var(--radius-large);
  overflow: hidden;
}

.cart-button__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 10px;
  background-color: #2e7d32;
  color: #ffffff;
}

@media (max-width: 639px) {
  .cart-button__icon {
    padding-inline: 8px;
  }
  .cart-button__icon .icon {
    width: 18px;
    height: 18px;
  }
}

.cart-button__count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding-inline: 6px;
  background-color: #ffffff;
  color: #18181b;
  font-weight: 600;
  font-size: var(--text-small-semi-size);
}

.inquiry-cart-widget__trigger {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inquiry-cart-widget__trigger:hover {
  color: var(--color-fg-base);
}

.inquiry-cart-widget__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background-color: var(--color-fg-base);
  color: var(--color-bg-base);
  font-size: 10px;
  line-height: 1;
  border-radius: var(--radius-full);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .inquiry-cart-widget__badge {
    display: none;
  }
}

.inquiry-cart-widget__label {
  display: none;
}

@media (min-width: 1024px) {
  .inquiry-cart-widget__label {
    display: inline;
  }
}

.inquiry-cart-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  width: 420px;
  max-width: 90vw;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border-base);
  border-top: none;
  color: var(--color-fg-base);
  z-index: 50;
}

@media (min-width: 1024px) {
  .inquiry-cart-dropdown.is-open {
    display: block;
  }
}

.inquiry-cart-dropdown__heading {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inquiry-cart-dropdown__items {
  max-height: 402px;
  overflow-y: auto;
  padding-inline: 16px;
}

.inquiry-cart-dropdown__row {
  grid-template-columns: 96px 1fr;
}

.inquiry-cart-dropdown__footer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inquiry-cart-dropdown__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inquiry-cart-dropdown__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-block: 64px;
}

/* Side menu */

.side-menu {
  height: 100%;
}

.site-nav__menu-trigger {
  height: 100%;
}
.site-nav__menu-trigger:hover {
  color: var(--color-fg-base);
}

.side-menu__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
}

.side-menu.is-open .side-menu__backdrop {
  display: block;
}

.side-menu__panel {
  display: none;
  position: fixed;
  inset: 8px;
  z-index: 61;
  width: calc(100% - 16px);
}

@media (min-width: 640px) {
  .side-menu__panel {
    width: 33%;
    min-width: 320px;
  }
}

.side-menu.is-open .side-menu__panel {
  display: flex;
}

.side-menu__panel-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* The panel is already inset: 8px on a fixed box -- 100vh here overshot
     it on mobile Safari, where 100vh includes the area behind the toolbar. */
  height: 100%;
  overflow-y: auto;
  width: 100%;
  padding: 24px;
  border-radius: 8px;
  background-color: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(24px);
  color: #ffffff;
}

.side-menu__close-row {
  display: flex;
  justify-content: flex-end;
}

.side-menu__close {
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
}

.side-menu__links {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-menu__link {
  font-size: 32px;
  line-height: 40px;
  color: #ffffff;
}
.side-menu__link:hover {
  color: rgba(255, 255, 255, 0.6);
}

.side-menu__theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: #ffffff;
  font-size: var(--text-base-regular-size);
}
.side-menu__theme-toggle:hover {
  color: rgba(255, 255, 255, 0.6);
}

.side-menu__copyright {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-small-regular-size);
}

/* Search bar */

.search-bar--desktop {
  display: none;
  position: relative;
  width: 100%;
  max-width: 28rem;
}

@media (min-width: 1024px) {
  .search-bar--desktop {
    display: block;
  }
}

.search-bar--mobile {
  position: relative;
}

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

.search-bar__field {
  display: flex;
  align-items: stretch;
  border-radius: 6px;
  border: 1px solid var(--color-border-base);
  background-color: var(--color-bg-base);
  overflow: hidden;
  height: 40px;
  width: 100%;
}

.search-bar__field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding-inline: 12px;
  font-size: var(--text-small-regular-size);
  color: inherit;
}

.search-bar__clear {
  color: var(--color-fg-subtle);
  font-size: 18px;
  line-height: 1;
  padding-inline: 8px;
}

.search-bar__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  background-color: #2e7d32;
  color: #ffffff;
}
.search-bar__submit:hover {
  filter: brightness(1.05);
}

.search-bar__suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border-base);
  border-radius: 6px;
  overflow: hidden;
  z-index: 50;
}

.search-bar__suggestions.is-open {
  display: block;
}

.search-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
}
.search-suggestion:hover {
  background-color: var(--color-bg-subtle);
}

.search-suggestion__thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: var(--color-bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
}
.search-suggestion__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-suggestion__category span {
  color: var(--color-fg-base);
}

.search-bar__mobile-overlay {
  display: none;
  position: fixed;
  inset-inline: 0;
  top: var(--nav-height);
  z-index: 50;
  background-color: var(--color-bg-base);
  border-bottom: 1px solid var(--color-border-base);
  padding: 12px;
  flex-direction: column;
  gap: 8px;
}

.search-bar__mobile-overlay.is-open {
  display: flex;
}

.search-bar__mobile-overlay .search-bar__suggestions {
  display: block;
  position: static;
  border: none;
}
.search-bar__mobile-overlay .search-bar__suggestions:not(.is-open) {
  display: none;
}

/* ---------- Touch / small-screen sizing ----------
   Desktop (1024px+) is intentionally untouched; these only resize things
   for fingers and narrow viewports. */

@media (max-width: 1023px) {
  /* With the desktop search field hidden, the slot only holds the search
     icon -- centered it floated alone mid-bar, so it sits by the cart. */
  .site-nav__search-slot {
    justify-content: flex-end;
  }

  .icon-button {
    padding: 10px;
  }

  .cart-button {
    height: 40px;
  }

  /* line-height rather than flex, so text-overflow: ellipsis still works */
  .site-nav__logo {
    display: block;
    line-height: 40px;
  }

  .button {
    min-height: 44px;
    padding-inline: 16px;
  }

  .category-nav__inner {
    gap: 4px;
    padding-block: 0;
  }

  .category-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 13px;
  }

  .site-footer__list a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  .side-menu__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  .side-menu__theme-toggle {
    min-height: 44px;
  }

  .search-bar__field {
    height: 44px;
  }

  .search-bar__clear {
    min-width: 40px;
  }

  .search-bar__mobile-overlay {
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
  }

  .search-suggestion {
    min-height: 48px;
  }
}

@media (max-width: 639px) {
  .side-menu__panel-inner {
    padding: 16px 20px 20px;
  }

  .side-menu__links {
    gap: 16px;
  }

  .side-menu__link {
    font-size: 26px;
    line-height: 36px;
  }

  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
    padding-block: 40px 24px;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }

  .site-footer__list {
    gap: 0;
  }
}

/* ---------- Cart control (cart-button.js) ----------
   "Add to Cart" until the pack is in the cart, then a green-tinted
   "- N in cart +" stepper of the same size, so swapping never moves the
   layout. */

.cart-btn {
  display: flex;
  width: 100%;
  height: 40px;
  min-width: 0;
}

.cart-btn__add {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding-inline: 12px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-btn__add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cart-btn.is-in-cart {
  align-items: stretch;
  overflow: hidden;
  border: 1.5px solid var(--color-in-cart);
  border-radius: 8px;
  background-color: var(--color-in-cart-soft);
  color: var(--color-in-cart);
}

.cart-btn.is-just-added {
  animation: cart-btn-pop 320ms ease-out;
}

@keyframes cart-btn-pop {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.cart-btn__step {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: inherit;
  transition: background-color 150ms ease;
}

.cart-btn__step:hover:not(:disabled) {
  background-color: var(--color-in-cart-hover);
}

.cart-btn__count {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: text;
}

.cart-btn__count input {
  width: 3.2ch;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  -moz-appearance: textfield;
}

/* Size the box to its digits so "2 in cart" sits centred, not "  2 in cart". */
@supports (field-sizing: content) {
  .cart-btn__count input {
    field-sizing: content;
    width: auto;
    min-width: 1ch;
    text-align: center;
  }
}

.cart-btn__count input:focus {
  outline: 1.5px solid currentColor;
  text-align: center;
}

.cart-btn__count input::-webkit-outer-spin-button,
.cart-btn__count input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.cart-btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.cart-btn--large {
  height: 44px;
}

.cart-btn--large .cart-btn__step {
  width: 48px;
}

.cart-btn--compact {
  height: 36px;
}

.cart-btn--compact .cart-btn__add {
  padding-inline: 8px;
  font-size: 13px;
}

.cart-btn--compact .cart-btn__step {
  width: 32px;
}

.cart-btn--compact .cart-btn__count {
  font-size: 12px;
}

/* .button gets min-height: 44px on touch screens; match it. */
@media (max-width: 1023px) {
  .cart-btn,
  .cart-btn--compact {
    height: 44px;
  }

  .cart-btn__step {
    width: 44px;
  }
}

@media (max-width: 399px) {
  .cart-btn--compact .cart-btn__step {
    width: 34px;
  }

  .cart-btn--compact .cart-btn__count span {
    display: none;
  }
}

/* Navbar mascot (mascot.js), between the menu button and the logo. Fixed size here
   so the bar doesn't shift while the script loads. */
.site-nav__mascot {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 639px) {
  .site-nav__mascot {
    width: 40px;
    height: 40px;
  }
}
