/* ==========================================================================
   PRO PEPTIDE — UNIFIED DROPDOWN SYSTEM (About + Cart)
   Shop dropdown lives in pp-shop-dropdown.css and is unchanged.
   These styles mirror Shop's visual DNA so all three read as a family.
   ========================================================================== */

/* --- Shared base ---------------------------------------------------------- */

.pp-dropdown {
    position: absolute;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 12px;
    z-index: 100;
    font-family: 'Montserrat', system-ui, sans-serif;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.pp-dropdown.is-open,
.pp-dropdown:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .pp-dropdown { transition: none; }
}

.pp-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    border-left: 1px solid #E5E7EB;
    transform: rotate(45deg);
    left: 50%;
    margin-left: -6px;
}

.pp-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #343434;
    transition: background 0.15s ease;
    position: relative;
    font-family: inherit;
    cursor: pointer;
}

.pp-dropdown__item:hover { background: #fafafa; }

.pp-dropdown__item:focus-visible {
    outline: 2px solid #1f9edb;
    outline-offset: -2px;
}

.pp-dropdown__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fafafa;
    color: #343434;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 700;
}

.pp-dropdown__icon svg { width: 16px; height: 16px; }

.pp-dropdown__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pp-dropdown__title {
    font-size: 13px;
    font-weight: 600;
    color: #343434;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.pp-dropdown__desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

.pp-dropdown__divider {
    height: 1px;
    background: #F3F4F6;
    margin: 6px 14px 8px;
    border: none;
}

.pp-dropdown__footer {
    border-top: 1px solid #F3F4F6;
    margin-top: 8px;
    padding-top: 8px;
}

/* --- About dropdown ------------------------------------------------------- */

/* Hide the parent theme's default About <a> + submenu — our pp-about-nav
   div replaces it inside the same <li>. */
.pp-about-nav-item > .header_nav_sub,
.pp-about-nav-item > .header_nav_arrow,
.pp-about-nav-item > a {
    display: none !important;
}

.pp-about-nav {
    position: relative;
    display: inline-block;
}

.pp-about-nav__trigger {
    position: relative;
    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;
}

/* Transparent bridge so mouseleave does not fire when the cursor crosses
   the visual gap between the trigger and the dropdown panel. */
.pp-about-nav__trigger::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.pp-about-nav__trigger:hover { background: #fafafa; }

.pp-about-nav__trigger:focus-visible {
    outline: 3px solid #1f9edb;
    outline-offset: 2px;
}

.pp-about-nav__trigger[aria-expanded="true"] {
    background: #E8F4FB;
    color: #0e6a99;
    font-weight: 600;
}

.pp-about-nav__chevron { transition: transform 0.2s ease; }

.pp-about-nav__trigger[aria-expanded="true"] .pp-about-nav__chevron {
    transform: rotate(180deg);
}

.pp-about-dropdown {
    min-width: 280px;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
}

.pp-about-dropdown.is-open,
.pp-about-dropdown:not([hidden]) {
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Mobile / tablet (<=1199px) — render About / "Q & A" as an inline accordion
   inside the parent theme's slide-in hamburger drawer. Same situation and
   reasoning as Shop (see pp-shop-dropdown.css): the About <li> was fully
   replaced, so the parent .header_nav_sub fallback does not exist, and the
   absolutely-positioned desktop panel renders clipped/off-canvas inside the
   300px drawer. 1199px matches the parent drawer breakpoint (not 768px).
   ========================================================================== */
@media (max-width: 1199px) {
    .header_nav .pp-about-nav {
        display: block;
        position: static;
    }
    .header_nav .pp-about-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-about-nav__trigger::after { display: none; }
    .header_nav .pp-about-nav__trigger[aria-expanded="true"] {
        color: var(--color-secondary);
        background: transparent;
    }
    .header_nav .pp-about-nav__chevron {
        margin-left: auto;
        flex: 0 0 auto;
    }
    .header_nav .pp-about-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-about-dropdown[hidden] { display: none; }
    .header_nav .pp-about-dropdown:not([hidden]) {
        display: block;
        transform: none !important;
    }
    .header_nav .pp-about-dropdown::before { display: none; }
    .header_nav .pp-about-dropdown__item,
    .header_nav .pp-about-dropdown .pp-dropdown__item {
        min-height: 50px;
        padding: 10px 30px;
        border-top: 1px solid var(--color-grey2);
        border-radius: 0;
    }
}

.pp-about-dropdown__item .pp-dropdown__icon {
    background: #E8F4FB;
    color: #0e6a99;
    border: 1.5px solid rgba(31, 158, 219, 0.3);
}

.pp-about-dropdown__item:hover .pp-dropdown__icon {
    background: #1f9edb;
    color: #FFFFFF;
    border-color: #0e6a99;
}

.pp-about-dropdown__item:hover .pp-dropdown__title { color: #0e6a99; }

/* --- Cart dropdown (overrides parent .header_cart_detail) ----------------- */

/* Transparent bridge so the parent theme's :hover state on .header_cart
   does not flicker off when the cursor crosses the gap to the panel. */
.header_cart .header_cart_label { position: relative; }
.header_cart .header_cart_label::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

/* --- Cart pill FILLED state (red resting status) -------------------------- *
 * Confirmed Option 4 (full red), 2026-05-31. The pill is always rendered by
 * the parent theme (naturally/woocommerce/init.php) with no filled-state class;
 * the ONLY DOM signal for "cart has items" is the presence of
 * .header_cart_mobile_label_text, which the parent renders only when
 * cart_contents_count >= 1 — in both the static markup AND the add-to-cart
 * fragment. So :has() keys on it and stays correct after AJAX. Empty cart keeps
 * the default neutral pill. Color only; radius/padding/size unchanged.
 * (Needs :has() — 2023+ browsers; older browsers gracefully keep the neutral
 * pill.) */
.header_cart .header_cart_label:has(.header_cart_mobile_label_text) {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}
/* Open state: revert to the parent theme's white pill so it still merges into
 * the white dropdown panel below (parent .is-active design). */
.header_cart.is-active .header_cart_label:has(.header_cart_mobile_label_text) {
    background: #ffffff;
    border-color: var(--color-grey2);
    color: var(--color-primary);
}

/* Parent theme already positions .header_cart_detail. We restyle it. */
.header_cart .header_cart_detail.pp-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 0;
    min-width: 380px;
    max-width: 420px;
    margin-top: 12px;
    font-family: 'Montserrat', system-ui, sans-serif;
    z-index: 100;
}

.pp-cart-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 28px;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    border-left: 1px solid #E5E7EB;
    transform: rotate(45deg);
}

.pp-cart-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
}

.pp-cart-dropdown__title {
    font-size: 14px;
    font-weight: 700;
    color: #343434;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-cart-dropdown__count {
    background: #E8F4FB;
    color: #0e6a99;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.pp-cart-dropdown__close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.pp-cart-dropdown__close:hover { background: #fafafa; color: #343434; }
.pp-cart-dropdown__close svg { width: 18px; height: 18px; }

.pp-cart-dropdown__items {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.pp-cart-dropdown__items::-webkit-scrollbar { width: 6px; }
.pp-cart-dropdown__items::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 9999px;
}

.pp-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.pp-cart-item:hover { background: #fafafa; }

.pp-cart-item__thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    overflow: hidden;
}

.pp-cart-item__thumb svg { width: 28px; height: 40px; }
.pp-cart-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9px;
}

.pp-cart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-cart-item__name {
    font-size: 13px;
    font-weight: 700;
    color: #343434;
    line-height: 1.3;
    margin: 0;
    text-decoration: none;
}

.pp-cart-item__name:hover { color: #0e6a99; }

.pp-cart-item__variant {
    font-size: 11px;
    color: #6B7280;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pp-cart-item__variant-pill {
    background: #E8F4FB;
    color: #0e6a99;
    border: 1px solid rgba(31, 158, 219, 0.3);
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
}

.pp-cart-item__qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.pp-cart-item__qty {
    display: flex;
    align-items: center;
    background: #fafafa;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    padding: 2px;
}

.pp-cart-item__qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #343434;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: inherit;
    padding: 0;
}

.pp-cart-item__qty-btn:hover:not(:disabled) {
    background: #FFFFFF;
    color: #0e6a99;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pp-cart-item__qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pp-cart-item__qty-btn[aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.pp-cart-item__qty-btn svg { width: 14px; height: 14px; }

.pp-cart-item__qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #343434;
    font-variant-numeric: tabular-nums;
}

.pp-cart-item__price {
    font-size: 14px;
    font-weight: 700;
    color: #343434;
    font-variant-numeric: tabular-nums;
}

.pp-cart-item__remove {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: -2px;
    margin-right: -2px;
    padding: 0;
}

.pp-cart-item__remove:hover { background: #FEF2F2; color: #ef4444; }
.pp-cart-item__remove svg { width: 14px; height: 14px; }

.pp-cart-dropdown__subtotal {
    padding: 14px 20px;
    border-top: 1px solid #F3F4F6;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-cart-dropdown__subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6B7280;
}

.pp-cart-dropdown__subtotal-row--total {
    font-size: 15px;
    font-weight: 700;
    color: #343434;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #E5E7EB;
}

.pp-cart-dropdown__subtotal-amount { font-variant-numeric: tabular-nums; color: #343434; font-weight: 600; }

/* Shipping is always free — single muted line with a small blue check
   (replaces the old "Calculated at checkout" / progress-bar treatment). */
.pp-cart-dropdown__freeship {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #6B7280;
}
.pp-cart-dropdown__freeship-icon {
    width: 13px;
    height: 13px;
    color: #1f9edb;
    flex: 0 0 auto;
}

.pp-cart-dropdown__ctas {
    padding: 14px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pp-cart-dropdown__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
}

.pp-cart-dropdown__btn--primary {
    background: #ef4444;
    color: #fafafa;
    box-shadow: none;
}

.pp-cart-dropdown__btn--primary:hover {
    background: #dc2626;
    color: #fafafa;
    box-shadow: none;
}

.pp-cart-dropdown__btn--secondary {
    background: transparent;
    color: #343434;
    border: 1.5px solid #E5E7EB;
}

.pp-cart-dropdown__btn--secondary:hover {
    background: #fafafa;
    color: #343434;
    border-color: #343434;
}

.pp-cart-dropdown__btn svg { width: 14px; height: 14px; }

.pp-cart-dropdown__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    /* Top padding gives the badges clear separation from the Checkout button
       so they read as a trust row, not crowding the CTA. */
    padding: 10px 20px 16px;
    font-size: 10px;
    color: #6b7280;
}

.pp-cart-dropdown__trust-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pp-cart-dropdown__trust-item svg {
    width: 12px;
    height: 12px;
    color: #1f9edb;
}

.pp-cart-dropdown__empty {
    padding: 32px 20px;
    text-align: center;
}

.pp-cart-dropdown__empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fafafa;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.pp-cart-dropdown__empty-icon svg { width: 28px; height: 28px; }

.pp-cart-dropdown__empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #343434;
    margin: 0 0 6px;
}

.pp-cart-dropdown__empty-text {
    font-size: 12px;
    color: #6B7280;
    margin: 0 0 16px;
    line-height: 1.5;
}

.pp-cart-dropdown__empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: #1f9edb;
    color: #fafafa;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.pp-cart-dropdown__empty-cta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pp-cart-dropdown__empty-cta:hover {
    background: #0e6a99;
    color: #fafafa;
}

