/* Parkland Mobile Navigation 0.1.22
 * RC cleanup: Kadence owns the native mobile header container, background and
 * branding. Parkland owns only its custom navigation controls and their styles.
 */

.pnh-mobile-nav {
  display: none;
}

/* Front-page phone reveal. Before interaction this preserves the lightweight
 * v1.0.1 state: the mobile header and sticky spacer are collapsed so the Hero
 * owns the first viewport. On the first interaction the header is prepared
 * off-flow and still invisible, allowing Parkland controls and Sticky Header
 * sizing to finish before one coordinated reveal starts. */
@media (max-width: 767px) {
  html.pnh-mobile-header-awaiting-interaction .site-mobile-header-wrap {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html.pnh-mobile-header-awaiting-interaction .pnh-sticky-header-spacer {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
  }

  /* After the interaction request, prepare the complete header at its natural
   * height but keep it fixed, invisible and out of document flow. This work
   * happens only after user input, not during the initial Lighthouse path. */
  html.pnh-mobile-header-awaiting-interaction.pnh-mobile-header-reveal-requested .site-mobile-header-wrap {
    position: fixed !important;
    top: var(--pnh-fixed-header-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(0, -10px, 0) !important;
    -webkit-transform: translate3d(0, -10px, 0) !important;
  }

  /* Sticky Header removes transforms on phones after reveal so the third-level
   * fixed modal remains viewport-relative. During preparation/reveal only, the
   * more-specific coordinator selectors temporarily own the transform. */
  html.pnh-mobile-header-awaiting-interaction.pnh-mobile-header-reveal-requested body.pnh-sticky-header-enabled .site-mobile-header-wrap.pnh-sticky-header-target {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(0, -10px, 0) !important;
    -webkit-transform: translate3d(0, -10px, 0) !important;
  }

  html.pnh-mobile-header-awaiting-interaction.pnh-mobile-header-reveal-requested .pnh-sticky-header-spacer,
  html.pnh-mobile-header-revealing .pnh-sticky-header-spacer {
    transition: height .8s cubic-bezier(.22, .61, .36, 1);
  }

  html.pnh-mobile-header-revealing .site-mobile-header-wrap,
  html.pnh-mobile-header-revealing body.pnh-sticky-header-enabled .site-mobile-header-wrap.pnh-sticky-header-target {
    position: fixed !important;
    top: var(--pnh-fixed-header-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    transition:
      opacity .8s ease-out,
      transform .8s cubic-bezier(.22, .61, .36, 1),
      -webkit-transform .8s cubic-bezier(.22, .61, .36, 1),
      box-shadow .18s ease !important;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  html.pnh-mobile-header-awaiting-interaction.pnh-mobile-header-reveal-requested .pnh-sticky-header-spacer,
  html.pnh-mobile-header-revealing .pnh-sticky-header-spacer,
  html.pnh-mobile-header-revealing .site-mobile-header-wrap,
  html.pnh-mobile-header-revealing body.pnh-sticky-header-enabled .site-mobile-header-wrap.pnh-sticky-header-target {
    transition: none !important;
  }
}

@media (max-width: 1199px) {
  /* Prevent a flash of Kadence's native hamburger before Parkland JS mounts. */
  body.pnh-mobile-nav-enabled #mobile-header .site-header-item-navigation-popup-toggle,
  body.pnh-mobile-nav-enabled #mobile-header .mobile-toggle-open-container,
  body.pnh-mobile-nav-enabled #mobile-header .menu-toggle-open {
    display: none !important;
  }

  /* Stable v1.1.53 visual defaults. PHP overrides these variables from
   * Settings > Parkland Header Tools without touching the Kadence header surface. */
  body.pnh-mobile-nav-enabled {
    --pnh-style-text-initial: #334155;
    --pnh-style-text-hover: #334155;
    --pnh-style-text-active: #334155;
    --pnh-style-bg-initial: transparent;
    --pnh-style-bg-hover: transparent;
    --pnh-style-bg-active: #ffffff;

    --pnh-pill-border: #d9dee6;
    --pnh-pill-border-width: 1px;
    --pnh-pill-radius: 999px;
    --pnh-row-divider: rgba(98, 116, 142, 0.22);
    --pnh-row-divider-width: 1px;
    --pnh-pill-pad-x: 11px;
    --pnh-pill-pad-y: 6px;

    --pnh-search-text-initial: #ffffff;
    --pnh-search-text-hover: #ffffff;
    --pnh-search-bg-initial: #28ab00;
    --pnh-search-bg-hover: #28ab00;
    --pnh-search-border: #28ab00;
    --pnh-search-border-width: 1px;
    --pnh-search-radius: 999px;

    --pnh-accent: #28ab00;
    --pnh-muted: #62748e;
    --pnh-panel-text: #253348;
    --pnh-panel-surface: #ffffff;
  }

  .pnh-mobile-nav {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    z-index: 1000;
    font-family: inherit;
  }

  .pnh-mobile-nav[hidden] {
    display: none !important;
  }

  /* Parkland lives inside Kadence's native mobile row. No background is set on
   * this root or on any Kadence row/container. */
  .site-mobile-header-wrap .site-header-row > .pnh-mobile-nav--inside-kadence {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
    flex: 1 1 100%;
  }

  /* Utilities are moved into Kadence's native right-side section by JS. */
  .pnh-mobile-nav__utilities,
  .site-mobile-header-wrap .pnh-mobile-nav__utilities--inside-kadence {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
  }

  .site-mobile-header-wrap .pnh-mobile-nav__utilities--inside-kadence {
    margin-left: auto;
  }

  .site-mobile-header-wrap .pnh-kadence-trigger-hidden {
    display: none !important;
  }

  .pnh-mobile-nav__utility,
  .pnh-mobile-nav__utility:visited,
  .pnh-mobile-nav__utility:hover,
  .pnh-mobile-nav__utility:focus {
    position: relative;
    min-width: 34px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--pnh-style-text-initial) !important;
    text-decoration: none !important;
  }

  .pnh-mobile-nav__utility-icon {
    position: relative;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pnh-mobile-nav__utility-label {
    margin-top: 1px;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
  }

  .pnh-mobile-nav__cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--pnh-accent);
    color: #ffffff;
    font-size: 9px;
    line-height: 16px;
    font-weight: 700;
  }

  .pnh-mobile-nav__primary-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
    border-bottom: var(--pnh-row-divider-width) solid var(--pnh-row-divider) !important;
  }

  .pnh-mobile-nav__primary,
  .pnh-mobile-nav__secondary {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  .pnh-mobile-nav__primary {
    width: 100%;
    min-height: 40px;
  }

  .pnh-mobile-nav__primary::-webkit-scrollbar,
  .pnh-mobile-nav__secondary::-webkit-scrollbar {
    display: none;
  }

  .pnh-mobile-nav__primary-item,
  .pnh-mobile-nav__primary-item:visited {
    flex: 0 0 auto;
    appearance: none;
    border: var(--pnh-pill-border-width) solid transparent !important;
    border-radius: var(--pnh-pill-radius) !important;
    background: var(--pnh-style-bg-initial) !important;
    color: var(--pnh-style-text-initial) !important;
    padding: 7px 14px !important;
    margin: 3px 2px !important;
    box-shadow: none !important;
    font: inherit !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer;
  }

  .pnh-mobile-nav__primary-item:hover,
  .pnh-mobile-nav__primary-item:focus {
    background: var(--pnh-style-bg-hover) !important;
    color: var(--pnh-style-text-hover) !important;
  }

  .pnh-mobile-nav__primary-item.is-active,
  .pnh-mobile-nav__primary-item.is-active:hover,
  .pnh-mobile-nav__primary-item.is-active:focus,
  .pnh-mobile-nav__primary-item.is-active:active {
    border-color: var(--pnh-pill-border) !important;
    background: var(--pnh-style-bg-active) !important;
    color: var(--pnh-style-text-active) !important;
    padding-top: var(--pnh-pill-pad-y) !important;
    padding-bottom: var(--pnh-pill-pad-y) !important;
  }

  .pnh-mobile-nav__primary-item:focus-visible,
  .pnh-mobile-nav__secondary-item:focus-visible,
  .pnh-mobile-nav__close-section:focus-visible,
  .pnh-mobile-nav__search-submit:focus-visible {
    outline: 2px solid rgba(40, 171, 0, 0.28);
    outline-offset: 1px;
  }

  .pnh-mobile-nav__search-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .pnh-mobile-nav__search-inline-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
  }

  .pnh-mobile-nav__close-section {
    flex: 0 0 auto;
    align-self: center;
    appearance: none;
    min-width: 0 !important;
    height: 34px;
    margin: 3px 6px 3px 4px;
    padding: 0 12px !important;
    border: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: var(--pnh-pill-radius) !important;
    background: var(--pnh-style-bg-initial) !important;
    color: var(--pnh-style-text-initial) !important;
    box-shadow: none !important;
    font: inherit;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 4px;
  }

  .pnh-mobile-nav__close-section:not([hidden]) {
    display: flex;
  }

  .pnh-mobile-nav__close-section:hover,
  .pnh-mobile-nav__close-section:focus {
    background: var(--pnh-style-bg-hover) !important;
    color: var(--pnh-style-text-hover) !important;
  }

  .pnh-mobile-nav__close-section > span:first-child {
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
  }

  .pnh-mobile-nav__close-text {
    margin: 0 !important;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    text-transform: none;
  }

  .pnh-mobile-nav__secondary-shell {
    overflow: hidden;
    border-bottom: var(--pnh-row-divider-width) solid var(--pnh-row-divider) !important;
  }

  .pnh-mobile-nav__secondary-shell:not([hidden]) {
    display: block;
  }

  .pnh-mobile-nav__secondary {
    min-height: 56px;
    padding: 4px;
  }

  .pnh-mobile-nav__secondary-item,
  .pnh-mobile-nav__secondary-item:visited {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    appearance: none;
    border: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: var(--pnh-pill-radius) !important;
    background: var(--pnh-style-bg-initial) !important;
    color: var(--pnh-style-text-initial) !important;
    padding: var(--pnh-pill-pad-y) var(--pnh-pill-pad-x) !important;
    margin: 0 2px !important;
    box-shadow: none !important;
    font: inherit !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer;
  }

  .pnh-mobile-nav__secondary-item:hover,
  .pnh-mobile-nav__secondary-item:focus {
    background: var(--pnh-style-bg-hover) !important;
    color: var(--pnh-style-text-hover) !important;
  }

  .pnh-mobile-nav__secondary-item.is-active,
  .pnh-mobile-nav__secondary-item[aria-current="page"] {
    background: var(--pnh-style-bg-active) !important;
    color: var(--pnh-style-text-active) !important;
  }

  .pnh-mobile-nav__chevron {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
  }

  .pnh-mobile-nav__search-panel {
    padding: 8px 10px;
    border-bottom: var(--pnh-row-divider-width) solid var(--pnh-row-divider) !important;
  }

  .pnh-mobile-nav__search-panel:not([hidden]) {
    display: block;
  }

  .pnh-mobile-nav__search-form {
    display: flex;
    gap: 7px;
    width: 100%;
  }

  .pnh-mobile-nav__search-input {
    min-width: 0;
    flex: 1 1 auto;
    height: 40px;
    border: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: var(--pnh-panel-text) !important;
    padding: 0 15px;
    font: inherit;
    font-size: 15px;
  }

  .pnh-mobile-nav__search-submit {
    flex: 0 0 auto;
    height: 40px;
    border: var(--pnh-search-border-width) solid var(--pnh-search-border) !important;
    border-radius: var(--pnh-search-radius) !important;
    background: var(--pnh-search-bg-initial) !important;
    color: var(--pnh-search-text-initial) !important;
    padding: 0 17px;
    box-shadow: none !important;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
  }

  .pnh-mobile-nav__search-submit:hover,
  .pnh-mobile-nav__search-submit:focus {
    background: var(--pnh-search-bg-hover) !important;
    color: var(--pnh-search-text-hover) !important;
  }

  .pnh-mobile-nav__modal[hidden] {
    display: none !important;
  }

  .pnh-mobile-nav__modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: block;
    width: 100vw;
    height: 100dvh;
  }

  .pnh-mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, .70) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    cursor: default;
  }

  .pnh-mobile-nav__panel {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    top: auto;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    display: block;
    background: var(--pnh-panel-surface) !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 0 !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .24) !important;
    transform: none !important;
  }

  .pnh-mobile-nav__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
    padding: 0;
  }

  .pnh-mobile-nav__panel-title {
    color: var(--pnh-muted) !important;
    background: transparent !important;
    font: inherit !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    text-transform: none !important;
  }

  .pnh-mobile-nav__panel-close {
    flex: 0 0 auto;
    appearance: none;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: var(--pnh-style-text-initial) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 24px !important;
    line-height: 30px !important;
    font-weight: 400 !important;
    text-align: center !important;
    cursor: pointer;
  }

  .pnh-mobile-nav__panel-list {
    display: block;
    overflow-y: auto;
    max-height: calc(100dvh - 108px);
    border: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .pnh-mobile-nav__panel-link,
  .pnh-mobile-nav__panel-link:visited {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: var(--pnh-pill-border-width) solid var(--pnh-pill-border) !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: var(--pnh-panel-text) !important;
    box-shadow: none !important;
    font: inherit !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-style: normal !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: left !important;
    text-decoration: none !important;
  }

  .pnh-mobile-nav__panel-link:last-child {
    border-bottom: 0 !important;
  }

  .pnh-mobile-nav__panel-link:hover,
  .pnh-mobile-nav__panel-link:focus {
    background: rgba(40, 171, 0, 0.08) !important;
    color: var(--pnh-panel-text) !important;
  }

  body.pnh-mobile-nav-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
  }
}

@media (max-width: 430px) {
  .pnh-mobile-nav__utilities,
  .site-mobile-header-wrap .pnh-mobile-nav__utilities--inside-kadence {
    gap: 4px;
  }
}

@media (min-width: 600px) and (max-width: 1199px) {
  .pnh-mobile-nav__utilities,
  .site-mobile-header-wrap .pnh-mobile-nav__utilities--inside-kadence {
    gap: 10px;
  }

  .pnh-mobile-nav__utility {
    min-width: 38px;
  }

  .pnh-mobile-nav__utility-icon {
    height: 22px;
  }

  .pnh-mobile-nav__primary {
    min-height: 44px;
  }

  .pnh-mobile-nav__close-section {
    padding-left: 13px !important;
    padding-right: 13px !important;
  }

  .pnh-mobile-nav__panel {
    left: 20px;
    right: 20px;
    bottom: 20px;
    max-height: calc(100dvh - 40px);
    border-radius: 10px !important;
  }
}
