/* SFP Premium Cart & Checkout v1.0.0 — scoped visual styling only */
body.sfp-premium-cart,body.sfp-premium-checkout{--sfp-navy:#091823;--sfp-panel:#172a36;--sfp-blue:#1596d2;--sfp-edge:#344957;--sfp-light:#eef3f6;--sfp-text:#e8f2f7;background:#091823;color:var(--sfp-text)}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .site-content,body:is(.sfp-premium-cart,.sfp-premium-checkout) #content,body:is(.sfp-premium-cart,.sfp-premium-checkout) .content-area,body:is(.sfp-premium-cart,.sfp-premium-checkout) main#main{background:#091823;color:#e8f2f7}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .entry-title,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce h2,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce h3,body:is(.sfp-premium-cart,.sfp-premium-checkout) .cart_totals h2{color:#fff!important;font-weight:800;letter-spacing:-.025em}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .entry-title{font-size:clamp(30px,4vw,50px);margin:22px 0 30px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce{color:#d9e5ed}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a:not(.button):not(.button-alt):not(.checkout-button){color:#75d4ff}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a:hover{color:#a7e5ff}
/* Tables retain WooCommerce HTML and calculations */
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table{border:1px solid var(--sfp-edge);border-collapse:separate;border-spacing:0;border-radius:7px;overflow:hidden;background:#152631;color:#e7f0f6}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table th{background:#1b3543;color:#fff;font-weight:800;border-color:#344957;padding:16px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table td{background:#132631;color:#e7f0f6;border-color:#344957;padding:15px;vertical-align:middle}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table tr:nth-child(even) td{background:#172d39}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table .product-thumbnail img{width:85px;max-width:100%;height:auto;background:#eef3f6;border-radius:5px;padding:5px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table .product-name a{font-weight:750}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table .product-remove a{color:#ff9f9f!important}
/* Totals and order review */
body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals{float:right;max-width:100%;background:#122531;padding:24px;border:1px solid var(--sfp-edge);border-radius:8px}
body.sfp-premium-cart .woocommerce .cart-collaterals{margin:36px 0 50px}
body.sfp-premium-cart .woocommerce .cart-collaterals:after{content:"";display:block;clear:both}
body.sfp-premium-checkout .woocommerce-checkout-review-order{background:#122531;border:1px solid var(--sfp-edge);border-radius:8px;padding:18px;margin-bottom:24px}
body.sfp-premium-checkout .woocommerce-checkout-review-order-table{width:100%}
/* Inputs: intentionally regular fields only; gateway-hosted inputs/iframes untouched */
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input.input-text,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce textarea,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce select,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input.qty,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input[type="text"]:not([type="radio"]):not([type="checkbox"]){background:#f3f7f9!important;color:#11222d!important;border:1px solid #a3b3bd!important;border-radius:5px;min-height:43px;padding:10px 12px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input::placeholder,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce textarea::placeholder{color:#637480;opacity:1}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input:focus-visible,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce textarea:focus-visible,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce select:focus-visible{outline:3px solid #76cffa;outline-offset:2px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce .form-row label{color:#eaf3f8;font-weight:650}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce .form-row .required{color:#ff9a9a}
/* Standard WooCommerce selects (Select2) */
body.sfp-premium-checkout .woocommerce .select2-container .select2-selection--single{background:#f3f7f9;color:#11222d;border:1px solid #a3b3bd;border-radius:5px;min-height:43px}
body.sfp-premium-checkout .woocommerce .select2-container .select2-selection__rendered{color:#11222d;line-height:41px;padding-left:12px}
body.sfp-premium-checkout .woocommerce .select2-container .select2-selection__arrow{height:41px}
/* Coupon notices and promo boxes */
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-message,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-info{background:#173142;color:#edf5f9;border-top:3px solid var(--sfp-blue);padding:18px 22px 18px 52px}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-error{background:#3c2329;color:#fff;border-top-color:#ef7f80}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-message::before,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-info::before{color:#65c8f6}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-form-coupon,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce-form-login{background:#142a38;border:1px solid var(--sfp-edge);border-radius:7px;color:#eaf1f5}
/* Native buttons only; do not alter Apple/Google Pay, Stripe/Affirm iframes */
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a.button,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce button.button,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input.button,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce #payment #place_order{background:#1596d2!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border:0;border-radius:5px;font-weight:800;padding:15px 23px;min-height:45px;text-shadow:none;box-shadow:none}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a.button:hover,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce button.button:hover,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce input.button:hover,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce #payment #place_order:hover{background:#087bb2!important;color:#fff!important}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a.button:disabled,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce button.button:disabled,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce button.button:disabled[disabled]{opacity:.58!important;cursor:not-allowed}
body.sfp-premium-cart .woocommerce a.checkout-button{display:block;width:100%;text-align:center;font-size:18px}
body.sfp-premium-checkout .woocommerce #payment #place_order{font-size:17px;min-width:185px}
/* Checkout structure */
body.sfp-premium-checkout .woocommerce form.checkout{margin-top:26px}
body.sfp-premium-checkout .woocommerce-billing-fields,body.sfp-premium-checkout .woocommerce-shipping-fields,body.sfp-premium-checkout .woocommerce-additional-fields{background:#142936;padding:26px;border:1px solid var(--sfp-edge);border-radius:8px;margin-bottom:22px}
body.sfp-premium-checkout .woocommerce form .form-row{margin-bottom:13px}
body.sfp-premium-checkout .woocommerce #payment{background:#182b38;border:1px solid var(--sfp-edge);border-radius:8px;color:#edf4f8}
body.sfp-premium-checkout .woocommerce #payment ul.payment_methods{border-color:var(--sfp-edge)}
body.sfp-premium-checkout .woocommerce #payment ul.payment_methods>li{padding:10px 0;color:#e7f1f7}
body.sfp-premium-checkout .woocommerce #payment div.payment_box{background:#e9eef2;color:#25333d;border-radius:5px}
body.sfp-premium-checkout .woocommerce #payment div.payment_box::before{border-bottom-color:#e9eef2}
body.sfp-premium-checkout .woocommerce #payment div.payment_box p,body.sfp-premium-checkout .woocommerce #payment div.payment_box label{color:#25333d}
body.sfp-premium-checkout .woocommerce #payment .place-order{padding:20px}
body.sfp-premium-checkout .woocommerce-privacy-policy-text,body.sfp-premium-checkout .woocommerce-privacy-policy-text p{color:#d5e3eb}
/* Selected payment gateways can inject secure, cross-origin iframes. No rules target their contents. */
@media(max-width:767px){body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals{float:none;width:100%;padding:17px}body.sfp-premium-checkout .woocommerce-billing-fields,body.sfp-premium-checkout .woocommerce-shipping-fields,body.sfp-premium-checkout .woocommerce-additional-fields{padding:17px}body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table th,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce table.shop_table td{padding:11px}body.sfp-premium-checkout .woocommerce-checkout-review-order{padding:10px}body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce a.button,body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce button.button{white-space:normal}}

/* =============================================================
   V1.1 REFINEMENTS — no changes to checkout/payment functionality
   ============================================================= */
/* Cart totals: consistent width without WooCommerce float collisions */
body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals{
  float:none!important;
  width:min(100%,660px)!important;
  max-width:100%!important;
  margin:0 0 0 auto!important;
  padding:26px!important;
  box-sizing:border-box;
}
body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals .wc-proceed-to-checkout{
  clear:both;
  position:relative;
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:20px;
  padding-top:0;
}
body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button{
  position:relative;
  margin:0!important;
}
/* Financing messages must sit in the normal flow rather than overlay CTA. */
body.sfp-premium-cart .cart_totals :is(.affirm-as-low-as,.affirm-promo,[data-affirm-promo-id],.affirm-promo-container),
body.sfp-premium-checkout .woocommerce :is(.affirm-as-low-as,.affirm-promo){
  position:static!important;
  float:none!important;
  display:block;
  width:auto;
  max-width:100%;
  height:auto!important;
  min-height:20px;
  margin:14px 0!important;
  padding:0!important;
  overflow:visible!important;
  clear:both;
  line-height:1.6;
  color:#e4edf5!important;
}
body.sfp-premium-cart .cart_totals :is(.affirm-as-low-as,.affirm-promo) :is(span,p,a),
body.sfp-premium-checkout .woocommerce :is(.affirm-as-low-as,.affirm-promo) :is(span,p,a){
  color:#e4edf5!important;
  opacity:1!important;
}
body.sfp-premium-cart .cart_totals :is(.affirm-as-low-as,.affirm-promo) a,
body.sfp-premium-checkout .woocommerce :is(.affirm-as-low-as,.affirm-promo) a{
  color:#75d4ff!important;
  text-decoration:underline;
}
/* The site may insert the Affirm promo immediately before the CTA. */
body.sfp-premium-cart .cart_totals .wc-proceed-to-checkout > :is(.affirm-as-low-as,.affirm-promo,[data-affirm-promo-id]){
  order:-1;
}
body.sfp-premium-cart .cart_totals .wc-proceed-to-checkout > :is(.affirm-as-low-as,.affirm-promo,[data-affirm-promo-id]) + .checkout-button{
  margin-top:10px!important;
}
/* Store-credit toggle rendered on a pale WooCommerce notice / accordion. */
body.sfp-premium-checkout .woocommerce :is(.wc-sc-toggle,.wc_sc_toggle,.wc-sc-apply-store-credit,.wc_sc_apply_store_credit,.wc-sc-store-credit-form,.wc_sc_store_credit_form),
body.sfp-premium-checkout .woocommerce :is(.wc-sc-toggle,.wc_sc_toggle,.wc-sc-apply-store-credit,.wc_sc_apply_store_credit) :is(a,span,p,label,strong){
  color:#132b39!important;
  -webkit-text-fill-color:#132b39!important;
}
body.sfp-premium-checkout .woocommerce :is(.wc-sc-toggle,.wc_sc_toggle,.wc-sc-apply-store-credit,.wc_sc_apply_store_credit){
  background:#eaf1f5;
  border-left:3px solid #1596d2;
  padding:14px 18px;
}
body.sfp-premium-checkout .woocommerce :is(.wc-sc-toggle,.wc_sc_toggle,.wc-sc-apply-store-credit,.wc_sc_apply_store_credit) a{
  color:#066b9e!important;
  -webkit-text-fill-color:#066b9e!important;
}
/* Smart Coupons / store-credit drawer implementations can use other classes. */
body.sfp-premium-checkout .woocommerce :is(.woocommerce-checkout-review-order,.woocommerce-checkout-review-order-table) :is(.wc_sc_apply_store_credit,.wc-sc-apply-store-credit,.wc_sc_apply_store_credit_form){
  color:#142d3b!important;
}
/* Gift-card redemption: gentle contrast, safely scoped to common providers. */
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce :is(
  #pwgc-redeem-gift-card-form,.pwgc-redeem-gift-card-form,
  .ywgc_enter_code,.yith-ywgc-enter-code,
  .wc-sc-gift-card-form,.wc_sc_gift_card_form
){
  background:#eaf1f5!important;
  border-left:4px solid #1596d2;
  padding:18px 20px;
  border-radius:4px;
  color:#162b39!important;
}
body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce :is(
  #pwgc-redeem-gift-card-form,.pwgc-redeem-gift-card-form,
  .ywgc_enter_code,.yith-ywgc-enter-code,
  .wc-sc-gift-card-form,.wc_sc_gift_card_form
) :is(p,label,span){color:#162b39!important}
/* Fallback: target just the immediate gift-code input wrapper in modern browsers. */
@supports selector(:has(> input)){
  body:is(.sfp-premium-cart,.sfp-premium-checkout) .woocommerce :is(div,form,p):has(> input[placeholder="Gift card code"]){
    background:#eaf1f5;
    border-left:3px solid #1596d2;
    padding:12px 14px;
    color:#162b39!important;
  }
}
@media(max-width:767px){
  body.sfp-premium-cart .woocommerce .cart-collaterals .cart_totals{
    width:100%!important;
    margin:0!important;
    padding:18px!important;
  }
}

/* ============================================================
   V1.2 AFFIRM + STORE CREDIT READABILITY
   Carefully scoped visual fixes only. No changes to gateway JS.
   ============================================================ */
/* The provider may insert the promo as a sibling of the checkout action. */
body.sfp-premium-cart .woocommerce .cart_totals :is(
  .sfp-affirm-message, .affirm-as-low-as, #affirm-as-low-as,
  .affirm-promo, #affirm-promo, .affirm-promo-container,
  [data-affirm-promo-id], [class*="affirm-as-low-as"]
) {
  position:relative!important;
  display:block!important;
  clear:both!important;
  float:none!important;
  color:#eaf5fc!important;
  -webkit-text-fill-color:#eaf5fc!important;
  opacity:1!important;
  line-height:1.6!important;
  min-height:24px!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  margin:18px 0 14px!important;
  padding:0!important;
  z-index:1!important;
}
body.sfp-premium-cart .woocommerce .cart_totals :is(
  .sfp-affirm-message, .affirm-as-low-as, #affirm-as-low-as,
  .affirm-promo, #affirm-promo, .affirm-promo-container,
  [data-affirm-promo-id], [class*="affirm-as-low-as"]
) :is(span,small,p,strong,em,a) {
  color:#eaf5fc!important;
  -webkit-text-fill-color:#eaf5fc!important;
  opacity:1!important;
  visibility:visible!important;
}
body.sfp-premium-cart .woocommerce .cart_totals :is(
  .sfp-affirm-message, .affirm-as-low-as, #affirm-as-low-as,
  .affirm-promo, #affirm-promo, .affirm-promo-container,
  [data-affirm-promo-id], [class*="affirm-as-low-as"]
) a {
  color:#81d8ff!important;
  -webkit-text-fill-color:#81d8ff!important;
  text-decoration:underline!important;
}
/* Add safety distance below totals to prevent messages touching the CTA. */
body.sfp-premium-cart .woocommerce .cart_totals .wc-proceed-to-checkout {
  position:relative!important;
  clear:both!important;
  padding-top:16px!important;
  margin-top:14px!important;
  gap:14px!important;
  overflow:visible!important;
}
body.sfp-premium-cart .woocommerce .cart_totals .wc-proceed-to-checkout > .checkout-button {
  position:relative!important;
  z-index:1!important;
  margin-top:10px!important;
}
/* When promo is INSIDE proceed area, render it in normal flex flow. */
body.sfp-premium-cart .woocommerce .cart_totals .wc-proceed-to-checkout > :is(
  .sfp-affirm-message,.affirm-as-low-as,#affirm-as-low-as,
  .affirm-promo,#affirm-promo,.affirm-promo-container,[data-affirm-promo-id]
) {
  order:-1;
  flex:0 0 auto;
  margin:0 0 6px!important;
}
/* Store-credit plugin's pale toggle: readable text across markup variants. */
body.sfp-premium-checkout .woocommerce .sfp-store-credit-row,
body.sfp-premium-checkout .woocommerce .sfp-store-credit-text {
  color:#152e3c!important;
  -webkit-text-fill-color:#152e3c!important;
  opacity:1!important;
}
body.sfp-premium-checkout .woocommerce .sfp-store-credit-row :is(a,span,label,strong,i,svg),
body.sfp-premium-checkout .woocommerce .sfp-store-credit-text :is(a,span,label,strong,i) {
  color:#126c9b!important;
  -webkit-text-fill-color:#126c9b!important;
  opacity:1!important;
}
body.sfp-premium-checkout .woocommerce .sfp-store-credit-row {
  border-left:3px solid #1596d2!important;
}
