/* ─────────────────────────────────────────────────────────────────────
   peptides_builder shared CSS

   Used by:
     - lifespanning_peptides_selection_v7.php  (public anonymous flow)
     - FrontEndCustomers_Page_OurCatalog.php   (v2 customer portal)
     - FrontEndCustomers_Page_AutoPilot.php    (v2 customer portal)

   Page-level chrome (header, hero, mode-switcher, ao-modal) stays
   inline in lifespanning_peptides_selection_v7.php — only used there.
   ───────────────────────────────────────────────────────────────────── */

/* ── Base box-sizing reset (component sizing depends on this) ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Design tokens shared by the components ── */
:root {
    --crimson: #a42145;
    --ink: #1a1a18;
    --ink-soft: #3d3d3a;
    --muted: #6b6b67;
    --border: #e4e2dc;
    --border-soft: #efefec;
    --surface: #fafaf8;
    --white: #ffffff;
    --gold: #c9a84c;
    --sub-green: #2d7a4f;
    --sub-green-bg: #edf7f2;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}


/* ── HOW IT WORKS (auto-pilot only) ──
   Compact intro block shown above the builder. Three numbered cards explain
   the protocol flow, with a single-line trust strip beneath. The whole block
   sits on a soft cream band that visually groups it as a distinct section. */
.howit-band {
    background: #faf8f5;
    border-radius: 10px;
    padding: 28px 24px 24px;
    margin-bottom: 24px;
}
.howit-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: 24px;
    color: var(--ink);
    margin-bottom: 18px;
    line-height: 1.2;
}
.howit-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.howit-card {
    background: var(--white);
    border-radius: 8px;
    padding: 14px 18px;
}
.howit-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.howit-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--crimson);
    letter-spacing: 0.05em;
}
.howit-step-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.25;
}
.howit-step-sub {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}
.howit-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    font-size: 11px;
    color: var(--ink-soft);
    font-weight: 500;
}
.howit-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.howit-trust-item svg { color: var(--crimson); flex-shrink: 0; }
.howit-trust-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
}

/* ── VIEW VISIBILITY ── */
#viewIndividual { display: block; }
#viewAutopilot { display: none; }
body.view-autopilot #viewIndividual { display: none; }
body.view-autopilot #viewAutopilot { display: block; }


