/* === RBM Cheque & Term Payment for WooCommerce =================================
   Front-end styles (product + checkout)
   Notes:
   - Avoid fixed margin hacks for sticky toolbars; we use a dynamic spacer variable set by JS.
   - Keep theme-safe selectors and minimal overrides.
============================================================================== */

:root{
    --rbmct-sticky-spacer: 0px;
    --rbmct-trigger-bg: #ffffff;
    --rbmct-trigger-color: #111827;
    --rbmct-mobile-strip-height: 44px;
}

/* If a theme overlays a sticky bar at the bottom, JS sets --rbmct-sticky-spacer */
body.single-product{
    padding-bottom: var(--rbmct-sticky-spacer);
}

/* === Term pricing card (single product) ===================================== */
.rbmct-term-pricing{
    margin: 18px 0 20px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    width: 100%;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.7;
}

/* Some themes make summary/form flex; keep card full width */
.single-product .summary .rbmct-term-pricing,
.single-product form.cart .rbmct-term-pricing{
    flex: 0 0 100%;
    max-width: 100%;
}

.rbmct-term-pricing__title{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 10px;
}

.rbmct-term-pricing__title::before{
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.rbmct-term-pricing__options{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.rbmct-term-option{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    cursor: pointer;
    transition: all 0.15s ease-out;
}

.rbmct-term-option input[type="radio"]{
    margin: 0 0 0 4px;
    accent-color: #22c55e;
}

.rbmct-term-option__label{
    font-weight: 500;
    white-space: nowrap;
}

.rbmct-term-option__price{
    font-size: 12px;
    opacity: 0.82;
}

.rbmct-term-option:hover{
    border-color: #cbd5f5;
    background-color: #f3f4ff;
}

.rbmct-term-option input[type="radio"]:checked ~ .rbmct-term-option__label,
.rbmct-term-option input[type="radio"]:checked ~ .rbmct-term-option__price{
    color: #14532d;
    font-weight: 600;
}

.rbmct-term-option input[type="radio"]:checked ~ .rbmct-term-option__price{
    opacity: 1;
}

.rbmct-term-pricing__hint{
    display: block;
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.7;
}

/* === Cheque fields on checkout ============================================= */
.rbmct-cheque-fields-wrapper{
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f9fafb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.rbmct-cheque-fields__title{
    margin: 0 0 10px;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

.rbmct-cheque-fields__title::before{
    content: "";
    position: absolute;
    left: 0;
    right: auto;
    bottom: -4px;
    width: 52px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #06b6d4);
}

.rbmct-cheque-amount-wrap,
.rbmct-cheque-due-date-wrap{
    margin-bottom: 10px;
}

#rbm_cheque_amount_display,
#rbm_cheque_due_date_display{
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rbm-cheque-amount-words{
    display: block;
    margin-top: 3px;
    font-size: 11px;
    opacity: 0.8;
}

.rbmct-cheque-fields-wrapper .form-row{
    margin-bottom: 10px;
}

@media (max-width: 480px){
    .rbmct-term-pricing,
    .rbmct-cheque-fields-wrapper{
        padding: 12px 14px;
        border-radius: 12px;
        max-width: 100%;
    }

    .rbmct-term-option{
        padding-inline: 8px;
    }
}

/* === WoodMart / sticky add-to-cart compatibility ============================ */
/* Note: Do not hard-hide the card inside WoodMart sticky containers. We handle duplicates and relocation via JS for better theme compatibility. */

/* Sticky trigger button (appears in sticky bar) */
.rbmct-term-trigger{
    font-size: 12px;
    line-height: 1.8;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: var(--rbmct-trigger-bg, #ffffff);
    color: var(--rbmct-trigger-color, #111827);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 8px;
}

.wd-sticky-btn .rbmct-term-trigger{
    margin-inline-start: 8px;
    margin-inline-end: 8px;
}

/* keep trigger visually aligned in flex toolbars */
.wd-sticky-btn .rbmct-term-trigger{
    flex: 0 0 auto;
}


/* ===== Mobile strip above sticky/bottom bars (matches WoodMart UX) ===== */
.rbmct-mobile-sticky-strip{
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--rbmct-sticky-height, 0px) + env(safe-area-inset-bottom, 0px));
    z-index: 999999;
    display: none;
    padding: 6px 10px;
    transition: opacity .18s ease, transform .18s ease;
}

.rbmct-mobile-sticky-strip.is-hidden{
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.rbmct-mobile-sticky-strip__btn{
    width: 100%;
    height: var(--rbmct-mobile-strip-height, 44px);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    background: var(--rbmct-trigger-bg, #ffffff);
    color: var(--rbmct-trigger-color, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 768px){
    .rbmct-mobile-sticky-strip{ display: block; }
}



/* RBMCT: prevent duplicate triggers across breakpoints */
@media (max-width: 1024px){
  .rbmct-term-trigger{ display:none !important; }
}
@media (min-width: 1025px){
  .rbmct-mobile-sticky-strip{ display:none !important; }
}


/* Custom description inside the term pricing box (scoped). */
.rbmct-term-pricing__desc{margin-top:10px;line-height:1.8;}
