/**
 * Peak Lab — Product page batch panel
 *
 * Tokens mirror the COA library page so the two surfaces read as one system.
 * Flat fills throughout; no gradients.
 */

.plbp {
    /* palette */
    --plbp-navy:        #36465C;
    --plbp-navy-deep:   #2c3a4d;
    --plbp-blue:        #3AB5FF;
    --plbp-bg:          #FFFFFF;
    --plbp-bg-subtle:   #F4F7FA;
    --plbp-text-mid:    #5A6E83;
    --plbp-text-light:  #8A9CB0;
    --plbp-border:      #E2EAF0;
    --plbp-border-mid:  #C4D4E4;
    --plbp-pass:        #2D8A5F;
    --plbp-pass-bg:     rgba(45, 138, 95, 0.08);
    --plbp-pass-border: rgba(45, 138, 95, 0.25);

    box-sizing: border-box;
    margin: 0 0 1.5rem;
    border: 1px solid var(--plbp-border);
    border-radius: 6px;
    background: var(--plbp-bg);
    overflow: hidden;
    color: var(--plbp-navy);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Adapt to the container, not the viewport — the panel may sit full-width
       below the summary or inside a narrower column depending on placement. */
    container-type: inline-size;
    container-name: plbp;
}

.plbp *,
.plbp *::before,
.plbp *::after { box-sizing: border-box; }

/* ============================================================
   HEADER STRIP
   ============================================================ */
.plbp-head {
    background: var(--plbp-bg-subtle);
    border-bottom: 1px solid var(--plbp-border);
    padding: 0.625rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.125rem;
}

.plbp-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--plbp-blue);
    white-space: nowrap;
}

.plbp-badge {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--plbp-pass-border);
    border-radius: 100px;
    background: var(--plbp-pass-bg);
    color: var(--plbp-pass);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   HISTORY PILLS
   ============================================================ */
.plbp-history {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.plbp-history::-webkit-scrollbar { display: none; }

.plbp-history-label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--plbp-text-light);
    white-space: nowrap;
}

.plbp-pills {
    display: flex;
    gap: 0.375rem;
}

.plbp-pill {
    padding: 5px 11px;
    border: 1px solid var(--plbp-border-mid);
    border-radius: 5px;
    background: #fff;
    color: var(--plbp-text-mid);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.plbp-pill:hover,
.plbp-pill:focus-visible {
    border-color: var(--plbp-navy);
    color: var(--plbp-navy);
}

.plbp-pill[aria-pressed="true"] {
    background: var(--plbp-navy);
    border-color: var(--plbp-navy);
    color: #fff;
}

/* ============================================================
   BODY BAND
   ============================================================ */
.plbp-body { padding: 1.25rem; }

.plbp-band {
    display: grid;
    grid-template-columns: 232px repeat(4, minmax(0, 1fr)) 230px;
    gap: 1.875rem;
    align-items: center;
}
.plbp-band > * { min-width: 0; }

/* ============================================================
   PURITY + SPEC BAR
   ============================================================ */
.plbp-purity-label {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--plbp-text-light);
}

.plbp-purity {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--plbp-pass);
}

.plbp-spec { margin-top: 0.6875rem; }

.plbp-spec-track {
    height: 7px;
    border-radius: 100px;
    background: var(--plbp-bg-subtle);
    overflow: hidden;
}

/* Static readout — deliberately not animated. */
.plbp-spec-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--plbp-pass);
}

.plbp-spec-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 10px;
    color: var(--plbp-text-light);
}

.plbp-spec-caption {
    margin: 0.4375rem 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--plbp-text-mid);
}

.plbp-spec-caption b { font-weight: 600; }

/* ============================================================
   DATA CELLS
   ============================================================ */
.plbp-cell { margin: 0; }

.plbp-cell dt {
    margin: 0 0 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--plbp-text-light);
}

.plbp-cell dd {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--plbp-text-mid);
}

/* ============================================================
   COA THUMBNAIL — this is the control, there is no separate button
   ============================================================ */
.plbp-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--plbp-border);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.plbp-thumb:hover,
.plbp-thumb:focus-visible { border-color: var(--plbp-border-mid); }

.plbp-thumb:focus-visible {
    outline: 2px solid var(--plbp-blue);
    outline-offset: 2px;
}

/* Crop from the top so the visible slice is the lab letterhead —
   a recognisable document header reads at this size, a fragment of
   chromatogram does not. */
.plbp-thumb img {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
    object-position: top;
}

.plbp-thumb-cap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 4px;
    border-top: 1px solid var(--plbp-border);
    background: var(--plbp-bg-subtle);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--plbp-text-light);
    transition: color 0.15s ease;
}

.plbp-thumb:hover .plbp-thumb-cap,
.plbp-thumb:focus-visible .plbp-thumb-cap { color: var(--plbp-navy); }