/* --- v2: open ONLY via .is-active (no hover involvement, anywhere).
       Parent theme uses .header_cart:hover .header_cart_detail { display:block }
       to show the drawer on hover, which creates two problems:
         (a) hover gap between cart icon and drawer → drawer hides mid-click
         (b) the previous :hover-hide override caused a state-bounce that
             flickered "open / close / open" rapidly under the cursor.
       Cleaner: hide the drawer unconditionally (overriding parent's hover-show
       via higher specificity + !important) and ONLY show it when our JS adds
       .is-active (click-to-toggle). No CSS :hover at all. --------------------- */
.header_cart .header_cart_detail.pp-cart-dropdown { display: none !important; }
.header_cart.is-active .header_cart_detail.pp-cart-dropdown { display: flex !important; }

/* --- v2: flex column so the footer can pin on mobile (and to host the new
       discount progress bar at the top of the scroll body) ----------------- */

.pp-cart-dropdown { display: flex; flex-direction: column; }
.pp-cart-dropdown__header { flex: 0 0 auto; }
.pp-cart-dropdown__body {
    flex: 1 1 auto;
    overflow-y: auto;
    /* desktop cap so the popover doesn't grow unbounded; mobile resets this */
    max-height: 420px;
    min-height: 0;
    /* Hide scrollbar visually (Firefox + IE/Edge legacy). Scroll still works. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
/* WebKit/Blink (Chrome, Safari, new Edge) — fully suppress the track + thumb. */
.pp-cart-dropdown__body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
.pp-cart-dropdown__footer { flex: 0 0 auto; }
/* The legacy __items max-height is replaced by the body's. */
.pp-cart-dropdown__items { max-height: none; padding: 8px; }

/* --- Discount progress bar ------------------------------------------------ */

.pp-cart-dropdown__discount {
    background: #EEF6FB;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #F3F4F6;
    /* Clearance so the progress bar + markers never crowd / overlap the first
       item row below. */
    margin-bottom: 8px;
}
.pp-cart-dropdown__discount-msg {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.4;
    color: #343434;
    text-align: center;
}
.pp-cart-dropdown__discount-emph {
    color: #1f9edb;
    font-weight: 700;
}
.pp-cart-dropdown__discount-msg--max .pp-cart-dropdown__discount-emph {
    display: inline-block;
    margin-left: 4px;
}
.pp-cart-dropdown__discount-track {
    position: relative;
    height: 8px;
    background: #dbeafe;
    border-radius: 9999px;
    overflow: hidden;
}
.pp-cart-dropdown__discount-fill {
    height: 100%;
    background: #1f9edb;
    border-radius: 9999px;
    transition: width 0.25s ease;
}
.pp-cart-dropdown__discount-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #6b7280;
}
.pp-cart-dropdown__discount-markers .is-reached { color: #1f9edb; }

/* --- Bulk discount line in the footer subtotal block --------------------- */

.pp-cart-dropdown__subtotal-row--discount {
    color: #0e6a99;
}
.pp-cart-dropdown__subtotal-row--discount .pp-cart-dropdown__subtotal-amount {
    color: #0e6a99;
}

/* --- Mobile drawer for cart (≤768px = brief spec) ------------------------- */

@media (max-width: 768px) {
    /* Dimmed backdrop behind the open drawer (parent toggles .is-active). */
    .header_cart.is-active::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 99;
        animation: pp-cart-overlay-fade 0.18s ease;
    }
    @keyframes pp-cart-overlay-fade { from { opacity: 0; } to { opacity: 1; } }

    .header_cart .header_cart_detail.pp-cart-dropdown {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 92vw;
        max-width: 420px;
        min-width: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin-top: 0;
        z-index: 100;
    }

    .pp-cart-dropdown::before { display: none; }

    /* Body fills available space between fixed header + pinned footer. */
    .pp-cart-dropdown__body { max-height: none; }

    /* Bigger tap zones on mobile (WCAG 2.5.5 ≥44px). */
    .pp-cart-item__qty-btn { width: 36px; height: 44px; }
    .pp-cart-item__remove { width: 44px; height: 44px; }
    .pp-cart-dropdown__close { width: 44px; height: 44px; }

    /* Large, full-width Checkout that always reads as the primary action. */
    .pp-cart-dropdown__btn--primary {
        min-height: 52px;
        font-size: 15px;
        padding: 0 18px;
    }
    /* "View full cart" demoted to a small underlined text link on mobile. */
    .pp-cart-dropdown__btn--secondary {
        background: transparent;
        border: none;
        min-height: 0;
        height: auto;
        padding: 6px 0 2px;
        font-size: 12px;
        font-weight: 500;
        text-decoration: underline;
        color: #6b7280;
        box-shadow: none;
    }
    .pp-cart-dropdown__btn--secondary:hover { background: transparent; color: #343434; }

    /* Slight tightening so the pinned footer doesn't eat too much real estate. */
    .pp-cart-dropdown__ctas { padding: 12px 16px 14px; gap: 4px; }
    .pp-cart-dropdown__trust { display: none; }
}
