/* =========================================================================
   TopManager Online Shop - Accessibility: high-contrast mode + text size
   -------------------------------------------------------------------------
   A FRONT-OFFICE-VISITOR controlled accessibility skin, completely independent
   of the shop's BO-selected colour theme (StyleTheme). It is turned on/off by
   the visitor via the floating accessibility widget (bottom-left) and persisted
   in a per-visitor cookie, so it works for anonymous marketplace clients and
   carries no database / tenant state.

   Applied on <html> as:
     .fo-high-contrast                 - master switch
     .fo-high-contrast-dark            - polarity: white text on black
     .fo-high-contrast-light           - polarity: black text on white
     .fo-a11y-font-1 .. .fo-a11y-font-4- optional larger text steps

   SAFETY: this file is ALWAYS loaded but INERT until the visitor turns the
   mode on. Only the small, namespaced widget chrome (.tm-a11y-*) is always
   present; every skin rule is scoped under html.fo-high-contrast, so a shop
   whose visitors never switch renders byte-for-byte as before. The file is
   linked LAST (after the media-queries bundle and the BO custom CSS) and uses
   !important on the enforced properties, because an accessibility skin must
   reliably win over themes, inline styles and shop custom CSS - legibility
   must never be silently overridden.
   ========================================================================= */
/* =========================================================================
   1. Floating accessibility widget (ALWAYS ON - normal-theme appearance)
   ========================================================================= */
.tm-a11y-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 13000;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #1b1b1b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tm-a11y-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.tm-a11y-fab:focus-visible {
  outline: 3px solid #ffbf00;
  outline-offset: 3px;
}

.tm-a11y-fab svg {
  width: 27px;
  height: 27px;
  display: block;
  fill: currentColor;
}

.tm-a11y-fab.tm-a11y-active {
  background: #ffffff;
  color: #000000;
  border-color: #000000;
}

.tm-a11y-panel {
  position: fixed;
  left: 18px;
  bottom: 82px;
  z-index: 13000;
  width: 306px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 16px 18px 18px;
  background: #ffffff;
  color: #1b1b1b;
  border: 2px solid #1b1b1b;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  font-family: "Open Sans", Arial, sans-serif;
  display: none;
}

.tm-a11y-panel.tm-a11y-open {
  display: block;
}

.tm-a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.tm-a11y-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1b1b1b;
}

.tm-a11y-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1b1b1b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tm-a11y-close:hover {
  background: #ececec;
}

.tm-a11y-section {
  margin-bottom: 16px;
}

.tm-a11y-section:last-child {
  margin-bottom: 0;
}

.tm-a11y-section-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
}

/* Contrast mode - three-state segmented control (Off / Dark / Light) */
.tm-a11y-modes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.tm-a11y-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
  padding: 8px 4px;
  border: 2px solid #1b1b1b;
  border-radius: 9px;
  background: #ffffff;
  color: #1b1b1b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.tm-a11y-mode-btn:hover {
  background: #f0f0f0;
}

.tm-a11y-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #1b1b1b;
  box-sizing: border-box;
}

.tm-a11y-mode-off .tm-a11y-swatch {
  background: linear-gradient(135deg, #ffffff 0 50%, #000000 50% 100%);
}

.tm-a11y-mode-dark .tm-a11y-swatch {
  background: #000000;
}

.tm-a11y-mode-light .tm-a11y-swatch {
  background: #ffffff;
}

.tm-a11y-mode-btn[aria-pressed=true] {
  background: #1b1b1b;
  color: #ffffff;
}

.tm-a11y-mode-btn[aria-pressed=true] .tm-a11y-swatch {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #1b1b1b;
}

/* Text size - stepper (shown only while a contrast mode is active) */
.tm-a11y-font-section {
  display: none;
}

.tm-a11y-panel.tm-a11y-mode-active .tm-a11y-font-section {
  display: block;
}

.tm-a11y-font-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tm-a11y-font-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid #1b1b1b;
  border-radius: 9px;
  background: #ffffff;
  color: #1b1b1b;
  font-weight: 700;
  cursor: pointer;
}

