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

.casablanca-quantity-offer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    /* Colour comes from the Customizer's brand token and nothing else — no hex
       anywhere in either state, so Appearance > Customize > brand colour
       repaints these cards, live (customizer-preview.js writes --casablanca-brand
       and --casablanca-brand-rgb on :root, and customize_css() prints both). */
    background: rgba(var(--casablanca-brand-rgb), 0.03);
    border: 1px solid rgba(var(--casablanca-brand-rgb), 0.35);
    border-radius: var(--casablanca-radius);
    cursor: pointer;
    position: relative;
}

/*
 * SELECTED OFFER — a two-state system, and only two states.
 *
 *   unselected : 3% brand tint  + 1px brand at 35%   (a hairline)
 *   selected   : 8% brand tint  + 2px brand at full strength
 *
 * Both states are the brand colour; the selected one is simply the stronger
 * reading of it, in BOTH width and alpha. Nothing here is a hex value, so the
 * whole component follows the Customizer.
 *
 * WHAT KEEPS IT FROM SHOUTING, and what must stay this way:
 *
 *  - the tints are 3% and 8%. An earlier version of this component used a 12%
 *    fill plus a coloured drop shadow, and on a jewellery storefront the
 *    selected option shouted louder than the product photo beside it. Low
 *    alpha is what makes a brand-coloured card read as premium rather than
 *    heavy, and it is what keeps a dark brand colour usable here.
 *  - the weight does the work, not the fill. A 1px hairline against a 2px solid
 *    is unmistakable at a glance without either card needing a loud background.
 *
 * KNOWN, AND DELIBERATE: the border grows by 1px per side on selection, so a
 * selected card is 2px taller and the cards under it move down by 2px. Both
 * widths were 2px before precisely to avoid that; the 1px/2px pair is the
 * requested design. Do not "fix" it by padding the unselected card to
 * compensate — that changes the component's spacing, which is not ours to
 * change here.
 *
 * Three things are deliberately absent and must stay absent: no transition (the
 * state change is instant), no :hover (a hover tint makes a third state that
 * competes with "selected"; the pointer cursor is the affordance), and no
 * box-shadow.
 */
.casablanca-quantity-offer-item.active {
    /* border-width is restated because the base rule is now 1px. */
    border-width: 2px !important;
    border-color: var(--casablanca-brand) !important;
    background: rgba(var(--casablanca-brand-rgb), 0.08) !important;
    box-shadow: none !important;
}

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

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

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

.casablanca-offer-details {
    flex: 1;
    text-align: start;
}

.casablanca-offer-subtitle {
    font-size: 0.65rem;
    color: #687079; /* AA on white and on the selected card's brand tint; #9ca3af was 2.3–2.5:1. */
    margin-bottom: 2px;
}

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

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

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

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

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

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

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

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

.casablanca-bundle-select-group select {
    width: 100%;
    font-size: 0.75rem;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--casablanca-border, #e5e7eb);
    border-radius: var(--casablanca-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;
}

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

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

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

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

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

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

/*
 * Vertical layout: geometry only.
 *
 * It no longer restates the border or the selected background. Both layouts are
 * the SAME component, so its colours are the ones above — one definition, and
 * the two layouts cannot drift apart when the brand colour changes. It follows
 * the same 1px hairline / 2px selected pair as the row layout above.
 */
.casablanca-quantity-offers-container.layout-vertical .casablanca-quantity-offer-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    height: 100%;
    box-sizing: border-box;
}

.casablanca-quantity-offers-container.layout-vertical .casablanca-offer-badge {
    /* Centring is physical: `inset-inline-start` would become `right` in the
       RTL form while translateX(-50%) still pulls left, off-centring it. */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: -10px;
    white-space: nowrap;
}

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

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

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

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

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

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

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

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

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

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

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

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

    .casablanca-quantity-offers-container.layout-vertical .casablanca-quantity-offer-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 12px 4px 10px 4px;
        border-radius: var(--casablanca-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. */

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

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

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

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

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

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

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

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

