/*
 * PumpkinDP refined header
 * Scoped to Astra's header builder so WooCommerce and page content remain untouched.
 */

:root {
  --pdp-ink: #111318;
  --pdp-muted: #667085;
  --pdp-orange: #f47a1f;
  --pdp-orange-soft: #fff3e9;
  --pdp-line: #ebeef2;
  --pdp-surface: rgba(255,255,255,.92);
}

#masthead {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--pdp-surface);
  border-bottom: 1px solid var(--pdp-line);
  box-shadow: 0 12px 40px rgba(17,19,24,.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.admin-bar #masthead { top: 32px; }

#masthead .ast-site-title-wrap { display: none; }

#ast-desktop-header .ast-primary-header-bar {
  min-height: 88px;
  background: transparent;
  border: 0;
}

#ast-desktop-header .site-primary-header-wrap {
  width: min(100% - 48px, 1240px);
  max-width: 1240px;
  margin-inline: auto;
  padding: 0;
}

#ast-desktop-header .ast-builder-grid-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(64px, 1fr);
  grid-template-areas: "brand navigation cart";
  align-items: center;
  gap: 28px;
  width: 100%;
}

#ast-desktop-header .site-header-primary-section-center {
  grid-area: brand;
  justify-self: start;
  justify-content: flex-start;
}

#ast-desktop-header .site-header-primary-section-left {
  grid-area: navigation;
  justify-self: center;
  justify-content: center;
}

#ast-desktop-header .site-header-primary-section-right {
  grid-area: cart;
  justify-self: end;
  justify-content: flex-end;
}

#ast-desktop-header .site-branding,
#ast-desktop-header .ast-site-identity {
  padding: 0;
}

#ast-desktop-header .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#ast-desktop-header .custom-logo-link {
  display: inline-flex;
  width: 196px;
  height: 52px;
  align-items: center;
  overflow: hidden;
}

#masthead #ast-desktop-header .custom-logo-link img,
#masthead #ast-desktop-header .custom-logo-link svg.pumpkindp-logo {
  display: block !important;
  width: 196px !important;
  max-width: 196px !important;
  height: 50px !important;
  max-height: 50px !important;
  object-fit: contain;
}

#masthead .main-header-menu {
  align-items: center;
  gap: 5px;
}

#masthead .main-header-menu > .menu-item > .menu-link {
  min-height: 0;
  height: auto;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--pdp-ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: .01em;
  text-decoration: none;
  transition: color .22s ease, background-color .22s ease, transform .22s ease;
}

#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .main-header-menu > .menu-item.focus > .menu-link {
  color: var(--pdp-orange);
  background: var(--pdp-orange-soft);
  transform: translateY(-1px);
}

#masthead .main-header-menu > .current-menu-item > .menu-link,
#masthead .main-header-menu > .current-menu-ancestor > .menu-link {
  color: #fff;
  background: var(--pdp-ink);
}

#masthead .main-header-menu .dropdown-menu-toggle {
  margin-inline-start: 5px;
  padding: 0;
  color: inherit;
}

#masthead .main-header-menu > .menu-item-has-children {
  position: relative;
}

#masthead .main-header-menu > .menu-item-has-children::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 18px;
}

#masthead .main-header-menu .sub-menu {
  min-width: 230px;
  margin-top: 0 !important;
  padding: 9px;
  border: 1px solid var(--pdp-line);
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 22px 60px rgba(17,19,24,.14);
  overflow: hidden;
}

@media (min-width: 922px) {
  #masthead .main-header-menu > .menu-item-has-children > .sub-menu {
    top: calc(100% - 1px) !important;
    margin-top: 0 !important;
  }

  #masthead .main-header-menu > .menu-item-has-children:hover > .sub-menu,
  #masthead .main-header-menu > .menu-item-has-children:focus-within > .sub-menu,
  #masthead .main-header-menu > .menu-item-has-children.focus > .sub-menu {
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

#masthead .main-header-menu .sub-menu .menu-link {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--pdp-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

#masthead .main-header-menu .sub-menu .menu-link:hover {
  color: var(--pdp-orange);
  background: var(--pdp-orange-soft);
}

/* Keep utility destinations in the cart flow, not the primary navigation. */
#menu-item-335,
#menu-item-334 {
  display: none !important;
}

/* Stable, intentional desktop order. */
#menu-item-336 { order: 1; }
#menu-item-333 { order: 2; }
#menu-item-758 { order: 3; }
#menu-item-375 { order: 4; }

#masthead .ast-site-header-cart .cart-container {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #24272e;
  border-radius: 15px;
  background: var(--pdp-ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17,19,24,.18);
  text-decoration: none;
  transition: transform .22s ease, background-color .22s ease, box-shadow .22s ease;
}