.tm-a11y-font-btn:hover:not(:disabled) {
  background: #1b1b1b;
  color: #ffffff;
}

.tm-a11y-font-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tm-a11y-font-dec {
  font-size: 15px;
}

.tm-a11y-font-inc {
  font-size: 21px;
}

.tm-a11y-font-value {
  flex: 1 1 auto;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1b1b1b;
}

.tm-a11y-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d5d5d5;
  text-align: center;
}

.tm-a11y-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #0b57d0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.tm-a11y-reset:hover {
  color: #08409c;
}

.tm-a11y-close:focus-visible,
.tm-a11y-mode-btn:focus-visible,
.tm-a11y-font-btn:focus-visible,
.tm-a11y-reset:focus-visible {
  outline: 3px solid #ffbf00;
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .tm-a11y-fab {
    width: 48px;
    height: 48px;
    left: 14px;
    bottom: 14px;
  }
  .tm-a11y-panel {
    left: 14px;
    bottom: 72px;
    width: calc(100vw - 28px);
  }
}
/* =========================================================================
   2. High-contrast palette (per polarity)
   ========================================================================= */
html.fo-high-contrast-dark {
  --a11y-bg: #000000;
  --a11y-fg: #ffffff;
  --a11y-muted: #e2e2e2;
  --a11y-surface: #000000;
  --a11y-border: #ffffff;
  --a11y-accent: #ffe100;
  --a11y-accent-fg: #000000;
  --a11y-focus: #ffffff;
}

html.fo-high-contrast-light {
  --a11y-bg: #ffffff;
  --a11y-fg: #000000;
  --a11y-muted: #1a1a1a;
  --a11y-surface: #ffffff;
  --a11y-border: #000000;
  --a11y-accent: #0b3d91;
  --a11y-accent-fg: #ffffff;
  --a11y-focus: #0b3d91;
}

/* Font-size steps (default = 1; the widget stepper adds a class). */
html.fo-high-contrast {
  --a11y-font-scale: 1;
}

html.fo-high-contrast.fo-a11y-font-1 {
  --a11y-font-scale: 1.15;
}

html.fo-high-contrast.fo-a11y-font-2 {
  --a11y-font-scale: 1.3;
}

html.fo-high-contrast.fo-a11y-font-3 {
  --a11y-font-scale: 1.45;
}

html.fo-high-contrast.fo-a11y-font-4 {
  --a11y-font-scale: 1.6;
}

/* =========================================================================
   3. Map the theme design tokens to the high-contrast palette, so every
      token-driven component recolours automatically (same lever the colour
      themes use), on top of the explicit reset below.
   ========================================================================= */
html.fo-high-contrast {
  --tm-primary: var(--a11y-accent);
  --tm-primary-dark: var(--a11y-accent);
  --tm-primary-light: var(--a11y-accent);
  --tm-secondary: var(--a11y-accent);
  --tm-secondary-dark: var(--a11y-accent);
  --tm-secondary-light: var(--a11y-accent);
  --tm-accent: var(--a11y-accent);
  --tm-accent-dark: var(--a11y-accent);
  --tm-accent-light: var(--a11y-accent);
  --tm-body-bg: var(--a11y-bg);
  --tm-footer-bg: var(--a11y-bg);
  --tm-anchor: var(--a11y-accent);
  --tm-anchor-hover: var(--a11y-accent);
  --tm-surface: var(--a11y-surface);
  --tm-surface-alt: var(--a11y-surface);
  --tm-text: var(--a11y-fg);
  --tm-text-muted: var(--a11y-muted);
  --tm-border: var(--a11y-border);
  --tm-success: var(--a11y-fg);
  --tm-danger: var(--a11y-fg);
  --tm-warn: var(--a11y-fg);
  --tm-info: var(--a11y-fg);
  --tm-gradient-default: none;
  --tm-fancy-bg: none;
  --tm-submenu-photo-fade: transparent;
  --tm-submenu-photo-fade-h: transparent;
}

