/* Sepahan 2.3.1.3 — thank-you and extension palettes.
   Only checkout/cart/thank-you output receives these overrides; other screens are untouched.
   All colors are derived from the configurable --mcc-* light/dark settings. */

/* The site itself controls its page background. The thank-you wrapper never paints over it. */
body.sepahan-commerce-meydan .meydan-thankyou-page {
  background:none!important;
  background-color:transparent!important;
  color:var(--mcc-text,#17213a)!important;
  min-width:0;
}

/* Meydan's legacy headers sometimes inherit a fixed pale background from the host theme.
   Enforce the selected card surface for every order summary/card header. */
body.sepahan-commerce-meydan .meydan-thankyou-page :is(
  .meydan-thankyou-card,.meydan-thankyou-hero,
  .meydan-order-products>header,.meydan-order-delivery>header,
  .meydan-order-total-card>header,.meydan-thankyou-meta,
  .meydan-thankyou-meta__item
) {
  background:var(--mcc-card,#fff)!important;
  background-color:var(--mcc-card,#fff)!important;
  color:var(--mcc-text,#17213a)!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page :is(
  h1,h2,h3,h4,.meydan-thankyou-hero__copy h1,.meydan-order-product__content strong,
  .meydan-thankyou-order-number strong,.meydan-order-total-card__body strong,
  .meydan-order-delivery__body strong,.meydan-order-product__price,
  .meydan-thankyou-meta strong
) {color:var(--mcc-text,#17213a)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page :is(
  .meydan-thankyou-eyebrow,.meydan-thankyou-hero__copy p,
  .meydan-order-products>header>span,.meydan-order-product__meta,
  .meydan-order-product__quantity,.meydan-order-delivery__body small,
  .meydan-order-delivery__body span,.meydan-order-total-card__body>div:not(.is-total),
  .meydan-thankyou-order-number small,.meydan-thankyou-meta small
) {color:var(--mcc-muted,#7b8799)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page :is(
  .meydan-thankyou-hero__icon,.meydan-thankyou-meta__icon,
  .meydan-thankyou-message__icon,.meydan-thankyou-order-number,
  .meydan-order-product__quantity
) {color:var(--mcc-accent,#ec6b00)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page :is(
  .meydan-thankyou-hero__icon,.meydan-thankyou-meta__icon,
  .meydan-thankyou-message__icon,.meydan-thankyou-order-number
) {background:var(--mcc-selected,#fffaf5)!important;border-color:var(--mcc-border,#e5e9ef)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-thankyou-message.is-failed .meydan-thankyou-message__icon{
  color:#e47b7b!important;
  background:color-mix(in srgb,#e47b7b 15%,var(--mcc-card,#fff))!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page :is(.meydan-order-product,.meydan-order-delivery__body>div,.meydan-order-total-card__body .is-total){border-color:var(--mcc-border,#e5e9ef)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-product__image{
  background:var(--mcc-card,#fff)!important;border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-product__price{
  background:color-mix(in srgb,var(--mcc-selected,#fffaf5) 55%,var(--mcc-card,#fff))!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-product__title{
  color:var(--mcc-accent,#ec6b00)!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-total-card__body .is-total,
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-total-card__body .is-total :is(span,strong){color:var(--mcc-text,#17213a)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-order-total-card__body .is-discount :is(span,strong){color:var(--mcc-discount,#0d8b5f)!important;}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-thankyou-button{
  background:var(--mcc-card,#fff)!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
  color:var(--mcc-text,#17213a)!important;
  font-size:12px!important;
  font-weight:700!important;
  line-height:1.7!important;
  opacity:1;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-thankyou-button.is-primary{
  background:var(--mcc-accent,#ec6b00)!important;
  border-color:var(--mcc-accent,#ec6b00)!important;
  color:var(--mcc-accent-text,#fff)!important;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-thankyou-button:is(:hover,:focus-visible){
  border-color:var(--mcc-accent,#ec6b00)!important;
  outline-offset:2px;
}
body.sepahan-commerce-meydan .meydan-thankyou-page .meydan-thankyou-button:focus-visible{
  outline:2px solid var(--mcc-accent,#ec6b00);
}

/* Extension-friendly defaults. Deliberately target known WooCommerce and gateway
   containers rather than forcing backgrounds onto arbitrary third-party widgets. */
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks) :is(
  .woocommerce-info,.woocommerce-message,.woocommerce-error,
  .woocommerce-notice,.woocommerce-notices-wrapper>*:not(script):not(style),
  .wc-block-components-notice-banner,.woocommerce-bacs-bank-details,
  .woocommerce-order-details,.woocommerce-customer-details,
  .woocommerce-table--order-details,.woocommerce-table--customer-details,
  .payment_box,.wc_payment_method,
  .wc-block-components-panel,.wc-block-components-card
){
  background-color:var(--mcc-card,#fff)!important;
  color:var(--mcc-text,#17213a)!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks) :is(
  .woocommerce-order-details,.woocommerce-customer-details,.woocommerce-bacs-bank-details,
  .wc-block-components-panel,.wc-block-components-card
) :is(h2,h3,h4,th,strong,label){color:var(--mcc-text,#17213a)!important;}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks) :is(
  .woocommerce-order-details,.woocommerce-customer-details,.woocommerce-bacs-bank-details,
  .woocommerce-table--order-details,.woocommerce-table--customer-details,
  .wc-block-components-panel,.wc-block-components-card
) :is(td,small,caption,p){color:var(--mcc-muted,#7b8799)!important;}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks) :is(
  .woocommerce-table,.woocommerce-table th,.woocommerce-table td,
  .shop_table,.shop_table th,.shop_table td,.wc-block-components-panel
){border-color:var(--mcc-border,#e5e9ef)!important;}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks) a:not(.button):not(.meydan-thankyou-button){color:var(--mcc-accent,#ec6b00)}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-hooks) :is(
  input:not([type=hidden]):not([type=radio]):not([type=checkbox]):not([type=file]),
  textarea,select,.select2-selection,.select2-selection--single,.select2-selection--multiple
){
  background:var(--mcc-card,#fff)!important;
  color:var(--mcc-text,#17213a)!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-hooks) :is(input,textarea)::placeholder{
  color:var(--mcc-muted,#7b8799)!important;
}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-hooks) :is(
  .select2-selection__rendered,.select2-selection__placeholder,
  .select2-selection__choice,.select2-results__option
){color:var(--mcc-text,#17213a)!important;}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-hooks) :is(
  input:not([type=hidden]),textarea,select,.select2-selection
):focus-visible{outline:2px solid var(--mcc-accent,#ec6b00);outline-offset:2px;}
body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-hooks) :is(.button,button.button,input.button),
body.sepahan-commerce-meydan .meydan-thankyou-hooks :is(.button,button.button,input.button){
  background:var(--mcc-accent,#ec6b00)!important;
  color:var(--mcc-accent-text,#fff)!important;
  border-color:var(--mcc-accent,#ec6b00)!important;
}
/* Select2 appends its menu to <body> rather than next to the checkout field. */
body.sepahan-commerce-meydan.woocommerce-checkout .select2-dropdown,
body.sepahan-commerce-meydan.woocommerce-checkout .select2-results,
body.sepahan-commerce-meydan.woocommerce-checkout .select2-search__field{
  background:var(--mcc-card,#fff)!important;
  color:var(--mcc-text,#17213a)!important;
  border-color:var(--mcc-border,#e5e9ef)!important;
}
body.sepahan-commerce-meydan.woocommerce-checkout .select2-results__option[aria-selected=true],
body.sepahan-commerce-meydan.woocommerce-checkout .select2-results__option--highlighted{
  background:var(--mcc-selected,#fffaf5)!important;
  color:var(--mcc-text,#17213a)!important;
}
/* Match the active theme palette, including native form controls and additions by extensions. */
html.dark body.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks),
body.dark.sepahan-commerce-meydan :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks){color-scheme:dark;}
html:not(.dark) body.sepahan-commerce-meydan:not(.dark) :is(.meydan-checkout-page,.meydan-thankyou-page,.meydan-thankyou-hooks){color-scheme:light;}

/* The old checkout dark repair colorizes every anchor, including filled
   buttons; explicitly restore accessible button-label contrast. */
body.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button:not(.is-primary),
html.dark body.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button:not(.is-primary),
body.dark.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button:not(.is-primary) {
  color:var(--mcc-text,#17213a)!important;
}
body.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button.is-primary,
html.dark body.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button.is-primary,
body.dark.sepahan-commerce-meydan.woocommerce-checkout .meydan-thankyou-page a.meydan-thankyou-button.is-primary {
  background:var(--mcc-accent,#ec6b00)!important;
  color:var(--mcc-accent-text,#fff)!important;
  border-color:var(--mcc-accent,#ec6b00)!important;
}
