/* =====================================================
   CBQ CyberSource Unified Checkout — Styles
   ===================================================== */

/* ---- Payment method selection — button UI ---- */

ul.wc_payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

ul.wc_payment_methods li.wc_payment_method {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide radio buttons and stray empty paragraphs from the NAPS plugin */
ul.wc_payment_methods li.wc_payment_method input[type="radio"] {
    display: none !important;
}

ul.wc_payment_methods li.wc_payment_method > p {
    margin: 0 !important;
    padding: 0 !important;
}

ul.wc_payment_methods li.wc_payment_method > p:empty {
    display: none !important;
}

/* Hide <br> injected inside labels */
ul.wc_payment_methods li.wc_payment_method label br {
    display: none !important;
}

/* Label as full-width button (label may be inside a <p> — use descendant selector) */
ul.wc_payment_methods li.wc_payment_method label {
    display: block !important;
    width: 100% !important;
    padding: 14px 20px !important;
    background: #f3f4f6 !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #333 !important;
    text-align: center !important;
    margin: 0 !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
}

ul.wc_payment_methods li.wc_payment_method label:hover {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
}

ul.wc_payment_methods li.wc_payment_method:has(input[type="radio"]:checked) label {
    background: #0071bc !important;
    border-color: #0071bc !important;
    color: #fff !important;
}

ul.wc_payment_methods .payment_box {
    padding: 12px 4px 4px !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* ---- Card brand badges ---- */

.cbq-cs-card-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.cbq-cs-brand {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.cbq-cs-brand-visa  { background: #1a1f71; color: #fff; }
.cbq-cs-brand-mc    { background: #eb001b; color: #fff; }
.cbq-cs-brand-amex  { background: #007bc1; color: #fff; }
.cbq-cs-brand-ap    { background: #000;    color: #fff; }
.cbq-cs-brand-gp    { background: #fff;    color: #5f6368; border-color: #dadce0; }

.cbq-cs-debit-note {
    font-size: 12px;
    color: #888;
    margin: 0 0 10px;
    font-style: italic;
}

/* ---- Inline payment container ---- */

#cbq-cs-payment-container {
    margin-top: 10px;
}

.cbq-cs-description {
    color: #555;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Status line */
#cbq-cs-card-status {
    font-size: 13px;
    margin-bottom: 10px;
}

#cbq-cs-card-entered {
    color: #1a7c1a;
    font-weight: 600;
}

#cbq-cs-change-card {
    margin-left: 8px;
    font-size: 12px;
    color: #0071bc;
    text-decoration: underline;
    cursor: pointer;
}

/* "Enter Payment Details" button */
.cbq-cs-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: #0071bc;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    line-height: 1.3;
    text-decoration: none;
}

.cbq-cs-open-btn:hover { background: #005a96; }
.cbq-cs-open-btn:active { transform: scale(0.98); }

/* Inline error */
#cbq-cs-inline-error {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    color: #b91c1c;
    font-size: 13px;
}

/* ---- Spinner ---- */

.cbq-cs-spinner {
    display: inline-block;
    border-radius: 50%;
    animation: cbq-spin 0.75s linear infinite;
    flex-shrink: 0;
}

.cbq-cs-spinner-sm {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    vertical-align: middle;
    margin-right: 5px;
}

.cbq-cs-spinner-lg {
    width: 40px; height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #0071bc;
    margin-bottom: 12px;
}

@keyframes cbq-spin { to { transform: rotate(360deg); } }

/* =====================================================
   MODAL / SIDEBAR PANEL
   ===================================================== */

#cbq-cs-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: stretch;
    justify-content: flex-end;  /* sidebar on right */
}

/* Sidebar panel */
#cbq-cs-modal {
    width: 100%;
    max-width: 440px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,0.18);
    animation: cbq-slide-in 0.25s ease;
    overflow-y: auto;
    max-height: 100vh;
    position: relative;
}

@keyframes cbq-slide-in {
    from { transform: translateX(100%); opacity: 0.7; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* Header */
#cbq-cs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

#cbq-cs-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

#cbq-cs-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

#cbq-cs-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

#cbq-cs-modal-close:hover { color: #333; background: #f0f0f0; }

/* Loading state */
#cbq-cs-modal-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

#cbq-cs-modal-loading p { margin: 0; }

/* UC widget container — CyberSource mounts its own UI here */
#cbq-cs-uc-container {
    flex: 1;
    padding: 20px;
    min-height: 200px;
}

/* Allow UC widget to use its full width */
#cbq-cs-uc-container iframe,
#cbq-cs-uc-container > div {
    width: 100% !important;
}

/* Modal error */
#cbq-cs-modal-error {
    margin: 0 20px 16px;
    padding: 10px 14px;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 13px;
}

/* Secure note footer */
#cbq-cs-modal-secure-note {
    padding: 14px 20px;
    border-top: 1px solid #f5f5f5;
    font-size: 11px;
    color: #999;
    text-align: center;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* Body lock */
body.cbq-cs-modal-open {
    overflow: hidden;
}

/* ---- Mobile: full-screen bottom sheet ---- */
@media (max-width: 600px) {
    #cbq-cs-modal-overlay {
        align-items: flex-end;
        justify-content: center;
    }

    #cbq-cs-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
        animation: cbq-slide-up 0.25s ease;
    }

    @keyframes cbq-slide-up {
        from { transform: translateY(100%); opacity: 0.7; }
        to   { transform: translateY(0);    opacity: 1; }
    }
}
