/* Kategori sayfası hızlı satın alma penceresi */
.rx-bm {
    --rxbm-primary: #0f67fe;
    --rxbm-primary-dark: #0b52cc;
    --rxbm-primary-soft: #e8f0ff;
    --rxbm-text: #161e33;
    --rxbm-muted: #64748b;
    --rxbm-border: #e2e8f0;
    --rxbm-bg: #f5f8fe;
    --rxbm-success: #16a34a;
    --rxbm-success-soft: #e7f8ee;
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: none;
    font-family: inherit;
    color: var(--rxbm-text);
}
.rx-bm.is-open { display: block; }
html.rx-bm-lock, html.rx-bm-lock body { overflow: hidden; }

.rx-bm__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    transition: opacity .25s ease;
}
.rx-bm.is-visible .rx-bm__overlay { opacity: 1; }

/* Pencere: mobilde alttan açılır, masaüstünde ortada */
.rx-bm__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, .18);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.rx-bm.is-visible .rx-bm__sheet { transform: translateY(0); }
@media (min-width: 768px) {
    .rx-bm__sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: 560px;
        max-height: 88vh;
        border-radius: 28px;
        box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
        transform: translate(-50%, -46%);
        opacity: 0;
        transition: transform .25s ease, opacity .25s ease;
    }
    .rx-bm.is-visible .rx-bm__sheet { transform: translate(-50%, -50%); opacity: 1; }
}

/* Başlık ve adımlar */
.rx-bm__head {
    position: relative;
    flex-shrink: 0;
    padding: 14px 56px 18px;
    background: var(--rxbm-bg);
    border-bottom: 1px solid var(--rxbm-border);
}
.rx-bm__grip {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 4px;
    background: #cbd5e1;
}
.rx-bm__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--rxbm-muted);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}
.rx-bm__close:hover { color: var(--rxbm-text); }
.rx-bm__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.rx-bm__step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rxbm-muted);
    white-space: nowrap;
}
.rx-bm__step-ic {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--rxbm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--rxbm-muted);
}
.rx-bm__step-ic .fa-check { display: none; }
.rx-bm__step.is-active { color: var(--rxbm-text); }
.rx-bm__step.is-active .rx-bm__step-ic { background: var(--rxbm-primary); border-color: var(--rxbm-primary); color: #fff; }
.rx-bm__step.is-done { color: var(--rxbm-text); }
.rx-bm__step.is-done .rx-bm__step-ic { background: var(--rxbm-primary-soft); border-color: var(--rxbm-primary-soft); color: var(--rxbm-primary); }
.rx-bm__step.is-done .rx-bm__step-ic i:not(.fa-check) { display: none; }
.rx-bm__step.is-done .rx-bm__step-ic .fa-check { display: inline-block; }
.rx-bm__step.is-skipped { opacity: .45; }
.rx-bm__step-line { width: 26px; height: 2px; border-radius: 2px; background: var(--rxbm-border); }
@media (max-width: 420px) {
    .rx-bm__head { padding-left: 14px; padding-right: 14px; }
    .rx-bm__steps { justify-content: flex-start; gap: 6px; }
    .rx-bm__step { font-size: 12.5px; gap: 5px; }
    .rx-bm__step-line { width: 12px; }
}

/* Gövde */
.rx-bm__body {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
    min-height: 220px;
}
@media (max-width: 420px) { .rx-bm__body { padding: 20px 16px; } }
.rx-bm__pane { display: none; }
.rx-bm__pane.is-active { display: block; }
.rx-bm__title { font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--rxbm-text); }
.rx-bm__sub { margin-top: 4px; font-size: 14px; color: var(--rxbm-muted); }
.rx-bm__label { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--rxbm-text); }
.rx-bm__label:empty { display: none; }
.rx-bm__label:empty + .rx-bm__field { margin-top: 20px; }
.rx-bm__field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border: 1.5px solid var(--rxbm-border);
    border-radius: 18px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.rx-bm__field:focus-within { border-color: var(--rxbm-primary); box-shadow: 0 0 0 4px rgba(15, 103, 254, .12); }
.rx-bm__field > i { color: var(--rxbm-muted); padding-right: 12px; border-right: 1px solid var(--rxbm-border); }
.rx-bm__field input {
    flex: 1;
    min-width: 0;
    height: 60px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: var(--rxbm-text);
}
.rx-bm__field input::placeholder { color: #94a3b8; font-weight: 400; }
.rx-bm__info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--rxbm-border);
    border-radius: 16px;
    background: var(--rxbm-bg);
    font-size: 13.5px;
    color: #475569;
    line-height: 1.5;
}
.rx-bm__info i { margin-top: 3px; color: var(--rxbm-muted); }

