/* 1. Reset the Label: Stop it from taking up the whole line and floating */
ul.payment_methods li.payment_method_fastspring_card label {
    padding-bottom: 0;
    padding-right: 0;
    padding-top: 0;
}

/* 2. The Container: Space it out from the text */
.fs-card-inline-icons-container {
    display: inline-block;
    float: right;
}

li.payment_method_fastspring_card .fs-card-inline-icons-container img.fs-inline-icon{
    display: inline;
    float: none;
    height: 26px;
    max-height: 26px;
    max-width: 43px;
    width: 43px;
}


/* 4. Remove any existing clearfixes that might be pushing the row down */
ul.payment_methods label[for="payment_method_fastspring_card"]::after {
    display: none !important;
}

/* 5. Clean up other FS icons (PayPal, etc.) */
img.fastspring-icon {
    vertical-align: middle;
    display: inline-block;
    float: right;
}

/* 6. Remove any legacy clear-fixes that might push content down */
ul.payment_methods label[for="payment_method_fastspring_card"]::after {
    display: none !important;
}

.woocommerce-checkout #payment ul.payment_methods li img.fastspring-icon {
    max-width: 50px !important;
    padding-left: 3px;
    margin: 0;
}
/* ── Embedded checkout: base layout ─────────────────────────────── */
.fssg-express-embedded {
    margin: 0;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

/* ── Express-only mode (googlepay / applepay only) ────────────────
   Compact clip: only the express button is visible with a tight gap.
   The full SBL content is clipped away by height + clip-path. */
.fssg-express-embedded[data-express-only="1"] {
    margin-top: -137px !important;
}
.fssg-express-embedded[data-express-only="1"].fssg-express-product {
    margin-top: 0 !important;
    margin-left: -25px !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    overflow: hidden !important;
    height: 80px !important;
    max-height: 80px !important;
}
.single-product form.cart:has(.fssg-express-embedded) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.fssg-express-embedded[data-express-only="1"] #fsc-embedded-checkout-container {
    width: 100% !important;
    height: 330px !important;
    max-height: 330px !important;
    overflow: hidden !important;
    clip-path: inset(116px 0 0 0) !important;
    min-height: 0;
}
.fssg-express-embedded[data-express-only="1"].fssg-express-product #fsc-embedded-checkout-container {
    position: relative;
    top: -116px;
    height: 180px !important;
    max-height: 180px !important;
}
.fssg-express-embedded[data-express-only="1"].fssg-express-embedded-blockcart #fsc-embedded-checkout-container {
    height: 167.2px !important;
    max-height: 167.2px !important;
}
.fssg-express-embedded[data-express-only="1"].fssg-express-applepay #fsc-embedded-checkout-container {
    height: 380px !important;
    max-height: 380px !important;
}

/* ── Full checkout mode (non-express methods enabled) ──────────────
   Trimmed band: hide header (Total/TEST/country) and footer,
   reveal only GPay button + OR divider + payment method tiles. */
.fssg-express-embedded[data-express-only="0"] {
    margin-top: -112px !important;
    padding-bottom: 15px !important;
}
.fssg-express-embedded[data-express-only="0"].fssg-express-product {
    margin-top: -112px !important;
    padding-bottom: 15px !important;
}
.fssg-express-embedded[data-express-only="0"] #fsc-embedded-checkout-container {
    width: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    clip-path: inset(80px 0 0 0) !important;
    -webkit-clip-path: inset(80px 0 0 0) !important;
}


