.section:has(> .mega-header) {
  display: contents;
}

.mega-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: rgb(251, 246, 238);
  border-bottom: 1px solid rgb(237, 228, 211);
  font-family: Archivo, sans-serif;
  font-size: 16px;
  line-height: normal;
  color: rgba(var(--color-text));
  padding: 18px 48px;
  box-sizing: content-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body:not([data-template-name="index"]) .mega-header {
  border-bottom-width: 2px;
  border-bottom-color: rgb(32, 21, 18);
}

body:has([data-section-key="shop-hero"]) .mega-header__link[href="/pages/shop"],
body:has([data-section-key="bundle-hero"]) .mega-header__link[href="/pages/shop"],
body[data-template-name="product"] .mega-header__link[href="/pages/shop"],
body[data-template-name="collection"] .mega-header__link[href="/pages/shop"] {
  color: rgb(186, 7, 7);
  padding-bottom: 4px;
  border-bottom: 3px solid rgb(186, 7, 7);
  text-decoration: none;
}

body:has([data-section-key="recipe-hero"]) .mega-header__link[href="/pages/recipes"],
body:has([data-section-key="recipe-detail-hero"]) .mega-header__link[href="/pages/recipes"] {
  color: rgb(186, 7, 7);
  padding-bottom: 4px;
  border-bottom: 3px solid rgb(186, 7, 7);
  text-decoration: none;
}

