/* ═══════════════════════════════════════════════════════
   BuddhaBrian Checkout Sidebar — v4
   Off-white · Playfair Display · DM Sans
   Button #FFDE58 → hover #5270FF · border-radius: 0
   + Login panel styles
════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────── */
#bb-sidebar {
    --bb-bg:           #f7f5f0;
    --bb-accent:       #1F3964;
    --bb-accent-faint: rgba(31,57,100,0.06);
    --bb-accent-mid:   rgba(31,57,100,0.12);
    --bb-border:       rgba(31,57,100,0.1);
    --bb-border-mid:   rgba(31,57,100,0.16);
    --bb-muted:        rgba(31,57,100,0.5);
    --bb-btn-bg:       #FFDE58;
    --bb-btn-text:     #1F3964;
    --bb-btn-hover-bg: #5270FF;
    --bb-btn-hover-tx: #FFFFFF;
    --bb-error:        #dc2626;
    --bb-success:      #16a34a;
    --bb-w:            430px;
}

/* ── Overlay ──────────────────────────────────────── */
.bb-overlay {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(15,25,60,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.bb-overlay.bb-open { opacity: 1; pointer-events: all; }

/* ── Sidebar panel ────────────────────────────────── */
#bb-sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
    width: min(var(--bb-w), 100vw);
    background: var(--bb-bg);
    border-left: 1px solid var(--bb-border-mid);
    box-shadow: -16px 0 60px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
}
#bb-sidebar.bb-open { transform: translateX(0); }
#bb-sidebar::before {
    content: ''; display: block; height: 3px; flex-shrink: 0;
    background: var(--bb-accent);
}

/* ── Header ───────────────────────────────────────── */
.bb-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--bb-border);
    flex-shrink: 0; background: var(--bb-bg);
}
.bb-eyebrow {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--bb-accent); opacity: 0.65; margin-bottom: 6px;
}
.bb-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.55rem; font-weight: 900;
    color: var(--bb-accent); line-height: 1.15; margin: 0 0 4px;
    transition: none;
}
.bb-subheading { font-size: 0.82rem; color: var(--bb-muted); line-height: 1.5; margin: 0; }
.bb-close {
    width: 34px; height: 34px; flex-shrink: 0;
    background: var(--bb-accent-faint);
    border: 1px solid var(--bb-border);
    color: var(--bb-accent); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; margin-left: 12px; border-radius: 0;
}
.bb-close:hover { background: var(--bb-accent); color: var(--bb-bg); }

/* ── Scrollable body ──────────────────────────────── */
.bb-body {
    flex: 1; overflow-y: auto;
    padding: 24px 26px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--bb-border-mid) transparent;
}
.bb-body::-webkit-scrollbar { width: 4px; }
.bb-body::-webkit-scrollbar-thumb { background: var(--bb-border-mid); }

/* ── Amount card ──────────────────────────────────── */
.bb-amount-card {
    background: var(--bb-accent); padding: 20px 22px;
    margin-bottom: 22px; text-align: center;
}
.bb-amount-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--bb-btn-bg); margin-bottom: 8px; opacity: 0.9;
}
.bb-amount-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.4rem; font-weight: 900;
    color: #ffffff; line-height: 1;
}
.bb-currency-prefix { font-size: 1.6rem; vertical-align: super; margin-right: 2px; }
.bb-amount-hint { font-size: 0.75rem; margin-top: 7px; color: rgba(255,255,255,0.6); }

/* ── Section label ────────────────────────────────── */
.bb-section-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--bb-accent); opacity: 0.55;
    margin-bottom: 10px; margin-top: 2px;
}

/* ── Preset buttons ───────────────────────────────── */
.bb-presets {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 8px; margin-bottom: 18px;
}
.bb-preset {
    background: #fff; border: 1.5px solid var(--bb-border-mid);
    color: var(--bb-accent); font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 700; padding: 11px 6px;
    cursor: pointer; transition: all 0.15s; text-align: center; border-radius: 0;
}
.bb-preset:hover { border-color: var(--bb-accent); background: var(--bb-accent-faint); }
.bb-preset.bb-active { background: var(--bb-accent); border-color: var(--bb-accent); color: #fff; }

/* ── Fields ───────────────────────────────────────── */
.bb-field-wrap { margin-bottom: 14px; }
.bb-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--bb-accent); opacity: 0.7; margin-bottom: 6px;
}
.bb-input-currency-wrap { position: relative; }
.bb-input-symbol {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    font-weight: 700; font-size: 0.95rem; color: var(--bb-accent); pointer-events: none;
}
.bb-input {
    width: 100%; background: #fff;
    border: 1.5px solid var(--bb-border-mid);
    padding: 12px 14px; color: var(--bb-accent);
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
    border-radius: 0; box-sizing: border-box; -moz-appearance: textfield;
}
.bb-input::-webkit-outer-spin-button,
.bb-input::-webkit-inner-spin-button { -webkit-appearance: none; }
#bb-custom-amount { padding-left: 30px; }
.bb-input:focus { border-color: var(--bb-accent); box-shadow: 0 0 0 3px var(--bb-accent-mid); }
.bb-input::placeholder { color: rgba(31,57,100,0.28); font-weight: 400; }
.bb-input.bb-invalid { border-color: var(--bb-error); }

/* ── Min warning ──────────────────────────────────── */
.bb-min-warning {
    display: none; align-items: center; gap: 5px;
    font-size: 0.75rem; color: var(--bb-error); margin: 5px 0 0;
}
.bb-min-warning.bb-show { display: flex; }

