/*
 * STORE APP Patch 413
 * Graphite-dark checkout/payment surface correction.
 *
 * Scope: persistent checkout page content only. True Bootstrap modals/popups
 * remain governed by the white popup rules from Patch 405.
 */

body.site-masterpalm.masterpalm-store-dark{
  --mp413-bg:#10151B;
  --mp413-panel:#171D24;
  --mp413-raised:#202832;
  --mp413-hover:#27313C;
  --mp413-border:#3D4854;
  --mp413-text:#FFFFFF;
  --mp413-muted:#B7C0CA;
  --mp413-red:#B8001F;
  --mp413-red-panel:#2A171D;
  --mp413-success:#8DE0AD;
}

/* Main checkout cards, AJAX summary targets, and bottom payment block. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(
  .mpb2b-form-card,
  .mpb2b-summary,
  [data-mpb2b-checkout-summary],
  .mpb2b-checkout-bottom-payment,
  [data-mpb2b-checkout-bottom-payment],
  .mpb2b-payment-panel,
  .mpb2b-box,
  .mpb2b-shipping-rate-empty,
  .mpb2b-shippo-rate-box
){
  background:var(--mp413-panel)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
  box-shadow:none!important;
}

body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(
  .mpb2b-form-card h1,.mpb2b-form-card h2,.mpb2b-form-card h3,
  .mpb2b-summary h1,.mpb2b-summary h2,.mpb2b-summary h3,
  .mpb2b-box h1,.mpb2b-box h2,.mpb2b-box h3,
  label,strong,b,legend
){
  color:var(--mp413-text)!important;
}

body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(
  p,small,.small,.text-muted,.form-text,em
){
  color:var(--mp413-muted)!important;
}

/* Explicit table correction for any checkout/payment table or responsive table. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(
  .table-responsive,table,.table,thead,tbody,tfoot,tr,th,td
){
  --bs-table-bg:var(--mp413-panel)!important;
  --bs-table-color:var(--mp413-text)!important;
  --bs-table-border-color:var(--mp413-border)!important;
  --bs-table-striped-bg:var(--mp413-raised)!important;
  --bs-table-striped-color:var(--mp413-text)!important;
  --bs-table-hover-bg:var(--mp413-hover)!important;
  --bs-table-hover-color:var(--mp413-text)!important;
  background-color:var(--mp413-panel)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] thead :where(th,td){
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
}

/* Payment methods are persistent cards, not white popup surfaces. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-options{
  background:transparent!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option{
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
  box-shadow:none!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option :where(strong,i){
  color:var(--mp413-text)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option :where(span,small){
  color:var(--mp413-muted)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option:hover,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option:focus-within{
  background:var(--mp413-hover)!important;
  border-color:#6A7784!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option:has(input:checked){
  background:var(--mp413-red-panel)!important;
  border-color:var(--mp413-red)!important;
  box-shadow:0 0 0 3px rgba(184,0,31,.20)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-option input:disabled~*{
  color:#7F8A96!important;
}

/* Payment/coupon savings notice: no cream/white background with white text. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-promo-note{
  background:var(--mp413-red-panel)!important;
  color:var(--mp413-text)!important;
  border:1px solid var(--mp413-red)!important;
  border-left:4px solid var(--mp413-red)!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-payment-promo-note :where(strong,span,small,b,i){
  color:var(--mp413-text)!important;
}

/* Order summary rows and totals. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page :where(.mpb2b-summary-line,.mpb2b-summary-total){
  background:transparent!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-line :where(span,strong,b),
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-total strong{
  color:var(--mp413-text)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-price del,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-price del span{
  color:var(--mp413-muted)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-line.discount :where(span,strong){
  color:var(--mp413-success)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-summary-total b,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-bottom-total>strong{
  color:#FF506C!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-bottom-total>span,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-bottom-total>strong small{
  color:var(--mp413-text)!important;
}

/* Shipping and rate choices. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-shipping-option{
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
  box-shadow:none!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-shipping-option :where(strong,b){color:var(--mp413-text)!important}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-shipping-option small{color:var(--mp413-muted)!important}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-shipping-option:has(input:checked){
  background:var(--mp413-red-panel)!important;
  border-color:var(--mp413-red)!important;
}

/* Checkout form controls, including browser autofill and file inputs. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(
  input:not([type=checkbox]):not([type=radio]),select,textarea,.form-control,.form-select
){
  background:#11171D!important;
  color:var(--mp413-text)!important;
  border-color:#4A5662!important;
  color-scheme:dark;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] :where(input,textarea)::placeholder{
  color:#8994A0!important;
  opacity:1!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] input::file-selector-button{
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
  border:0!important;
  border-right:1px solid var(--mp413-border)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] input:-webkit-autofill,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] input:-webkit-autofill:hover,
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page form[data-mpb2b-checkout-form] input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--mp413-text)!important;
  -webkit-box-shadow:0 0 0 1000px #11171D inset!important;
  caret-color:var(--mp413-text)!important;
}

/* AJAX checkout status notices remain dark and readable. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-ajax-status{
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-ajax-status.is-success{
  background:#14271D!important;
  color:#A9E8BF!important;
  border-color:#34774B!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-checkout-ajax-status.is-error{
  background:var(--mp413-red-panel)!important;
  color:#FFD9DF!important;
  border-color:var(--mp413-red)!important;
}

/* Zelle is permanent checkout content; retain only the QR image well as white. */
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page :where(
  .mpb2b-zelle-panel,.mpb2b-zelle-reference,.mpb2b-zelle-qr-card,.mpb2b-zelle-copy,.mpb2b-zelle-memo-reminder
){
  background:var(--mp413-raised)!important;
  color:var(--mp413-text)!important;
  border-color:var(--mp413-border)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page :where(
  .mpb2b-zelle-panel,.mpb2b-zelle-reference,.mpb2b-zelle-qr-card,.mpb2b-zelle-copy,.mpb2b-zelle-memo-reminder
) :where(strong,span,em,p,label){
  color:var(--mp413-text)!important;
}
body.site-masterpalm.masterpalm-store-dark #site-main .mpb2b-shop-page .mpb2b-zelle-qr-image-box{
  background:#FFFFFF!important;
  border-color:#D5DBE2!important;
  color-scheme:light;
}

/* Keep white popup policy untouched: no .modal/.dropdown/.popover selectors here. */
