:root {
    --grc-bmsm-blue: #0aaeff;
    --grc-bmsm-blue-deep: #052f63;
    --grc-bmsm-blue-dark: #071a35;
    --grc-bmsm-gold: #f0b90b;
    --grc-bmsm-gold-soft: #fff6d8;
    --grc-bmsm-line: #dbe8f7;
    --grc-bmsm-text: #0b1f3b;
    --grc-bmsm-muted: #66758a;
}

/* Retire the old Cabin-only bulk UI only while this plugin is enabled. */
.grc-entry-box .grc-bulk-banner,
.grc-entry-box .grc-bulk-wrap,
.grc-entry-box .grc-entry-note {
    display: none !important;
}

.grc-bmsm-reward-card {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid rgba(10, 174, 255, .38);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(10, 174, 255, .11), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    color: var(--grc-bmsm-text);
    box-shadow: 0 12px 32px rgba(4, 48, 100, .08);
    overflow: hidden;
}

.grc-bmsm-reward-card--product {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* On product pages the highlighted tier already communicates the active reward; avoid repeating it above the grid. */
.grc-bmsm-reward-card--product .grc-bmsm-current-state {
    display: none;
}

.grc-bmsm-reward-card.is-hot {
    border-color: rgba(10, 174, 255, .9);
    animation: grcBmsmNear 1.6s ease-in-out infinite;
}

.grc-bmsm-reward-card.is-max {
    border-color: rgba(240, 185, 11, .72);
    background:
        radial-gradient(circle at 100% 0%, rgba(240, 185, 11, .17), transparent 38%),
        linear-gradient(180deg, #fffef9 0%, #fff9e8 100%);
}

@keyframes grcBmsmNear {
    0%, 100% { box-shadow: 0 10px 28px rgba(4, 48, 100, .08), 0 0 0 0 rgba(10,174,255,.16); }
    50% { box-shadow: 0 12px 34px rgba(4, 48, 100, .12), 0 0 0 5px rgba(10,174,255,.07); }
}

.grc-bmsm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.grc-bmsm-title-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.grc-bmsm-crown {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    background: linear-gradient(180deg, #fff8d8 0%, #ffe78d 100%);
    color: #c78d00;
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(215,164,0,.24);
}

.grc-bmsm-title,
.grc-bmsm-subtitle {
    display: block;
}

.grc-bmsm-title {
    color: var(--grc-bmsm-blue-dark);
    font-size: 18px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.015em;
}

.grc-bmsm-subtitle {
    margin-top: 4px;
    color: var(--grc-bmsm-muted);
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
}

.grc-bmsm-current-state {
    margin-top: 8px;
    color: #075b9c;
    font-size: 11px;
    line-height: 1.25;
}

.grc-bmsm-current-state strong {
    font-weight: 900;
}

.grc-bmsm-reward-card.is-max .grc-bmsm-current-state {
    color: #7b5700;
}

.grc-bmsm-saving {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid rgba(10, 174, 255, .38);
    border-radius: 10px;
    background: linear-gradient(135deg, #fff9e7 0%, #ffffff 46%, #eef9ff 100%);
    color: var(--grc-bmsm-blue-dark);
    text-align: left;
    box-shadow: inset 3px 0 0 #f0b90b, 0 4px 12px rgba(4, 48, 100, .07);
}

.grc-bmsm-saving-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #49647f;
    font-size: 8px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .08em;
    white-space: nowrap;
}



.grc-bmsm-saving strong {
    display: block;
    margin: 0;
    color: #06366a;
    font-size: 15px;
    line-height: 1;
    font-weight: 950;
    white-space: nowrap;
    text-shadow: none;
}

.grc-bmsm-tier-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.grc-bmsm-tier {
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid var(--grc-bmsm-line);
    border-radius: 10px;
    background: #fff;
    text-align: center;
    opacity: .58;
    transition: border-color .18s ease, background .18s ease, opacity .18s ease, transform .18s ease;
}

.grc-bmsm-tier span,
.grc-bmsm-tier strong {
    display: block;
}

.grc-bmsm-tier span {
    color: #6d7c8f;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .04em;
}

.grc-bmsm-tier strong {
    margin-top: 4px;
    color: #31425a;
    font-size: 13px;
    line-height: 1;
    font-weight: 950;
}

.grc-bmsm-tier.is-unlocked {
    border-color: rgba(10, 174, 255, .72);
    background: #eaf8ff;
    opacity: 1;
}

.grc-bmsm-tier.is-unlocked span { color: #087ec2; }
.grc-bmsm-tier.is-unlocked strong { color: #053f78; }

/* Earlier unlocked rungs stay readable; the customer's current rung gets the visual emphasis. */
.grc-bmsm-tier.is-unlocked:not(.is-current):not(.is-top) {
    background: #f4fbff;
    border-color: rgba(10, 174, 255, .34);
}

.grc-bmsm-tier.is-current:not(.is-top) {
    position: relative;
    border-color: #0a9ff0;
    background: linear-gradient(180deg, #e3f7ff 0%, #cceeff 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 4px 12px rgba(8,126,194,.11);
    transform: translateY(-1px);
}

.grc-bmsm-tier.is-current:not(.is-top)::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #0a9ff0;
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 950;
}

.grc-bmsm-tier.is-top {
    border-color: rgba(240, 185, 11, .52);
    background: linear-gradient(180deg, #fffdf4 0%, #fff7d9 100%);
    opacity: .82;
}

.grc-bmsm-tier.is-top span,
.grc-bmsm-tier.is-top strong { color: #805b00; }

.grc-bmsm-tier.is-top.is-unlocked {
    border-color: #d7a400;
    background: linear-gradient(180deg, #fff7d1 0%, #ffe999 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 5px 14px rgba(163,112,0,.10);
    opacity: 1;
}

.grc-bmsm-tier.is-top.is-current {
    border-color: #c89400;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.64), 0 6px 16px rgba(163,112,0,.16);
}

.grc-bmsm-progress {
    position: relative;
    width: 100%;
    height: 6px;
    margin-top: 9px;
    border-radius: 999px;
    background: #e6eef8;
    overflow: hidden;
}

.grc-bmsm-progress > span.grc-bmsm-progress-confirmed {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #087ee6 0%, #10bfff 72%, #35cfff 100%);
    box-shadow: 0 0 10px rgba(10,174,255,.18);
    transition: width .28s ease;
    z-index: 2;
}

.grc-bmsm-progress-trail {
    position: absolute;
    top: 0;
    bottom: 0;
    display: block;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, rgba(53,207,255,.34) 0%, rgba(255,212,85,.72) 100%);
    transition: left .28s ease, width .28s ease;
    z-index: 1;
}

.grc-bmsm-progress::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(90deg,
        transparent 24.6%, rgba(255,255,255,.95) 24.8%, rgba(255,255,255,.95) 25.2%, transparent 25.4%,
        transparent 49.6%, rgba(255,255,255,.95) 49.8%, rgba(255,255,255,.95) 50.2%, transparent 50.4%,
        transparent 74.6%, rgba(255,255,255,.95) 74.8%, rgba(255,255,255,.95) 75.2%, transparent 75.4%
    );
    opacity: .72;
}

.grc-bmsm-nudge {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--grc-bmsm-muted);
    font-size: 12px;
    line-height: 1.35;
}

.grc-bmsm-nudge strong {
    color: #075b9c;
    font-size: 13px;
    font-weight: 950;
}

.grc-bmsm-reward-card.is-hot .grc-bmsm-nudge strong {
    color: #003b72;
}

.grc-bmsm-reward-card.is-max .grc-bmsm-nudge strong {
    color: #7b5700;
}

.grc-bmsm-foot {
    margin-top: 7px;
    color: #7a8798;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
}

.grc-bmsm-smart-add[hidden] {
    display: none !important;
}

.grc-bmsm-smart-add {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #0b91df;
    border-radius: 10px;
    background: #fff;
    color: #066cae;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}

.grc-bmsm-smart-add:hover,
.grc-bmsm-smart-add:focus-visible {
    background: #eaf8ff;
    color: #034e82;
    transform: translateY(-1px);
}

.grc-bmsm-max-add[hidden] {
    display: none !important;
}

.grc-bmsm-max-add {
    display: flex;
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    padding: 8px 12px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid #c99600;
    border-radius: 11px;
    background: linear-gradient(180deg, #fff3b3 0%, #f4bf24 100%);
    color: #4f3600;
    box-shadow: 0 8px 20px rgba(159, 109, 0, .16), inset 0 1px 0 rgba(255,255,255,.78);
    cursor: pointer;
    animation: grcBmsmGoldPulse 2.4s ease-in-out infinite;
}

.grc-bmsm-max-add span {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: .05em;
}

.grc-bmsm-max-add strong {
    font-size: 13px;
    line-height: 1.15;
    font-weight: 950;
}

.grc-bmsm-max-add:hover,
.grc-bmsm-max-add:focus-visible {
    background: linear-gradient(180deg, #fff8cf 0%, #f8ca38 100%);
    transform: translateY(-1px);
}

@keyframes grcBmsmGoldPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(159, 109, 0, .14), 0 0 0 0 rgba(240,185,11,.12), inset 0 1px 0 rgba(255,255,255,.78); }
    50% { box-shadow: 0 10px 24px rgba(159, 109, 0, .20), 0 0 0 4px rgba(240,185,11,.06), inset 0 1px 0 rgba(255,255,255,.78); }
}

.grc-bmsm-pack-meta {
    display: block;
    width: 100%;
    margin-top: 3px;
    color: #096ba7;
    font-size: 9px;
    line-height: 1.1;
    font-weight: 900;
}

.grc-bmsm-pack-meta del {
    margin-right: 3px;
    opacity: .55;
    font-weight: 700;
}

.grc-bmsm-subtotal {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 5px;
}

.grc-bmsm-subtotal del { opacity: .48; }
.grc-bmsm-subtotal small { flex-basis: 100%; color: #087ec2; font-size: 10px; font-weight: 800; }

.grc-bmsm-checkout-row > td {
    padding-top: 0 !important;
    padding-bottom: 8px !important;
}

@media (max-width: 700px) {
    .grc-bmsm-reward-card {
        padding: 12px;
        border-radius: 14px;
        margin-bottom: 12px;
    }

    .grc-bmsm-head {
        gap: 10px;
    }

    .grc-bmsm-title {
        font-size: 16px;
    }

    .grc-bmsm-subtitle {
        font-size: 10px;
    }

    .grc-bmsm-crown {
        width: 29px;
        height: 29px;
        font-size: 20px;
    }

    .grc-bmsm-head {
        flex-wrap: wrap;
    }

    .grc-bmsm-saving {
        flex: 1 0 100%;
        width: 100%;
        justify-content: space-between;
        padding: 7px 10px;
        border-radius: 9px;
    }

    .grc-bmsm-saving strong { font-size: 14px; }

    .grc-bmsm-tier-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 9px;
    }

    .grc-bmsm-tier {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 38px;
        padding: 7px 9px;
        text-align: left;
    }

    .grc-bmsm-tier span,
    .grc-bmsm-tier strong {
        margin: 0;
    }

    .grc-bmsm-nudge {
        display: block;
        margin-top: 8px;
    }

    .grc-bmsm-nudge strong,
    .grc-bmsm-nudge span {
        display: block;
    }

    .grc-bmsm-nudge span { margin-top: 2px; }

    .grc-bmsm-foot {
        font-size: 9px;
    }

    .grc-bmsm-smart-add {
        min-height: 44px;
        font-size: 12px;
    }

    .grc-bmsm-max-add {
        min-height: 50px;
        padding: 9px 10px;
    }
}

@media (max-width: 380px) {
    .grc-bmsm-head { display: flex; }
    .grc-bmsm-saving { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .grc-bmsm-reward-card.is-hot { animation: none !important; }
    .grc-bmsm-progress > span,
    .grc-bmsm-progress-trail,
    .grc-bmsm-smart-add,
    .grc-bmsm-max-add,
    .grc-bmsm-tier { transition: none !important; }
    .grc-bmsm-max-add { animation: none !important; }
}


.grc-bmsm-toast {
    position: fixed;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(10,174,255,.72);
    border-radius: 14px;
    background: rgba(5, 27, 55, .97);
    color: #fff;
    box-shadow: 0 18px 48px rgba(0, 20, 55, .28);
    transform: translate(-50%, 18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.grc-bmsm-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.grc-bmsm-toast > span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0aaeff;
    font-size: 17px;
}

.grc-bmsm-toast strong,
.grc-bmsm-toast small {
    display: block;
}

.grc-bmsm-toast strong {
    color: #fff;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 950;
}

.grc-bmsm-toast small {
    margin-top: 2px;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    line-height: 1.25;
}

@media (max-width: 700px) {
    .grc-bmsm-toast {
        bottom: max(14px, env(safe-area-inset-bottom));
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .grc-bmsm-toast { transition: none !important; }
}


.grc-bmsm-preview-badge {
    display: inline-flex;
    align-items: center;
    margin: 0 0 10px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 180, 0, .55);
    border-radius: 999px;
    background: #fff8d7;
    color: #704d00;
    font-size: 9px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .06em;
}

.grc-bmsm-limit {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid #f1c86b;
    border-radius: 9px;
    background: #fff9e8;
    color: #6c500f;
    font-size: 11px;
    line-height: 1.35;
}

.grc-bmsm-preview-toolbar {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1000000;
    width: min(340px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid rgba(10,174,255,.5);
    border-radius: 13px;
    background: rgba(5, 24, 49, .98);
    color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,.3);
}

.grc-bmsm-preview-toolbar > strong,
.grc-bmsm-preview-toolbar > span,
.grc-bmsm-preview-toolbar > small { display: block; }
.grc-bmsm-preview-toolbar > strong { color: #65cbff; font-size: 11px; font-weight: 950; letter-spacing: .08em; }
.grc-bmsm-preview-toolbar > span { margin-top: 4px; font-size: 11px; font-weight: 800; }
.grc-bmsm-preview-toolbar > small { margin-top: 7px; color: rgba(255,255,255,.62); font-size: 9px; line-height: 1.3; }

.grc-bmsm-preview-scenarios {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.grc-bmsm-preview-scenarios button {
    min-height: 32px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 7px;
    background: rgba(255,255,255,.07);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.grc-bmsm-preview-scenarios button.is-active {
    border-color: #0aaeff;
    background: #0a6fb0;
}

.grc-bmsm-preview-notice {
    position: fixed;
    left: 50%;
    top: max(16px, env(safe-area-inset-top));
    z-index: 1000001;
    width: min(440px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 11px 14px;
    border-radius: 11px;
    background: #071a35;
    color: #fff;
    box-shadow: 0 14px 36px rgba(0,0,0,.25);
    text-align: center;
    font-size: 11px;
    font-weight: 850;
    transform: translate(-50%, -14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.grc-bmsm-preview-notice.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 700px) {
    .grc-bmsm-preview-toolbar {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .grc-bmsm-preview-notice { transition: none !important; }
}

.grc-ticket-grid .grc-ticket-option[hidden] {
    display: none !important;
}