/* =========================================================================
   4. Universal reset - the readability guarantee.
      EVERY element is flattened: no coloured/gradient/image background, no
      shadows, foreground text forced to the palette colour, borders recoloured.
      This is what makes text readable in BOTH polarities: whatever colour a
      component hard-coded (a white label, a dark-grey caption, a brand-coloured
      chip on a brand-coloured bar) is overridden to a guaranteed-contrast pair.

      The invariant (this is the whole point of the theme): wherever text sits,
      it must be readable. Text colour is forced to the palette foreground, so the
      element's BACKGROUND must be flattened too - otherwise forced-dark text lands
      on a surviving coloured background (e.g. a brand gradient, which turns navy
      because every brand token maps to the accent). Hence BOTH background-colour
      AND background-image are removed here, on every element.

      Why it is safe + wins:
        - :where(body *) is universal but specificity stays (0,1,1); !important
          then beats every NON-important component rule no matter how specific,
          so a hard-coded colour/gradient cannot survive.
        - PHOTOGRAPHIC CONTENT is delivered as <img>/<picture>/<video>/<svg>
          elements, NOT as CSS backgrounds, so it is untouched: product & article
          photos, the logo and the carousel's sharp image all stay visible. Only
          decorative CSS backgrounds are dropped - which is precisely what makes
          text sitting on them readable.
        - The interactive / surface / widget rules below (higher specificity, or
          later on a tie) re-establish backgrounds WITH a matching text colour.
   ========================================================================= */
html.fo-high-contrast body {
  background: var(--a11y-bg) !important;
  color: var(--a11y-fg) !important;
}