body:has([data-section-key="gifting-hero"]) .mega-header__link[href="/pages/corporate-gifting"] {
  color: rgb(186, 7, 7);
  padding-bottom: 4px;
  border-bottom: 3px solid rgb(186, 7, 7);
  text-decoration: none;
}
body:has([data-section-key="wholesale-hero"]) .mega-header__link[href="/pages/wholesale"] {
  color: rgb(186, 7, 7);
  padding-bottom: 4px;
  border-bottom: 3px solid rgb(186, 7, 7);
  text-decoration: none;
}
body:has([data-section-key="locator-hero"]) .mega-header__link[href="/pages/find-a-store"] {
  color: rgb(186, 7, 7);
  padding-bottom: 4px;
  border-bottom: 3px solid rgb(186, 7, 7);
  text-decoration: none;
}
.mega-header__bar {
  display: contents;
}
.mega-header__logo {
  display: block;
  flex: 0 0 auto;
}
.mega-header__logo img {
  width: auto;
  height: 64px;
  display: block;
  object-fit: contain;
}
.mega-header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 0 0 auto;
  margin-left: 0;
}
.mega-header__item {
  display: flex;
  align-items: center;
  position: static;
}
.mega-header__link {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgb(32, 21, 18);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  white-space: nowrap;
}
.mega-header__caret {
  box-sizing: content-box;
  display: block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mega-header__item:hover .mega-header__link,
.mega-header__item:focus-within .mega-header__link,
.mega-header__item.is-open .mega-header__link {
  color: rgb(186, 7, 7);
}

.mega-header__item:hover .mega-header__caret,
.mega-header__item:focus-within .mega-header__caret,
.mega-header__item.is-open .mega-header__caret {
  transform: translateY(1px) rotate(-135deg);
}
.mega-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}
.mega-header__action {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgb(32, 21, 18);
  text-decoration: none;
}
.mega-header__search-icon {
  display: none;
}
.mega-header .mega-header__cart {
  background: rgb(32, 21, 18);
  color: rgb(251, 246, 238);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.mega-header__retailer-login {
  cursor: default;
}
.mega-header__hamburger {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.mega-header__hamburger-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

@keyframes barlows-nav-shrink {
  from {
    padding-top: 18px;
    padding-bottom: 18px;
    box-shadow: rgba(32, 21, 18, 0) 0 0 0;
  }
  to {
    padding-top: 9px;
    padding-bottom: 9px;
    box-shadow: rgba(32, 21, 18, 0.14) 0 10px 26px;
  }
}

@keyframes barlows-nav-logo-shrink {
  from { height: 64px; }
  to { height: 44px; }
}

@supports (animation-timeline: scroll()) {
  @media (min-width: 1024px) {
    .mega-header {
      animation: barlows-nav-shrink linear both;
      animation-timeline: scroll();
      animation-range: 0 160px;
    }
    .mega-header .mega-header__logo img {
      animation: barlows-nav-logo-shrink linear both;
      animation-timeline: scroll();
      animation-range: 0 160px;
    }
  }
}

@media (min-width: 960px) {
  .mega-header.is-stuck {
    padding: 9px 48px;
    box-shadow: rgba(32, 21, 18, 0.14) 0 10px 26px;
  }
  .mega-header.is-stuck .mega-header__logo img {
    width: auto;
    height: 44px;
  }
}

@media (min-width: 960px) and (max-width: 1150px) {
  .mega-header {
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
  }
  .mega-header.is-stuck {
    padding-right: 20px;
    padding-left: 20px;
  }
  .mega-header__logo img {
    height: 48px;
  }
  .mega-header__nav {
    flex: 1 1 auto;
    gap: 12px;
    min-width: 0;
  }
  .mega-header__link {
    font-size: 11px;
    letter-spacing: 0.4px;
  }
  .mega-header__caret {
    margin-left: 4px;
  }
  .mega-header__actions {
    gap: 10px;
  }
  .mega-header__action {
    font-size: 11px;
    letter-spacing: 0.4px;
  }
  .mega-header .mega-header__cart {
    font-size: 11px;
    letter-spacing: 0.4px;
    padding: 6px 10px;
  }
}

/* ── Mega panel ── */
.mega-header__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  background: rgb(251, 246, 238);
  border-top: 2px solid rgb(32, 21, 18);
  border-bottom: 2px solid rgb(32, 21, 18);
  box-shadow: rgba(32, 21, 18, 0.16) 0 28px 56px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 70;
}
.mega-header__item--has-panel:hover .mega-header__panel,
.mega-header__item--has-panel:focus-within .mega-header__panel,
.mega-header__item--has-panel.is-open .mega-header__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-header__panel-inner {
  display: flex;
  align-items: stretch;
  gap: 56px;
  padding: 40px 48px 44px;
}
.mega-header__panel-col--links {
  flex: 0 0 230px;
}
.mega-header__panel-col--secondary {
  flex: 0 0 250px;
}
.mega-header__panel-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #BA0707;
  margin: 0 0 18px;
}
.mega-header__panel-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mega-header__panel-links li {
  margin: 0;
}
.mega-header__panel-links a {
  font-size: 15px;
  font-weight: 600;
  color: rgb(58, 44, 36);
  text-decoration: none;
}
.mega-header__panel-links a:hover {
  color: #BA0707;
}
.mega-header__panel-links--rich a {
  display: block;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.5px;
}
.mega-header__panel-col--links .mega-header__panel-links a {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 55px;
  padding: 9px 0;
  border-bottom: 1px solid rgb(237, 228, 211);
  color: rgb(32, 21, 18);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: normal;
  text-transform: uppercase;
}
.mega-header__panel-col--links .mega-header__panel-links li:last-child a {
  border-bottom: 0;
}
.mega-header__panel-link-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.mega-header__panel-link-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: rgb(138, 125, 109);
  margin-top: 1px;
  letter-spacing: 1.5px;
}
.mega-header__panel-accent {
  font-family: Yellowtail, cursive;
  font-size: 26px;
  color: #BA0707;
  margin: 0 0 8px;
}
.mega-header__panel-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgb(92, 81, 72);
  margin: 0;
  max-width: 320px;
}
.mega-header__panel-card,
.mega-header__panel-promo {
  display: block;
  box-sizing: border-box;
  text-decoration: none;
}
.mega-header__panel-featured {
  display: flex;
  align-items: stretch;
  flex: 0 0 544px;
  gap: 20px;
  margin-left: auto;
}
.mega-header__panel-card {
  flex: 0 0 244px;
  border: 2px solid rgb(32, 21, 18);
  background: rgb(255, 255, 255);
  color: rgb(32, 21, 18);
}
.mega-header__panel-card-media {
  display: block;
  height: 170px;
  background-size: cover;
  background-position: center;
  background-color: rgb(244, 237, 224);
}
.mega-header__panel-card-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #201512;
  color: #FBF6EE;
  padding: 5px 9px;
  margin: 16px 18px 0;
}
.mega-header__panel-card-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 20px;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: 1.5px;
  margin: 10px 18px 0;
}
.mega-header__panel-card-meta {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 1.5px;
  color: rgb(92, 81, 72);
  margin: 6px 18px 0;
}
.mega-header__panel-card-cta {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #BA0707;
  margin: 12px 18px 18px;
}
.mega-header__panel-promo {
  flex: 0 0 280px;
  background: #BA0707;
  color: rgb(251, 246, 238);
  padding: 26px 24px;
}
.mega-header__panel-promo-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #F0B41C;
  color: #201512;
  padding: 5px 9px;
  margin: 0 0 14px;
}
.mega-header__panel-promo-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  color: #FBF6EE;
  margin: 0 0 10px;
}
.mega-header__panel-promo-body {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
  color: #FBF6EE;
}
.mega-header__panel-promo-cta {
  display: inline;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #F0B41C;
}

