/*
 * MasterPalm Patch 293
 * Precision storefront style correction after Patch 292.
 * - Removes global dark-theme leakage.
 * - Verifies header images before applying image geometry.
 * - Keeps contact and footer surfaces light and readable.
 * - Scopes homepage/category card changes to their intended modules only.
 */

:root {
  --mp-corporate-red: #B8001F;
  --mp-corporate-red-dark: #8E0018;
  --mp-graphite: #252B31;
  --mp-graphite-deep: #171C21;
  --mp-text: #1F2933;
  --mp-muted-text: #667085;
  --mp-border-light: rgba(31, 41, 51, .16);
  --mp-surface-light: #F5F6F7;
}

/* ============================================================
   1. Inner-page header image verification and geometry
   ============================================================ */

/* No declared image, or an image that failed the runtime probe. */
body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]),
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]),
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-no-image {
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: auto !important;
  display: block !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"])::before,
body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"])::after,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image::before,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image::after,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"])::before,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"])::after,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-no-image::before,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-no-image::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) .mp-page-hero-inner,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image .mp-page-hero-inner,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) .mp-page-hero-inner,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-no-image .mp-page-hero-inner {
  min-height: 0 !important;
  height: auto !important;
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) h1,
body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) p,
body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) .mp-breadcrumb,
body.site-masterpalm:not(.home) #site-main .mp-page-hero:not([style*="--mp-bg"]) .mp-breadcrumb a,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image h1,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image p,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image .mp-breadcrumb,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-no-image .mp-breadcrumb a {
  color: var(--mp-text) !important;
  text-shadow: none !important;
}

/* A real image that completed loading keeps the intended image header. */
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image {
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  display: flex !important;
  align-items: center !important;
  background-color: var(--mp-graphite) !important;
  background-image: var(--mp-bg) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image::before,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(17, 22, 27, .42) !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image h1,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image p,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image .mp-breadcrumb,
body.site-masterpalm:not(.home) #site-main .mp-page-hero.mp-header-has-image .mp-breadcrumb a,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image h1,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image p,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image .mp-breadcrumb,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.mp-header-has-image .mp-breadcrumb a {
  color: #FFFFFF !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .48) !important;
}

/* ============================================================
   2. Contact page: light industrial layout only
   ============================================================ */

body.mp-contact-page #site-main,
body.mp-contact-page #site-main .mp-industrial-contact,
body.mp-contact-page #site-main .mp-contact-workspace {
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-industrial-contact,
body.mp-contact-page #site-main .mp-contact-hero {
  overflow: visible !important;
}

body.mp-contact-page #site-main .mp-contact-hero {
  min-height: 0 !important;
  height: auto !important;
  padding: 24px 0 !important;
  display: block !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-contact-hero::before,
body.mp-contact-page #site-main .mp-contact-hero::after,
body.mp-contact-page #site-main .mp-contact-workspace::before,
body.mp-contact-page #site-main .mp-contact-workspace::after {
  content: none !important;
  display: none !important;
}

body.mp-contact-page #site-main .mp-contact-hero-inner,
body.mp-contact-page #site-main .mp-contact-shell,
body.mp-contact-page #site-main .mp-contact-feature-strip {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: min(1440px, calc(100% - 40px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.mp-contact-page #site-main .mp-contact-hero-inner {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr) !important;
  gap: 28px !important;
  align-items: center !important;
}

body.mp-contact-page #site-main .mp-contact-breadcrumb,
body.mp-contact-page #site-main .mp-contact-breadcrumb a {
  color: var(--mp-muted-text) !important;
  text-decoration: none !important;
}

body.mp-contact-page #site-main .mp-kicker {
  color: var(--mp-corporate-red) !important;
}

body.mp-contact-page #site-main .mp-contact-title,
body.mp-contact-page #site-main .mp-contact-lead,
body.mp-contact-page #site-main .mp-contact-lead strong {
  color: var(--mp-text) !important;
  text-shadow: none !important;
}

body.mp-contact-page #site-main .mp-contact-title {
  margin: 0 !important;
  font-size: clamp(2.2rem, 5vw, 4.6rem) !important;
  line-height: .96 !important;
  letter-spacing: -.045em !important;
  text-transform: uppercase !important;
}