/* ── Divider ──────────────────────────────────────── */
.bb-divider { height: 1px; background: var(--bb-border); margin: 18px 0; }

/* ── Stripe card ──────────────────────────────────── */
.bb-card-element {
    background: #fff; border: 1.5px solid var(--bb-border-mid);
    padding: 13px 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.bb-card-element.StripeElement--focus { border-color: var(--bb-accent); box-shadow: 0 0 0 3px var(--bb-accent-mid); }
.bb-card-element.StripeElement--invalid { border-color: var(--bb-error); }
.bb-card-error {
    font-size: 0.76rem; color: var(--bb-error);
    margin-top: 6px; min-height: 18px;
    display: flex; align-items: center; gap: 4px;
}

/* ── Pay / action button ──────────────────────────── */
.bb-pay-btn {
    width: 100%; margin-top: 18px;
    background: var(--bb-btn-bg); color: var(--bb-btn-text);
    font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700;
    padding: 16px 20px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: background 0.2s, color 0.2s, transform 0.12s;
    box-shadow: 0 2px 12px rgba(31,57,100,0.12); border-radius: 0;
    position: relative; overflow: hidden;
}
.bb-pay-btn:hover:not(:disabled) {
    background: var(--bb-btn-hover-bg); color: var(--bb-btn-hover-tx);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(82,112,255,0.3);
}
.bb-pay-btn:active:not(:disabled) { transform: translateY(0); }
.bb-pay-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.bb-pay-btn svg { flex-shrink: 0; }

/* ── Secure row ───────────────────────────────────── */
.bb-secure-row {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 0.73rem; color: var(--bb-muted); margin-top: 12px; text-align: center;
}

/* ── "Already have account" toggle ───────────────── */
.bb-login-toggle-wrap {
    display: flex; justify-content: center;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--bb-border);
}
.bb-login-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem; font-weight: 600;
    color: var(--bb-accent); opacity: 0.65;
    padding: 4px 0; transition: opacity 0.15s;
    text-decoration: underline; text-underline-offset: 3px;
}
.bb-login-toggle:hover { opacity: 1; }
.bb-login-toggle svg { flex-shrink: 0; }

/* ── States (processing / success) ───────────────── */
.bb-state { text-align: center; padding: 32px 20px; }
.bb-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--bb-border-mid);
    border-top-color: var(--bb-accent); border-radius: 50%;
    animation: bb-spin 0.7s linear infinite; margin: 0 auto 16px;
}
@keyframes bb-spin { to { transform: rotate(360deg); } }
.bb-state p { color: var(--bb-muted); font-size: 0.88rem; }
.bb-success-state { animation: bb-fade-up 0.45s ease both; }
@keyframes bb-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bb-success-icon {
    width: 60px; height: 60px;
    background: rgba(22,163,74,0.1); border: 2px solid rgba(22,163,74,0.4);
    color: var(--bb-success); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.bb-success-state h3 {
    font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900;
    color: var(--bb-accent); margin-bottom: 10px;
}
.bb-success-state p { color: var(--bb-muted); font-size: 0.86rem; line-height: 1.6; margin-bottom: 6px; }
.bb-redirect-txt { color: var(--bb-accent) !important; font-weight: 600 !important; font-size: 0.8rem !important; }

/* ════════════════════════════════════════════════════
   LOGIN PANEL STYLES
════════════════════════════════════════════════════ */

/* Icon at top of login panel */
.bb-login-icon {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--bb-accent-faint);
    border: 1.5px solid var(--bb-border-mid);
    color: var(--bb-accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.bb-login-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 900;
    color: var(--bb-accent); text-align: center; margin: 0 0 8px;
}
.bb-login-sub {
    font-size: 0.85rem; color: var(--bb-muted);
    text-align: center; margin: 0; line-height: 1.6;
}

/* Password field with toggle */
.bb-password-wrap { position: relative; }
.bb-password-wrap .bb-input { padding-right: 44px; }
.bb-pw-toggle {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 42px;
    background: none; border: none; cursor: pointer;
    color: var(--bb-muted); display: flex;
    align-items: center; justify-content: center;
    transition: color 0.15s;
}
.bb-pw-toggle:hover { color: var(--bb-accent); }

/* Login error */
.bb-login-error {
    font-size: 0.78rem; color: var(--bb-error);
    display: none; align-items: center; gap: 5px;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.2);
    padding: 10px 12px; margin-top: 4px;
    line-height: 1.5;
}

/* Forgot password link */
.bb-forgot-row {
    display: flex; justify-content: center;
    margin-top: 14px;
}
.bb-forgot-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: var(--bb-muted);
    text-decoration: none; font-weight: 500;
    transition: color 0.15s;
}
.bb-forgot-link:hover { color: var(--bb-accent); }

/* Back to checkout link */
.bb-back-to-checkout-wrap {
    display: flex; justify-content: center;
    margin-top: 24px; padding-top: 16px;
    border-top: 1px solid var(--bb-border);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    .bb-header { padding: 16px 18px 14px; }
    .bb-body { padding: 20px 18px 36px; }
    .bb-heading { font-size: 1.35rem; }
    .bb-amount-value { font-size: 2.8rem; }
    .bb-presets { gap: 6px; }
    .bb-preset { font-size: 0.82rem; padding: 9px 4px; }
}