/* ── PROGRAM BUILDER ── */
.pb-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 28px;
}
.pb-collapsed {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.pb-collapsed:hover { border-color: var(--ink); }
.pb-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pb-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pb-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.2;
}
.pb-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}
.pb-collapsed-body { flex: 1; min-width: 0; }
.pb-cta {
    flex-shrink: 0;
    background: var(--ink);
    color: var(--white);
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.pb-expanded { display: none; }
.pb-card.is-expanded .pb-collapsed { display: none; }
.pb-card.is-expanded .pb-expanded { display: block; }
.pb-header {
    padding: 18px 22px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.pb-header-body { flex: 1; min-width: 0; }
.pb-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.pb-close:hover { border-color: var(--ink-soft); color: var(--ink); }
.pb-body {
    display: grid;
    grid-template-columns: 320px 1fr;
}
.pb-controls {
    padding: 22px 24px;
    border-right: 1px solid var(--border-soft);
}
.pb-schedule-col {
    padding: 22px 24px;
}
.pb-step { margin-bottom: 22px; }
.pb-step:last-child { margin-bottom: 0; }
.pb-step-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.pb-step-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 13px;
    line-height: 1.2;
}
.pb-step-title .pb-step-num {
    color: var(--crimson);
    margin-right: 6px;
}
.pb-step-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.4;
}
.pb-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pb-pill {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.pb-pill:hover { border-color: #bebbb2; }
.pb-pill.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}
.pb-tc-group { display: flex; gap: 6px; }
.pb-tc-btn {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pb-tc-btn:hover:not(.active) { border-color: #bebbb2; }
.pb-tc-btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}
/* Disabled when chosen value exceeds goal count — visible but not interactive,
   so users can see the full range and understand they need more goals first. */
.pb-tc-btn.is-disabled,
.pb-tc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--white);
    color: var(--ink);
}
.pb-tc-btn.is-disabled:hover,
.pb-tc-btn:disabled:hover { border-color: var(--border); }
.pb-prio {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.pb-prio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: var(--white);
}
.pb-prio-row.odd { background: var(--border-soft); }
.pb-prio-row + .pb-prio-row { border-top: 1px solid var(--border-soft); }
.pb-prio-handle { color: #c9c7bd; flex-shrink: 0; }
.pb-prio-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--crimson);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pb-prio-body { flex: 1; min-width: 0; }
.pb-prio-name { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.pb-prio-therapy { font-size: 10px; color: #8a8a82; }
.pb-mv {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 4px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pb-mv:disabled { opacity: 0.3; cursor: not-allowed; }
.pb-coverage {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.pb-coverage-num {
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
}
.pb-gantt-card {
    background: #fbfbf9;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px 16px;
}
.pb-gantt {
    display: grid;
    gap: 6px;
}
.pb-gantt-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-top: 10px;
}
.pb-legend-group { display: flex; gap: 10px; }
.pb-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.pb-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 30px 0;
    text-align: center;
    background: #fbfbf9;
    border: 1px dashed var(--border);
    border-radius: 10px;
}
.pb-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.pb-schedule-toggle {
    font-family: inherit;
    font-size: 11px;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
}


/* ── AUTO-PILOT PRICING BLOCK ── */
.ap-price-block {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px 16px;
}
.ap-toggle-row {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    width: calc(50% - 4px);
    vertical-align: top;
}
.ap-toggle-row:first-of-type { margin-right: 8px; }
.ap-toggle-row:last-of-type { margin-bottom: 12px; }
/* When the Plan row is hidden (3-month variant has no subscribe option),
   the Supply row takes the full width on its own. */
.ap-price-block:has(#apPlanRow[style*="display: none"]) .ap-toggle-row:first-of-type,
.ap-price-block:has(#apPlanRow[style*="display:none"]) .ap-toggle-row:first-of-type {
    width: 100%;
    margin-right: 0;
}
.ap-toggle-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
}
.ap-toggle-group {
    display: inline-flex;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.ap-toggle-btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ap-toggle-btn:hover:not(.active) { color: var(--ink); }
.ap-toggle-btn.active {
    background: var(--ink);
    color: var(--white);
}
.ap-price-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 6px 0 10px;
}
.ap-price-display {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.ap-price-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
}
.ap-price-amount {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
}
.ap-price-period {
    font-size: 12px;
    color: var(--muted);
    margin-left: 2px;
}
.ap-price-savings {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--sub-green);
    background: var(--sub-green-bg);
    border-radius: 6px;
    padding: 6px 10px;
    text-align: center;
}
.ap-checkout-btn {
    width: 100%;
    margin-top: 14px;
    padding: 14px 20px;
    background: var(--crimson);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.ap-checkout-btn:hover:not(:disabled) {
    background: #8a1c3a;
}
.ap-checkout-btn:disabled {
    background: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}
.ap-checkout-note {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
    margin-top: 10px;
}


/* ── LAYOUT ── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}
.content-grid > aside {
    align-self: start;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
}


/* ── SECTION LABEL ── */
.section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}


/* ── PRODUCT CARD ── */
.product-list { display: flex; flex-direction: column; gap: 12px; }

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: default;
}
.product-card.selected {
    border-color: var(--ink);
    box-shadow: 0 0 0 1px var(--ink);
}
.product-card.unselected {
    background: #fdfdfb;
}
.product-card.hidden { display: none; }

.product-img,
.product-img-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface);
}
.product-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--muted);
}

.product-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.card-info {
    flex: 1;
    min-width: 0;
}
.card-top-mobile-only { display: none; }

.card-columns {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.card-columns .card-info {
    flex: 1;
    min-width: 0;
}
.product-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 6px;
}

.card-name-desktop { display: block; }

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.badge-top {
    background: var(--ink);
    color: var(--white);
    font-size: 10px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 11px;
    letter-spacing: 0.3px;
}
.badge-cat {
    background: var(--surface);
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 11px;
}

.usp-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.usp-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.45;
}
.usp-check {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--sub-green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}


/* ── PRICE BLOCK ── */
.price-block {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    min-width: 200px;
}
.price-supply-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    text-align: right;
}

/* ── PER-CARD SUPPLY TOGGLE (replaces static label) ── */
.card-supply-toggle {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 2px;
    text-transform: none;
    letter-spacing: 0;
    align-self: flex-end;
    margin-top: auto;
    margin-bottom: 4px;
    margin-right: 142px;
}
.cst-btn {
    background: transparent;
    border: 0;
    border-radius: 5px;
    padding: 4px 9px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}
