/* Product option picker — a per-line choice that is not a separate product (e.g. gift voucher
   card design). Shares the card language of .gift-voucher-choice in view-product.css. */

.product-options {
    --po-accent: #008a88;
    --po-border: #cfd8df;
    --po-ink: #161616;
    --po-muted: #5c6670;
    --po-danger: #b3261e;

    margin: 18px 0 8px;
    padding: 20px 24px 18px;
    border: 1px solid #c9d7dd;
    border-radius: 8px;
    background: #fff;
}

.product-options[hidden] {
    display: none;
}

.product-options__title {
    width: 100%;
    margin: 0 0 6px;
    padding: 0;
    color: var(--po-ink);
    font-family: var(--font-heading);
    font-size: 1.3125rem;
    font-weight: 700;
    line-height: 1.3;
}

.product-options__help {
    margin: 0 0 16px;
    color: var(--po-muted);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.product-options__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.product-options__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 44px;
    margin: 0;
    padding: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--po-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.product-options__card:hover {
    border-color: var(--po-accent);
    box-shadow: 0 8px 22px rgba(0, 138, 136, .08);
}

.product-options__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Selection is never signalled by colour alone: the border thickens and a tick appears.
   Driven by `.is-selected` from product.js, NOT :has() — see purchase-mode.css for why. */
.product-options__card.is-selected {
    border-color: var(--po-accent);
    box-shadow: inset 0 0 0 2px var(--po-accent);
}

.product-options__card:focus-within {
    outline: 3px solid var(--po-accent);
    outline-offset: 2px;
}

.product-options__figure {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f2f5f6;
}

.product-options__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-options__tick {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--po-accent);
    color: #fff;
    font-size: 0.875rem;
    line-height: 26px;
    text-align: center;
}

.product-options__card.is-selected .product-options__tick {
    display: block;
}

.product-options__label {
    padding: 12px 14px 0;
    color: var(--po-ink);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.product-options__status {
    padding: 4px 14px 0;
    color: var(--po-muted);
    font-size: 0.875rem;
    line-height: 1.35;
}

.product-options__card--unavailable {
    cursor: not-allowed;
    background: #f7f9fa;
}

.product-options__card--unavailable:hover {
    border-color: var(--po-border);
    box-shadow: none;
}

/* Readable rather than washed out — the customer still needs to know what exists. */
.product-options__card--unavailable .product-options__figure {
    filter: grayscale(1);
    opacity: .55;
}

.product-options__card--unavailable .product-options__status {
    color: var(--po-danger);
    font-weight: 600;
}

.product-options__error {
    margin-top: 12px;
    color: var(--po-danger);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.product-options__error:empty {
    display: none;
}

/* Applied by product.js to the Email/Post card when its whole option set is out of stock — the
   delivery route itself is closed off, not just the designs beneath it. */
.gift-voucher-choice__card--unavailable {
    background: #f7f9fa;
    cursor: not-allowed;
    opacity: .75;
}

.product-options__sold-out {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #f0d2cf;
    border-radius: 8px;
    background: #fdf4f3;
    color: var(--po-danger);
    font-size: 0.9375rem;
    line-height: 1.45;
}

@media (max-width: 575px) {
    .product-options {
        padding: 16px 16px 14px;
    }

    .product-options__grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
    }
}