body.mp-contact-page #site-main .mp-contact-lead {
  max-width: 760px !important;
  margin: 14px 0 0 !important;
  line-height: 1.65 !important;
}

body.mp-contact-page #site-main .mp-response-board {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
}

body.mp-contact-page #site-main .mp-response-card {
  min-height: 118px !important;
  padding: 18px !important;
  border: 1px solid var(--mp-border-light) !important;
  background: var(--mp-surface-light) !important;
  background-image: none !important;
  color: var(--mp-text) !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.mp-contact-page #site-main .mp-response-card strong {
  display: block !important;
  margin-bottom: 8px !important;
  color: var(--mp-text) !important;
  text-transform: uppercase !important;
}

body.mp-contact-page #site-main .mp-response-card span {
  color: var(--mp-muted-text) !important;
  line-height: 1.5 !important;
}

body.mp-contact-page #site-main .mp-contact-workspace {
  padding: 24px 0 64px !important;
}

body.mp-contact-page #site-main .mp-contact-body {
  display: grid !important;
  grid-template-columns: minmax(290px, 410px) minmax(0, 1fr) !important;
  gap: 24px !important;
  align-items: stretch !important;
}

body.mp-contact-page #site-main .mp-branch-console,
body.mp-contact-page #site-main .mp-inquiry-console {
  border: 1px solid var(--mp-border-light) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
  box-shadow: 0 18px 48px rgba(31, 41, 51, .08) !important;
}

body.mp-contact-page #site-main .mp-console-head,
body.mp-contact-page #site-main .mp-map-plate__head,
body.mp-contact-page #site-main .mp-form-actions {
  background: #FFFFFF !important;
  background-image: none !important;
  border-color: var(--mp-border-light) !important;
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-console-head {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 20px 22px !important;
  border-bottom: 1px solid var(--mp-border-light) !important;
}

body.mp-contact-page #site-main .mp-console-head h2,
body.mp-contact-page #site-main .mp-map-plate__head,
body.mp-contact-page #site-main .mp-map-plate__head span {
  margin: 0 !important;
  color: var(--mp-text) !important;
  text-shadow: none !important;
}

body.mp-contact-page #site-main .mp-console-head span,
body.mp-contact-page #site-main .mp-office-group-title,
body.mp-contact-page #site-main .mp-map-plate__head a {
  color: var(--mp-corporate-red) !important;
}

body.mp-contact-page #site-main .mp-branch-list,
body.mp-contact-page #site-main .mp-form-grid {
  padding: 20px !important;
}

body.mp-contact-page #site-main .mp-office-group-title {
  margin: 18px 0 8px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}

body.mp-contact-page #site-main .mp-office-group-title:first-child {
  margin-top: 0 !important;
}

body.mp-contact-page #site-main .mp-form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
}

body.mp-contact-page #site-main .mp-field.full,
body.mp-contact-page #site-main .mp-form-protection,
body.mp-contact-page #site-main .mp-form-actions {
  grid-column: 1 / -1 !important;
}

body.mp-contact-page #site-main .mp-branch-card {
  display: block !important;
  width: 100% !important;
  margin: 0 0 12px !important;
  padding: 17px !important;
  border: 1px solid var(--mp-border-light) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.mp-contact-page #site-main .mp-branch-card h3 {
  margin: 0 0 7px !important;
  font-size: 17px !important;
  font-weight: 900 !important;
}

body.mp-contact-page #site-main .mp-branch-card p {
  margin: 0 0 8px !important;
  line-height: 1.5 !important;
}

body.mp-contact-page #site-main .mp-branch-lines {
  display: grid !important;
  gap: 4px !important;
  margin: 8px 0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body.mp-contact-page #site-main .mp-branch-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  margin-top: 10px !important;
}

body.mp-contact-page #site-main .mp-branch-card:hover,
body.mp-contact-page #site-main .mp-branch-card:focus {
  border-color: var(--mp-corporate-red) !important;
  background: #FFF7F8 !important;
  outline: 0 !important;
}

body.mp-contact-page #site-main .mp-branch-card.is-active,
body.mp-contact-page #site-main .mp-branch-card.active {
  border-color: var(--mp-corporate-red) !important;
  background: var(--mp-corporate-red) !important;
  color: #FFFFFF !important;
}

