.product-freebies {
    padding: 0;
    margin: 0;
    border: 0;
    min-width: 0;
}

.product-freebies legend {
    width: auto;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 700;
}

.product-freebie-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    max-width: 320px;
}

.product-freebie-option {
    display: block;
    position: relative;
    height: 100%;
    cursor: pointer;
}

/* Keep the native radio available to keyboard and screen-reader users. */
.product-freebie-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.product-freebie-card {
    display: block;
    height: 100%;
    padding: 4px;
    color: inherit;
    text-align: center;
    border-radius: 3px;
}

.product-freebie-image {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 128px;
    height: 112px;
    margin: 0 auto 0.5rem;
}

.product-freebie-image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-freebie-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.product-freebie-tick {
    display: none;
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 1;
    width: 1em;
    height: 1em;
    border: 0;
    border-radius: 1em;
    background-color: #45CC45;
    color: #fff;
}

/* Override the earlier CSS-drawn tick if it is already compiled into app.css. */
.product-freebie-tick::after {
    content: none;
}

.product-freebie-radio:checked + .product-freebie-card .product-freebie-tick {
    display: block;
}

.product-freebie-option:hover .product-freebie-card {
    background: rgba(0, 0, 0, 0.025);
}

.product-freebie-radio:focus-visible + .product-freebie-card {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.product-freebie-radio:disabled + .product-freebie-card {
    cursor: wait;
    opacity: 0.7;
}

.product-freebie-message:empty {
    display: none;
}

.product-freebie-message:not(:empty) {
    margin-bottom: 0.75rem;
}
