.product-addons {
    margin-block: 1.125rem .875rem;
    padding: 1rem clamp(.5rem, 2vw, 1rem) .5rem;
    color: #edf0ff;
    background: linear-gradient(150deg, #171c3b, #0b1026 55%);
    border: 1px solid #353d62;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgb(3 5 20 / 20%);
}

.product-addons .product-addons__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .45rem;
    margin: 0 .375rem .625rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
}

.product-addons__heading small {
    color: #b2bad6;
    font-size: .8125rem;
    font-weight: 400;
}

.product-addons__list,
.product-addons__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--addon-help-width, 1.875rem) auto;
    column-gap: .375rem;
}

.product-addons__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-addons__list:not(:has(details)) { --addon-help-width: 0px; }

.product-addons__row {
    position: relative;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    padding-inline: .375rem;
    border-top: 1px solid rgb(163 176 225 / 13%);
}

.product-addons__row:has(input:checked) {
    background: #20284d;
    box-shadow: inset 3px 0 #8592ff;
    border-radius: .5rem;
}

.buy .product-addons__option {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    min-height: 2.875rem;
    margin: 0;
    padding-block: .55rem;
    font-size: .9375rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.product-addons__option input {
    appearance: none;
    display: grid;
    place-content: center;
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    background: #1b223e;
    border: 1px solid #7884a9;
    border-radius: .35rem;
    cursor: pointer;
}

.product-addons__option input:checked {
    background: #5968dc;
    border-color: #98a5ff;
}

.product-addons__option input:checked::after {
    content: "";
    width: .3rem;
    height: .56rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}

.product-addons__help {
    grid-area: 2 / 1 / auto / -1;
}

/* The question mark sits beside the price. The open note takes the full row below. */
.product-addons__help summary {
    position: absolute;
    grid-area: 1 / 2 / 2 / 3;
    inset: 0;
    display: grid;
    place-items: center;
    min-width: 1.875rem;
    min-height: 2.75rem;
    list-style: none;
    cursor: pointer;
}

.product-addons__help summary::-webkit-details-marker { display: none; }

.product-addons__help summary span {
    display: grid;
    place-items: center;
    width: 1.125rem;
    height: 1.125rem;
    color: #c5cee9;
    background: #262e4d;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 600;
}

.product-addons__option input:focus-visible,
.product-addons__help summary:focus-visible {
    outline: 2px solid #a9b5ff;
    outline-offset: 2px;
}

.product-addons__help p {
    margin: 0 0 .55rem;
    padding: .75rem .875rem;
    border: 1px solid #59668c;
    border-radius: .625rem;
    background: #222b49;
    color: #f0f3ff;
    font-size: .875rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.product-addons__price {
    grid-area: 1 / 3;
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.product-addons__price,
.product-addons__price .woocommerce-Price-amount {
    font-size: .875rem;
}

.product-addons__price bdi { justify-content: flex-end; }

@media (max-width: 575px) {
    .product-addons { margin-inline: -.5rem; }
    .buy .product-addons__option { font-size: .9rem; }
}

@media (hover: hover) and (pointer: fine) {
    .product-addons__option:hover { color: #fff; }
    .product-addons__help:hover::details-content { content-visibility: visible; }
    .product-addons__help:not([open]) p {
        position: absolute;
        z-index: 2;
        inset-inline: .25rem;
        bottom: calc(100% - .25rem);
        margin: 0;
        box-shadow: 0 4px 14px rgb(0 0 0 / 30%);
    }
}

@media (forced-colors: active) {
    .product-addons__option input { appearance: auto; }
    .product-addons__option input:checked::after { content: none; }
}
