/*
 * ─── THE PRICE LINE ──────────────────────────────────────────────────────────
 *
 * Handoff `price-line-and-timeline`, frame 1b. Values read from
 * "Price Line and Timeline Options.dc.html", not from the PNG:
 *
 *   block     #F5F8FA, radius 16px, padding 16px 20px, column, gap 10px
 *             no border, and nothing rounded nested inside it
 *   summary   flex, align-items center, gap 10px, 12px, #555B68, wraps
 *   eyebrow   11px / 800 / 0.1em / #1AB0E0
 *   rule      1 × 12px, rgba(45,56,75,0.2)
 *   item      600
 *   row 2     sign: align-items center, gap 16px, total flex:1
 *             sticker: align-items baseline, gap 12px
 *   total     34px / 800 / -0.02em / #2D3445 / line-height 1
 *   unit      13px / 600 / #555B68
 *   stepper   44px tall pill, #FFF, 1.5px rgba(45,56,75,0.18), radius 999px
 *             − 42px · n 28px · + 42px, 18px/15px, weight 700
 *
 * ONE DEVIATION, not yet approved: the radius scale has 14px (standard card)
 * and 18px (feature panel) and no 16px — it was deliberately consolidated onto
 * those rungs. This uses --radius-lg (18px), which is what the gallery's main
 * image beside it already wears, rather than adding a rung for 2px. Needs
 * Dennis's line in .design-audit/deviations.md like the other two.
 *
 * The markup is Centro_Price_Line; the stylesheet is here because it has to
 * dress two callers — the theme's sign routes and the sticker plugin's studio
 * panel — and this is the sheet that loads on every product page.
 */

.as-priceline {
    display: flex;
    flex-direction: column;
    gap: var(--space-2-5);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-surface-alt);
}

/* ── Row 1: what they picked ─────────────────────────────────────────────── */

.as-priceline__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2-5);
    font-size: 12px;
    color: var(--color-text-muted);
}

/*
 * The type recipe is .as-eyebrow's, in primitives.css — this selector is in
 * that list, where .as-bn-buy__eyebrow and .asp-live-price__label used to be.
 * CLAUDE.md retires a local copy of it by name, and writing one here would
 * have made it the sixth.
 */
.as-priceline__eyebrow { color: var(--atomic-blue); }

.as-priceline__rule {
    width: 1px;
    height: 12px;
    background: rgba(45, 56, 75, 0.2);
    flex: none;
}

.as-priceline__item { font-weight: 600; }

/*
 * An item the JS has not filled yet collapses, and takes its hairline with it.
 *
 * `:has(+ …)`, not `+`. open() emits the hairline BEFORE the item it
 * introduces, so the sibling combinator was hiding the rule on the wrong side
 * — the one after the empty item, which belongs to the next one. On the
 * sticker page that left #asp-summary-finish-sep hanging on first paint, a
 * rule with nothing before it, until pricing.js filled the span.
 */
.as-priceline__item:empty { display: none; }
.as-priceline__rule:has(+ .as-priceline__item:empty) { display: none; }

/* ── Row 2: the number ───────────────────────────────────────────────────── */

.as-priceline__row {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}

.as-priceline__total {
    font-size: var(--price-xl);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    line-height: 1;
    color: var(--atomic-dark);
    /* The figure changes under the cursor on a sticker page; tabular keeps it
       from shuffling sideways on every keystroke. */
    font-variant-numeric: tabular-nums;
}

/*
 * ─── WOOCOMMERCE'S OWN PRICE MARKUP, INSIDE THE FIGURE ───────────────────
 *
 * A VARIABLE product's get_price_html() wraps the amount in
 * <span class="price">; a simple product's does not. So only the three
 * variable products on the site hit this — and they were showing the figure
 * in Woo's olive (#958E09) at 42.5px, because Woo ships
 *
 *   .woocommerce:where(body:not(…)) div.product span.price { color: …; font-size: 1.25em }
 *
 * and `:where()` contributes nothing, leaving it at (0,3,2). Scoped to a
 * route this lost at (0,3,1) — one element short, the same way the thumbnail
 * grid and the stepper margin did. Naming .woocommerce and div.product takes
 * it to (0,4,2).
 *
 * On the component rather than a route, because a variable product can appear
 * on any of them.
 */
.woocommerce div.product .as-priceline__total span.price,
.woocommerce div.product .as-priceline__total .price,
.woocommerce div.product .as-priceline__total .woocommerce-Price-amount {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

.as-priceline__unit {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

/*
 * WooCommerce's attribution inputs are a zero-width element that still takes a
 * flex slot and one gap with it. The old buy row hid them and the note there
 * recorded the bug; the row is this now, so the rule comes with it.
 *
 * DESCENDANT, not child. form.cart is display:contents, so the element draws
 * no box of its own but is still the DOM parent — `>` from the row missed it
 * and left the 16px gap it was written to remove.
 */
.as-priceline__row wc-order-attribution-inputs { display: none; }

/*
 * ── The sign variant ─────────────────────────────────────────────────────
 *
 * The stepper is WooCommerce's quantity field, not a copy of it: form.cart is
 * display:contents, so the field and the button become children of this row.
 * That is why the row centres rather than sitting on a baseline here, and why
 * the total takes the slack — it pushes the stepper to the right edge.
 */
.as-priceline--sign .as-priceline__row {
    align-items: center;
    gap: var(--space-4);
}

.as-priceline--sign .as-priceline__total { flex: 1; }

/*
 * The stepper's own recipe is NOT here. It is one list in
 * route-sign-product.css, which already carried it for the three stems this
 * component replaced — a second copy with different numbers is exactly what
 * the note above that rule exists to prevent.
 */

/*
 * ── Inside the sign studio's buy area ────────────────────────────────────
 *
 * That route keeps its own class on the block, because `.ass-total` is what
 * makes the buy area STICKY to the bottom of the viewport while somebody
 * scrolls the uploader — a real feature, and not the handoff's business.
 *
 * Everything else about that class is a different design: a bordered,
 * shadowed card laid out as a wrapping row. 1b is a flat tinted block in a
 * column, so those four properties are taken back here rather than the class
 * being dropped and the stickiness lost with it.
 */
.as-priceline.ass-total {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2-5);
    padding: 16px 20px;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: none;
}

/*
 * Below the ladder's 560 rung the summary is already wrapping and the total
 * and stepper stop fitting on one line, so the row stacks rather than
 * shrinking the figure the page exists to show.
 */
@media (max-width: 560px) {
    .as-priceline--sign .as-priceline__row {
        flex-wrap: wrap;
        gap: var(--space-2-5);
    }
    .as-priceline--sign .as-priceline__total { flex: 1 0 100%; }
}