html.fo-high-contrast :where(body *) {
  background-color: transparent !important;
  color: var(--a11y-fg) !important;
  border-color: var(--a11y-border) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Decorative CSS backgrounds (brand gradients, coloured fills, patterns) are
   removed so text sitting on them is readable. CONTENT PHOTOS are set INLINE as
   style="background:url(./)" (product, article and carousel imagery use a
   dynamic per-item URL, so it can only be inline) - those elements are exempted
   via :not([style*="url("]) and keep their image. A couple of known CSS-driven
   image containers are exempted by class as a safety net. Decorative gradients
   live in the CSS files (no inline url), so they are still flattened. */
html.fo-high-contrast :where(body *:not([style*="url("]):not(.tm-carousel-item-backdrop):not(.article-media-container):not(.product-big-picture-wrapper):not(.picture-wrapper)) {
  background-image: none !important;
}

/* Muted/secondary text keeps a slightly softer tone (still high contrast). */
html.fo-high-contrast :where(.text-muted, .title-categ-name, .page-sub-title, small) {
  color: var(--a11y-muted) !important;
}

/* =========================================================================
   5. Links
   ========================================================================= */
html.fo-high-contrast a {
  color: var(--a11y-accent) !important;
}

/* Underline genuine text links; skip block/card/button-style links so whole
   cards are not underlined. */
html.fo-high-contrast a:not(.btn):not(.tm-fancy-command):not(.product-link):not(.navbar-brand):not(.nav-link):not(.page-link):not(.dropdown-item):not([class*=card]):not([class*=-command]) {
  text-decoration: underline !important;
}

html.fo-high-contrast a:hover,
html.fo-high-contrast a:focus {
  text-decoration: underline !important;
}

/* =========================================================================
   6. Buttons
   ========================================================================= */
html.fo-high-contrast .btn,
html.fo-high-contrast .tm-fancy-command,
html.fo-high-contrast .quick-cart-flyout-cta,
html.fo-high-contrast .access-shopping-cart-command,
html.fo-high-contrast .quick-cart-flyout-tab,
html.fo-high-contrast .newsletter-dock-tab,
html.fo-high-contrast .back-to-top-command,
html.fo-high-contrast input[type=submit],
html.fo-high-contrast input[type=button],
html.fo-high-contrast input[type=reset],
html.fo-high-contrast button:not([class^=tm-a11y]):not([class*=" tm-a11y"]) {
  background: var(--a11y-accent) !important;
  background-image: none !important;
  color: var(--a11y-accent-fg) !important;
  border: 2px solid var(--a11y-border) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

/* Everything inside an accent button (label + icon) must use the accent foreground,
   otherwise the universal reset leaves the label on the plain fg (e.g. dark text on
   the accent-filled newsletter/scroll-top tabs). */
html.fo-high-contrast .btn *,
html.fo-high-contrast .tm-fancy-command *,
html.fo-high-contrast .quick-cart-flyout-cta *,
html.fo-high-contrast .access-shopping-cart-command *,
html.fo-high-contrast .quick-cart-flyout-tab *,
html.fo-high-contrast .newsletter-dock-tab *,
html.fo-high-contrast .back-to-top-command *,
html.fo-high-contrast button:not([class^=tm-a11y]):not([class*=" tm-a11y"]) * {
  color: var(--a11y-accent-fg) !important;
}

html.fo-high-contrast .btn:hover,
html.fo-high-contrast .btn:focus,
html.fo-high-contrast .tm-fancy-command:hover,
html.fo-high-contrast .tm-fancy-command:focus,
html.fo-high-contrast button:not([class^=tm-a11y]):not([class*=" tm-a11y"]):hover {
  background: var(--a11y-fg) !important;
  color: var(--a11y-bg) !important;
}

html.fo-high-contrast .btn:hover *,
html.fo-high-contrast .tm-fancy-command:hover *,
html.fo-high-contrast button:not([class^=tm-a11y]):not([class*=" tm-a11y"]):hover * {
  color: var(--a11y-bg) !important;
}

/* Disabled controls: keep them legible but visibly inert. */
html.fo-high-contrast .btn:disabled,
html.fo-high-contrast .btn.disabled,
html.fo-high-contrast button:disabled {
  background: var(--a11y-surface) !important;
  color: var(--a11y-muted) !important;
  opacity: 0.65 !important;
}

/* =========================================================================
   7. Form controls
   ========================================================================= */
html.fo-high-contrast input:not([type=submit]):not([type=button]):not([type=reset]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
html.fo-high-contrast select,
html.fo-high-contrast textarea {
  background: var(--a11y-surface) !important;
  background-image: none !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
  box-shadow: none !important;
}

html.fo-high-contrast ::placeholder {
  color: var(--a11y-muted) !important;
  opacity: 1 !important;
}

html.fo-high-contrast input[type=checkbox],
html.fo-high-contrast input[type=radio] {
  accent-color: var(--a11y-accent) !important;
}

/* =========================================================================
   8. Focus - strong, always-visible outline
   ========================================================================= */
html.fo-high-contrast a:focus-visible,
html.fo-high-contrast button:focus-visible,
html.fo-high-contrast input:focus-visible,
html.fo-high-contrast select:focus-visible,
html.fo-high-contrast textarea:focus-visible,
html.fo-high-contrast summary:focus-visible,
html.fo-high-contrast [tabindex]:focus-visible,
html.fo-high-contrast [role=button]:focus-visible {
  outline: 3px solid var(--a11y-focus) !important;
  outline-offset: 2px !important;
}

/* Form fields also outline on plain focus (not only :focus-visible). */
html.fo-high-contrast input:focus,
html.fo-high-contrast select:focus,
html.fo-high-contrast textarea:focus {
  outline: 3px solid var(--a11y-focus) !important;
  outline-offset: 2px !important;
  border-color: var(--a11y-accent) !important;
}

/* On accent-filled buttons the focus ring must contrast with the accent. */
html.fo-high-contrast .btn:focus-visible,
html.fo-high-contrast .tm-fancy-command:focus-visible,
html.fo-high-contrast button:not([class^=tm-a11y]):not([class*=" tm-a11y"]):focus-visible {
  outline-color: var(--a11y-fg) !important;
  outline-offset: 3px !important;
}

/* =========================================================================
   9. Chrome & floating surfaces - solid opaque background + border so they
      never let page content show through (fixed navbar, dropdowns, menus,
      modals, popups, toasts, cart/account panels, ...).
   ========================================================================= */
html.fo-high-contrast #main-navbar,
html.fo-high-contrast #secondary-navbar,
html.fo-high-contrast .categories-menu-list-item,
html.fo-high-contrast .dropdown-menu,
html.fo-high-contrast .menu-item-details,
html.fo-high-contrast .classic-submenu-deep,
html.fo-high-contrast .modal-content,
html.fo-high-contrast .offcanvas,
html.fo-high-contrast .popover,
html.fo-high-contrast .toast,
html.fo-high-contrast .own-popup-contents,
html.fo-high-contrast .confirm-container,
html.fo-high-contrast .busy-box-container,
html.fo-high-contrast .alert-container,
html.fo-high-contrast .newsletter-popup-panel,
html.fo-high-contrast .quick-cart-flyout-pane,
html.fo-high-contrast .cookie-consent-card,
html.fo-high-contrast .fo-chat-window,
html.fo-high-contrast #login-register-invite-dialog-contents,
html.fo-high-contrast .shopping-cart-totals-container,
html.fo-high-contrast .my-account-side-menu-container,
html.fo-high-contrast .my-account-section-container,
html.fo-high-contrast .catalogue-filter-container,
html.fo-high-contrast .articles-list-filter-container {
  background: var(--a11y-surface) !important;
  background-image: none !important;
  color: var(--a11y-fg) !important;
  border-color: var(--a11y-border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Separators for the two fixed bars + footer so they read as distinct zones. */
html.fo-high-contrast #main-navbar {
  border-bottom: 2px solid var(--a11y-border) !important;
}

html.fo-high-contrast #secondary-navbar {
  border-top: 1px solid var(--a11y-border) !important;
}

html.fo-high-contrast footer,
html.fo-high-contrast #footer {
  background: var(--a11y-surface) !important;
  border-top: 2px solid var(--a11y-border) !important;
}

html.fo-high-contrast .dropdown-item:hover,
html.fo-high-contrast .dropdown-item:focus,
html.fo-high-contrast .menu-item-caption:hover {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
}

html.fo-high-contrast .dropdown-item:hover *,
html.fo-high-contrast .menu-item-caption:hover * {
  color: var(--a11y-accent-fg) !important;
}

/* select2 (used by pickers) - dropdown + selected value box. */
html.fo-high-contrast .select2-dropdown,
html.fo-high-contrast .select2-search__field,
html.fo-high-contrast .select2-selection {
  background: var(--a11y-surface) !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
}

html.fo-high-contrast .select2-results__option--highlighted {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
}

/* =========================================================================
   10. Cards / panels - flat background + a visible border so each block is a
       clearly delimited box on the uniform background.
   ========================================================================= */
html.fo-high-contrast .card,
html.fo-high-contrast .tm-product-card,
html.fo-high-contrast .tm-product-card-minimal,
html.fo-high-contrast .article-card,
html.fo-high-contrast .article-card-on-sidebar,
html.fo-high-contrast .article-item,
html.fo-high-contrast .article-category-card,
html.fo-high-contrast .content-panel,
html.fo-high-contrast .product-info-tab,
html.fo-high-contrast .cart-container,
html.fo-high-contrast .cart-item,
html.fo-high-contrast .cart-summary,
html.fo-high-contrast .product-pictures-container,
html.fo-high-contrast .product-price-and-other-details-container,
html.fo-high-contrast .free-price-text {
  background: var(--a11y-surface) !important;
  background-image: none !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
  box-shadow: none !important;
}

/* Callout badges / pills / ribbons. Many sit OVER the product/article photo, so a
   solid opaque background + contrasting, larger text is required to stay readable
   (the reset alone would leave a tiny label as bare text on top of the image). */
html.fo-high-contrast .badge,
html.fo-high-contrast .tm-badge,
html.fo-high-contrast .discount-badge,
html.fo-high-contrast .product-label,
html.fo-high-contrast .article-category,
html.fo-high-contrast .article-category-container,
html.fo-high-contrast .mc-badge,
html.fo-high-contrast .product-badge {
  background: var(--a11y-surface) !important;
  background-image: none !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
  border-radius: 4px !important;
  text-shadow: none !important;
  font-weight: 700 !important;
}
html.fo-high-contrast .product-badge,
html.fo-high-contrast .mc-badge,
html.fo-high-contrast .article-category-container a {
  font-size: calc(12px * var(--a11y-font-scale)) !important;
}
html.fo-high-contrast .badge *,
html.fo-high-contrast .product-badge *,
html.fo-high-contrast .discount-badge *,
html.fo-high-contrast .mc-badge,
html.fo-high-contrast .mc-badge *,
html.fo-high-contrast .article-category-container,
html.fo-high-contrast .article-category-container * {
  color: var(--a11y-fg) !important;
}
/* The promo/discount badge is the key call-to-attention - render it in the accent so
   it pops and reads clearly over any photo. */
html.fo-high-contrast .product-badge.discount,
html.fo-high-contrast .discount-badge {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
  border-color: var(--a11y-border) !important;
}
html.fo-high-contrast .product-badge.discount *,
html.fo-high-contrast .discount-badge * {
  color: var(--a11y-accent-fg) !important;
}
/* Remove the decorative coloured "tail" (a pseudo the element reset does not reach). */
html.fo-high-contrast .product-badge::after,
html.fo-high-contrast .article-category-container::before,
html.fo-high-contrast .mc-badge::before {
  display: none !important;
}
/* Corner/edge "attention" ribbons that overlay the card image (JOB / AD / NOT
   APPROVED / DRAFT markers). The reset flattens their coloured background to
   transparent, leaving the label floating unreadably over the photo - repaint them
   in the accent so they stay a solid, legible marker. */
html.fo-high-contrast .job-article-hint,
html.fo-high-contrast .ad-article-hint,
html.fo-high-contrast .article-is-not-approved-hint,
html.fo-high-contrast .article-is-draft-hint-container {
  background: var(--a11y-accent) !important;
  background-image: none !important;
  color: var(--a11y-accent-fg) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.fo-high-contrast .job-article-hint *,
html.fo-high-contrast .ad-article-hint *,
html.fo-high-contrast .article-is-not-approved-hint *,
html.fo-high-contrast .article-is-draft-hint-container * {
  color: var(--a11y-accent-fg) !important;
}

/* =========================================================================
   Over-image text - text that sits directly on a content photo gets its own
   opaque plate. The darkening scrim behind these labels is either a normal
   element (flattened by the reset) or absent entirely, so without a plate the
   forced-contrast text would be unreadable on the photo. The opaque plate also
   survives any leftover pseudo scrim (it travels with the text) in both
   polarities. Covers: product-category tiles, landing article hero, "big
   header" hero template, article-details header title, gallery captions.
   ========================================================================= */
html.fo-high-contrast .category-name,
html.fo-high-contrast .category-icon,
html.fo-high-contrast .hero-content,
html.fo-high-contrast .gallery-picture-caption,
html.fo-high-contrast .gallery-preview-caption,
html.fo-high-contrast .article-title-overlay .article-title,
html.fo-high-contrast .sup-for-big-header,
html.fo-high-contrast .title-for-big-header,
html.fo-high-contrast .description-for-big-header-webinars {
  background: var(--a11y-bg) !important;
  background-image: none !important;
  color: var(--a11y-fg) !important;
  text-shadow: none !important;
}
/* Plates whose element is much wider than its text shrink to hug the text so
   the photo still shows around them. */
html.fo-high-contrast .article-title-overlay .article-title,
html.fo-high-contrast .sup-for-big-header,
html.fo-high-contrast .title-for-big-header,
html.fo-high-contrast .description-for-big-header-webinars {
  width: fit-content !important;
  max-width: 100% !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
}
html.fo-high-contrast .category-name,
html.fo-high-contrast .category-icon,
html.fo-high-contrast .hero-content {
  padding: 6px 10px !important;
  border-radius: 4px !important;
}

/* =========================================================================
   Decorative pseudo-elements with HARD-CODED colours (greys, brand blues, the
   category-ribbon fold, the popup close "X"). Token-driven pseudos already
   recolour through the --tm-* map above; these use literal colours the element
   reset cannot reach, so repaint them into the palette.
   ========================================================================= */
/* Checkout progress circles - the step number is drawn by the pseudo. */
html.fo-high-contrast .checkout-steps-container .checkout-step-container::before {
  background: var(--a11y-surface) !important;
  color: var(--a11y-fg) !important;
  border-color: var(--a11y-border) !important;
}
html.fo-high-contrast .checkout-steps-container .checkout-step-container.active::before {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
  border-color: var(--a11y-fg) !important;
}
/* Product-review "speech bubble" pointer triangle (border-colour trick). */
html.fo-high-contrast .product-reviews-list .client-comments-and-rating::before {
  border-top-color: var(--a11y-border) !important;
  border-right-color: var(--a11y-border) !important;
}
/* Active carousel navigation dot. */
html.fo-high-contrast .slick-dots li.slick-active button::before {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent) !important;
}
/* Popup close-button "X" strokes. */
html.fo-high-contrast .own-popup-close-command::before,
html.fo-high-contrast .own-popup-close-command::after {
  background: var(--a11y-fg) !important;
}

/* Prices stay bold and use the plain foreground colour for maximum contrast. */
html.fo-high-contrast .price,
html.fo-high-contrast .product-price,
html.fo-high-contrast .final-price {
  color: var(--a11y-fg) !important;
  font-weight: 700 !important;
}

/* =========================================================================
   11. Media - keep content images visible. Give the header logo a white
       plate so it stays visible in BOTH polarities (a dark logo on the black
       background, or a light logo on the white one, would otherwise vanish).
   ========================================================================= */
html.fo-high-contrast .logo-image {
  background: #ffffff !important;
  padding: 4px !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

/* Never dim/hide the actual content photos (carousel slide + product listing). They
   are <img>/inline-url elements the reset does not touch; this guards against any
   leftover opacity/filter so the image is always at full strength in high contrast. */
html.fo-high-contrast .product-picture,
html.fo-high-contrast .tm-carousel-item-img,
html.fo-high-contrast .tm-carousel-item-backdrop {
  opacity: 1 !important;
  visibility: visible !important;
}

html.fo-high-contrast .product-picture,
html.fo-high-contrast .tm-carousel-item-img {
  filter: none !important;
}

/* When a product genuinely has no listing picture (or its image 404s) the JS reveals
   this placeholder. Make it a clean, intentional tile in high contrast. */
html.fo-high-contrast .product-picture-placeholder {
  background: var(--a11y-surface) !important;
  border: 2px solid var(--a11y-border) !important;
  color: var(--a11y-fg) !important;
}

html.fo-high-contrast .product-picture-placeholder .pp-icon,
html.fo-high-contrast .product-picture-placeholder .pp-label,
html.fo-high-contrast .product-picture-placeholder .pp-icon-chip {
  color: var(--a11y-fg) !important;
  background: transparent !important;
}

html.fo-high-contrast .tm-icon,
html.fo-high-contrast i[class*=fa-] {
  color: inherit !important;
  text-shadow: none !important;
}

/* Text that sits OVER a full-bleed photo (Web Studio "header/hero" sections keep
   their <img> background photo visible) gets a solid palette-coloured band behind
   it, so the heading/subheading stay readable on top of any image - photo visible
   around the text, text always legible. The CTAs are handled by the button rules. */
html.fo-high-contrast .section-of-type-header-headline,
html.fo-high-contrast .section-of-type-header-sunbheadline {
  background: var(--a11y-bg) !important;
  color: var(--a11y-fg) !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  max-width: 100% !important;
}

/* =========================================================================
   12. Text size - fold a clear, larger base into the skin and scale it by the
       widget stepper. Absolute px * scale (never em) so nothing compounds.
       Widget internals (.tm-a11y-*) are deliberately not matched here.
   ========================================================================= */
html.fo-high-contrast body,
html.fo-high-contrast :where(p, li, dd, dt, td, th, blockquote, figcaption, .form-label, .form-control, .command-text, .menu-item-caption, .nav-link, .title-categ-name) {
  font-size: calc(16px * var(--a11y-font-scale)) !important;
  line-height: 1.6 !important;
}

html.fo-high-contrast input:not([type=checkbox]):not([type=radio]),
html.fo-high-contrast select,
html.fo-high-contrast textarea,
html.fo-high-contrast .btn {
  font-size: calc(16px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast :where(.product-name, .tm-product-card-name, .article-title) {
  font-size: calc(17px * var(--a11y-font-scale)) !important;
  line-height: 1.4 !important;
}

html.fo-high-contrast :where(.price, .product-price, .final-price) {
  font-size: calc(20px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast h1,
html.fo-high-contrast .page-main-title {
  font-size: calc(30px * var(--a11y-font-scale)) !important;
  line-height: 1.25 !important;
}

html.fo-high-contrast h2 {
  font-size: calc(26px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast h3 {
  font-size: calc(22px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast h4 {
  font-size: calc(20px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast h5 {
  font-size: calc(18px * var(--a11y-font-scale)) !important;
}

html.fo-high-contrast h6 {
  font-size: calc(16px * var(--a11y-font-scale)) !important;
}

/* =========================================================================
   13. The accessibility widget itself, re-skinned to the active palette so it
       matches the mode it controls (high specificity beats the reset above).
   ========================================================================= */
html.fo-high-contrast .tm-a11y-fab {
  background: var(--a11y-surface) !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
}

html.fo-high-contrast .tm-a11y-fab.tm-a11y-active {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
  border-color: var(--a11y-border) !important;
}

html.fo-high-contrast .tm-a11y-panel {
  background: var(--a11y-surface) !important;
  color: var(--a11y-fg) !important;
  border: 2px solid var(--a11y-border) !important;
}

html.fo-high-contrast .tm-a11y-close {
  color: var(--a11y-fg) !important;
}

/* The skin above targets generic elements (h2 gets a big heading size, span gets a
   transparent background + forced colour). Re-assert the widget's own type size and
   let its labels follow the colour of the button they sit on. */
html.fo-high-contrast .tm-a11y-title {
  font-size: 16px !important;
  color: var(--a11y-fg) !important;
}

html.fo-high-contrast .tm-a11y-panel span {
  color: inherit !important;
}

html.fo-high-contrast .tm-a11y-mode-btn,
html.fo-high-contrast .tm-a11y-font-btn,
html.fo-high-contrast .tm-a11y-close {
  background: var(--a11y-surface) !important;
  color: var(--a11y-fg) !important;
  border-color: var(--a11y-border) !important;
}

html.fo-high-contrast .tm-a11y-mode-btn[aria-pressed=true] {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
}

html.fo-high-contrast .tm-a11y-mode-btn:hover,
html.fo-high-contrast .tm-a11y-font-btn:hover:not(:disabled),
html.fo-high-contrast .tm-a11y-close:hover {
  background: var(--a11y-accent) !important;
  color: var(--a11y-accent-fg) !important;
}

html.fo-high-contrast .tm-a11y-reset {
  color: var(--a11y-accent) !important;
}

html.fo-high-contrast .tm-a11y-foot {
  border-top-color: var(--a11y-border) !important;
}

html.fo-high-contrast .tm-a11y-swatch {
  border-color: var(--a11y-border) !important;
}

/* Keep the mode-preview swatches showing their polarity (Layer A would blank the
   span backgrounds). */
html.fo-high-contrast .tm-a11y-mode-off .tm-a11y-swatch {
  background: linear-gradient(135deg, #ffffff 0 50%, #000000 50% 100%) !important;
}

html.fo-high-contrast .tm-a11y-mode-dark .tm-a11y-swatch {
  background: #000000 !important;
}

html.fo-high-contrast .tm-a11y-mode-light .tm-a11y-swatch {
  background: #ffffff !important;
}
