/* ==========================================================================
   BonusPlus Loyalty System - Basket Debit Block
   Light / Dark Themes with Modal Form Aesthetics
   ========================================================================== */

/* Wrapper & Layout */
.bp-basket-wrapper {
    display: flex;
    width: 100%;
    height: auto;
    margin: 8px 0;
    box-sizing: border-box;
    align-items: flex-start;
}

.bp-basket-wrapper.bp-position-left,
.bp-basket-wrapper.position-left {
    justify-content: flex-start;
}

.bp-basket-wrapper.bp-position-center,
.bp-basket-wrapper.position-center {
    justify-content: center;
}

.bp-basket-wrapper.bp-position-right,
.bp-basket-wrapper.position-right {
    justify-content: flex-end;
}

/* Card Container */
.bonusplus-basket-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 360px;
    height: auto;
    align-self: flex-start;
    padding: 12px 14px;
    border-radius: var(--bp-radius-card, 12px);
    background-color: var(--bp-bg-card, #ffffff);
    border: 1px solid var(--bp-border-card, #e2e8f0);
    box-shadow: var(--bp-shadow-card, 0 4px 16px -2px rgba(0, 0, 0, 0.06));
    box-sizing: border-box;
    color: var(--bp-text-primary, #1e293b);
    margin: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.bonusplus-basket-container * {
    box-sizing: border-box;
    margin: 0;
}

/* Width Modifiers */
.bp-basket-wrapper.bp-width-full,
.bp-basket-wrapper.width-full,
.bp-width-full {
    width: 100%;
}

.bp-basket-wrapper.bp-width-full .bonusplus-basket-container,
.bp-basket-wrapper.width-full .bonusplus-basket-container,
.bonusplus-basket-container.bp-width-full,
.bonusplus-basket-container.width-full {
    width: 100%;
    max-width: 100%;
}

.bp-basket-wrapper.bp-width-fixed .bonusplus-basket-container,
.bp-basket-wrapper.width-fixed .bonusplus-basket-container,
.bonusplus-basket-container.bp-width-fixed,
.bonusplus-basket-container.width-fixed {
    width: 360px;
    max-width: 100%;
}

/* Themes */
:root[data-bp-theme="dark"] .bonusplus-basket-container,
[data-bp-theme="dark"] .bonusplus-basket-container,
.bp-basket-wrapper.bp-theme-dark .bonusplus-basket-container,
.bp-basket-wrapper[data-bp-theme="dark"] .bonusplus-basket-container,
.bp-basket-wrapper[data-theme="dark"] .bonusplus-basket-container,
.bonusplus-basket-container.bp-theme-dark,
.bonusplus-basket-container[data-bp-theme="dark"],
.bonusplus-basket-container[data-theme="dark"] {
    background-color: #252830;
    color: #f3f4f6;
    border-color: #383c48;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

:root[data-bp-theme="light"] .bonusplus-basket-container,
[data-bp-theme="light"] .bonusplus-basket-container,
.bp-basket-wrapper.bp-theme-light .bonusplus-basket-container,
.bp-basket-wrapper[data-bp-theme="light"] .bonusplus-basket-container,
.bp-basket-wrapper[data-theme="light"] .bonusplus-basket-container,
.bonusplus-basket-container.bp-theme-light,
.bonusplus-basket-container[data-bp-theme="light"],
.bonusplus-basket-container[data-theme="light"] {
    background-color: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
    box-shadow: var(--bp-shadow-card, 0 4px 16px -2px rgba(0, 0, 0, 0.06));
}

/* Bonus Info Rows */
.bp-basket-bonus-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.bp-basket-bonus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    line-height: 1.2;
    width: 100%;
    margin: 0;
    padding: 0;
}

.bp-basket-bonus-row span {
    color: var(--bp-text-secondary, #64748b);
    font-weight: 500;
    margin: 0;
    padding: 0;
}

:root[data-bp-theme="dark"] .bp-basket-bonus-row span,
[data-bp-theme="dark"] .bp-basket-bonus-row span,
.bp-theme-dark .bp-basket-bonus-row span,
[data-theme="dark"] .bp-basket-bonus-row span,
.bonusplus-basket-container.bp-theme-dark .bp-basket-bonus-row span,
.bonusplus-basket-container[data-theme="dark"] .bp-basket-bonus-row span {
    color: #a1a7b5;
}

.bp-basket-bonus-row b,
.bonusplus-basket-container b.js-bonus-balance {
    color: var(--infopush-bonusplus-site-color, #007bff);
    font-weight: 700;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

/* Input Block */
.bp-bonus-input-block,
.bonusplus-basket-container .js-bonus-input-block,
.js-bonus-input-block {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0 0;
    padding: 0;
    box-sizing: border-box;
}

.bp-bonus-input-block[style*="display: none"],
.bonusplus-basket-container .js-bonus-input-block[style*="display: none"],
.js-bonus-input-block[style*="display: none"] {
    display: none;
}

.bonus_mode[style*="display: none"],
.bonus-debit-btn[style*="display: none"] {
    display: none;
}

.bp-bonus-amount-input,
.bonusplus-basket-container .js-bonus-amount-input,
.js-bonus-amount-input {
    flex: 1 1 auto;
    width: 100%;
    height: 34px;
    min-height: 34px;
    padding: 4px 10px;
    margin: 0;
    background-color: var(--bp-bg-input, #ffffff);
    color: var(--bp-text-primary, #1e293b);
    border: 1px solid var(--bp-border-input, #cbd5e1);
    border-radius: var(--bp-radius-input, 8px);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: var(--bp-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

:root[data-bp-theme="dark"] .js-bonus-amount-input,
:root[data-bp-theme="dark"] .bp-bonus-amount-input,
[data-bp-theme="dark"] .js-bonus-amount-input,
[data-bp-theme="dark"] .bp-bonus-amount-input,
.bp-theme-dark .js-bonus-amount-input,
.bp-theme-dark .bp-bonus-amount-input,
[data-theme="dark"] .js-bonus-amount-input,
.bonusplus-basket-container.bp-theme-dark .js-bonus-amount-input,
.bonusplus-basket-container[data-theme="dark"] .js-bonus-amount-input {
    background-color: #1d2027;
    color: #f3f4f6;
    border-color: #424754;
}

.bp-bonus-amount-input:focus,
.bonusplus-basket-container .js-bonus-amount-input:focus,
.js-bonus-amount-input:focus {
    border-color: var(--infopush-bonusplus-site-color, #007bff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--infopush-bonusplus-site-color, #007bff) 22%, transparent);
    outline: none;
}

/* Debit Buttons */
.bp-bonus-debit-btn,
.bonusplus-basket-container .bonus-debit-btn,
.bonusplus-basket-container button.bonus-debit-btn,
.bonusplus-basket-container .bonus_mode,
.bonusplus-basket-container .js-apply-bonus-btn,
.bonusplus-basket-container .show_regystr_modal,
.bonus-debit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    height: 34px;
    min-height: 34px;
    margin: 4px 0 0 0;
    background-color: var(--infopush-bonusplus-site-color, #007bff);
    color: var(--infopush-bonusplus-text-color, #ffffff);
    border: 1px solid var(--infopush-bonusplus-site-color, #007bff);
    outline: none;
    border-radius: var(--bp-radius-btn, 8px);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    font-family: inherit;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    user-select: none;
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.bonus_mode[style*="display: none"],
.bonus-debit-btn[style*="display: none"],
.bp-bonus-debit-btn[style*="display: none"],
.js-apply-bonus-btn[style*="display: none"],
.show_regystr_modal[style*="display: none"],
.bonusplus-basket-container button[style*="display: none"],
.bp-basket-bonus-info button[style*="display: none"] {
    display: none;
}

.bp-bonus-debit-btn:hover,
.bp-bonus-debit-btn:focus,
.bp-bonus-debit-btn:focus-visible,
.bonusplus-basket-container .bonus-debit-btn:hover,
.bonusplus-basket-container .bonus-debit-btn:focus,
.bonusplus-basket-container .bonus-debit-btn:focus-visible,
.bonusplus-basket-container .bonus_mode:hover,
.bonusplus-basket-container .bonus_mode:focus,
.bonusplus-basket-container .js-apply-bonus-btn:hover,
.bonusplus-basket-container .js-apply-bonus-btn:focus,
.bonusplus-basket-container .show_regystr_modal:hover,
.bonusplus-basket-container .show_regystr_modal:focus,
.bonus-debit-btn:hover,
.bonus-debit-btn:focus,
.bonus-debit-btn:focus-visible {
    background-color: var(--infopush-bonusplus-site-color-hover, #0056b3);
    color: var(--infopush-bonusplus-text-color, #ffffff);
    border-color: var(--infopush-bonusplus-site-color-hover, #0056b3);
    box-shadow: none;
    transform: none;
    outline: none;
}

.bp-bonus-debit-btn:active,
.bonusplus-basket-container .bonus-debit-btn:active,
.bonusplus-basket-container .bonus_mode:active,
.bonusplus-basket-container .js-apply-bonus-btn:active,
.bonusplus-basket-container .show_regystr_modal:active,
.bonus-debit-btn:active {
    background-color: var(--infopush-bonusplus-site-color-hover, #0056b3);
    color: var(--infopush-bonusplus-text-color, #ffffff);
    border-color: var(--infopush-bonusplus-site-color-hover, #0056b3);
    transform: none;
    box-shadow: none;
    outline: none;
}

/* Unregistered State */
.bp-basket-reg-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.bp-basket-reg-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--bp-text-secondary, #64748b);
    line-height: 1.35;
    margin: 0;
    padding: 0;
}

:root[data-bp-theme="dark"] .bp-basket-reg-text,
[data-bp-theme="dark"] .bp-basket-reg-text,
.bp-theme-dark .bp-basket-reg-text,
[data-theme="dark"] .bp-basket-reg-text,
.bonusplus-basket-container.bp-theme-dark .bp-basket-reg-text,
.bonusplus-basket-container[data-theme="dark"] .bp-basket-reg-text {
    color: #a1a7b5;
}

/* ==========================================================================
   Widget Loader & Spinner
   ========================================================================== */
.bp-basket-wrapper,
.bonusplus-basket-container,
#js-bonus-widget {
    position: relative;
    overflow: hidden;
}

.bp-widget-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background-color: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-sizing: border-box;
}

:root[data-bp-theme="dark"] .bp-widget-loader,
[data-bp-theme="dark"] .bp-widget-loader,
.bp-theme-dark .bp-widget-loader,
[data-theme="dark"] .bp-widget-loader,
.bonusplus-basket-container.bp-theme-dark .bp-widget-loader,
.bonusplus-basket-container[data-theme="dark"] .bp-widget-loader,
.bonusplus-basket-container[data-bp-theme="dark"] .bp-widget-loader {
    background-color: rgba(37, 40, 48, 0.82);
}

.bonusplus-basket-container.bp-loading > .bp-widget-loader,
#js-bonus-widget.bp-loading > .bp-widget-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bp-spinner {
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 2.5px solid color-mix(in srgb, var(--infopush-bonusplus-site-color, #007bff) 22%, transparent);
    border-top-color: var(--infopush-bonusplus-site-color, #007bff);
    border-radius: 50%;
    animation: bp-spinner-rot 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes bp-spinner-rot {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}