body.mp-contact-page #site-main .mp-branch-card h3,
body.mp-contact-page #site-main .mp-branch-card p,
body.mp-contact-page #site-main .mp-branch-lines,
body.mp-contact-page #site-main .mp-branch-meta span,
body.mp-contact-page #site-main .mp-contact-office-credential,
body.mp-contact-page #site-main .mp-contact-office-credential strong {
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-branch-card.is-active h3,
body.mp-contact-page #site-main .mp-branch-card.is-active p,
body.mp-contact-page #site-main .mp-branch-card.is-active .mp-branch-lines,
body.mp-contact-page #site-main .mp-branch-card.is-active .mp-branch-meta span,
body.mp-contact-page #site-main .mp-branch-card.is-active .mp-contact-office-credential,
body.mp-contact-page #site-main .mp-branch-card.is-active .mp-contact-office-credential strong,
body.mp-contact-page #site-main .mp-branch-card.active h3,
body.mp-contact-page #site-main .mp-branch-card.active p,
body.mp-contact-page #site-main .mp-branch-card.active .mp-branch-lines,
body.mp-contact-page #site-main .mp-branch-card.active .mp-branch-meta span,
body.mp-contact-page #site-main .mp-branch-card.active .mp-contact-office-credential,
body.mp-contact-page #site-main .mp-branch-card.active .mp-contact-office-credential strong {
  color: #FFFFFF !important;
}

body.mp-contact-page #site-main .mp-branch-meta span,
body.mp-contact-page #site-main .mp-contact-office-credential {
  border: 1px solid var(--mp-border-light) !important;
  background: var(--mp-surface-light) !important;
}

body.mp-contact-page #site-main .mp-contact-office-credential {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  text-decoration: none !important;
}

body.mp-contact-page #site-main .mp-contact-office-credential img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  filter: none !important;
}

body.mp-contact-page #site-main .mp-branch-card.is-active .mp-branch-meta span,
body.mp-contact-page #site-main .mp-branch-card.is-active .mp-contact-office-credential,
body.mp-contact-page #site-main .mp-branch-card.active .mp-branch-meta span,
body.mp-contact-page #site-main .mp-branch-card.active .mp-contact-office-credential {
  border-color: rgba(255, 255, 255, .44) !important;
  background: rgba(255, 255, 255, .12) !important;
}

body.mp-contact-page #site-main .mp-map-plate {
  margin: 0 18px 18px !important;
  border: 1px solid var(--mp-border-light) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  overflow: hidden !important;
}

body.mp-contact-page #site-main .mp-map-plate__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--mp-border-light) !important;
}

body.mp-contact-page #site-main .mp-map-plate iframe {
  display: block !important;
  width: 100% !important;
  height: 250px !important;
  border: 0 !important;
  filter: none !important;
}

body.mp-contact-page #site-main .mp-map-selected {
  padding: 12px 14px !important;
  color: var(--mp-muted-text) !important;
}

body.mp-contact-page #site-main .mp-map-selected strong {
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-field label {
  display: block !important;
  margin-bottom: 7px !important;
  color: var(--mp-text) !important;
  font-weight: 800 !important;
}

body.mp-contact-page #site-main .mp-inquiry-console {
  padding-bottom: 0 !important;
}

body.mp-contact-page #site-main .mp-field input,
body.mp-contact-page #site-main .mp-field textarea,
body.mp-contact-page #site-main .mp-field select,
body.mp-contact-page #site-main .mp-inquiry-console .form-control,
body.mp-contact-page #site-main .mp-inquiry-console .form-select {
  width: 100% !important;
  border: 1px solid var(--mp-border-light) !important;
  background: #FFFFFF !important;
  color: var(--mp-text) !important;
  min-height: 46px !important;
  padding: 11px 12px !important;
  box-shadow: none !important;
}

body.mp-contact-page #site-main .mp-field input:focus,
body.mp-contact-page #site-main .mp-field textarea:focus,
body.mp-contact-page #site-main .mp-field select:focus,
body.mp-contact-page #site-main .mp-inquiry-console .form-control:focus,
body.mp-contact-page #site-main .mp-inquiry-console .form-select:focus {
  border-color: var(--mp-corporate-red) !important;
  background: #FFFFFF !important;
  color: var(--mp-text) !important;
  box-shadow: 0 0 0 3px rgba(184, 0, 31, .12) !important;
}