.rx-bm__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 9px 14px;
    border: 0;
    border-radius: 12px;
    background: var(--rxbm-bg);
    color: var(--rxbm-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.rx-bm__back:hover { color: var(--rxbm-text); }

/* Ek paket kartları */
.rx-bm__offers { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.rx-bm__offer {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--rxbm-border);
    border-radius: 18px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.rx-bm__offer:hover { border-color: #bfd4ff; }
.rx-bm__offer.is-on { border-color: var(--rxbm-primary); background: #f7faff; box-shadow: 0 4px 16px rgba(15, 103, 254, .1); }
.rx-bm__offer-ic {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--rxbm-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.rx-bm__offer-body { flex: 1; min-width: 0; }
.rx-bm__offer-name { font-size: 15px; font-weight: 600; color: var(--rxbm-text); line-height: 1.35; }
.rx-bm__offer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 13px; }
.rx-bm__offer-old { color: #94a3b8; text-decoration: line-through; }
.rx-bm__offer-price { font-weight: 700; color: var(--rxbm-text); }
.rx-bm__offer-badge {
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--rxbm-success-soft);
    color: var(--rxbm-success);
    font-size: 11.5px;
    font-weight: 700;
}
.rx-bm__switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 30px;
    background: #cbd5e1;
    transition: background-color .2s;
}
.rx-bm__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s;
}
.rx-bm__offer.is-on .rx-bm__switch { background: var(--rxbm-primary); }
.rx-bm__offer.is-on .rx-bm__switch::after { transform: translateX(20px); }

/* Yükleniyor / hata */
.rx-bm__loading {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    font-size: 14px;
    color: var(--rxbm-muted);
}
.rx-bm.is-loading .rx-bm__loading { display: flex; }
.rx-bm__spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--rxbm-primary-soft);
    border-top-color: var(--rxbm-primary);
    border-radius: 50%;
    animation: rxbm-spin .8s linear infinite;
}
@keyframes rxbm-spin { to { transform: rotate(360deg); } }
.rx-bm__error {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13.5px;
    line-height: 1.5;
}
.rx-bm__error.is-show { display: block; }

/* Alt kısım */
.rx-bm__foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--rxbm-border);
    background: #fff;
}
@media (max-width: 420px) { .rx-bm__foot { padding-left: 16px; padding-right: 16px; gap: 10px; } }
.rx-bm__total { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rx-bm__total-ic {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--rxbm-primary-soft);
    color: var(--rxbm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.rx-bm__total small { display: block; font-size: 13px; color: var(--rxbm-muted); }
.rx-bm__total strong { display: block; font-size: 22px; font-weight: 800; color: var(--rxbm-text); white-space: nowrap; }
.rx-bm__next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 170px;
    height: 54px;
    padding: 0 24px;
    border: 0;
    border-radius: 16px;
    background: var(--rxbm-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, opacity .2s, transform .1s;
}
.rx-bm__next:hover:not(:disabled) { background: var(--rxbm-primary-dark); }
.rx-bm__next:active:not(:disabled) { transform: scale(.98); }
.rx-bm__next:disabled { opacity: .45; cursor: not-allowed; }
.rx-bm__next.is-busy { opacity: .7; cursor: progress; }
@media (max-width: 420px) { .rx-bm__next { min-width: 0; padding: 0 18px; font-size: 15px; } }

/* Sepete eklendi */
.rx-bm__done {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45);
}
.rx-bm.is-done .rx-bm__done { display: flex; }
.rx-bm__done-card {
    width: 100%;
    max-width: 400px;
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
    animation: rxbm-pop .25s ease;
}
@keyframes rxbm-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rx-bm__done-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.rx-bm__done-ic {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--rxbm-success-soft);
    color: var(--rxbm-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.rx-bm__done-title { font-size: 18px; font-weight: 700; color: var(--rxbm-text); }
.rx-bm__done-sub { margin-top: 2px; font-size: 14px; color: var(--rxbm-muted); }
.rx-bm__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s;
}
.rx-bm__btn + .rx-bm__btn { margin-top: 10px; }
.rx-bm__btn--primary { background: var(--rxbm-primary); color: #fff; }
.rx-bm__btn--primary:hover { background: var(--rxbm-primary-dark); color: #fff; }
.rx-bm__btn--light { background: var(--rxbm-bg); color: var(--rxbm-muted); font-weight: 600; }
.rx-bm__btn--light:hover { color: var(--rxbm-text); }

@media (prefers-reduced-motion: reduce) {
    .rx-bm__overlay, .rx-bm__sheet, .rx-bm__done-card { transition: none; animation: none; }
}
