/* ==========================================================================
   Pro Peptide — Shop Dropdown Nav (v2)
   Replaces the parent theme's default Shop submenu styling.
   ========================================================================== */

/* Hide the parent theme's default sub-menu only on the Shop item — our
   replacement is a child of `.pp-shop-nav-item` and supplies its own panel. */
.pp-shop-nav-item > .header_nav_sub,
.pp-shop-nav-item > .header_nav_arrow,
.pp-shop-nav-item > a {
    display: none !important;
}

.pp-shop-nav {
    position: relative;
    display: inline-block;
}

/* --- Trigger button --- */
.pp-shop-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #343434;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1;
}
.pp-shop-nav__trigger:hover {
    background: #fafafa;
}
.pp-shop-nav__trigger:focus-visible {
    outline: 3px solid #1f9edb;
    outline-offset: 2px;
}
.pp-shop-nav__trigger[aria-expanded="true"] {
    background: #E8F4FB;
    color: #0e6a99;
    font-weight: 600;
}
.pp-shop-nav__chevron {
    transition: transform 0.2s ease;
}
.pp-shop-nav__trigger[aria-expanded="true"] .pp-shop-nav__chevron {
    transform: rotate(180deg);
}

/* --- Dropdown panel --- */
.pp-shop-nav__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 380px;
    padding: 12px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}
/* Invisible bridge across the 8px gap between the trigger and the panel.
   Without it the cursor enters dead-air on the way down, mouseleave fires
   on the wrapper, and the dropdown closes before the cursor arrives. */
.pp-shop-nav__dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}
.pp-shop-nav__dropdown:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.pp-shop-nav__dropdown[hidden] {
    /* Keep the panel laid out so the transition animates rather than snapping. */
    display: block;
    visibility: hidden;
}
.pp-shop-nav__dropdown:not([hidden]) {
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .pp-shop-nav__dropdown,
    .pp-shop-nav__chevron,
    .pp-shop-nav__arrow,
    .pp-shop-nav__icon--all {
        transition: none !important;
    }
}

/* --- Pointer triangle --- */
.pp-shop-nav__pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    border-left: 1px solid #E5E7EB;
}

/* --- Items (shared) --- */
.pp-shop-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    color: #343434;
}
.pp-shop-nav__item:focus-visible {
    outline: 3px solid #1f9edb;
    outline-offset: -3px;
}

/* --- All Products (master) --- */
.pp-shop-nav__item--all {
    padding: 12px 16px;
    margin-bottom: 6px;
}
.pp-shop-nav__item--all:hover {
    background: #fafafa;
}
.pp-shop-nav__icon--all {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fafafa;
    color: #343434;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.pp-shop-nav__item--all:hover .pp-shop-nav__icon--all {
    background: #343434;
    color: #fafafa;
}
.pp-shop-nav__item--all .pp-shop-nav__title {
    font-size: 14px;
    font-weight: 700;
    color: #343434;
}
.pp-shop-nav__item--all .pp-shop-nav__desc {
    color: #6B7280;
}

/* --- Divider --- */
.pp-shop-nav__divider {
    height: 1px;
    background: #F3F4F6;
    margin: 6px 16px 8px;
    border: none;
}

/* --- Category items --- */
.pp-shop-nav__item--cat:hover {
    background: var(--pp-cat-bg);
}
.pp-shop-nav__item--cat:hover .pp-shop-nav__title,
.pp-shop-nav__item--cat:hover .pp-shop-nav__count {
    color: var(--pp-cat-color);
}

.pp-shop-nav__icon--cat {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--pp-cat-bg);
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
}