/* ── Shared: loading / ready fade ────────────────────────────────── */
.fssg-express-embedded:not(.fssg-express-ready) #fsc-embedded-checkout-container {
    opacity: 0 !important;
}
.fssg-express-embedded.fssg-express-loading {
    opacity: 0.6;
    pointer-events: none;
}
.woocommerce-cart .fssg-express-embedded {
    padding-bottom: 15px;
}
/* Product page: keep theme payment-icon blocks small (Pay securely with ...) */
.payments_icons img {
    max-width: 45px;
    width: auto;
    height: auto;
}
.payments_icons img.fastspring-icon {
    float: none;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

/* ── Cart page: embedded checkout coexists with Proceed to Checkout ── */


/* ── 1.15.0: Google Pay + PayPal pay stack ───────────────────────── */
.fssg-pay-stack { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; margin: 12px 0 4px; clear: both; flex-basis: 100%; }
.fssg-pay-stack .fssg-express-embedded { margin: 0 !important; border-radius: 6px; overflow: hidden; }
.fssg-pay-stack .fssg-express-embedded.fssg-express-loading { min-height: 48px; background: #f3f4f6; border-radius: 6px; position: relative; }
.fssg-pay-stack .fssg-express-embedded.fssg-express-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid #d1d5db; border-top-color: #111; border-radius: 50%; animation: fssg-spin .8s linear infinite; }
.fssg-pay-stack .fssg-express-embedded.fssg-gpay-unavailable { display: none !important; }
.fssg-pay-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 6px; cursor: pointer; font: 600 15px/1 -apple-system, "Segoe UI", Roboto, sans-serif; transition: filter .15s, transform .05s; position: relative; box-shadow: none; text-transform: none; letter-spacing: 0; }
.fssg-pay-btn:hover { filter: brightness(.96); }
.fssg-pay-btn:active { transform: translateY(1px); }
.fssg-pay-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.fssg-pay-paypal, .fssg-pay-paypal:hover, .fssg-pay-paypal:focus { background: #ffc439 !important; color: #111 !important; }
.fssg-pay-paypal .fssg-pp-logo { height: 22px; width: auto; }
.fssg-pay-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.2); border-top-color: #111; border-radius: 50%; animation: fssg-spin .8s linear infinite; position: absolute; right: 16px; }
.fssg-pay-btn.is-busy { pointer-events: none; opacity: .85; }
.fssg-pay-btn.is-busy .fssg-pay-spinner { display: block; }
.fssg-pay-note { font-size: 13px; color: #4b5563; min-height: 0; }
.fssg-pay-note:empty { display: none; }
.fssg-pay-note button { margin-left: 6px; background: none; border: 0; padding: 0; color: #2563eb; text-decoration: underline; cursor: pointer; font: inherit; }
@keyframes fssg-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .fssg-pay-stack { max-width: none; } }

/* 1.15.2: product/cart pay stack — Google Pay button only, aligned with PayPal button */
.fssg-pay-stack .fssg-express-embedded[data-express-only="0"] { margin-top: 0 !important; }
.fssg-pay-stack .fssg-express-embedded { width: 100% !important; max-width: 480px !important; padding: 0 !important; }
.fssg-pay-stack .fssg-pay-paypal { width: 100% !important; max-width: 480px !important; }
/* 1.16.0 Google's own Google Pay button */
.fssg-pay-stack .fssg-gpay-native { width: 100%; height: 48px; border-radius: 6px; overflow: hidden; }
.fssg-pay-stack .fssg-gpay-native > div, .fssg-pay-stack .fssg-gpay-native button { width: 100% !important; height: 48px !important; }
.fssg-pay-stack .fssg-gpay-native.fssg-gpay-loading { background: #f3f4f6; position: relative; }
.fssg-pay-stack .fssg-gpay-native.fssg-gpay-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid #d1d5db; border-top-color: #111; border-radius: 50%; animation: fssg-spin .8s linear infinite; }
.fssg-pay-stack .fssg-gpay-native.is-busy { opacity: .7; pointer-events: none; }
.fssg-pay-stack .fssg-gpay-note:empty { display: none; }
/* 1.17.0 per-method buttons (settings-driven) */
.fssg-pay-stack .fssg-pay-method { width: 100% !important; max-width: 480px !important; height: var(--fssg-h, 48px) !important; border-radius: var(--fssg-r, 6px) !important; margin: 0 !important; }
.fssg-pay-method.fssg-style-brand, .fssg-pay-method.fssg-style-brand:hover, .fssg-pay-method.fssg-style-brand:focus { background: var(--fssg-bg, #1f2937) !important; color: var(--fssg-fg, #fff) !important; border: 0 !important; }
.fssg-pay-method.fssg-style-dark, .fssg-pay-method.fssg-style-dark:hover, .fssg-pay-method.fssg-style-dark:focus { background: #111 !important; color: #fff !important; border: 0 !important; }
.fssg-pay-method.fssg-style-light, .fssg-pay-method.fssg-style-light:hover, .fssg-pay-method.fssg-style-light:focus { background: #fff !important; color: #111 !important; border: 1px solid #d1d5db !important; }
.fssg-pay-method.fssg-style-outline, .fssg-pay-method.fssg-style-outline:hover, .fssg-pay-method.fssg-style-outline:focus { background: transparent !important; color: #111 !important; border: 2px solid #111 !important; }
.fssg-pay-method .fssg-pay-logo { height: calc(var(--fssg-h, 48px) * .46); width: auto; max-width: 60%; object-fit: contain; }
.fssg-pay-stack { display: flex; flex-direction: column; gap: 10px; }
.fssg-pay-stack .fssg-gpay-native { height: var(--fssg-h, 48px); border-radius: var(--fssg-r, 6px); max-width: 480px; }
.fssg-pay-stack .fssg-gpay-native > div, .fssg-pay-stack .fssg-gpay-native button { height: var(--fssg-h, 48px) !important; }
.fssg-ctx-mini_cart { margin-top: 10px; }
.fssg-ctx-mini_cart .fssg-pay-method, .fssg-ctx-mini_cart .fssg-gpay-native { max-width: none !important; }
.fssg-express-top { margin: 0 0 24px; }
.fssg-express-top .fssg-express-title { font-weight: 600; margin: 0 0 10px; }
.fssg-express-top .fssg-pay-stack { flex-direction: row; flex-wrap: wrap; }
.fssg-express-top .fssg-pay-stack > .fssg-pay-method, .fssg-express-top .fssg-pay-stack > .fssg-gpay-native { flex: 1 1 200px; max-width: none !important; }
.fssg-express-top .fssg-pay-note { flex-basis: 100%; }
.fssg-express-or { display: flex; align-items: center; gap: 12px; color: #6b7280; font-size: 13px; margin: 18px 0 0; }
.fssg-express-or::before, .fssg-express-or::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }

/* PayPal uses the full, unmasked FastSpring embedded checkout on product/cart. */
.fssg-pay-stack .fssg-inline-paypal[hidden] { display: none !important; }
.fssg-pay-stack .fssg-inline-paypal { box-sizing: border-box; width: 100% !important; max-width: 480px !important; margin: 4px 0 0 !important; padding: 0 !important; overflow: hidden !important; height: auto !important; max-height: none !important; }
.fssg-pay-stack .fssg-inline-paypal .fssg-wallet-loading { display: none; min-height: 48px; align-items: center; justify-content: center; padding: 12px; color: #4b5563; font: 500 14px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; background: #f3f4f6; }
.fssg-pay-stack .fssg-inline-paypal.fssg-express-loading .fssg-wallet-loading { display: flex; }
.fssg-pay-stack .fssg-inline-paypal:not(.fssg-express-ready) #fsc-embedded-checkout-container { visibility: hidden !important; height: 0 !important; min-height: 0 !important; }
.fssg-pay-stack .fssg-inline-paypal #fsc-embedded-checkout-container { box-sizing: border-box; position: static !important; width: 100% !important; max-width: 100% !important; height: 820px !important; max-height: none !important; min-height: 580px !important; margin: 0 !important; overflow: hidden !important; clip-path: none !important; -webkit-clip-path: none !important; opacity: 1 !important; transform: none !important; }
.fssg-pay-stack .fssg-inline-paypal iframe { width: 100% !important; min-height: 780px !important; border: 0 !important; }
@media (max-width: 600px) { .fssg-pay-stack .fssg-inline-paypal #fsc-embedded-checkout-container { height: 900px !important; } .fssg-pay-stack .fssg-inline-paypal iframe { min-height: 860px !important; } }