#masthead .ast-site-header-cart .cart-container:hover {
  transform: translateY(-2px);
  background: var(--pdp-orange);
  border-color: var(--pdp-orange);
  box-shadow: 0 14px 28px rgba(244,122,31,.26);
}

#masthead .ast-site-header-cart i.astra-icon {
  padding: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

#masthead .ast-site-header-cart i.astra-icon::after {
  top: -10px;
  right: -11px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--pdp-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
}

@media (max-width: 921.99px) {
  .admin-bar #masthead { top: 46px; }

  #ast-mobile-header .ast-above-header-bar,
  #ast-mobile-header .ast-primary-header-bar {
    min-height: 76px;
    background: transparent;
    border: 0;
  }

  #ast-mobile-header .ast-builder-grid-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
  }

  #ast-mobile-header .site-header-section {
    min-width: 0;
  }

  #ast-mobile-header .site-header-above-section-left,
  #ast-mobile-header .site-header-primary-section-left {
    justify-content: flex-start;
  }

  #ast-mobile-header .site-header-above-section-center,
  #ast-mobile-header .site-header-primary-section-center {
    justify-content: center;
  }

  #ast-mobile-header .site-header-above-section-right,
  #ast-mobile-header .site-header-primary-section-right {
    justify-content: flex-end;
  }

  #ast-mobile-header .custom-logo-link {
    display: inline-flex;
    width: 160px;
    height: 44px;
    align-items: center;
    overflow: hidden;
  }

  #masthead #ast-mobile-header .custom-logo-link img,
  #masthead #ast-mobile-header .custom-logo-link svg.pumpkindp-logo {
    display: block !important;
    width: 160px !important;
    max-width: 160px !important;
    height: 41px !important;
    max-height: 41px !important;
    object-fit: contain;
  }

  #ast-mobile-header .pumpkindp-logo > g:last-child > text:last-child {
    transform: translateX(-16px);
  }

  #ast-mobile-header .menu-toggle {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--pdp-orange-soft);
    color: var(--pdp-orange);
  }

  #ast-mobile-header .ast-site-header-cart .cart-container {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .ast-mobile-popup-drawer .ast-mobile-popup-inner {
    width: min(88vw, 390px);
    background: #ffffff;
    border-right: 1px solid var(--pdp-line);
    box-shadow: 24px 0 60px rgba(17,19,24,.18);
  }

  .ast-mobile-popup-drawer .ast-mobile-popup-header {
    padding: 22px 20px 10px;
  }

  .ast-mobile-popup-drawer .menu-toggle-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--pdp-orange-soft);
    color: var(--pdp-orange);
  }

  .ast-mobile-popup-content {
    padding: 14px 18px 30px;
  }

  #ast-mobile-popup .main-header-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  #ast-mobile-popup .main-header-menu > .menu-item {
    width: 100%;
  }

  #ast-mobile-popup .main-header-menu > .menu-item > .menu-link {
    justify-content: space-between;
    width: 100%;
    padding: 15px 16px;
    border-radius: 12px;
    border: 1px solid #edf0f3;
    color: var(--pdp-ink);
    background: #f7f8fa;
    font-size: 15px;
  }

  #ast-mobile-popup .main-header-menu > .current-menu-item > .menu-link,
  #ast-mobile-popup .main-header-menu > .current-menu-ancestor > .menu-link,
  #ast-mobile-popup .main-header-menu > .menu-item > .menu-link:hover {
    border-color: #ffd9bd;
    color: var(--pdp-orange);
    background: var(--pdp-orange-soft);
  }

  #ast-mobile-popup .sub-menu {
    margin: 6px 0 4px;
    padding: 6px 8px;
    border: 0;
    border-radius: 12px;
    border: 1px solid #edf0f3;
    background: #fff;
    box-shadow: none;
  }

  #ast-mobile-popup .sub-menu .menu-link {
    color: #3f4650;
    background: transparent;
  }
}

@media (max-width: 544px) {
  #ast-mobile-header .ast-builder-grid-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding-inline: 12px;
  }

  #ast-mobile-header .custom-logo-link {
    width: 142px;
    height: 40px;
  }

  #masthead #ast-mobile-header .custom-logo-link img,
  #masthead #ast-mobile-header .custom-logo-link svg.pumpkindp-logo {
    width: 142px !important;
    max-width: 142px !important;
    height: 36px !important;
    max-height: 36px !important;
  }

  #ast-mobile-header .menu-toggle,
  #ast-mobile-header .ast-site-header-cart .cart-container {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #masthead *,
  #masthead *::before,
  #masthead *::after {
    transition-duration: .01ms !important;
  }
}
