.mobile-menu-toggle { display: none; }

@media (max-width: 1023px) {
  .header-main {
    position: relative !important;
    display: flex !important;
    min-height: 82px;
    justify-content: center !important;
  }

  .header-main > .brand {
    position: absolute !important;
    z-index: 4;
    left: 50% !important;
    top: 50%;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap;
  }

  .header-main > .primary-nav,
  .site-header > .category-bar {
    display: none !important;
  }

  /* React renders the TOC trigger inside .header-actions. Preserve that
     component and hide only the non-menu controls on compact headers. */
  .header-main > .header-actions {
    position: absolute !important;
    z-index: 6;
    left: max(14px, env(safe-area-inset-left));
    top: 50%;
    display: flex !important;
    min-width: 44px !important;
    margin: 0 !important;
    transform: translateY(-50%);
  }

  .header-main > .header-actions > :not(.menu-toggle) {
    display: none !important;
  }

  .header-main > .header-actions > .menu-toggle {
    display: inline-grid !important;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(26, 39, 68, 0.18);
    border-radius: 50%;
    background: #fffdf9;
    color: #1a2744;
    box-shadow: 0 5px 15px rgba(26, 39, 68, 0.08);
  }

  .mobile-menu-toggle {
    position: absolute;
    z-index: 6;
    left: max(14px, env(safe-area-inset-left));
    top: 50%;
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(26, 39, 68, 0.18);
    border-radius: 50%;
    background: #fffdf9;
    color: #1a2744;
    box-shadow: 0 5px 15px rgba(26, 39, 68, 0.08);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms ease;
  }

  .mobile-menu-toggle:active { transform: translateY(-50%) scale(0.94); }
  .mobile-menu-toggle:focus-visible { outline: 3px solid rgba(186, 96, 19, 0.42); outline-offset: 3px; }
  .mobile-menu-toggle__bars,
  .mobile-menu-toggle__bars::before,
  .mobile-menu-toggle__bars::after {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    content: "";
    transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), opacity 120ms ease;
  }
  .mobile-menu-toggle__bars { position: relative; }
  .mobile-menu-toggle__bars::before { position: absolute; top: -6px; left: 0; }
  .mobile-menu-toggle__bars::after { position: absolute; top: 6px; left: 0; }
  .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__bars { background: transparent; }
  .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

  .mobile-menu-panel {
    position: fixed;
    z-index: 10001;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    display: grid;
    gap: 2px;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 0 20px;
    overflow: hidden;
    border: 1px solid rgba(26, 39, 68, 0.12);
    border-radius: 16px;
    background: #fffdf9;
    box-shadow: 0 22px 46px rgba(12, 22, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-14px) scale(0.98);
    visibility: hidden;
    transition: padding 260ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease, transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 260ms;
  }
  .mobile-menu-panel.is-open { padding-top: 14px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); visibility: visible; transition-delay: 0s; }
  .mobile-menu-section-label { margin: 10px 10px 0; color: #8a5a23; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .mobile-menu-panel a { display: flex; min-height: 48px; align-items: center; padding: 0 10px; border-bottom: 1px solid rgba(26, 39, 68, 0.08); color: #1a2744; font-size: 15px; font-weight: 700; text-decoration: none; }
  .mobile-menu-panel a:last-child { margin-top: 10px; justify-content: center; border: 0; border-radius: 10px; background: #ba6013; color: #fff; }
  body.mobile-menu-open,
  html.mobile-menu-open { overflow: hidden; }
  .mobile-menu-scrim { position: fixed; z-index: 10000; inset: 0; background: rgba(7, 14, 29, 0.4); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .mobile-menu-scrim.is-open { opacity: 1; pointer-events: auto; }

  html, body, #root { min-height: 100%; overscroll-behavior-y: none; }
  html { min-height: 100dvh; background: #111c32 !important; }
  body { min-height: 100dvh; background: #111c32 !important; overscroll-behavior-y: none; }
  #root { background: #faf7f2; }
  .site-footer { margin-bottom: 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); background-color: #111c32; }
}

@supports (-webkit-touch-callout: none) {
  @media (max-width: 1023px) {
    html, body { min-height: -webkit-fill-available; }
  }
}

@media (max-width: 480px) {
  .header-main { min-height: 76px; }
  .header-main > .brand .brand-logo { width: 52px; height: 52px; }
  .header-main > .brand .brand-copy strong { font-size: clamp(17px, 4.45vw, 20px); }
  .header-main > .brand .brand-copy > span { font-size: 9px; letter-spacing: 0.12em; }
}

html.viewport-zoom-ready .viewport-zoom {
  opacity: 0 !important;
  transform: scale(0.975) !important;
  transform-origin: center center;
  transition: opacity 380ms cubic-bezier(0.23, 1, 0.32, 1), transform 500ms cubic-bezier(0.23, 1, 0.32, 1) !important;
  will-change: transform, opacity;
}
html.viewport-zoom-ready .viewport-zoom.viewport-zoom--visible {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.category-intro-grid > .fade-up[data-seo-fallback-cleared="true"] {
  min-height: 0;
}

.product-gallery-thumbnail-strip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.product-gallery-thumbs {
  display: flex !important;
  gap: 10px !important;
  margin-top: 0 !important;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 69, 19, .45) transparent;
}
.product-gallery-thumbs button {
  flex: 0 0 82px;
  height: 82px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: pointer;
}
.product-gallery-scroll {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(26, 39, 68, .2);
  border-radius: 50%;
  background: #fffdf9;
  color: #1a2744;
  font: 400 30px/1 Georgia, serif;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.product-gallery-scroll:hover { background: #1a2744; color: #fff; }
.product-gallery-scroll:active { transform: scale(.94); }
.product-gallery-scroll:focus-visible { outline: 3px solid rgba(186, 96, 19, .42); outline-offset: 3px; }

@media (max-width: 720px) {
  .product-gallery-thumbnail-strip { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 7px; margin-top: 10px; }
  .product-gallery-thumbs { gap: 8px !important; }
  .product-gallery-thumbs button { flex-basis: 68px; height: 68px; }
  .product-gallery-scroll { width: 34px; height: 34px; font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  html.viewport-zoom-ready .viewport-zoom,
  html.viewport-zoom-ready .viewport-zoom.viewport-zoom--visible,
  .mobile-menu-panel,
  .mobile-menu-scrim,
  .mobile-menu-toggle,
  .mobile-menu-toggle__bars,
  .mobile-menu-toggle__bars::before,
  .mobile-menu-toggle__bars::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .product-gallery-scroll { transition: none !important; }
  html.viewport-zoom-ready .viewport-zoom { opacity: 1 !important; }
}