.cst-btn:hover:not(.active) { color: var(--ink); }
.cst-btn.active {
    background: var(--ink);
    color: var(--white);
}

.price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.price-cols {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}
.price-oneshot,
.price-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.price-oneshot-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.3px;
}
.price-oneshot-amount {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
}
.price-sub {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
}
.price-sub::before {
    content: 'Subscribe';
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.3px;
    width: 100%;
    order: 0;
}
.price-sub-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--sub-green);
    background: none;
    padding: 0;
    border-radius: 0;
    letter-spacing: 0.2px;
    text-transform: none;
    align-self: auto;
    order: 2;
}
.price-sub-amount {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--sub-green);
    line-height: 1;
    order: 1;
}


/* ── ADD / REMOVE BUTTON ── */
.card-btn {
    width: 130px;
    padding: 12px 0;
    border-radius: 8px;
    border: 1px solid var(--ink);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.card-btn .card-btn-add { display: inline; }
.card-btn .card-btn-remove { display: none; }
.product-card.selected .card-btn {
    background: var(--ink);
    color: var(--white);
}
.product-card.selected .card-btn .card-btn-add { display: none; }
.product-card.selected .card-btn .card-btn-remove { display: inline; }
.product-card.selected .card-btn:hover {
    background: var(--crimson);
    border-color: var(--crimson);
}


/* ── SECTION DIVIDER ── */
.section-divider {
    margin: 24px 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}


/* ── STICKY SUMMARY ── */
.summary-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
}
.summary-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 16px;
}
.summary-count {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 500;
}
.summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    line-height: 1.3;
}
.summary-item-name {
    flex: 1;
    min-width: 0;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.summary-item-price {
    color: var(--ink);
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
.summary-item-price.sub { color: var(--sub-green); }
.summary-item-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.summary-item-remove:hover {
    background: #fdecea;
    color: var(--crimson);
}
.summary-empty {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
    text-align: center;
}
.summary-divider {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 14px 0;
}
.summary-total-label {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 500;
}
.summary-total-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}
.summary-total-amount {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
}
.summary-total-period {
    font-size: 13px;
    color: var(--muted);
}
.summary-sub-savings {
    margin-top: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--sub-green);
    background: var(--sub-green-bg);
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
}
.summary-sub-savings.hidden { display: none; }
.summary-sub-savings.teaser { cursor: pointer; }
.summary-note {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
    margin-top: 10px;
}
.cancel-anytime {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}
.summary-expert-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.summary-expert-btn {
    /* Mirrors .sticky-checkout-btn's brand language (crimson + DM Sans) but is
       a quieter ghost variant — meant for the "talk to a specialist" /
       "chat with us" footer in the cart. */
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 11px;
    color: var(--ink-soft);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: border-color 0.15s, color 0.15s;
}
.summary-expert-btn:hover {
    border-color: var(--crimson);
    color: var(--crimson);
}
.summary-expert-btn svg { color: inherit; }

.btn-primary {
    width: 100%;
    padding: 13px 20px;
    background: var(--ink);
    color: var(--white);
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) {
    background: var(--crimson);
}
.btn-primary:disabled {
    background: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}


