
.opsim-quantity-offers-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.opsim-quantity-offer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--opsim-radius);
    cursor: pointer;
    position: relative;
}

/*
 * SELECTED OFFER — a two-state system, and only two states.
 *
 *   unselected : white  + 1px #e5e7eb
 *   selected   : #f5f5f5 + 1px near-black
 *
 * The old selected state filled the card with a 12% brand tint, ringed it in a
 * 2px brand border and floated it on a coloured drop shadow. On a jewellery
 * storefront that reads as heavy — the selected option shouted louder than the
 * product image beside it.
 *
 * Three things are deliberately absent and must stay absent: no transition (the
 * state change is instant), no :hover (the previous brand tint on hover made a
 * third state that competed with "selected"; the pointer cursor is the
 * affordance), and no box-shadow.
 *
 * border-width is NOT overridden here, so the selected card keeps the same 1px
 * the unselected one has. Only the colour changes. That is what makes the
 * border "refined" rather than aggressive, and it means selecting a card cannot
 * shift its content by a pixel.
 *
 * --opsim-text-primary is the theme's ink (#111827) — black to the eye, and a
 * token rather than a hardcoded #000. The background is a NEUTRAL grey on
 * purpose: it must not track the brand colour, or a dark brand turns the
 * selected card heavy again, which is the bug this replaces.
 */
.opsim-quantity-offer-item.active {
    border-color: var(--opsim-text-primary, #111827) !important;
    background: #f5f5f5 !important;
    box-shadow: none !important;
}

.opsim-offer-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--opsim-brand, #531628);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: var(--opsim-radius);
    text-transform: uppercase;
    z-index: 2;
    letter-spacing: 0.5px;
}

.opsim-offer-img {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: var(--opsim-radius);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.opsim-offer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opsim-offer-details {
    flex: 1;
    text-align: left;
}

.opsim-offer-subtitle {
    font-size: 0.65rem;
    color: #687079; /* AA contrast on white and on the selected #f5f5f5; #9ca3af was 2.3–2.5:1. */
    margin-bottom: 2px;
}

.opsim-offer-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2px;
}

.opsim-offer-bundle-variations {
    margin-top: 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed #eee;
}

.opsim-quantity-offer-item.active .opsim-offer-bundle-variations {
    display: flex;
}

.opsim-bundle-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opsim-bundle-item-header {
    font-size: 0.75rem;
    font-weight: 900;
    color: #111827;
    width: 25px;
    flex-shrink: 0;
}

.opsim-bundle-item-selects {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.opsim-bundle-select-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}

.opsim-bundle-select-group label {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--opsim-brand, #531628);
    text-transform: uppercase;
    opacity: 0.9;
}

.opsim-bundle-select-group select {
    width: 100%;
    font-size: 0.75rem;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--opsim-border, #e5e7eb);
    border-radius: var(--opsim-radius);
    background: #fafafa;
    color: #111827;
    outline: none;
    cursor: pointer;
    appearance: none; 
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E558F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
}

.opsim-bundle-select-group select:focus {
    border-color: var(--opsim-brand, #531628);
    background-color: #fff;
}

.opsim-offer-pricing {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.opsim-offer-price {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

.opsim-offer-compare {
    font-size: 0.75rem;
    color: #687079;
    text-decoration: line-through;
}

@media (max-width: 768px) {
    .opsim-quantity-offer-item {
        padding: 10px;
        gap: 10px;
    }
    .opsim-offer-label {
        font-size: 0.75rem;
    }
    .opsim-bundle-item-selects {
        grid-template-columns: 1fr 1fr;
    }
    .opsim-bundle-select-group select {
        font-size: 0.7rem;
        padding: 5px 24px 5px 8px;
        background-position: right 6px center;
        background-size: 8px;
    }
    .opsim-offer-img {
        width: 38px;
        height: 38px;
    }
}

.opsim-quantity-offers-container.layout-vertical {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.opsim-quantity-offers-container.layout-vertical .opsim-quantity-offer-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    height: 100%;
    box-sizing: border-box;
    border: 2px solid #e5e7eb;
}

/* Vertical layout, same two states. Its unselected border is 2px, so the
   selected card keeps 2px and only the colour changes. */
.opsim-quantity-offers-container.layout-vertical .opsim-quantity-offer-item.active {
    border-color: var(--opsim-text-primary, #111827) !important;
    background: #f5f5f5 !important;
    box-shadow: none !important;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-badge {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: -10px;
    white-space: nowrap;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-img {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    border-radius: var(--opsim-radius);
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-subtitle {
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-label {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-pricing {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-price {
    font-size: 1.15rem;
    font-weight: 800;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-compare {
    font-size: 0.8rem;
    margin-top: 2px;
}

.opsim-quantity-offers-container.layout-vertical .opsim-offer-bundle-variations {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
}

.opsim-quantity-offers-container.layout-vertical .opsim-bundle-item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

.opsim-quantity-offers-container.layout-vertical .opsim-bundle-item-header {
    width: auto;
}

.opsim-quantity-offers-container.layout-vertical .opsim-bundle-item-selects {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 6px;
}

@media (max-width: 768px) {
    .opsim-quantity-offers-container.layout-vertical {
        display: flex;
        flex-direction: row;
        gap: 6px;
        margin-bottom: 15px;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-quantity-offer-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 12px 4px 10px 4px;
        border-radius: var(--opsim-radius);
        border-width: 1.5px;
        gap: 4px;
    }

    /* Mobile keeps the 1.5px border its unselected cards use — the desktop
       rule above already supplies the colour and the background, so nothing
       needs restating here. */

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-badge {
        font-size: 7px;
        padding: 1px 6px;
        top: -7px;
        border-radius: var(--opsim-radius);
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-img {
        width: 35px;
        height: 35px;
        margin-bottom: 4px;
        border-radius: var(--opsim-radius);
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-subtitle {
        font-size: 8px;
        margin-bottom: 1px;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-label {
        font-size: 10px;
        font-weight: 800;
        margin-bottom: 4px;
        line-height: 1.1;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-pricing {
        margin-top: auto;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-price {
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-compare {
        font-size: 9px;
        margin-top: 1px;
        line-height: 1;
    }

    .opsim-quantity-offers-container.layout-vertical .opsim-offer-bundle-variations {
        margin-top: 6px;
        padding-top: 6px;
        gap: 4px;
    }
    .opsim-quantity-offers-container.layout-vertical .opsim-bundle-item-row {
        gap: 2px;
    }
    .opsim-quantity-offers-container.layout-vertical .opsim-bundle-item-header {
        font-size: 7px;
    }
    .opsim-quantity-offers-container.layout-vertical .opsim-bundle-select-group label {
        font-size: 6px;
    }
    .opsim-quantity-offers-container.layout-vertical .opsim-bundle-select-group select {
        font-size: 8px;
        padding: 3px 14px 3px 4px;
        background-position: right 4px center;
        background-size: 6px;
        border-radius: var(--opsim-radius);
    }
}

