/* The palette belongs to the product template. Header, footer, cart and app embeds
   outside the product template keep their own color settings. */
body[data-page="product"] { background: #fff; }
body[data-page="product"] #MainContent { background: var(--uc-pdp-page, #fff); }
body[data-page="product"] #MainContent:has([data-uc-pdp-palette]) {
  background: var(--uc-pdp-page);
  color: var(--uc-pdp-text);

  & .product-r12 {
    --pe-canvas: var(--uc-pdp-page);
    --pe-ink: var(--uc-pdp-heading);
    --pe-muted: var(--uc-pdp-muted);
    --pe-line: var(--uc-pdp-line);
    --pe-stone: var(--uc-pdp-soft);
    --pe-red: var(--uc-pdp-accent);
    --pe-forest: var(--uc-pdp-accent);
    --sales-ink: var(--uc-pdp-heading);
    --sales-muted: var(--uc-pdp-muted);
    --sales-line: var(--uc-pdp-line);
    --sales-paper: var(--uc-pdp-soft);
    --sales-accent: var(--uc-pdp-accent);
    --sales-accent-text: var(--uc-pdp-accent);
    --sales-dark: var(--uc-pdp-heading);
    background: var(--uc-pdp-page);
    color: var(--uc-pdp-text);
  }

  & .product-r12 :is(.pdp-heading-title h1, .pdp-purchase-intro h2, .pdp-expert-card h2,
    .pdp-price, [data-product-price], .product-subtitle, .sales-at-glance dd, .mobile-sticky-buy strong) {
    color: var(--uc-pdp-heading);
  }

  & .product-r12 :is(.pdp-summary, .pdp-why-strip > span, .pdp-warranty strong, .financing-heading,
    .financing-heading strong, .product-delivery strong, .pdp-professional-capacity strong,
    .product-offer-heading strong, .product-offer-items strong, .r12-proof-rating strong,
    .r12-proof-purchases strong, .benefit-bubble > summary, .mobile-sticky-buy > div, .rte) {
    color: var(--uc-pdp-text);
  }

  & .product-r12 :is(.breadcrumbs, .pdp-gallery-heading, .r12-proof,
    .r12-proof-rating, .r12-proof-purchases, .pdp-secure-line, .purchase-note, .product-delivery,
    .pdp-stock, .pdp-warranty p, .pdp-professional-capacity, .pdp-price s, .pdp-expert-card p,
    .product-offer-stack > p, .product-offer-heading > span, .product-offer-items small,
    .purchase-form > label, .quantity-field label, .benefit-panel p, .sales-finance-body p,
    .sales-finance-body small, .sales-at-glance dt, .sales-configuration-note) {
    color: var(--uc-pdp-muted);
  }

  & .product-r12 .pdp-identity :is(.pdp-description, .pdp-lead) {
    color: var(--uc-pdp-muted) !important;
  }

  & .product-r12 :is(.pdp-heading-title > .eyebrow, .breadcrumbs a, .pdp-detail-shortcuts a,
    .pdp-gallery-caption a, .pdp-warranty a, .pdp-warranty-icon svg, .pdp-why-strip svg,
    .pdp-professional-capacity a, .financing-links > *, .sales-finance-icon, .pdp-secondary-actions > *,
    .purchase-note a, .benefit-panel a, .benefit-bubble > summary svg, .benefit-bubble > summary > span,
    .pdp-summary .rte a, .product-inclusion-proof > span > span) {
    color: var(--uc-pdp-accent);
  }

  & .product-r12 :is(.pdp-identity, .pdp-warranty, .pdp-fact-strip, .sales-at-glance,
    .sales-at-glance > div, .sales-finance-details, .pdp-secondary-actions, .benefit-bubble, .purchase-note) {
    border-color: var(--uc-pdp-line);
  }

  & .product-r12 :is(.pdp-confidence, .product-offer-stack, .product-inclusion-proof, .pdp-expert-card) {
    background: var(--uc-pdp-soft);
    border-color: var(--uc-pdp-line);
    color: var(--uc-pdp-text);
  }

  & .product-r12 :is(.sales-at-glance, .benefit-bubble, .benefit-panel, .financing-card) {
    background: var(--uc-pdp-page);
  }

  & .product-r12 .pdp-gallery {
    background: var(--uc-pdp-gallery);
    border-color: var(--uc-pdp-line);
  }

  & .product-r12 :is(.gallery-main, .pdp-featured, .gallery-thumbs button, .product-offer-items img) {
    background: var(--uc-pdp-gallery);
    border-color: var(--uc-pdp-line);
  }

  & .product-r12 .gallery-thumbs button:is([aria-pressed="true"], .active, :hover) {
    border-color: var(--uc-pdp-accent);
    box-shadow: 0 0 0 1px var(--uc-pdp-accent);
  }

  & .product-r12 :is(.purchase-form select, .quantity-field input, .uc-finish-option, .variant-pill,
    .product-hotspot, .product-hotspot-detail, .mobile-sticky-buy, .benefit-bubble[open]) {
    background-color: var(--uc-pdp-surface);
    border-color: var(--uc-pdp-line);
    color: var(--uc-pdp-text);
  }

  & .product-r12 :is(.uc-finish-option[aria-pressed="true"], .variant-pill[aria-pressed="true"]) {
    background: var(--uc-pdp-soft);
    border-color: var(--uc-pdp-accent);
    box-shadow: inset 0 0 0 1px var(--uc-pdp-accent);
  }

  & .r12-proof .r12-rating-stars {
    background-image: linear-gradient(90deg, var(--uc-pdp-star) var(--rating-fill, 0%),
      color-mix(in srgb, var(--uc-pdp-star) 25%, var(--uc-pdp-page)) var(--rating-fill, 0%));
    color: transparent;
  }

  & .r12-proof .r12-rating-empty { color: var(--uc-pdp-star); }

  & .product-r12 :is(.purchase-actions > .btn, .mobile-sticky-buy .btn,
    .pdp-expert-card .btn, .business-price-offer .btn) {
    background: var(--uc-pdp-button);
    color: var(--uc-pdp-button-text) !important;
    border-color: var(--uc-pdp-button);
    box-shadow: none;
  }

  & .product-r12 :is(.purchase-actions > .btn, .mobile-sticky-buy .btn,
    .pdp-expert-card .btn, .business-price-offer .btn):hover:not(:disabled) {
    box-shadow: 0 0 0 2px var(--uc-pdp-page), 0 0 0 3px var(--uc-pdp-button);
  }

  & .product-r12 :is(.purchase-actions > .btn, .mobile-sticky-buy .btn):disabled {
    background: var(--uc-pdp-soft);
    border-color: var(--uc-pdp-line);
    color: var(--uc-pdp-muted) !important;
    box-shadow: none;
  }

  & .product-r12 :is(button, a, summary, input, select):focus-visible {
    outline: 2px solid var(--uc-pdp-accent);
    outline-offset: 3px;
  }
}

@media (forced-colors: active) {
  body[data-page="product"] #MainContent:has([data-uc-pdp-palette]) .r12-proof .r12-rating-stars {
    background: none;
    color: CanvasText;
  }
}