body.mp-contact-page #site-main .mp-field input[readonly] {
  background: var(--mp-surface-light) !important;
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-field textarea {
  min-height: 190px !important;
  resize: vertical !important;
}

body.mp-contact-page #site-main .mp-field input::placeholder,
body.mp-contact-page #site-main .mp-field textarea::placeholder {
  color: #98A2B3 !important;
}

body.mp-contact-page #site-main .mp-form-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding-top: 4px !important;
}

body.mp-contact-page #site-main .mp-route-note {
  color: var(--mp-muted-text) !important;
}

body.mp-contact-page #site-main .mp-contact-feature-strip {
  position: relative !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1px !important;
  margin-top: 28px !important;
  border: 1px solid var(--mp-border-light) !important;
  background: var(--mp-border-light) !important;
}

body.mp-contact-page #site-main .mp-contact-feature {
  padding: 18px !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.mp-contact-page #site-main .mp-contact-feature strong {
  display: block !important;
  color: var(--mp-text) !important;
  text-transform: uppercase !important;
}

body.mp-contact-page #site-main .mp-contact-feature span {
  display: block !important;
  margin-top: 5px !important;
  color: var(--mp-muted-text) !important;
}

/* ============================================================
   3. Homepage Tool Collections only
   ============================================================ */

body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card {
  background: var(--mp-graphite) !important;
  background-image: none !important;
  border-color: #3A424A !important;
  color: #FFFFFF !important;
}

body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card::before {
  background: var(--mp-bg, none) center center / contain no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
}

body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card::after {
  background: linear-gradient(180deg, rgba(23, 28, 33, .05) 0%, rgba(23, 28, 33, .38) 48%, rgba(23, 28, 33, .96) 100%) !important;
}

body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card .mp-card-body,
body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card .mp-card-body strong,
body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card .mp-card-body small,
body.ses-home-page #site-main > section.mp-section.mp-section-dark > .mp-header-container > .mp-category-grid > a.mp-category-card .mp-card-more {
  color: #FFFFFF !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .58) !important;
}

/* ============================================================
   4. Category collection cards only
   ============================================================ */

body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card {
  background: var(--mp-graphite) !important;
  background-image: none !important;
  border-color: #3A424A !important;
  color: #FFFFFF !important;
}

body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card::before,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card::before {
  background: var(--mp-bg, none) center center / cover no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
}

body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card::after,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card::after {
  background: linear-gradient(180deg, rgba(17, 22, 27, .04), rgba(17, 22, 27, .40) 48%, rgba(17, 22, 27, .94)) !important;
}

body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card .mp-card-body,
body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card .mp-card-body strong,
body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card .mp-card-body small,
body.site-masterpalm #site-main section.mp-collection-page .mp-category-grid-list > a.mp-category-card .mp-card-more,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card .mp-card-body,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card .mp-card-body strong,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card .mp-card-body small,
body.site-masterpalm #site-main .mp-child-collections-after-products .mp-category-grid-list > a.mp-category-card .mp-card-more {
  color: #FFFFFF !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .58) !important;
}

/* ============================================================
   5. Homepage Industrial Services only
   ============================================================ */

/* No image: retain the normal white card. */
body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card:not([style*="--mp-bg"]) {
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card:not([style*="--mp-bg"]) strong,
body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card:not([style*="--mp-bg"]) p {
  color: var(--mp-text) !important;
  text-shadow: none !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card:not([style*="--mp-bg"]) p {
  color: var(--mp-muted-text) !important;
}

/* Image exists: show the real image with no grayscale or all-white wash. */
body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"] {
  background: var(--mp-graphite) !important;
  background-image: none !important;
  color: #FFFFFF !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"]::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: var(--mp-bg) center center / cover no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"]::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(17, 22, 27, .08), rgba(17, 22, 27, .42) 48%, rgba(17, 22, 27, .88)) !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"] > * {
  position: relative !important;
  z-index: 1 !important;
}

body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"] strong,
body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"] p,
body.ses-home-page #site-main > section.mp-section.mp-services > .mp-header-container > .mp-service-grid > a.mp-service-card[style*="--mp-bg"] em {
  color: #FFFFFF !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .60) !important;
}