@media (min-width: 960px) and (max-width: 1150px) {
  .mega-header__panel-inner {
    gap: 20px;
    padding: 28px 20px 32px;
  }
  .mega-header__panel-col--links {
    flex: 0 1 168px;
    min-width: 0;
  }
  .mega-header__panel-col--secondary {
    flex: 0 1 190px;
    min-width: 0;
  }
  .mega-header__panel-col--links .mega-header__panel-links a {
    min-height: 44px;
    padding: 6px 0;
    font-size: 16px;
    letter-spacing: 0.2px;
  }
  .mega-header__panel-links--rich a,
  .mega-header__panel-link-label {
    font-size: 13px;
    letter-spacing: 0.4px;
  }
  .mega-header__panel-link-sub {
    font-size: 11px;
    letter-spacing: 0.4px;
  }
  .mega-header__panel-featured {
    flex: 1 1 auto;
    gap: 12px;
    min-width: 0;
    margin-left: 0;
  }
  .mega-header__panel-card,
  .mega-header__panel-promo {
    flex: 1 1 0;
    min-width: 0;
  }
  .mega-header__panel-card-media {
    height: 120px;
  }
  .mega-header__panel-card-title {
    font-size: 16px;
    letter-spacing: 0.4px;
    margin-right: 12px;
    margin-left: 12px;
  }
  .mega-header__panel-card-eyebrow,
  .mega-header__panel-card-meta,
  .mega-header__panel-card-cta {
    margin-right: 12px;
    margin-left: 12px;
    letter-spacing: 0.4px;
  }
  .mega-header__panel-promo {
    padding: 18px 14px;
  }
  .mega-header__panel-promo-title {
    font-size: 22px;
  }
  .mega-header__panel-promo-body {
    font-size: 13px;
  }
}

/* ── Mobile drawer ── */
.mega-header__drawer {
  display: none;
}

@media (max-width: 959px) {
  .mega-header {
    padding: 10px 20px;
  }
  .mega-header__logo img {
    width: auto;
    height: 44px;
  }
  .mega-header__nav {
    display: none;
  }
  .mega-header__actions {
    gap: 6px;
  }
  .mega-header__action:not(.mega-header__search) {
    display: none;
  }
  .mega-header__search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
  }
  .mega-header__search-label {
    display: none;
  }
  .mega-header__search-icon {
    display: block;
    width: 22px;
    height: 22px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .mega-header .mega-header__cart {
    padding: 8px 12px;
    font-size: 11px;
    line-height: normal;
  }
  .mega-header__hamburger {
    display: flex;
    width: 40px;
    height: 40px;
  }
  .mega-header__drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: rgb(32, 21, 18);
    color: rgb(251, 246, 238);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow: auto;
    padding: 0;
  }
  .mega-header__drawer.is-open {
    transform: translateX(0);
  }
  .mega-header__drawer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 65px;
    box-sizing: border-box;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid rgb(58, 44, 36);
  }
  .mega-header__drawer-logo {
    display: block;
    width: 53px;
    height: 44px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .mega-header__drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .mega-header__drawer-close-icon {
    display: block;
    width: 22px;
    height: 22px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .mega-header__drawer-nav {
    flex: 1 0 auto;
    padding: 8px 0;
  }
  .mega-header__drawer-link,
  .mega-header__drawer-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: 0;
    box-sizing: border-box;
    min-height: 78px;
    border-bottom: 1px solid rgb(58, 44, 36);
    color: rgb(251, 246, 238);
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: normal;
    text-transform: uppercase;
    text-decoration: none;
    padding: 16px 20px;
    cursor: pointer;
    text-align: left;
  }
  .mega-header .mega-header__drawer-link,
  .mega-header .mega-header__drawer-toggle {
    color: #FBF6EE;
  }
  .mega-header__drawer-arrow {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
  }
  .mega-header__drawer-link-arrow {
    display: block;
    width: 22px;
    height: 22px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .mega-header__drawer-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
  }
  .mega-header__drawer-group.is-open .mega-header__drawer-sub {
    display: block;
  }
  .mega-header__drawer-sub a {
    display: block;
    box-sizing: border-box;
    min-height: 40px;
    padding: 12px 20px 12px 36px;
    border-bottom: 1px solid rgb(44, 32, 25);
    color: rgb(217, 205, 187);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: normal;
    text-decoration: none;
  }
  .mega-header .mega-header__drawer-sub a {
    color: rgb(217, 205, 187);
  }
  .mega-header__drawer-utilities {
    display: flex;
    gap: 24px;
    padding: 22px 20px 8px;
  }
  .mega-header__drawer-utilities a {
    color: rgb(168, 155, 136);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
  }
  .mega-header .mega-header__drawer-utilities a {
    color: rgb(168, 155, 136);
  }
  .mega-header__drawer-utilities span {
    color: rgb(168, 155, 136);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
  }
  .mega-header__drawer-promo {
    flex: 0 0 130px;
    box-sizing: border-box;
    padding: 20px;
    border-top: 1px solid rgb(58, 44, 36);
  }
  .mega-header__drawer-promo p {
    margin: 0 0 10px;
    color: #F0B41C;
    font-family: Yellowtail, cursive;
    font-size: 22px;
    font-weight: 400;
    line-height: normal;
  }
  .mega-header__drawer-promo a {
    display: block;
    padding: 17px 0;
    background: #BA0707;
    color: #FBF6EE;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: normal;
    text-align: center;
    text-decoration: none;
  }
  .mega-header .mega-header__drawer-promo a {
    color: #FBF6EE;
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  .mega-header { padding: 10px 32px; }
}