/* --- Text block --- */
.pp-shop-nav__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.pp-shop-nav__title {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #343434;
    line-height: 1.3;
    transition: color 0.15s ease;
}
.pp-shop-nav__desc {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

/* --- Right side (count + arrow) --- */
.pp-shop-nav__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pp-shop-nav__count {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.15s ease;
}
.pp-shop-nav__arrow {
    color: var(--pp-cat-color, #9CA3AF);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    display: flex;
}
.pp-shop-nav__arrow--all {
    color: #6b7280;
}
.pp-shop-nav__item:hover .pp-shop-nav__arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- Footer CTA --- */
.pp-shop-nav__footer {
    border-top: 1px solid #F3F4F6;
    margin-top: 8px;
    padding-top: 8px;
}
.pp-shop-nav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #E8F4FB;
    color: #0e6a99;
    text-decoration: none;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s ease;
}
.pp-shop-nav__cta:hover {
    background: #D4EAF6;
    color: #0e6a99;
}
.pp-shop-nav__cta:focus-visible {
    outline: 3px solid #1f9edb;
    outline-offset: 2px;
}

/* ==========================================================================
   Mobile / tablet (<=1199px) — render Shop as an inline accordion inside the
   parent theme's slide-in hamburger drawer.

   The parent drawer is active at max-width:1199px (naturally/css/style.css +
   the toggle JS in naturally/js/scripts.js). The whole Shop <li> was replaced
   by this custom component, so the parent's .header_nav_sub fallback does NOT
   exist — the old "hide panel, let the parent drawer take over" approach left
   Shop as a blank, link-less <li> on mobile. Instead we keep the custom panel
   and make it an in-flow accordion the existing trigger JS already toggles.

   Breakpoint is 1199px (not the project's 768px standard) to match the parent
   drawer; the parent theme hard-codes 1199px and cannot be edited. At 768px,
   769-1199px would still show the desktop overlay inside the narrow drawer.
   ========================================================================== */
@media (max-width: 1199px) {
    .header_nav .pp-shop-nav {
        display: block;
        position: static;
    }
    /* Trigger becomes a full-width 50px row, matching .header_nav li > a. */
    .header_nav .pp-shop-nav__trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 50px;
        padding: 0 30px;
        border-radius: 0;
        background: transparent;
        color: var(--color-primary);
        font-size: inherit;
        font-weight: inherit;
    }
    .header_nav .pp-shop-nav__trigger[aria-expanded="true"] {
        color: var(--color-secondary);
        background: transparent;
    }
    .header_nav .pp-shop-nav__chevron {
        margin-left: auto;
        flex: 0 0 auto;
    }
    /* Panel: in-flow accordion, full width, no desktop overlay chrome. */
    .header_nav .pp-shop-nav__dropdown {
        position: static !important;
        width: 100%;
        min-width: 0 !important;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none !important;
        background: var(--color-grey1);
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .header_nav .pp-shop-nav__dropdown[hidden] {
        display: none;
    }
    .header_nav .pp-shop-nav__dropdown:not([hidden]) {
        display: block;
        visibility: visible;
    }
    .header_nav .pp-shop-nav__dropdown::before,
    .header_nav .pp-shop-nav__pointer {
        display: none;
    }
    /* Each row at least 50px tall, full-bleed inside the 300px drawer. */
    .header_nav .pp-shop-nav__item {
        min-height: 50px;
        padding: 10px 30px;
        border-top: 1px solid var(--color-grey2);
        border-radius: 0;
    }
    .header_nav .pp-shop-nav__footer {
        margin: 0;
        padding: 0;
        border-top: 1px solid var(--color-grey2);
    }
    .header_nav .pp-shop-nav__cta {
        padding: 14px 30px;
    }
}

/* ==========================================================================
   Top-nav consistency — match other menu items to the Shop pill style.
   DESKTOP ONLY (min-width:1200px). Below that the parent slide-in drawer is
   active and its own .header_nav li > a styling (50px rows) must win, or tap
   targets collapse to short inline pills. This block was previously unscoped,
   which was a secondary cause of the broken-looking mobile menu.
   ========================================================================== */
@media (min-width: 1200px) {
.naturally-main-header .header_bottom .header_nav > ul > li:not(.pp-shop-nav-item) > a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    font-family: 'Montserrat', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #343434 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}
.naturally-main-header .header_bottom .header_nav > ul > li:not(.pp-shop-nav-item) > a:hover,
.naturally-main-header .header_bottom .header_nav > ul > li:not(.pp-shop-nav-item) > a:focus {
    background: #fafafa !important;
    color: #343434 !important;
}
.naturally-main-header .header_bottom .header_nav > ul > li.current-menu-item:not(.pp-shop-nav-item) > a,
.naturally-main-header .header_bottom .header_nav > ul > li.current-menu-ancestor:not(.pp-shop-nav-item) > a {
    background: #E8F4FB !important;
    color: #0e6a99 !important;
    font-weight: 600 !important;
}
/* Kill the parent theme's underline-on-active pseudo-element since we use a pill bg now. */
.naturally-main-header .header_bottom .header_nav > ul > li:not(.pp-shop-nav-item).current-menu-item > a::after,
.naturally-main-header .header_bottom .header_nav > ul > li:not(.pp-shop-nav-item).current-menu-ancestor > a::after {
    display: none !important;
}
} /* end @media (min-width: 1200px) — desktop-only top-nav consistency */