/* ── TOGGLE ROWS (supply/payment in cart sidebar) ── */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.toggle-row {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.toggle-btn {
    flex: 1;
    background: transparent;
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
}
.toggle-btn:hover:not(.active) { color: var(--ink); }
.toggle-btn.active {
    background: var(--ink);
    color: var(--white);
}
.toggle-btn small {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 400;
}


/* ── FILTER ROW (catalog category chips) ── */
.formulation-disclaimer {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    margin: 4px 0 16px;
    max-width: 640px;
}

/* ── FILTER DROPDOWNS (replaces pill row) ── */
#filterDropdownRow {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.fdr-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fdr-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
}
.fdr-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.fdr-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-width: 180px;
}
.fdr-select:hover  { border-color: #bebbb2; }
.fdr-select:focus  { border-color: var(--ink); }
.fdr-chevron {
    position: absolute;
    right: 10px;
    width: 12px;
    height: 12px;
    color: var(--muted);
    pointer-events: none;
}

/* ── BUNDLE CARD TINT ── */
.product-card.is-bundle {
    background: #f5f3ee;
}

/* ── BUNDLE / TYPE TOGGLE (inside filter dropdown row) ── */
.fdr-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.fdr-toggle-btn {
    background: transparent;
    border: 0;
    border-radius: 6px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.2;
}
.fdr-toggle-btn:hover:not(.active) { color: var(--ink); }
.fdr-toggle-btn.active {
    background: var(--ink);
    color: var(--white);
}

.fdr-reset {
    align-self: flex-end;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.fdr-reset:hover { color: var(--crimson); }

/* Legacy pill row — hidden but kept in DOM for label lookups */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}
.filter-chip {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.filter-chip:hover { border-color: #bebbb2; }
.filter-chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

/* ── FILTER VISIBILITY ──
   When a filter is active (data-filter on the list is non-empty), hide any
   card that doesn't have the matching attribute. The JS sets data-filter-match
   on cards whose data-cats includes the active filter; cards without it
   stay hidden until the filter is cleared.

   When no filter is active (data-filter=""), all cards are shown — the
   `:not([data-filter=""])` guard means the hide rule only kicks in for
   active filters. */
.product-list:not([data-filter=""]) .product-card:not([data-filter-match]),
.product-list:not([data-peptide-filter=""]) .product-card:not([data-filter-match]),
.product-list:not([data-bundle-filter=""]) .product-card:not([data-filter-match]) {
    display: none;
}

/* Highlight the matching benefit badge inside each visible card so the user
   sees why the card matched the filter. */
.badge-cat.is-match {
    background: var(--ink);
    color: var(--white);
}


/* ── SPINNER (used in checkout button loading state) ── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── MOBILE STICKY BAR (hidden on desktop) ── */
.mobile-sticky {
    display: none;
}


/* ── Partner branding ── */
.partner-header-logo {
    height: 32px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.partner-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.partner-provider-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.partner-provider-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.partner-provider-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.partner-provider-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.partner-provider-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
}
.partner-provider-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}
.partner-provider-company {
    font-size: 12px;
    color: var(--muted);
}


/* ──────────────────────────────────────────────────────────────────
   Mobile rules (≤800px) — sticky cart bar appears, layout collapses
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 800px) {

    /* Mobile sticky cart bar — appears at the bottom of the viewport */
    .mobile-sticky {
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a1a18;
        color: #fff;
        padding: 10px 16px max(14px, env(safe-area-inset-bottom));
        z-index: 9999;
        box-shadow: 0 -1px 0 rgba(255,255,255,0.08), 0 -8px 24px rgba(0,0,0,0.3);
        transition: transform 0.3s ease;
    }
    .sticky-toggles {
        display: flex;
        gap: 8px;
    }
    .sticky-toggle-group {
        display: flex;
        flex-direction: column;
        gap: 3px;
        flex: 1;
    }
    .sticky-toggle-label {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: rgba(255,255,255,0.4);
    }
    .sticky-toggle-row {
        flex: 1;
        display: flex;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 6px;
        overflow: hidden;
    }
    .sticky-toggle-btn {
        flex: 1;
        padding: 6px 4px;
        font-size: 11px;
        font-weight: 500;
        font-family: 'DM Sans', sans-serif;
        border: none;
        background: transparent;
        color: rgba(255,255,255,0.45);
        cursor: pointer;
        transition: all 0.15s;
        white-space: nowrap;
    }
    .sticky-toggle-btn + .sticky-toggle-btn {
        border-left: 1px solid rgba(255,255,255,0.2);
    }
    .sticky-toggle-btn.active {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }
    .sticky-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .sticky-meta {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }
    .sticky-count {
        font-size: 11px;
        color: rgba(255,255,255,0.5);
    }
    .sticky-total {
        font-family: 'Cormorant Garamond', serif;
        font-size: 24px;
        font-weight: 400;
        line-height: 1;
        color: #fff;
    }
    .sticky-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
        padding-right: 56px;
    }
    .sticky-view-btn {
        padding: 9px 14px;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.3);
        border-radius: 6px;
        color: rgba(255,255,255,0.8);
        font-size: 12px;
        font-weight: 500;
        font-family: 'DM Sans', sans-serif;
        cursor: pointer;
    }
    .sticky-checkout-btn {
        padding: 9px 16px;
        background: var(--crimson);
        border: none;
        border-radius: 6px;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        font-family: 'DM Sans', sans-serif;
        cursor: pointer;
    }
    .sticky-checkout-btn:disabled {
        background: rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.4);
        cursor: not-allowed;
    }

    /* Layout: single column, summary moves below product list */
    .content-grid { grid-template-columns: 1fr; }
    .content-grid > * { min-width: 0; }   /* let grid columns shrink to viewport — fixes card overflow that pushed the price row off-screen */
    .summary-panel { position: static; }

    /* Mobile card: image+name on top row, rest full width */
    .card-img-desktop { display: none !important; }
    .card-name-desktop { display: none; }
    .card-top-mobile-only { display: flex; }

    /* Card: image stays left, product-body becomes a column below */
    .product-card {
        align-items: flex-start;
        padding: 14px;
        gap: 10px;
    }
    .product-img, .product-img-placeholder {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
    }

    /* product-body: switch from row to column */
    .product-body { 
        flex-direction: column;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }

    /* card-columns: stack selling points above price/buttons on mobile */
    .card-columns {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* card-info takes full width */
    .card-info { width: 100%; }
    .card-info .card-badges { display: none; }

    /* price-block: full width, left-aligned */
    .price-block {
        width: 100%;
        align-items: stretch;
    }
    .price-supply-label { font-size: 12px; }
    .price-cols { width: 100%; }
    .price-oneshot, .price-sub { width: auto; flex: 1; }

    /* price-row: stays as flex row on mobile too */
    .price-row {
        flex-wrap: nowrap;
        align-items: center;
    }

    /* button: fixed width */
    .card-btn {
        width: 110px;
        padding: 11px 0;
        font-size: 13px;
    }

    /* summary */
    .summary-title { font-size: 26px; }
    .summary-total-amount { font-size: 26px; }
    .sub-toggle-btn { font-size: 11px; }

    /* Program builder: stack, full-width CTA, tighter paddings */
    .program-builder-wrap { margin-bottom: 24px; }
    .pb-collapsed {
        flex-wrap: wrap;
        padding: 18px 16px;
        gap: 12px;
    }
    .pb-collapsed .pb-icon { order: 0; }
    .pb-collapsed .pb-collapsed-body { order: 1; flex: 1 1 calc(100% - 60px); }
    .pb-collapsed .pb-cta {
        order: 2;
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    .pb-title { font-size: 19px; }
    .pb-header { padding: 14px 14px 12px; gap: 10px; }
    .pb-header .pb-title { font-size: 18px; }
    .pb-body { grid-template-columns: 1fr; }
    .pb-controls { padding: 16px 14px; border-right: none; }
    .pb-schedule-col {
        padding: 16px 14px;
        border-top: 1px solid var(--border-soft);
    }
    .pb-step { margin-bottom: 18px; }
    .pb-step-title { font-size: 21px; margin-bottom: 11px; }
    .pb-pill { padding: 7px 11px; font-size: 11px; }
    .pb-tc-btn { flex: 1; height: 38px; font-size: 14px; }
    .pb-schedule-toggle { display: inline-flex; }

    /* How-it-works block: stack steps, drop separators, tighten padding */
    .howit-band {
        padding: 22px 16px 20px;
        margin-bottom: 20px;
    }
    .howit-title { font-size: 21px; margin-bottom: 16px; }
    .howit-steps {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }
    .howit-card { padding: 14px 16px; }
    .howit-trust { gap: 6px 14px; }
    .howit-trust-sep { display: none; }

    /* Add bottom padding so sticky bar doesn't cover last card */
    main.page-wrap { padding-bottom: 160px; }
}


/* Tiny screens: shrink the product name */
@media (max-width: 480px) {
    .product-name { font-size: 20px; }
}

/* ── DISCOUNT CODE ── */
.discount-row {
    display: flex;
    gap: 6px;
    margin: 12px 0 4px;
}
.discount-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color 0.15s;
}
.discount-input:focus { border-color: var(--ink); }
.discount-btn {
    padding: 8px 12px;
    background: var(--ink);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.discount-btn:hover { opacity: 0.85; }
.discount-feedback {
    font-size: 11px;
    min-height: 16px;
    margin-bottom: 8px;
}
.discount-feedback.success { color: var(--sub-green); }
.discount-feedback.error   { color: var(--crimson); }
.discount-amount-line {
    font-size: 13px;
    color: var(--sub-green);
    font-weight: 500;
    margin-top: 2px;
    margin-bottom: 4px;
}
#summaryTotalOriginal {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 16px;
    font-weight: 400;
    margin-right: 6px;
    align-self: center;
}
