{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-commerce-rows",
  "type": "registry:component",
  "title": "Navbar Commerce Rows",
  "description": "A three-tier store header: a rotating message strip, a row with search, account and a cart that opens a mini cart with quantity steppers and a free shipping meter, and a category row with mega panels. Phones get a stacked layout, scrolling chips and an accordion drawer.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "ecommerce",
    "mega menu",
    "mini cart",
    "search",
    "store"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-commerce-rows",
  "files": [
    {
      "path": "registry/hyperblur/navbar-commerce-rows.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-commerce-rows.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarCommerceRowsGroup {\n  title: string;\n  links: { label: string; href: string }[];\n}\n\nexport interface NavbarCommerceRowsCategory {\n  label: string;\n  href: string;\n  groups?: NavbarCommerceRowsGroup[];\n  promo?: { eyebrow: string; title: string; href: string; tone?: string };\n  sale?: boolean;\n}\n\nexport interface NavbarCommerceRowsCartItem {\n  id: string;\n  name: string;\n  variant: string;\n  price: number;\n  qty: number;\n  swatch?: string;\n}\n\nexport interface NavbarCommerceRowsProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  messages?: string[];\n  categories?: NavbarCommerceRowsCategory[];\n  cartItems?: NavbarCommerceRowsCartItem[];\n  currency?: string;\n  locale?: string;\n  freeShippingAt?: number;\n  defaultCategory?: string | null;\n  defaultCartOpen?: boolean;\n  onCartOpenChange?: (open: boolean) => void;\n  onCartChange?: (items: NavbarCommerceRowsCartItem[]) => void;\n  onCheckout?: (items: NavbarCommerceRowsCartItem[]) => void;\n  onSearch?: (query: string) => void;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst defaultCategories: NavbarCommerceRowsCategory[] = [\n  {\n    label: \"New in\",\n    href: \"#new\",\n    groups: [\n      { title: \"This week\", links: [{ label: \"Trail shells\", href: \"#\" }, { label: \"Merino base layers\", href: \"#\" }, { label: \"Camp kitchen\", href: \"#\" }, { label: \"Back in stock\", href: \"#\" }] },\n      { title: \"Collections\", links: [{ label: \"Alpine 26\", href: \"#\" }, { label: \"Coastline\", href: \"#\" }, { label: \"Night hike\", href: \"#\" }] },\n    ],\n    promo: { eyebrow: \"Just dropped\", title: \"The Ridgeline 2L shell\", href: \"#ridgeline\", tone: \"linear-gradient(140deg, #0f766e, #134e4a 55%, #0b1f1d)\" },\n  },\n  {\n    label: \"Women\",\n    href: \"#women\",\n    groups: [\n      { title: \"Clothing\", links: [{ label: \"Jackets\", href: \"#\" }, { label: \"Fleece\", href: \"#\" }, { label: \"Pants & tights\", href: \"#\" }, { label: \"Base layers\", href: \"#\" }] },\n      { title: \"Footwear\", links: [{ label: \"Hiking boots\", href: \"#\" }, { label: \"Trail runners\", href: \"#\" }, { label: \"Sandals\", href: \"#\" }] },\n      { title: \"Accessories\", links: [{ label: \"Beanies\", href: \"#\" }, { label: \"Gloves\", href: \"#\" }, { label: \"Socks\", href: \"#\" }] },\n    ],\n    promo: { eyebrow: \"Women's edit\", title: \"Layers for shoulder season\", href: \"#women-edit\", tone: \"linear-gradient(140deg, #9a3412, #7c2d12 55%, #1c0f0a)\" },\n  },\n  {\n    label: \"Men\",\n    href: \"#men\",\n    groups: [\n      { title: \"Clothing\", links: [{ label: \"Jackets\", href: \"#\" }, { label: \"Insulation\", href: \"#\" }, { label: \"Shirts\", href: \"#\" }, { label: \"Shorts\", href: \"#\" }] },\n      { title: \"Footwear\", links: [{ label: \"Hiking boots\", href: \"#\" }, { label: \"Approach shoes\", href: \"#\" }, { label: \"Camp slides\", href: \"#\" }] },\n    ],\n    promo: { eyebrow: \"Best seller\", title: \"Talus down hoodie\", href: \"#talus\", tone: \"linear-gradient(140deg, #1e3a8a, #172554 55%, #0b1020)\" },\n  },\n  {\n    label: \"Camp & hike\",\n    href: \"#camp\",\n    groups: [\n      { title: \"Shelter\", links: [{ label: \"Tents\", href: \"#\" }, { label: \"Tarps\", href: \"#\" }, { label: \"Hammocks\", href: \"#\" }] },\n      { title: \"Sleep\", links: [{ label: \"Sleeping bags\", href: \"#\" }, { label: \"Pads\", href: \"#\" }, { label: \"Pillows\", href: \"#\" }] },\n      { title: \"Packs\", links: [{ label: \"Daypacks\", href: \"#\" }, { label: \"Overnight\", href: \"#\" }, { label: \"Hip packs\", href: \"#\" }] },\n    ],\n  },\n  { label: \"Climb\", href: \"#climb\" },\n  { label: \"Journal\", href: \"#journal\" },\n  { label: \"Sale\", href: \"#sale\", sale: true },\n];\n\nconst defaultCart: NavbarCommerceRowsCartItem[] = [\n  { id: \"ridgeline\", name: \"Ridgeline 2L Shell\", variant: \"Moss, M\", price: 189, qty: 1, swatch: \"linear-gradient(140deg,#4d7c0f,#1a2e05)\" },\n  { id: \"merino\", name: \"Merino Crew 180\", variant: \"Charcoal, M\", price: 64, qty: 2, swatch: \"linear-gradient(140deg,#52525b,#18181b)\" },\n];\n\nconst ease = \"cubic-bezier(.22,1,.36,1)\";\n\nconst css = `\n.hb-xj6 {\n  --hb-xj6-accent: #e8ff5a;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xj6 *, .hb-xj6 *::before, .hb-xj6 *::after { box-sizing: border-box; }\n.hb-xj6[data-backdrop=\"true\"] { min-height: 640px; overflow: hidden; background: #0a0a0a; }\n.hb-xj6-head { position: relative; z-index: 5; background: #0d0d0d; border-bottom: 1px solid #1f1f1f; }\n.hb-xj6-util { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 24px; background: #151515; color: #a1a1a1; font-size: 12px; }\n.hb-xj6-msg { position: relative; height: 34px; overflow: hidden; flex: 1; }\n.hb-xj6-msg span { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; transform: translateY(100%); opacity: 0; transition: transform .6s ${ease}, opacity .4s ease; }\n.hb-xj6-msg span[data-state=\"on\"] { transform: none; opacity: 1; }\n.hb-xj6-msg span[data-state=\"off\"] { transform: translateY(-100%); }\n.hb-xj6-msg b { color: #ededed; font-weight: 500; }\n.hb-xj6-msg i { width: 5px; height: 5px; border-radius: 50%; background: var(--hb-xj6-accent); font-style: normal; }\n.hb-xj6-ulinks { display: flex; gap: 18px; }\n.hb-xj6-ulinks a { color: #a1a1a1; text-decoration: none; transition: color .2s ease; }\n.hb-xj6-ulinks a:hover { color: #ededed; }\n.hb-xj6-main { display: flex; align-items: center; gap: 24px; height: 68px; padding: 0 24px; }\n.hb-xj6-burger { display: none; }\n.hb-xj6-brand { display: inline-flex; align-items: baseline; gap: 2px; color: #ededed; font-family: var(--font-grotesk, inherit); font-size: 22px; font-weight: 700; letter-spacing: -.05em; text-decoration: none; flex: none; }\n.hb-xj6-brand span { color: var(--hb-xj6-accent); }\n.hb-xj6-search {\n  flex: 1;\n  display: flex;\n  align-items: center;\n  max-width: 560px;\n  height: 42px;\n  margin: 0 auto;\n  border: 1px solid #262626;\n  border-radius: 999px;\n  background: #141414;\n  transition: border-color .2s ease, box-shadow .3s ease;\n}\n.hb-xj6-search:focus-within { border-color: #3a3a3a; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }\n.hb-xj6-search svg { width: 17px; height: 17px; margin: 0 10px 0 16px; flex: none; fill: none; stroke: #8f8f8f; stroke-width: 2; stroke-linecap: round; }\n.hb-xj6-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: #ededed; font: inherit; font-size: 14px; }\n.hb-xj6-search input::placeholder { color: #707070; }\n.hb-xj6-search button { height: 34px; margin-right: 4px; padding: 0 16px; border: 0; border-radius: 999px; background: #ededed; color: #0a0a0a; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }\n.hb-xj6-acts { display: flex; align-items: center; gap: 6px; flex: none; }\n.hb-xj6-act {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  height: 44px;\n  padding: 0 10px;\n  border: 0;\n  border-radius: 12px;\n  background: none;\n  color: #ededed;\n  font: inherit;\n  text-decoration: none;\n  cursor: pointer;\n  transition: background-color .2s ease;\n}\n.hb-xj6-act:hover, .hb-xj6-act[aria-expanded=\"true\"] { background: rgba(255,255,255,.06); }\n.hb-xj6-act > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xj6-two { display: grid; text-align: left; line-height: 1.15; }\n.hb-xj6-two small { color: #8f8f8f; font-size: 11px; }\n.hb-xj6-two b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-xj6-count {\n  position: absolute;\n  top: 4px;\n  left: 24px;\n  min-width: 18px;\n  height: 18px;\n  padding: 0 5px;\n  border-radius: 999px;\n  background: var(--hb-xj6-accent);\n  color: #0a0a0a;\n  font-size: 10.5px;\n  font-weight: 700;\n  line-height: 18px;\n  text-align: center;\n  box-shadow: 0 0 0 2px #0d0d0d;\n  animation: hb-xj6-bump .5s cubic-bezier(.34,1.56,.64,1);\n}\n@keyframes hb-xj6-bump { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }\n.hb-xj6-cats { position: relative; display: flex; gap: 2px; height: 46px; margin: 0; padding: 0 16px; list-style: none; border-top: 1px solid #1a1a1a; }\n.hb-xj6-cat {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  height: 46px;\n  padding: 0 12px;\n  border: 0;\n  background: none;\n  color: #c4c4c4;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 500;\n  white-space: nowrap;\n  text-decoration: none;\n  cursor: pointer;\n  transition: color .2s ease;\n}\n.hb-xj6-cat::after { content: \"\"; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: #ededed; transform: scaleX(0); transition: transform .35s ${ease}; }\n.hb-xj6-cat:hover, .hb-xj6-cat[aria-expanded=\"true\"] { color: #fff; }\n.hb-xj6-cat[aria-expanded=\"true\"]::after, .hb-xj6-cat:hover::after { transform: scaleX(1); }\n.hb-xj6-cat[data-sale=\"true\"] { color: #ff6b6b; }\n.hb-xj6-cat[data-sale=\"true\"]::after { background: #ff6b6b; }\n.hb-xj6-cat svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .6; transition: transform .3s ${ease}; }\n.hb-xj6-cat[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n.hb-xj6-mega {\n  position: absolute;\n  top: 100%;\n  left: 0;\n  right: 0;\n  border-bottom: 1px solid #1f1f1f;\n  background: linear-gradient(180deg, #111, #0d0d0d);\n  box-shadow: 0 40px 60px -30px rgba(0,0,0,.9);\n  animation: hb-xj6-drop .35s ${ease};\n}\n@keyframes hb-xj6-drop { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }\n.hb-xj6-megain { display: flex; gap: 40px; max-width: 1080px; margin: 0 auto; padding: 26px 24px 30px; }\n.hb-xj6-col { min-width: 140px; animation: hb-xj6-col .45s ${ease} both; animation-delay: calc(var(--hb-xj6-i) * 40ms); }\n@keyframes hb-xj6-col { from { opacity: 0; transform: translateY(6px); } }\n.hb-xj6-col h4 { margin: 0 0 12px; color: #6f6f6f; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-xj6-col a { display: block; padding: 6px 0; color: #d4d4d4; font-size: 14px; text-decoration: none; transition: color .2s ease, transform .25s ${ease}; }\n.hb-xj6-col a:hover { color: #fff; transform: translateX(3px); }\n.hb-xj6-promo {\n  position: relative;\n  margin-left: auto;\n  width: 280px;\n  min-height: 170px;\n  padding: 18px;\n  border-radius: 16px;\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  color: #fff;\n  text-decoration: none;\n  overflow: hidden;\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.06);\n}\n.hb-xj6-promo::before { content: \"\"; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 0 0 26px rgba(255,255,255,.03), 0 0 0 52px rgba(255,255,255,.02); }\n.hb-xj6-promo small { position: relative; color: rgba(255,255,255,.7); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }\n.hb-xj6-promo b { position: relative; margin-top: 4px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }\n.hb-xj6-promo span { position: relative; margin-top: 10px; font-size: 13px; color: var(--hb-xj6-accent); }\n.hb-xj6-cart {\n  position: absolute;\n  top: calc(100% + 8px);\n  right: 0;\n  z-index: 6;\n  width: 360px;\n  border: 1px solid #262626;\n  border-radius: 18px;\n  background: linear-gradient(180deg, #151515, #101010);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 40px 80px -24px rgba(0,0,0,.95);\n  transform-origin: 90% 0;\n  animation: hb-xj6-pop .35s ${ease};\n}\n@keyframes hb-xj6-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }\n.hb-xj6-cwrap { position: relative; }\n.hb-xj6-ch { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }\n.hb-xj6-ch b { font-size: 15px; font-weight: 600; }\n.hb-xj6-ch span { color: #8f8f8f; font-size: 12px; }\n.hb-xj6-ship { margin: 12px 18px 4px; padding: 10px 12px; border-radius: 12px; background: #1a1a1a; font-size: 12.5px; color: #c4c4c4; }\n.hb-xj6-ship b { color: #fff; font-weight: 600; }\n.hb-xj6-track { height: 5px; margin-top: 8px; border-radius: 99px; background: #262626; overflow: hidden; }\n.hb-xj6-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--hb-xj6-accent) 60%, #fff), var(--hb-xj6-accent)); font-style: normal; transition: width .6s ${ease}; }\n.hb-xj6-items { margin: 0; padding: 6px 18px; list-style: none; }\n.hb-xj6-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #1c1c1c; }\n.hb-xj6-item:last-child { border-bottom: 0; }\n.hb-xj6-thumb { width: 52px; height: 60px; flex: none; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }\n.hb-xj6-info { flex: 1; min-width: 0; }\n.hb-xj6-info b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-xj6-info small { color: #8f8f8f; font-size: 12px; }\n.hb-xj6-step { display: inline-flex; align-items: center; margin-top: 6px; height: 26px; border: 1px solid #2a2a2a; border-radius: 999px; }\n.hb-xj6-step button { width: 26px; height: 24px; border: 0; background: none; color: #c4c4c4; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; border-radius: 999px; }\n.hb-xj6-step button:hover { color: #fff; background: rgba(255,255,255,.06); }\n.hb-xj6-step span { min-width: 18px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }\n.hb-xj6-price { align-self: flex-start; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-xj6-empty { padding: 26px 18px; color: #8f8f8f; font-size: 13px; text-align: center; }\n.hb-xj6-cf { padding: 14px 18px 18px; border-top: 1px solid #1f1f1f; }\n.hb-xj6-sub { display: flex; justify-content: space-between; font-size: 14px; }\n.hb-xj6-sub b { font-variant-numeric: tabular-nums; }\n.hb-xj6-checkout {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  width: 100%;\n  height: 46px;\n  margin-top: 12px;\n  border: 0;\n  border-radius: 12px;\n  background: var(--hb-xj6-accent);\n  color: #0a0a0a;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 650;\n  cursor: pointer;\n  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 10px 24px -12px var(--hb-xj6-accent);\n  transition: transform .2s ${ease}, filter .2s ease;\n}\n.hb-xj6-checkout:hover { filter: brightness(1.05); transform: translateY(-1px); }\n.hb-xj6-checkout:active { transform: scale(.98); }\n.hb-xj6-checkout:disabled { opacity: .4; cursor: not-allowed; transform: none; }\n.hb-xj6 a:focus-visible, .hb-xj6 button:focus-visible, .hb-xj6 input:focus-visible { outline: 2px solid var(--hb-xj6-accent); outline-offset: 2px; }\n.hb-xj6-drawer { display: none; }\n@container (max-width: 860px) {\n  .hb-xj6-two { display: none; }\n  .hb-xj6-main { gap: 12px; }\n}\n@container (max-width: 680px) {\n  .hb-xj6-util { justify-content: center; padding: 0 14px; }\n  .hb-xj6-msg span { justify-content: center; }\n  .hb-xj6-ulinks { display: none; }\n  .hb-xj6-main { flex-wrap: wrap; height: auto; padding: 10px 14px 12px; row-gap: 10px; }\n  .hb-xj6-burger {\n    display: grid;\n    place-items: center;\n    width: 40px;\n    height: 40px;\n    margin-left: -6px;\n    border: 0;\n    border-radius: 10px;\n    background: none;\n    color: #ededed;\n    cursor: pointer;\n  }\n  .hb-xj6-burger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }\n  .hb-xj6-brand { font-size: 20px; }\n  .hb-xj6-acts { margin-left: auto; gap: 0; }\n  .hb-xj6-act[data-wish=\"true\"] { display: none; }\n  .hb-xj6-search { order: 5; flex-basis: 100%; max-width: none; height: 40px; }\n  .hb-xj6-search button { display: none; }\n  .hb-xj6-cats { overflow-x: auto; scrollbar-width: none; padding: 0 8px; height: 44px; }\n  .hb-xj6-cats::-webkit-scrollbar { display: none; }\n  .hb-xj6-cat svg { display: none; }\n  .hb-xj6-mega { display: none; }\n  .hb-xj6-cwrap { position: static; }\n  .hb-xj6-cart { left: 10px; right: 10px; width: auto; top: calc(100% - 4px); }\n  .hb-xj6-drawer {\n    position: absolute;\n    top: 100%;\n    left: 0;\n    right: 0;\n    z-index: 6;\n    display: block;\n    max-height: 70dvh;\n    overflow-y: auto;\n    padding: 8px 14px 18px;\n    border-bottom: 1px solid #1f1f1f;\n    background: #0f0f0f;\n    box-shadow: 0 40px 60px -30px rgba(0,0,0,.9);\n    animation: hb-xj6-drop .4s ${ease};\n  }\n  .hb-xj6-drawer[hidden] { display: none; }\n  .hb-xj6-drow { border-bottom: 1px solid #1c1c1c; }\n  .hb-xj6-dbtn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 52px; padding: 0 4px; border: 0; background: none; color: #ededed; font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; }\n  .hb-xj6-dbtn[data-sale=\"true\"] { color: #ff6b6b; }\n  .hb-xj6-dbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .3s ${ease}; }\n  .hb-xj6-dbtn[aria-expanded=\"true\"] svg { transform: rotate(45deg); }\n  .hb-xj6-dsub { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 0 4px 14px; }\n  .hb-xj6-dsub a { padding: 6px 0; color: #a1a1a1; font-size: 14px; text-decoration: none; }\n}\n.hb-xj6-page { position: relative; z-index: 1; padding: 24px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }\n.hb-xj6-hero { grid-row: span 2; min-height: 380px; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; background: radial-gradient(90% 70% at 70% 20%, #3f6212, transparent 60%), linear-gradient(160deg, #1a2e05, #0b0f06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }\n.hb-xj6-hero small { color: var(--hb-xj6-accent); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }\n.hb-xj6-hero b { margin-top: 8px; font-family: var(--font-grotesk, inherit); font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }\n.hb-xj6-tile { min-height: 183px; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }\n.hb-xj6-tile b { font-size: 14px; font-weight: 600; }\n.hb-xj6-tile small { color: #a1a1a1; font-size: 12px; }\n@container (max-width: 680px) { .hb-xj6-page { grid-template-columns: 1fr 1fr; padding: 14px; } .hb-xj6-hero { grid-column: span 2; grid-row: auto; min-height: 220px; } .hb-xj6-hero b { font-size: 28px; } .hb-xj6-tile { min-height: 140px; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xj6 *, .hb-xj6 *::before, .hb-xj6 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nfunction Chevron() {\n  return (\n    <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n      <path d=\"m2 3.5 3 3 3-3\" />\n    </svg>\n  );\n}\n\nexport function NavbarCommerceRows({\n  brand = \"Fieldhouse\",\n  messages = [\"Free shipping on orders over $150\", \"Repairs are free for life on Fieldhouse gear\", \"Members get 10% back on every order\"],\n  categories = defaultCategories,\n  cartItems = defaultCart,\n  currency = \"USD\",\n  locale = \"en-US\",\n  freeShippingAt = 400,\n  defaultCategory = null,\n  defaultCartOpen = false,\n  onCartOpenChange,\n  onCartChange,\n  onCheckout,\n  onSearch,\n  accent = \"#e8ff5a\",\n  showBackdrop = true,\n  className,\n  style,\n  ...rest\n}: NavbarCommerceRowsProps) {\n  const [msg, setMsg] = React.useState(0);\n  const [openCat, setOpenCat] = React.useState<string | null>(defaultCategory);\n  const [cartOpen, setCartOpen] = React.useState(defaultCartOpen);\n  const [items, setItems] = React.useState(cartItems);\n  const [menuOpen, setMenuOpen] = React.useState(false);\n  const [expanded, setExpanded] = React.useState<string | null>(null);\n  const [query, setQuery] = React.useState(\"\");\n  const cartRef = React.useRef<HTMLDivElement>(null);\n  const cartBtnRef = React.useRef<HTMLButtonElement>(null);\n  const burgerRef = React.useRef<HTMLButtonElement>(null);\n  const catsRef = React.useRef<HTMLUListElement>(null);\n  const hoverTimer = React.useRef<number | undefined>(undefined);\n  const cartId = React.useId();\n  const megaId = React.useId();\n  const drawerId = React.useId();\n\n  const fmt = React.useMemo(() => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }), [locale, currency]);\n  const count = items.reduce((n, i) => n + i.qty, 0);\n  const subtotal = items.reduce((n, i) => n + i.qty * i.price, 0);\n  const remaining = Math.max(0, freeShippingAt - subtotal);\n  const progress = freeShippingAt > 0 ? Math.min(1, subtotal / freeShippingAt) : 1;\n\n  React.useEffect(() => {\n    if (messages.length < 2) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const id = window.setInterval(() => setMsg((m) => (m + 1) % messages.length), 4500);\n    return () => window.clearInterval(id);\n  }, [messages.length]);\n\n  const setCart = React.useCallback(\n    (next: boolean) => {\n      setCartOpen(next);\n      onCartOpenChange?.(next);\n    },\n    [onCartOpenChange],\n  );\n\n  React.useEffect(() => {\n    if (!cartOpen && !openCat && !menuOpen) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key !== \"Escape\") return;\n      if (cartOpen) {\n        setCart(false);\n        cartBtnRef.current?.focus();\n      }\n      if (menuOpen) {\n        setMenuOpen(false);\n        burgerRef.current?.focus();\n      }\n      if (openCat) {\n        const btn = catsRef.current?.querySelector<HTMLButtonElement>(`[data-cat=\"${CSS.escape(openCat)}\"]`);\n        setOpenCat(null);\n        btn?.focus();\n      }\n    };\n    const onDown = (e: PointerEvent) => {\n      if (cartOpen && cartRef.current && !cartRef.current.contains(e.target as Node)) setCart(false);\n    };\n    document.addEventListener(\"keydown\", onKey);\n    document.addEventListener(\"pointerdown\", onDown);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      document.removeEventListener(\"pointerdown\", onDown);\n    };\n  }, [cartOpen, openCat, menuOpen, setCart]);\n\n  const updateQty = (id: string, delta: number) => {\n    const next = items.map((i) => (i.id === id ? { ...i, qty: i.qty + delta } : i)).filter((i) => i.qty > 0);\n    setItems(next);\n    onCartChange?.(next);\n  };\n\n  const enterCat = (label: string | null) => {\n    window.clearTimeout(hoverTimer.current);\n    const delay = openCat ? 0 : 110;\n    hoverTimer.current = window.setTimeout(() => setOpenCat(label), label ? delay : 160);\n  };\n\n  const active = categories.find((c) => c.label === openCat && c.groups);\n\n  return (\n    <header\n      className={[\"hb-xj6\", className].filter(Boolean).join(\" \")}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      style={{ \"--hb-xj6-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-navbar-commerce-rows\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-xj6-head\">\n        <div className=\"hb-xj6-util\">\n          <div className=\"hb-xj6-msg\">\n            {messages.map((m, i) => (\n              <span key={m} data-state={i === msg ? \"on\" : i === (msg - 1 + messages.length) % messages.length ? \"off\" : \"next\"} aria-hidden={i !== msg}>\n                <i aria-hidden=\"true\" />\n                <b>{m}</b>\n              </span>\n            ))}\n          </div>\n          <div className=\"hb-xj6-ulinks\">\n            <a href=\"#help\">Help</a>\n            <a href=\"#stores\">Find a store</a>\n            <a href=\"#currency\">{currency}</a>\n          </div>\n        </div>\n        <div className=\"hb-xj6-main\">\n          <button\n            ref={burgerRef}\n            type=\"button\"\n            className=\"hb-xj6-burger\"\n            aria-label={menuOpen ? \"Close menu\" : \"Open menu\"}\n            aria-expanded={menuOpen}\n            aria-controls={drawerId}\n            onClick={() => {\n              setMenuOpen(!menuOpen);\n              setCart(false);\n            }}\n          >\n            <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n              {menuOpen ? <path d=\"m6 6 12 12M18 6 6 18\" /> : <path d=\"M4 7h16M4 12h16M4 17h10\" />}\n            </svg>\n          </button>\n          <a className=\"hb-xj6-brand\" href=\"#top\">\n            {brand}\n            <span>.</span>\n          </a>\n          <form\n            className=\"hb-xj6-search\"\n            role=\"search\"\n            onSubmit={(e) => {\n              e.preventDefault();\n              onSearch?.(query.trim());\n            }}\n          >\n            <svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n              <circle cx=\"9\" cy=\"9\" r=\"5.5\" />\n              <path d=\"m13.2 13.2 3.3 3.3\" />\n            </svg>\n            <input type=\"search\" aria-label=\"Search products\" placeholder=\"Search jackets, tents, boots…\" value={query} onChange={(e) => setQuery(e.target.value)} />\n            <button type=\"submit\">Search</button>\n          </form>\n          <div className=\"hb-xj6-acts\">\n            <a className=\"hb-xj6-act\" href=\"#account\" aria-label=\"Account\">\n              <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n                <circle cx=\"12\" cy=\"8.5\" r=\"3.5\" />\n                <path d=\"M5 19.5c1.2-3.3 3.8-5 7-5s5.8 1.7 7 5\" />\n              </svg>\n              <span className=\"hb-xj6-two\">\n                <small>Hello, sign in</small>\n                <b>Account</b>\n              </span>\n            </a>\n            <a className=\"hb-xj6-act\" href=\"#wishlist\" data-wish=\"true\" aria-label=\"Wishlist, 4 items\">\n              <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n                <path d=\"M12 19.5s-7-4.3-7-9.5a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.2-7 9.5-7 9.5Z\" />\n              </svg>\n            </a>\n            <div className=\"hb-xj6-cwrap\" ref={cartRef}>\n              <button\n                ref={cartBtnRef}\n                type=\"button\"\n                className=\"hb-xj6-act\"\n                aria-expanded={cartOpen}\n                aria-controls={cartId}\n                aria-label={`Cart, ${count} items, ${fmt.format(subtotal)}`}\n                onClick={() => {\n                  setCart(!cartOpen);\n                  setMenuOpen(false);\n                }}\n              >\n                <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n                  <path d=\"M5 8h14l-1.2 10.2a1.5 1.5 0 0 1-1.5 1.3H7.7a1.5 1.5 0 0 1-1.5-1.3Z\" />\n                  <path d=\"M9 10V7a3 3 0 0 1 6 0v3\" />\n                </svg>\n                {count > 0 && (\n                  <span className=\"hb-xj6-count\" key={count} aria-hidden=\"true\">\n                    {count}\n                  </span>\n                )}\n                <span className=\"hb-xj6-two\">\n                  <small>Cart</small>\n                  <b>{fmt.format(subtotal)}</b>\n                </span>\n              </button>\n              {cartOpen && (\n                <div className=\"hb-xj6-cart\" id={cartId} role=\"dialog\" aria-label=\"Cart\">\n                  <div className=\"hb-xj6-ch\">\n                    <b>Your cart</b>\n                    <span>\n                      {count} {count === 1 ? \"item\" : \"items\"}\n                    </span>\n                  </div>\n                  <div className=\"hb-xj6-ship\">\n                    {remaining > 0 ? (\n                      <>\n                        You are <b>{fmt.format(remaining)}</b> away from free shipping\n                      </>\n                    ) : (\n                      <>\n                        <b>Free shipping unlocked.</b> Arrives Thu, Nov 12\n                      </>\n                    )}\n                    <div className=\"hb-xj6-track\">\n                      <i style={{ width: `${(progress * 100).toFixed(1)}%` }} />\n                    </div>\n                  </div>\n                  {items.length === 0 ? (\n                    <div className=\"hb-xj6-empty\">Your cart is empty. The trail is waiting.</div>\n                  ) : (\n                    <ul className=\"hb-xj6-items\">\n                      {items.map((it) => (\n                        <li className=\"hb-xj6-item\" key={it.id}>\n                          <span className=\"hb-xj6-thumb\" style={{ background: it.swatch ?? \"#262626\" }} aria-hidden=\"true\" />\n                          <div className=\"hb-xj6-info\">\n                            <b>{it.name}</b>\n                            <small>{it.variant}</small>\n                            <div className=\"hb-xj6-step\">\n                              <button type=\"button\" aria-label={`Remove one ${it.name}`} onClick={() => updateQty(it.id, -1)}>\n                                −\n                              </button>\n                              <span aria-live=\"polite\">{it.qty}</span>\n                              <button type=\"button\" aria-label={`Add one ${it.name}`} onClick={() => updateQty(it.id, 1)}>\n                                +\n                              </button>\n                            </div>\n                          </div>\n                          <span className=\"hb-xj6-price\">{fmt.format(it.price * it.qty)}</span>\n                        </li>\n                      ))}\n                    </ul>\n                  )}\n                  <div className=\"hb-xj6-cf\">\n                    <div className=\"hb-xj6-sub\">\n                      <span>Subtotal</span>\n                      <b>{fmt.format(subtotal)}</b>\n                    </div>\n                    <button type=\"button\" className=\"hb-xj6-checkout\" disabled={items.length === 0} onClick={() => onCheckout?.(items)}>\n                      Checkout\n                    </button>\n                  </div>\n                </div>\n              )}\n            </div>\n          </div>\n        </div>\n        <nav aria-label=\"Categories\" onPointerLeave={() => enterCat(null)}>\n          <ul className=\"hb-xj6-cats\" ref={catsRef}>\n            {categories.map((c) => (\n              <li key={c.label}>\n                {c.groups ? (\n                  <button\n                    type=\"button\"\n                    className=\"hb-xj6-cat\"\n                    data-cat={c.label}\n                    data-sale={c.sale ? \"true\" : undefined}\n                    aria-expanded={openCat === c.label}\n                    aria-controls={megaId}\n                    onPointerEnter={(e) => e.pointerType === \"mouse\" && enterCat(c.label)}\n                    onClick={() => setOpenCat(openCat === c.label ? null : c.label)}\n                  >\n                    {c.label}\n                    <Chevron />\n                  </button>\n                ) : (\n                  <a className=\"hb-xj6-cat\" href={c.href} data-sale={c.sale ? \"true\" : undefined} onPointerEnter={() => enterCat(null)}>\n                    {c.label}\n                  </a>\n                )}\n              </li>\n            ))}\n          </ul>\n          {active && (\n            <div className=\"hb-xj6-mega\" id={megaId} key={active.label} onPointerEnter={() => window.clearTimeout(hoverTimer.current)}>\n              <div className=\"hb-xj6-megain\">\n                {active.groups?.map((g, gi) => (\n                  <div className=\"hb-xj6-col\" key={g.title} style={{ \"--hb-xj6-i\": gi } as React.CSSProperties}>\n                    <h4>{g.title}</h4>\n                    {g.links.map((l) => (\n                      <a key={l.label} href={l.href}>\n                        {l.label}\n                      </a>\n                    ))}\n                  </div>\n                ))}\n                {active.promo && (\n                  <a className=\"hb-xj6-promo\" href={active.promo.href} style={{ background: active.promo.tone ?? \"linear-gradient(140deg,#262626,#111)\" }}>\n                    <small>{active.promo.eyebrow}</small>\n                    <b>{active.promo.title}</b>\n                    <span>Shop now →</span>\n                  </a>\n                )}\n              </div>\n            </div>\n          )}\n        </nav>\n        <div className=\"hb-xj6-drawer\" id={drawerId} hidden={!menuOpen}>\n          {categories.map((c) => (\n            <div className=\"hb-xj6-drow\" key={c.label}>\n              {c.groups ? (\n                <>\n                  <button type=\"button\" className=\"hb-xj6-dbtn\" aria-expanded={expanded === c.label} onClick={() => setExpanded(expanded === c.label ? null : c.label)}>\n                    {c.label}\n                    <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n                      <path d=\"M7 2v10M2 7h10\" />\n                    </svg>\n                  </button>\n                  {expanded === c.label && (\n                    <div className=\"hb-xj6-dsub\">\n                      {c.groups.flatMap((g) => g.links.slice(0, 3)).map((l, li) => (\n                        <a key={l.label + li} href={l.href}>\n                          {l.label}\n                        </a>\n                      ))}\n                    </div>\n                  )}\n                </>\n              ) : (\n                <a className=\"hb-xj6-dbtn\" href={c.href} data-sale={c.sale ? \"true\" : undefined}>\n                  {c.label}\n                </a>\n              )}\n            </div>\n          ))}\n        </div>\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-xj6-page\" aria-hidden=\"true\">\n          <div className=\"hb-xj6-hero\">\n            <small>Fall 26 collection</small>\n            <b>Built for the long way round</b>\n          </div>\n          <div className=\"hb-xj6-tile\" style={{ background: \"linear-gradient(160deg,#7c2d12,#1c0f0a)\" }}>\n            <b>Insulated jackets</b>\n            <small>From $149</small>\n          </div>\n          <div className=\"hb-xj6-tile\" style={{ background: \"linear-gradient(160deg,#1e3a8a,#0b1020)\" }}>\n            <b>Ultralight tents</b>\n            <small>From $329</small>\n          </div>\n          <div className=\"hb-xj6-tile\" style={{ background: \"linear-gradient(160deg,#3f3f46,#111)\" }}>\n            <b>Trail footwear</b>\n            <small>From $119</small>\n          </div>\n          <div className=\"hb-xj6-tile\" style={{ background: \"linear-gradient(160deg,#854d0e,#1a1206)\" }}>\n            <b>Camp kitchen</b>\n            <small>From $24</small>\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}