/* ============================================================
   6. Homepage News badge and product quote label
   ============================================================ */

body.ses-home-page #site-main > section.mp-section.mp-news .mp-news-card > b {
  background: var(--mp-corporate-red) !important;
  border-color: var(--mp-corporate-red) !important;
  color: #FFFFFF !important;
  text-shadow: none !important;
}

body.site-masterpalm #site-main .mp-product-page .mp-stock-row .mp-stock,
body.masterpalm-theme #site-main .mp-product-page .mp-stock-row .mp-stock {
  background: var(--mp-corporate-red) !important;
  border: 1px solid var(--mp-corporate-red) !important;
  color: #FFFFFF !important;
  text-shadow: none !important;
}

/* ============================================================
   7. Footer contrast: no dark background with dark text
   ============================================================ */

body.site-masterpalm .mp-industrial-footer.mp-footer-light {
  background: #F5F6F7 !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-primary,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-rfq,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-policy-row {
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--mp-text) !important;
}

body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-badges span,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-location-tabs button,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-credential {
  background: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid var(--mp-border-light) !important;
  color: var(--mp-text) !important;
  text-shadow: none !important;
}

body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-badges span:first-child,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-location-tabs button.is-active {
  background: var(--mp-corporate-red) !important;
  background-image: none !important;
  border-color: var(--mp-corporate-red) !important;
  color: #FFFFFF !important;
  text-shadow: none !important;
}

body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-badges span:first-child *,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-location-tabs button.is-active *,
body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-credential__value {
  color: inherit !important;
}

body.site-masterpalm .mp-industrial-footer.mp-footer-light .mp-footer-credential__label {
  color: var(--mp-corporate-red) !important;
}

/* ============================================================
   8. Responsive contact layout
   ============================================================ */

@media (max-width: 980px) {
  body.mp-contact-page #site-main .mp-contact-hero-inner,
  body.mp-contact-page #site-main .mp-contact-body {
    grid-template-columns: 1fr !important;
  }

  body.mp-contact-page #site-main .mp-response-board,
  body.mp-contact-page #site-main .mp-contact-feature-strip {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 640px) {
  body.mp-contact-page #site-main .mp-contact-hero-inner,
  body.mp-contact-page #site-main .mp-contact-shell,
  body.mp-contact-page #site-main .mp-contact-feature-strip {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  body.mp-contact-page #site-main .mp-response-board,
  body.mp-contact-page #site-main .mp-form-grid,
  body.mp-contact-page #site-main .mp-contact-feature-strip {
    grid-template-columns: 1fr !important;
  }

  body.mp-contact-page #site-main .mp-form-actions {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  body.mp-contact-page #site-main .mp-form-actions .mp-btn {
    width: 100% !important;
  }
}

/* ============================================================
   Patch 294: Product-detail active-tab contrast
   Keep the existing corporate-red active state and force all
   active tab text/icons to white. Scope is product detail only.
   ============================================================ */
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-overview:checked ~ .mp-tab-labels label[for="mp-tab-overview"],
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-specs:checked ~ .mp-tab-labels label[for="mp-tab-specs"],
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-features:checked ~ .mp-tab-labels label[for="mp-tab-features"],
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-downloads:checked ~ .mp-tab-labels label[for="mp-tab-downloads"],
body.site-masterpalm #site-main .product-detail .nav-tabs .nav-link.active,
body.site-masterpalm #site-main .mp-product-detail .nav-tabs .nav-link.active {
  background: #B8001F !important;
  background-image: none !important;
  border-color: #B8001F !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  text-shadow: none !important;
}

body.site-masterpalm #site-main .mp-product-tabs #mp-tab-overview:checked ~ .mp-tab-labels label[for="mp-tab-overview"] *,
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-specs:checked ~ .mp-tab-labels label[for="mp-tab-specs"] *,
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-features:checked ~ .mp-tab-labels label[for="mp-tab-features"] *,
body.site-masterpalm #site-main .mp-product-tabs #mp-tab-downloads:checked ~ .mp-tab-labels label[for="mp-tab-downloads"] *,
body.site-masterpalm #site-main .product-detail .nav-tabs .nav-link.active *,
body.site-masterpalm #site-main .mp-product-detail .nav-tabs .nav-link.active * {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
