/* Canvas only / Canvas + complete wool pack. Sits in the buy area, above Add to basket. */

/* view-product.css sets `.materials-configurator { display: grid }`, and any author rule beats the
   user-agent `[hidden] { display: none }` — so hiding the wool list needs an author rule of its own. */
.materials-configurator[hidden] {
    display: none;
}

.purchase-mode {
    --pm-accent: #008a88;
    --pm-border: #cfd8df;
    --pm-ink: #161616;
    --pm-muted: #5c6670;
    --pm-warn: #b3261e;

    margin: 18px 0 12px;
}

.purchase-mode__title {
    margin: 0 0 10px;
    color: var(--pm-ink);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.purchase-mode__options {
    display: grid;
    gap: 10px;
}

.purchase-mode__card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.purchase-mode__card:hover {
    border-color: var(--pm-accent);
    box-shadow: 0 8px 22px rgba(0, 138, 136, .08);
}

.purchase-mode__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Selection is driven by `.is-selected`, set by product.js — NOT by :has(). Browser QA found
   engines that match `:has(:checked)` but never recompute when the radio changes, which left the
   ring stuck on the previously-selected card so two cards looked chosen at once. The picker needs
   JS to post the choice anyway, so there is nothing to fall back to. */
.purchase-mode__card.is-selected {
    border-color: var(--pm-accent);
    box-shadow: inset 0 0 0 2px var(--pm-accent);
}

/* :focus-within is a live pseudo-class, so it does not suffer the same staleness. */
.purchase-mode__card:focus-within {
    outline: 3px solid var(--pm-accent);
    outline-offset: 2px;
}

.purchase-mode__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.purchase-mode__name {
    color: var(--pm-ink);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
}

.purchase-mode__detail {
    color: var(--pm-muted);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.purchase-mode__detail--warn {
    color: var(--pm-warn);
    font-weight: 600;
}

.purchase-mode__price {
    color: var(--pm-ink);
    font-size: 1.125rem;
    font-weight: 700;
    white-space: nowrap;
}

.purchase-mode__card--disabled {
    background: #f7f9fa;
    cursor: not-allowed;
}

.purchase-mode__card--disabled:hover {
    border-color: var(--pm-border);
    box-shadow: none;
}

.purchase-mode__missing {
    margin-top: 6px;
    font-size: 0.9375rem;
}

.purchase-mode__missing summary {
    color: var(--pm-accent);
    cursor: pointer;
}

.purchase-mode__missing ul {
    margin: 8px 0 0;
    padding-left: 20px;
    color: var(--pm-muted);
    line-height: 1.5;
}

/* Deliberately secondary: an incomplete set is a fallback, not the headline offer. */
.purchase-mode__secondary {
    justify-self: start;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--pm-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--pm-accent);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.purchase-mode__secondary:hover {
    background: rgba(0, 138, 136, .07);
}

.purchase-mode__secondary:focus-visible {
    outline: 3px solid var(--pm-accent);
    outline-offset: 2px;
}
