/* Miracle Labs Bundle Selector 1.3.3. Change --ml-primary to recolour everything. */
.ml-bundle-selector {
    --ml-primary: #0064FF;
    --ml-primary-dark: #004ECC;
    --ml-primary-light: #3D8BFF;
    --ml-text: #1B3350;
    --ml-muted: #8A97A6;
    --ml-card-border: #1B3350;
    --ml-shell-border: #E3E8EE;
    --ml-selected-bg: #F2F4F7;
    --ml-radio: #6B7580;

    width: 100%;
    margin: 14px 0;
    padding: 34px 16px 16px;
    box-sizing: border-box;
    border: 1px solid var(--ml-shell-border);
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
}

.ml-bundle-selector *,
.ml-bundle-selector *::before,
.ml-bundle-selector *::after { box-sizing: border-box; }

.ml-bundle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

/* Card: reset theme/Elementor button styles so they cannot leak in */
.ml-bundle-selector .ml-bundle-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    height: 148px;
    min-height: 0;
    margin: 0;
    padding: 21px 6px 10px;
    border: 1.5px solid var(--ml-card-border);
    border-radius: 9px;
    background: #fff;
    color: var(--ml-text);
    font: inherit;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.2;
    box-shadow: none;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ml-bundle-selector .ml-bundle-card:hover,
.ml-bundle-selector .ml-bundle-card:focus {
    background: #fff;
    color: var(--ml-text);
    border-color: var(--ml-primary);
}

.ml-bundle-selector .ml-bundle-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 100, 255, .25);
}

.ml-bundle-selector .ml-bundle-card.is-selected,
.ml-bundle-selector .ml-bundle-card.is-selected:hover,
.ml-bundle-selector .ml-bundle-card.is-selected:focus {
    background: var(--ml-selected-bg);
    border: 2px solid var(--ml-primary);
    padding: 20.5px 5.5px 9.5px; /* keeps content still when border thickens */
}

.ml-bundle-label {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    color: var(--ml-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .01em;
}

/* Discount pill sitting on the top border (packs 2 and 3 only) */
.ml-bundle-badge {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 6px;
    background: var(--ml-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
    pointer-events: none;
}

.ml-bundle-bottles {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    margin: 10px 0 12px;
}

.ml-vial-svg {
    display: block;
    width: auto;
    height: 30px;
    overflow: visible;
}

.ml-bundle-price-row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 2px 5px;
    line-height: 1;
}

.ml-bundle-price {
    display: inline-block;
    color: var(--ml-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.ml-bundle-compare {
    display: none;
    color: var(--ml-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-decoration: line-through;
}

.ml-bundle-compare.is-visible { display: inline-block; }

.ml-bundle-card:not(.is-selected) .ml-bundle-price {
    color: var(--ml-muted);
}

.ml-bundle-radio {
    position: relative;
    display: block;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    margin-top: 11px;
    border: 1.5px solid var(--ml-radio);
    border-radius: 50%;
    background: #fff;
}

.ml-bundle-card.is-selected .ml-bundle-radio {
    border-color: var(--ml-text);
}

.ml-bundle-card.is-selected .ml-bundle-radio::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--ml-text);
}

/* Add to cart */
.ml-bundle-selector .ml-bundle-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    margin: 14px 0 0;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: radial-gradient(ellipse 60% 140% at 35% 20%, var(--ml-primary-light) 0%, var(--ml-primary) 45%, var(--ml-primary-dark) 100%);
    background-color: var(--ml-primary);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 100, 255, .22);
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease;
}

.ml-bundle-selector .ml-bundle-add-to-cart:hover,
.ml-bundle-selector .ml-bundle-add-to-cart:focus {
    color: #fff;
    filter: brightness(1.06);
    box-shadow: 0 6px 16px rgba(0, 100, 255, .3);
}

.ml-bundle-selector .ml-bundle-add-to-cart:focus-visible {
    outline: 3px solid rgba(0, 100, 255, .35);
    outline-offset: 3px;
}

.ml-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.ml-cart-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ml-bundle-status {
    display: none;
    margin-top: 8px;
    color: #31536a;
    font-size: 12px;
    text-align: center;
}
.ml-bundle-status.is-visible { display: block; }
.ml-bundle-status.is-error { color: #B42318; }

@media (prefers-reduced-motion: reduce) {
    .ml-bundle-selector .ml-bundle-card,
    .ml-bundle-selector .ml-bundle-add-to-cart { transition: none; }
}

/* Mobile: same sizes, tighter spacing; struck price drops under the price */
@media (max-width: 767px) {
    .ml-bundle-selector { padding: 30px 10px 12px; border-radius: 12px; }
    .ml-bundle-grid { gap: 8px; }
    /* Cards grow together to the tallest one; radios pin to the same bottom line */
    .ml-bundle-selector .ml-bundle-card { height: auto; min-height: 148px; padding: 19px 4px 10px; }
    .ml-bundle-selector .ml-bundle-card.is-selected { padding: 18.5px 3.5px 9.5px; }
    .ml-bundle-label { font-size: 12px; }
    .ml-bundle-badge { height: 20px; padding: 0 7px; font-size: 10px; }
    .ml-bundle-price-row { flex-direction: column; align-items: center; gap: 3px; }
    .ml-bundle-price { font-size: 13px; }
    .ml-bundle-compare { font-size: 10px; }
    .ml-bundle-price-row { margin-bottom: 9px; }
    .ml-bundle-radio { margin-top: auto; }
    .ml-bundle-selector .ml-bundle-add-to-cart { height: 48px; font-size: 14px; }
}
