/*
 * KS-IA-20260925 — WCAG AA contrast for white text on orange buttons.
 *
 * White on the old orange fills failed AA (4.5:1): #FB923C 2.26, #F97316 2.80, #EA580C 3.56.
 * Every fill below keeps white text at >= 5.18:1 across the whole gradient:
 *   #C2410C 5.18 · #9A3412 7.31 · #7C2D12 9.37 · #B91C1C 6.47
 * The gradients start at #C2410C (not #EA580C) so text over the lighter end also passes.
 *
 * Why one override file: the old fills are spread over theme.css / theme-critical.css,
 * kluczesoft-category-v3.css, the kscheckout module CSS, inline <style> blocks in templates
 * and CMS HTML, most of them with !important. Loaded last from head.tpl; the "html body"
 * prefix outranks those !important rules. Rollback = remove the <link> in head.tpl.
 * Disabled buttons (out-of-stock add-to-cart, pending checkout submit) keep their own styling.
 */
:root {
  --ks-cta-fill: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
  --ks-cta-fill-hover: linear-gradient(135deg, #9a3412 0%, #7c2d12 100%);
  --ks-cta-solid: #c2410c;
  --ks-cta-solid-hover: #9a3412;
}

/* Primary CTAs (gradient) */
html body .btn-primary:not(:disabled):not(.disabled),
html body #product .add-to-cart:not(:disabled):not(.disabled),
html body .product-add-to-cart .add-to-cart:not(:disabled):not(.disabled),
html body .ks-v3-card__cta,
html body .ks-v3-drawer__cta,
html body .ks-sticky-bar-btn,
html body .ks-hero-btn-primary,
html body .ks-bundle-cta,
html body .ks-b2b-btn,
html body .ks-nl-btn,
html body #ks-checkout-root .ks-cta:not(:disabled) {
  background: var(--ks-cta-fill) !important;
  background-color: var(--ks-cta-solid) !important;
  color: #fff !important;
}

html body .btn-primary:not(:disabled):not(.disabled):hover,
html body .btn-primary:not(:disabled):not(.disabled):focus-visible,
html body #product .add-to-cart:not(:disabled):not(.disabled):hover,
html body #product .add-to-cart:not(:disabled):not(.disabled):focus-visible,
html body .product-add-to-cart .add-to-cart:not(:disabled):not(.disabled):hover,
html body .ks-v3-card__cta:hover,
html body .ks-v3-card__cta:focus-visible,
html body .ks-v3-drawer__cta:hover,
html body .ks-sticky-bar-btn:hover,
html body .ks-hero-btn-primary:hover,
html body .ks-bundle-cta:hover,
html body .ks-b2b-btn:hover,
html body .ks-nl-btn:hover,
html body #ks-checkout-root .ks-cta:not(:disabled):hover {
  background: var(--ks-cta-fill-hover) !important;
  background-color: var(--ks-cta-solid-hover) !important;
  color: #fff !important;
  filter: none !important;
}

/* The checkout submit keeps its own greyed-out look while disabled, but on the new fill. */
html body #ks-checkout-root .ks-cta:disabled {
  background: var(--ks-cta-fill) !important;
}

/* Pagination current page, active checkout step, cart count badge (solid) */
html body .ks-v3-pagination__item--current,
html body #module-kscheckout-checkout .ks-progress__step--active .ks-progress__num,
html body .ks-progress__step--active .ks-progress__num {
  background: var(--ks-cta-solid) !important;
  border-color: var(--ks-cta-solid) !important;
  color: #fff !important;
}
html body .ks-v3-pagination__item--current:hover {
  background: var(--ks-cta-solid-hover) !important;
  border-color: var(--ks-cta-solid-hover) !important;
}
html body .cart-products-count,
html body #header .cart-products-count,
html body #header #_desktop_cart .cart-products-count,
html body #header .blockcart .cart-products-count,
html body .ks-icons .cart-products-count {
  background: var(--ks-cta-solid) !important;
  color: #fff !important;
}

/* Exit-intent coupon button: same orange-to-red idea, both ends >= 5.18:1 */
html body .ks-exit-btn {
  background: linear-gradient(135deg, #c2410c 0%, #b91c1c 100%) !important;
  color: #fff !important;
}

/* Rules elsewhere that carry ids (PDP mobile sticky bar, cart page, add-to-cart popup) */
html body.page-product #ks-sticky-bar #ks-sticky-cta.ks-sticky-bar-btn,
html body #ks-sticky-bar .ks-sticky-bar-btn,
html body#cart .cart-grid-right .cart-detailed-actions .btn.btn-primary:not(.disabled),
html body#cart .cart-detailed-actions .btn-primary:not(.disabled),
html body #blockcart-modal .btn.btn-primary.ks-cart-modal-checkout {
  background: var(--ks-cta-fill) !important;
  background-color: var(--ks-cta-solid) !important;
  color: #fff !important;
}
html body.page-product #ks-sticky-bar #ks-sticky-cta.ks-sticky-bar-btn:hover,
html body #ks-sticky-bar .ks-sticky-bar-btn:hover,
html body#cart .cart-grid-right .cart-detailed-actions .btn.btn-primary:not(.disabled):hover,
html body#cart .cart-detailed-actions .btn-primary:not(.disabled):hover,
html body #blockcart-modal .btn.btn-primary.ks-cart-modal-checkout:hover {
  background: var(--ks-cta-fill-hover) !important;
  background-color: var(--ks-cta-solid-hover) !important;
}