/* ============================================================
   NARROW CONTAINERS
   Container queries so the panel responds to its column rather than
   the viewport — it behaves correctly wherever it's placed.
   ============================================================ */

/* Not enough room for the horizontal band: stack into the mobile layout. */
@container plbp (max-width: 900px) {
    .plbp-band {
        grid-template-columns: 128px minmax(0, 1fr);
        gap: 1rem;
        align-items: start;
    }

    /* Purity spans the full width above the thumbnail/data pair. */
    .plbp-purity-zone {
        grid-column: 1 / -1;
        margin-bottom: 0.25rem;
    }

    .plbp-purity { font-size: 27px; }

    /* Data cells stack in the right-hand column beside the thumbnail. */
    .plbp-cell { grid-column: 2; }

    .plbp-thumb {
        grid-column: 1;
        grid-row: 2 / span 4;
    }

    .plbp-thumb img { height: 166px; }
}

/* Header strip wraps before the pills would be squeezed.
   Reorder so the eyebrow and badge share the first row and the pills take
   the second — otherwise the badge wraps alone and burns a whole line. */
@container plbp (max-width: 620px) {
    .plbp-head {
        flex-wrap: wrap;
        gap: 0.625rem 1.125rem;
    }
    .plbp-eyebrow { order: 1; }
    .plbp-badge   { order: 2; margin-left: auto; }
    .plbp-history { order: 3; width: 100%; }
}

/* Very narrow: drop the thumbnail rather than shrink the data. */
@container plbp (max-width: 340px) {
    .plbp-band { grid-template-columns: 1fr; }
    .plbp-thumb { display: none; }
    .plbp-cell { grid-column: 1; }
}

/* ============================================================
   FALLBACK for browsers without container query support.
   Roughly matches the container breakpoints for a full-width panel.
   ============================================================ */
@supports not (container-type: inline-size) {
    @media (max-width: 960px) {
        .plbp-band {
            grid-template-columns: 128px minmax(0, 1fr);
            gap: 1rem;
            align-items: start;
        }
        .plbp-purity-zone { grid-column: 1 / -1; margin-bottom: 0.25rem; }
        .plbp-purity { font-size: 27px; }
        .plbp-cell { grid-column: 2; }
        .plbp-thumb { grid-column: 1; grid-row: 2 / span 4; }
        .plbp-thumb img { height: 166px; }
        .plbp-head { flex-wrap: wrap; gap: 0.625rem 1.125rem; }
        .plbp-eyebrow { order: 1; }
        .plbp-badge   { order: 2; margin-left: auto; }
        .plbp-history { order: 3; width: 100%; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .plbp * { transition: none !important; }
}

/* ============================================================
   COMPACT STRIP — [pl_batch_strip]
   Sits high in the product summary, under the title. Typography
   does the work; no fill, no box. The only chrome is a hairline
   above, which stops the eyebrow reading as a subtitle to the
   product name.
   ============================================================ */
.plbs {
    --plbs-blue:       #3AB5FF;
    --plbs-text-mid:   #5A6E83;
    --plbs-text-light: #8A9CB0;
    --plbs-border:     #E2EAF0;
    --plbs-pass:       #2D8A5F;
    --plbs-mono:       'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;

    box-sizing: border-box;
    margin: 1rem 0 0;
    padding-top: 0.875rem;
    border-top: 1px solid var(--plbs-border);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.plbs *,
.plbs *::before,
.plbs *::after { box-sizing: border-box; }

.plbs-eyebrow {
    display: block;
    margin-bottom: 0.5625rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--plbs-text-light);
}

.plbs-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.375rem 1.75rem;
}

.plbs-cell { display: block; }

.plbs-key {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--plbs-text-light);
}

/* Monospace is what makes these read as recorded measurements
   rather than marketing copy. */
.plbs-val {
    display: block;
    font-family: var(--plbs-mono);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--plbs-text-mid);
}

/* Deliberately below the product title and price in scale — purity is
   evidence supporting the price, not a competitor to it. */
.plbs-val--hero {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--plbs-pass);
}

/* Inline rather than pushed to the far right: on a wide summary column
   margin-left:auto strands the link away from the data it refers to. */
.plbs-link {
    align-self: center;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--plbs-blue);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid rgba(58, 181, 255, 0.3);
}

.plbs-link:hover,
.plbs-link:focus-visible {
    color: var(--plbs-blue);
    border-bottom-color: var(--plbs-blue);
}

/* Narrow: the link wraps to its own row and would otherwise sit tight
   against whatever follows the strip. */
@media (max-width: 600px) {
    .plbs-row { gap: 0.625rem 1.375rem; }
    .plbs-link { margin-bottom: 0.25rem; }
}
