/* ===========================================================================
   JA Atoms — Dark Mode
   ---------------------------------------------------------------------------
   Light mode is the original, approved design and is NOT modified here.
   Every rule is scoped under html[data-theme="dark"] except the toggle button
   (visible in both modes). Dark MIRRORS light — same relationships, never adds
   contrast light lacks. Brand accent (--color-primary #c1ab7c gold) is kept.
   Loaded LAST in <head> via addCustomTag in index.php (after the optimize bundle).
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1) Palette — one source of truth (cool-neutral dark, tuned to mirror light)
   --------------------------------------------------------------------------- */
html[data-theme="dark"] {
  --dm-bg:        #14171c;   /* page background (light: #ffffff)            */
  --dm-band:      #1a1e25;   /* section bands / .bg-light (light: #f8f9fa)  */
  --dm-surface:   #1e232b;   /* cards / panels                              */
  --dm-surface-2: #262c36;   /* elevated: inputs, dropdowns, hover surfaces */
  --dm-border:    #2d3440;   /* dividers / frames                           */
  --dm-field-border: #3c4654;/* form-field outlines (one step lighter)      */
  --dm-text:      #c2c9d6;   /* body copy (light: #616161)                  */
  --dm-text-muted:#8c97a8;   /* meta / muted                                */
  --dm-heading:   #eef1f6;   /* headings (light: near-#111)                 */

  /* Brand accent — KEEP the gold; only a slightly lighter hover for dark.   */
  --dm-accent:       #c1ab7c;
  --dm-accent-hover: #d4c199;

  color-scheme: dark;

  /* -------------------------------------------------------------------------
     2) REMAP the template's own colour TOKENS (the big lever). Confirmed vars.
        Do NOT remap --color-primary (brand accent).
     ------------------------------------------------------------------------- */
  --body-bg-color:   var(--dm-bg);
  --body-text-color: var(--dm-text);
  --color-light:     var(--dm-band);
  --heading-color:   var(--dm-heading);
  --border-color:    var(--dm-border);

  /* Nav text tokens (light: near-black #212529 → invisible on dark). */
  --mainnav-link-color: var(--dm-text);
  --mainnav-text-color: var(--dm-text);
  /* Default :root hover/active are Bootstrap blue #007bff (palettes mostly
     override to gold) — align the var to the brand accent for consistency. */
  --mainnav-link-hover-color: var(--dm-accent);
  --mainnav-link-active-color: var(--dm-accent);
  /* Prose link hover was a dark gold (#ac8124) that vanishes on dark → lift it. */
  --body-link-hover-color: var(--dm-accent-hover);
}

/* ---------------------------------------------------------------------------
   3) Base surfaces
   --------------------------------------------------------------------------- */
html[data-theme="dark"] body {
  background: var(--dm-bg);
  color: var(--dm-text);
}
html[data-theme="dark"] .t4-wrapper,
html[data-theme="dark"] .t4-content,
html[data-theme="dark"] .t4-section,
html[data-theme="dark"] .t4-mainbody {
  background-color: var(--dm-bg);
}

/* ---------------------------------------------------------------------------
   3b) Headings & prose — base headings are literal #212121 (NOT --heading-color,
       which the template leaves empty), so the token remap can't reach them.
       Lift every heading directly. Mirrors light's near-black-on-white contrast.
   --------------------------------------------------------------------------- */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] .h1, html[data-theme="dark"] .h2, html[data-theme="dark"] .h3,
html[data-theme="dark"] .h4, html[data-theme="dark"] .h5, html[data-theme="dark"] .h6,
html[data-theme="dark"] .display-1, html[data-theme="dark"] .display-2,
html[data-theme="dark"] .display-3, html[data-theme="dark"] .display-4,
html[data-theme="dark"] .site-name,
html[data-theme="dark"] .ja-masthead-title {
  color: var(--dm-heading);
}
/* Heading LINKS (manufacturer names, latestnews/article titles) hardcode #212121
   via deep chains (e.g. ul.latestnews … h6 a, .manufacturer h2 a) → force-lift. */
html[data-theme="dark"] h1 a, html[data-theme="dark"] h2 a, html[data-theme="dark"] h3 a,
html[data-theme="dark"] h4 a, html[data-theme="dark"] h5 a, html[data-theme="dark"] h6 a,
html[data-theme="dark"] .h1 a, html[data-theme="dark"] .h2 a, html[data-theme="dark"] .h3 a {
  color: var(--dm-heading) !important;
}
/* Headings (and their links) on a coloured/accent fill stay white by design
   (promo banners, masthead-over-photo) — restored where the fill provides contrast. */
html[data-theme="dark"] [class*="bg-primary"] :is(h1,h2,h3,h4,h5,h6),
html[data-theme="dark"] [class*="bg-dark"]    :is(h1,h2,h3,h4,h5,h6),
html[data-theme="dark"] .text-white,
html[data-theme="dark"] .text-white :is(h1,h2,h3,h4,h5,h6) { color: #fff; }
html[data-theme="dark"] [class*="bg-primary"] :is(h1,h2,h3,h4,h5,h6) a,
html[data-theme="dark"] [class*="bg-dark"]    :is(h1,h2,h3,h4,h5,h6) a,
html[data-theme="dark"] .text-white :is(h1,h2,h3,h4,h5,h6) a { color: #fff !important; }

/* ---------------------------------------------------------------------------
   4) Header / topbar / megamenu (shared chrome on every page)
   --------------------------------------------------------------------------- */
/* Text logo "ATOMS" — the visible text is .site-name (own #212121 colour that
   the parent <a> colour can't cascade past) → lift it directly. */
html[data-theme="dark"] .logo-text a,
html[data-theme="dark"] .navbar-brand.logo-text a,
html[data-theme="dark"] .logo-text .site-name,
html[data-theme="dark"] .logo-text,
html[data-theme="dark"] .site-title a { color: var(--dm-heading); }
/* Page/module title text (.menu-item-title literal #343a40). */
html[data-theme="dark"] .menu-item-title { color: var(--dm-heading); }

/* Topbar utility bar (.t4-palette-topbar is literal #fff in light). Its border. */
html[data-theme="dark"] .t4-topbar,
html[data-theme="dark"] .t4-palette-topbar {
  background-color: var(--dm-band);
  border-bottom-color: var(--dm-border);
}
html[data-theme="dark"] .t4-palette-topbar,
html[data-theme="dark"] .t4-palette-topbar a {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .t4-palette-topbar h1,
html[data-theme="dark"] .t4-palette-topbar h2,
html[data-theme="dark"] .t4-palette-topbar h3,
html[data-theme="dark"] .t4-palette-topbar h4,
html[data-theme="dark"] .t4-palette-topbar h1 a,
html[data-theme="dark"] .t4-palette-topbar h2 a,
html[data-theme="dark"] .t4-palette-topbar h3 a,
html[data-theme="dark"] .t4-palette-topbar h4 a { color: var(--dm-text); }

/* Hamburger / off-canvas trigger icon (palette sets #212121 on light headers). */
html[data-theme="dark"] .navbar-toggler,
html[data-theme="dark"] .t4-offcanvas-toggle,
html[data-theme="dark"] .megamenu-toggle,
html[data-theme="dark"] .t4-offcanvas-toggle .fa,
html[data-theme="dark"] .t4-offcanvas-toggle i { color: var(--dm-text); }

/* Per-home: Digital Shop (Home 2) ships a DARK NAVY header + topbar (#041e42).
   Align them to the dark page so the header bar and megamenu strip match. */
html[data-theme="dark"] .layout-home-2 .t4-header.t4-palette-mainnav,
html[data-theme="dark"] .layout-home-2 .t4-palette-mainnav,
html[data-theme="dark"] .layout-home-2 .t4-topbar.t4-palette-topbar {
  background-color: var(--dm-bg);
}

/* Megamenu bar — literal #fff per palette (.t4-palette-mainnav / -light /
   -masthead …) and via .nav-breakpoint rules. Palette-agnostic override that
   beats the 3-class palette rules on element count. */
html[data-theme="dark"] .navbar-expand-lg div.t4-megamenu,
html[data-theme="dark"] div.t4-megamenu {
  background-color: var(--dm-bg);
  border-color: var(--dm-border);
}

/* Dropdown / mega panels — white in light → elevated surface. */
html[data-theme="dark"] .t4-megamenu .dropdown-menu {
  background-color: var(--dm-surface);
  box-shadow: 0 0 0 1px var(--dm-border);
}
/* Top-level nav links (literal near-black per palette) → body text; keep the
   brand gold (#c1ab7c) the palette already applies on active/hover/open. */
html[data-theme="dark"] .t4-megamenu .navbar-nav > li > a,
html[data-theme="dark"] .t4-megamenu .navbar-nav > li > .nav-link {
  color: var(--dm-text);
}
/* Open/show state set descendants to #212121 → lift to heading (visible on the
   dark dropdown surface). Per-palette rules are 4-class — beat with !important. */
html[data-theme="dark"] .t4-megamenu .nav > li.show > a,
html[data-theme="dark"] .t4-megamenu .nav > li.show > .nav-link {
  color: var(--dm-heading) !important;
}
/* Dropdown link items — palette rules target `li > a` / `li .dropdown-item` at
   3-class/2-elem specificity; match the `li >` structure so we tie-or-beat them. */
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > a,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > .nav-link,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .dropdown-item,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .nav-link {
  color: var(--dm-text);
}
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > a:hover,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > a:focus,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .dropdown-item:hover {
  color: var(--dm-heading);
}
/* Top-level dropdown caret: per-palette rules (.t4-palette-* … .nav > .dropdown >
   .dropdown-toggle, spec 0,6,1) paint the rest state near-black (#212121) → invisible
   on dark. Mirror that 6-class chain so the rest state shows; active/hover palette rules
   (0,6,3) still win, keeping the gold accent. */
html[data-theme="dark"] .t4-megamenu .nav > .dropdown > .dropdown-toggle .item-caret::before,
html[data-theme="dark"] .t4-megamenu .navbar-nav > li > a.dropdown-toggle .item-caret::before,
html[data-theme="dark"] .t4-megamenu .dropdown-toggle .item-caret::before {
  border-top-color: var(--dm-text);
}
/* Mega column titles (hardcoded near-black) → heading colour, subtle divider. */
html[data-theme="dark"] .t4-megamenu .mega-col-title,
html[data-theme="dark"] .t4-megamenu .module-title,
html[data-theme="dark"] .t4-megamenu .t4-module .module-title {
  color: var(--dm-heading);
  border-bottom-color: var(--dm-border);
}
/* Dropdown item active/hover bg (light: #f5f5f5) → surface-2, keep text light. */
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .dropdown-item:hover,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .dropdown-item:focus,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li .dropdown-item:active {
  background-color: var(--dm-surface-2);
  color: var(--dm-heading);
}

/* ---------------------------------------------------------------------------
   4b) Content components — breadcrumb, tables, utilities
   --------------------------------------------------------------------------- */
/* Breadcrumb (transparent bar; links & site-name literal #212121). */
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .breadcrumb a,
html[data-theme="dark"] .breadcrumb .site-name,
html[data-theme="dark"] .breadcrumb .menu-item-title { color: var(--dm-text); }
html[data-theme="dark"] .breadcrumb-item.active,
html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--dm-text-muted); }
/* The ACTUAL "/" separator is the <span class="divider">::before (the Bootstrap
   .breadcrumb-item+...::before above is display:none in this template). Its color is a
   literal #212121 → invisible on dark. Mirror light (separator == breadcrumb link colour,
   reads muted as a thin glyph) with a clearly-visible muted tone. */
html[data-theme="dark"] .breadcrumb .divider::before { color: var(--dm-text-muted); }
html[data-theme="dark"] .breadcrumb a:hover,
html[data-theme="dark"] .breadcrumb a:focus,
html[data-theme="dark"] .breadcrumb a:active { color: var(--dm-accent); }

/* Inline <code> keeps Bootstrap red #bd4147 (3.43:1 on dark) → lift to a warm
   red that meets AA on the dark page. */
html[data-theme="dark"] code { color: #e87878; }

/* Blog article title link hover/focus/active reverts to blue #0056b3 (invisible
   on the dark card) → gold accent affordance across all three states. */
html[data-theme="dark"] .page-header h2 a:hover,
html[data-theme="dark"] .page-header h2 a:focus,
html[data-theme="dark"] .page-header h2 a:active { color: var(--dm-accent) !important; }

/* Tables (bare <table> + Bootstrap .table). th near-black; borders #dee2e6. */
html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > * { color: var(--dm-text); border-color: var(--dm-border); }
html[data-theme="dark"] th { color: var(--dm-heading); }
html[data-theme="dark"] td,
html[data-theme="dark"] th { border-color: var(--dm-border); }
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255,255,255,.03); color: var(--dm-text); }
html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .table-bordered > :not(caption) > * > * { border-color: var(--dm-border); }

/* Restore .text-light: it reads var(--color-light) which we remap to a dark band
   for .bg-light/sections — but the TEXT utility must stay light. */
html[data-theme="dark"] .text-light { color: #e9ecef !important; }
/* Muted texts with a LITERAL #616161 (light body colour) that bypass the var
   remap — blockquote attribution, figure caption, article intro, cite, ACM intro.
   Lift to the dark muted token so they stay readable (mirrors light's ~muted). */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .blockquote-footer,
html[data-theme="dark"] .figure-caption,
html[data-theme="dark"] .figcaption,
html[data-theme="dark"] cite,
html[data-theme="dark"] .mod-article-list .articles-introtext,
html[data-theme="dark"] .acym_introtext { color: var(--dm-text-muted) !important; }
/* <mark> highlight keeps its light-on-dark relationship from light (by design). */

/* ---------------------------------------------------------------------------
   5) Form fields (search, contact, login, register, comments, VirtueMart)
      White #fff fill + #eee border in light → elevated surface + field border.
   --------------------------------------------------------------------------- */
html[data-theme="dark"] input.inputbox,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .chzn-single,
html[data-theme="dark"] .custom-select {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
  border-color: var(--dm-field-border);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--dm-text-muted); }
/* VM header search uses a dark PNG magnifier baked into the input's background-image
   (right 16px center) → invisible on the dark field. Swap for a light SVG magnifier. */
html[data-theme="dark"] .header-block-1 .search .inputbox,
html[data-theme="dark"] .search .inputbox {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%238c97a8' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cline x1='9.7' y1='9.7' x2='13' y2='13'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
/* Form labels / legends (literal #212529 on many forms — contact/login/edit). */
html[data-theme="dark"] label,
html[data-theme="dark"] legend,
html[data-theme="dark"] .control-label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .controls label { color: var(--dm-text); }
/* :focus re-asserts light bg/text in many templates (gotcha #16, #43). */
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] .form-control:focus {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
  border-color: var(--dm-accent);
}
/* Validation error state. On submit, AcyMailing flags fields with .acym_invalid_field
   (#f2dede) and Joomla with .invalid (#ffffdd) — a near-white field on the dark page.
   Keep the field dark and signal the error with a clear red border (the shipped #9d261d
   is too dark to read on dark). */
html[data-theme="dark"] input.acym_invalid_field,
html[data-theme="dark"] textarea.acym_invalid_field,
html[data-theme="dark"] .acym_invalid_field,
html[data-theme="dark"] input.invalid,
html[data-theme="dark"] textarea.invalid,
html[data-theme="dark"] select.invalid {
  background-color: var(--dm-surface-2) !important;
  color: var(--dm-text) !important;
  border-color: #e2574c !important;
}
/* Joomla legacy validation also paints the LABEL itself (label.invalid{background:#fff;
   color:red}). Our generic dark `label{color:--dm-text}` then leaves LIGHT text on a WHITE
   box → unreadable. Drop the white box and signal the error with readable red text, like
   the field's red border. (0,2,2) beats both label.invalid (0,1,1) and the generic label. */
html[data-theme="dark"] label.invalid {
  background-color: transparent !important;
  color: #e9897f !important;
}
/* Error message blocks (light pink/white boxes) → dark surface, readable red text. */
html[data-theme="dark"] div.acym_module_error,
html[data-theme="dark"] .acym__field__error__block {
  background-color: var(--dm-surface-2) !important;
  border-color: #e2574c !important;
  color: #e9897f !important;
}

/* ---------------------------------------------------------------------------
   6) Off-canvas mobile menu (panel #fff, header dark, drill-down arrows)
   --------------------------------------------------------------------------- */
html[data-theme="dark"] .t4-offcanvas,
html[data-theme="dark"] .c-offcanvas { background: var(--dm-surface); }
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header {
  background-color: var(--dm-surface-2);
  border-bottom-color: var(--dm-border);
}
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header .close {
  background-color: var(--dm-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Base CSS leaves .close at width:auto; with display:flex the box collapses to the
     glyph width (~13px) while height stays 32px → border-radius:50% renders a vertical
     ELLIPSE. Lock it back to a 32×32 square so it's a circle, like light mode. */
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}
/* The × glyph used line-height:28px + top:-2px in a 32px box → off-centre (worse once
   the box is flex-centred). Reset to a clean flex centre. */
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header .close span {
  color: var(--dm-text);
  height: auto;
  width: auto;
  line-height: 1;
  top: 0;
}
/* Base template spins the glyph on hover (.close:hover span{transform:rotate(180deg)}).
   The × is 180°-symmetric so the spin is invisible, BUT the rotation pivots on the box
   centre while the glyph's optical centre is offset → the × visibly JUMPS on hover (box
   itself never moves). Kill the rotate so the glyph stays put. */
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header .close:hover span,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header .close:focus span,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-header .close:active span {
  transform: none;
}
/* Body links — a literal #212121 rule (4-class) overrides the var; match it. */
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .nav-link,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .separator,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .dropdown-menu .dropdown-item,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .dropdown-menu .nav-link { color: var(--dm-text); }
/* Drill-down caret button: light circle #f0f0f0 + #9e9e9e chevron → surface + light. */
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .btn-toggle {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
}
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .btn-toggle:hover,
html[data-theme="dark"] .t4-offcanvas .t4-off-canvas-body .navbar .btn-toggle:focus {
  background-color: var(--dm-surface-2);
  color: var(--dm-heading);
}

/* ---------------------------------------------------------------------------
   7) Content surfaces — cards, sections, VirtueMart, pagination
   --------------------------------------------------------------------------- */
/* Article intro card (.item-content). Light is #f2f2f2 on a #fff page — a ~5% tint that
   reads as NO box (blends invisibly). On the featured/blog cards (image stacked ABOVE the
   text, not behind it) a --dm-surface fill instead becomes a loud two-tone split light
   never has. Mirror light's invisible box → transparent (blend with the page). */
html[data-theme="dark"] .item-content {
  background-color: transparent;
}
/* Section bands (.section-features #f2f3f7) → subtle dark band. */
html[data-theme="dark"] .section-features { background-color: var(--dm-band); }
/* Product neighbours (prev/next nav) → surface. */
html[data-theme="dark"] .productdetails-view .product-neighbours {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
}
/* Product gallery: light leaves the media container transparent (photo sits on the
   page). A dark surface fill made a 2-tone band around the photo; mirror light — stay
   transparent so the container blends with the page. */
html[data-theme="dark"] .vm-product-media-container {
  background-color: transparent;
  border-color: var(--dm-border);
}
/* Pagination — page links keep transparent bg in light; lift border + text. */
html[data-theme="dark"] .pagination .page-link {
  background-color: transparent;
  border-color: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .pagination .page-item.disabled .page-link { color: var(--dm-text-muted); }
/* Cart dropdown caret (::after border-top:#000) → light. */
html[data-theme="dark"] .dropdownCart-btn::after { border-top-color: var(--dm-text); }
/* Header cart icon: the template ships a fixed DARK bag PNG (background-image) that
   ignores the header colour — invisible on dark/navy headers and inconsistent with
   the theme toggle. Re-render it as a MASK filled with currentColor, so the bag
   ALWAYS takes the header text colour — identical treatment to the toggle, in every
   header layout and both light & dark (gotcha §17). This block is unscoped (applies
   in both modes); the dark text colour is set just below. */
#head-cart-dropdown {
  color: inherit;                          /* <button> UA breaks inheritance — restore it */
  background-image: none !important;
  background-color: currentColor !important;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* In dark the header text colour follows --dm-text → the masked bag does too. */
html[data-theme="dark"] #head-cart-dropdown { color: var(--dm-text) !important; }
/* VirtueMart mini-cart dropdown panel (white #fff when opened from the header). */
html[data-theme="dark"] .head-cart .dropdown-menu {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
}
html[data-theme="dark"] .head-cart .dropdown-menu,
html[data-theme="dark"] .head-cart .dropdown-menu a,
html[data-theme="dark"] .head-cart .dropdown-menu .vmCartModule,
html[data-theme="dark"] .head-cart .dropdown-menu .vmCartModule * { color: var(--dm-text); }
/* Footnav column links (plain <a> at literal #616161 — 2.9:1 on dark). Brand
   .text-primary links keep their gold via their own !important. */
html[data-theme="dark"] .t4-footnav a { color: var(--dm-text); }
html[data-theme="dark"] .t4-footnav a:hover,
html[data-theme="dark"] .t4-footnav a:focus { color: var(--dm-accent); }
/* Active/current footnav link has its own bold #343a40 → lift (emphasis kept). */
html[data-theme="dark"] .t4-footnav .active > a,
html[data-theme="dark"] .t4-footnav .current > a { color: var(--dm-heading); }

/* ---------------------------------------------------------------------------
   7b) VirtueMart — product cards, fields, tabs, reviews, Chosen selects
       (deep .ja-megafilter chains / literal labels). Colour swatches that show
       an actual colour (white/black options) are LEFT by design.
   --------------------------------------------------------------------------- */
/* Product CARDS (grid/listing) = surfaces. NOT .product-field-display /
   .product-fields-title — those are the SIZE/MATERIALS/STYLE option rows and the
   related-products meta, which are TRANSPARENT in light (flush on the page); a
   surface there creates an unwanted 2-tone band. */
html[data-theme="dark"] .manuModal {
  background-color: var(--dm-surface) !important;
  border-color: var(--dm-border);
}
/* Listing & VM product cards: .product-item-info is #fff on the #fff page in light, so
   it blends INVISIBLY. A dark surface fill makes the 2-tone card the user reported —
   the photo area sits on page-bg (#14171c) while the info block is a lighter surface.
   Mirror light: stay transparent so the whole card is one flush colour. */
html[data-theme="dark"] .product-item-info,
html[data-theme="dark"] .ja-megafilter-wrap .ja-products-wrapper .product-item .product-item-info {
  background-color: transparent !important;
  border-color: var(--dm-border);
}
/* Option rows / field-meta: keep transparent to mirror light. */
html[data-theme="dark"] .product-field-display,
html[data-theme="dark"] .product-fields-title { background-color: transparent !important; }
/* Manufacturer chip hover reverts to light grey #f0f0f0 (no dark hover override). */
html[data-theme="dark"] .manuModal:hover,
html[data-theme="dark"] .productdetails-view .manufacturer .manuModal:hover { background-color: var(--dm-surface-2) !important; }
/* ---------------------------------------------------------------------------
   Add-to-cart fancybox modal (VM "added to cart" notice). Fancybox ships a white
   #fancybox-outer/#fancybox-content surface with a dark PNG close-× — unstyled on
   dark. Theme the surface, lift the headings, and swap the × for a light SVG. The
   related-product titles/prices already inherit the VM dark rules. */
html[data-theme="dark"] #fancybox-outer,
html[data-theme="dark"] #fancybox-content {
  background-color: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
/* Headings: "1 x … added" + "Related Products" (the latter a literal #212121 via a
   two-ID chain #fancybox-wrap #fancybox-outer .product-related-products h4 → match it). */
html[data-theme="dark"] #fancybox-content h4,
html[data-theme="dark"] #fancybox-wrap #fancybox-outer .product-related-products h4 { color: var(--dm-heading); }
/* CTA buttons keep their near-black fill + white text (like light); add an edge so the
   button shape reads against the dark surface. */
html[data-theme="dark"] #fancybox-content .vm-btn { border-color: var(--dm-field-border) !important; }
/* Close × is a dark PNG sprite → invisible on dark; replace with a light SVG glyph. */
html[data-theme="dark"] #fancybox-close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' stroke='%23c2c9d6' stroke-width='1.6' stroke-linecap='round'%3E%3Cline x1='4' y1='4' x2='12' y2='12'/%3E%3Cline x1='12' y1='4' x2='4' y2='12'/%3E%3C/svg%3E") !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
/* VM field labels / tabs / review author + body text (literal #212121/#343a40). */
html[data-theme="dark"] .product-fields-title,
html[data-theme="dark"] .product-field-display,
html[data-theme="dark"] .product-fields strong,
html[data-theme="dark"] .productdetails-view .nav-tabs a,
html[data-theme="dark"] .productdetails-view .nav-tabs .nav-link,
html[data-theme="dark"] .vm-product-rating-container,
html[data-theme="dark"] blockquote { color: var(--dm-text); }
/* Chosen.js dropdown (VM selects). */
html[data-theme="dark"] .chzn-drop,
html[data-theme="dark"] .chzn-results,
html[data-theme="dark"] .chzn-single,
html[data-theme="dark"] .chosen-drop,
html[data-theme="dark"] .chosen-container .chosen-single {
  background-color: var(--dm-surface-2);
  background-image: none !important;   /* kill the white→grey gradient layer */
  color: var(--dm-text);
  border-color: var(--dm-field-border);
}
/* VM short product description (literal #343a40) + per-page native select
   (class .inputbox, not .form-control — missed by the forms block). */
html[data-theme="dark"] .product_s_desc { color: var(--dm-text); }
html[data-theme="dark"] select.inputbox,
html[data-theme="dark"] select#limit,
html[data-theme="dark"] .orderby-displaynumber select {
  background-color: var(--dm-surface-2) !important;
  color: var(--dm-text) !important;
  border-color: var(--dm-field-border);
}
html[data-theme="dark"] .chzn-results li,
html[data-theme="dark"] .chosen-results li { color: var(--dm-text); }
/* VM reviews area: "Customer Reviews" title is a <div.review-title> (literal
   #212121), stock note .product-box (#616161), review meta .info-author/.time. */
html[data-theme="dark"] .review-title,
html[data-theme="dark"] .review-title span { color: var(--dm-heading); }
/* The centered section headings (Customer Reviews / Related Products) wrap their
   text in a span with a WHITE bg to "cut" a divider line behind it — a white box
   on dark. Repaint the cut to the page colour so it masks the line invisibly. */
html[data-theme="dark"] .review-title span,
html[data-theme="dark"] .product-fields-title-wrapper span,
html[data-theme="dark"] .productdetails-view .title span { background-color: var(--dm-bg) !important; }
html[data-theme="dark"] .product-box,
html[data-theme="dark"] .productdetails-view .product-box,
html[data-theme="dark"] .product-box * { color: var(--dm-text) !important; }
html[data-theme="dark"] .info-author,
html[data-theme="dark"] .customer-reviews .info-author,
html[data-theme="dark"] .list-reviews .info-author,
html[data-theme="dark"] .customer-reviews .time,
html[data-theme="dark"] .list-reviews .time { color: var(--dm-text-muted) !important; }
/* Quantity input (#212121 text via a deep .productdetails-view chain → invisible). */
html[data-theme="dark"] input.quantity-input,
html[data-theme="dark"] .quantity-controls input {
  color: var(--dm-text) !important;
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-field-border) !important;
}
/* Cart page (#cart-view): product-name links + the row action icons (qty +/-, remove,
   reload) + payment-brand icons are all literal #212121 → near-invisible on dark. The
   title link carries an ID-level selector, so override with !important. */
html[data-theme="dark"] #cart-view table.cart-summary td.vm-cart-item-name a { color: var(--dm-heading) !important; }
html[data-theme="dark"] #cart-view .vmicon,
html[data-theme="dark"] #cart-view .vmicon::before,
html[data-theme="dark"] #cart-view .fab,
html[data-theme="dark"] #cart-view .divider::before { color: var(--dm-text) !important; }
/* The +/- quantity buttons are <input> with DARK +/- glyph PNGs as background-image
   → faint on the dark surface. Swap for light inline-SVG +/- glyphs (gotcha §17). */
html[data-theme="dark"] input.quantity-plus,
html[data-theme="dark"] .quantity-plus {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c2c9d6' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
}
html[data-theme="dark"] input.quantity-minus,
html[data-theme="dark"] .quantity-minus {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c2c9d6' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
}
/* ADD TO CART button is a near-black fill (#212121) with white text. In light it has
   NO border, and on the listing it appears as a band OVER the product photo (reads
   fine). Mirror light — do NOT add a border (the earlier field-border frame looked
   like ugly black lines around the hovered card). */
html[data-theme="dark"] input.addtocart-button,
html[data-theme="dark"] .addtocart-button input,
html[data-theme="dark"] .addtocart-area .addtocart-button {
  border: 0 !important;
}
/* Product tab separator (.nav-tabs border-bottom rgba(52,58,64,.12) — invisible). */
html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .productdetails-tabs .nav-tabs { border-bottom-color: var(--dm-border); }

/* VM product titles / category names / manufacturer links (literal #212121). */
html[data-theme="dark"] .vmproduct-title,
html[data-theme="dark"] .vmproduct-title a,
html[data-theme="dark"] .vm-categories-wall-catname,
html[data-theme="dark"] .manuModal,
html[data-theme="dark"] .productdetails-view .nav-tabs a,
html[data-theme="dark"] .product-tabs a,
html[data-theme="dark"] .additional-info a,
html[data-theme="dark"] blockquote,
html[data-theme="dark"] .vm-review-author,
html[data-theme="dark"] .vm-review b { color: var(--dm-text); }
/* VM prices (literal #212121) → prominent heading colour. KEEP brand-coloured
   sale prices where the template uses an accent (those stay by design). */
html[data-theme="dark"] .PricesalesPrice,
html[data-theme="dark"] .PricebasePrice,
html[data-theme="dark"] .product-price { color: var(--dm-heading); }

/* ---------------------------------------------------------------------------
   7c) Module text + utility buttons + ACM bands
   --------------------------------------------------------------------------- */
/* Article / category module titles + uppercase text links (literal #212121). */
html[data-theme="dark"] .mod-articles-category-title,
html[data-theme="dark"] .mod-articles-category-title a,
html[data-theme="dark"] .link-uppercase:not(.btn-white):not([class*="bg-"]),
html[data-theme="dark"] .latestnews-items .title a { color: var(--dm-text); }
html[data-theme="dark"] .link-uppercase:not(.btn-white):hover { color: var(--dm-accent); }
/* …but slide/banner uppercase links sit OVER a photo (white in light) — the repaint
   above wrongly lightens them to body text. Keep them white in dark, like light.
   5-class chain to outrank the :not():not() repaint (spec 0,4,1). */
html[data-theme="dark"] .slider-content .slider-content-inner .slide-action .link-uppercase,
html[data-theme="dark"] .slider-content .slider-content-inner .slide-action .link-uppercase:hover {
  color: #fff;
}
/* …same for ACM "features" cards (style-1/style-2): the .features-item sits OVER a photo
   (background-image) with white uppercase links in light (.link-uppercase{color:#fff} +
   .features-item .item-inner .link-uppercase:hover{color:#fff}). The §7c repaint wrongly
   lightens them to body text/accent. Keep white in dark, like light. Exclude .btn-white
   (danger-on-white pill keeps its own treatment). Spec (0,5,1)/(0,6,1) beats the repaint. */
html[data-theme="dark"] .features-item .item-inner .link-uppercase:not(.btn-white),
html[data-theme="dark"] .features-item .item-inner .link-uppercase:not(.btn-white):hover {
  color: #fff;
}
/* Outline-dark button (border+color #212529 → invisible on dark) → light. */
html[data-theme="dark"] .btn.btn-outline-dark,
html[data-theme="dark"] .btn-outline-dark {
  border-color: var(--dm-field-border) !important;
  color: var(--dm-heading) !important;
}
html[data-theme="dark"] .btn.btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:hover {
  background-color: var(--dm-surface-2) !important;
  color: var(--dm-heading) !important;
}
/* ACM slideshow / decorative light bands (#f8f4ef warm, #f2f3f7 cool). */
html[data-theme="dark"] .acm-slideshow.style-2,
html[data-theme="dark"] .acm-slideshow { background-color: var(--dm-band); }

/* Force-lift: these hardcode #212121/#343a40 via deep VM/module chains that beat
   the earlier rules. Titles/prices → heading; review/quote body → text. */
html[data-theme="dark"] a.vmproduct-title,
html[data-theme="dark"] .vmproduct-title,
html[data-theme="dark"] .vm-categories-wall-catname,
html[data-theme="dark"] .manuModal,
html[data-theme="dark"] .productdetails-tabs .nav-tabs a,
html[data-theme="dark"] .productdetails-tabs .nav-tabs li a,
html[data-theme="dark"] .mod-articles-category-title,
html[data-theme="dark"] .mod-articles-category-title a,
html[data-theme="dark"] .page-header h1 a,
html[data-theme="dark"] .page-header h2 a,
html[data-theme="dark"] .item-title a { color: var(--dm-heading) !important; }
html[data-theme="dark"] .product-price .PricesalesPrice,
html[data-theme="dark"] .PricesalesPrice,
html[data-theme="dark"] .PricebasePrice { color: var(--dm-heading) !important; }
html[data-theme="dark"] blockquote,
html[data-theme="dark"] blockquote b,
html[data-theme="dark"] .vm-review b,
html[data-theme="dark"] .product-review b { color: var(--dm-text) !important; }
/* Tabbed module article links + related-product titles (deep chains, #212121). */
html[data-theme="dark"] .items-more .nav a,
html[data-theme="dark"] .nav-stacked a,
html[data-theme="dark"] .product-neighbours a,
html[data-theme="dark"] .product-neighbours .vmproduct-title { color: var(--dm-text) !important; }
/* Review author names. */
html[data-theme="dark"] [class*="review"] b,
html[data-theme="dark"] [class*="review"] .author { color: var(--dm-text) !important; }
/* Login/account helper links (forgot / remind / reset / register). Scope to
   .t4-main-body (the content zone) — NOT .t4-content (the page wrapper, which
   ALSO contains the footnav → would gold-out the "Registration" footer link). */
html[data-theme="dark"] .t4-main-body a[href*="forgot"],
html[data-theme="dark"] .t4-main-body a[href*="remind"],
html[data-theme="dark"] .t4-main-body a[href*="reset"],
html[data-theme="dark"] .t4-main-body a[href*="registration"],
html[data-theme="dark"] .login a,
html[data-theme="dark"] .login-message a,
html[data-theme="dark"] .mod-login a { color: var(--dm-accent) !important; }

/* Input-group addon icons (login user/lock — #e9ecef). */
html[data-theme="dark"] .input-group-text {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
  border-color: var(--dm-field-border);
}
/* Megafilter filter UI: headings, labels, per-page, product links. */
html[data-theme="dark"] .ja-megafilter-wrap .block-subtitle,
html[data-theme="dark"] .filter-subtitle,
html[data-theme="dark"] .ja-megafilter-wrap label,
html[data-theme="dark"] .ja-megafilter-wrap .filter-options-title,
html[data-theme="dark"] .limiter-text { color: var(--dm-text) !important; }
html[data-theme="dark"] .product-item-link,
html[data-theme="dark"] .product-neighbours a,
html[data-theme="dark"] .product-neighbour a { color: var(--dm-heading) !important; }
/* Megafilter filter accordion title text (span child, literal #212121). */
html[data-theme="dark"] .filter-options-title,
html[data-theme="dark"] .filter-options-title span,
html[data-theme="dark"] .filter-field .filter-options-title { color: var(--dm-text) !important; }
/* Megafilter filter ITEM labels (radio options + size-box numbers, literal #212121
   — invisible on dark). Colour chips carry an inline bg, unaffected by text colour. */
html[data-theme="dark"] .filter-items .item label,
html[data-theme="dark"] .filter-items .item .color-item-bg,
html[data-theme="dark"] .filter-field .item label { color: var(--dm-text) !important; }
/* Size-swatch box outline (was the inherited #212121 — invisible on dark). */
html[data-theme="dark"] .filter-field.filter-size .item .color-item-bg { border-color: var(--dm-field-border); }
/* ACTIVE size/option: light turns the selected option gold (var(--color-primary)).
   The number sits in span.color-item-bg, which the !important reset above forces to
   --dm-text — so colouring only the <label> leaves the visible digit grey. Gold BOTH
   the label and the inner .color-item-bg so the selected size actually reads, like light. */
html[data-theme="dark"] .filter-items .jamg-active label,
html[data-theme="dark"] .filter-items .item.jamg-active label,
html[data-theme="dark"] .filter-items .item.jamg-active .color-item-bg,
html[data-theme="dark"] .filter-field .jamg-active label,
html[data-theme="dark"] .filter-field .item.jamg-active .color-item-bg { color: var(--color-primary) !important; }
/* Grid/list view switcher: the spans carry a hard background:#fff (both modes) that is
   invisible on light's white toolbar but shows as a white block on dark. Make it
   transparent and lift the glyph: active = heading (light #212121), idle = muted
   (light #9e9e9e). */
html[data-theme="dark"] .jamg-layout-chooser span { background-color: transparent; }
html[data-theme="dark"] .jamg-layout-chooser span,
html[data-theme="dark"] .jamg-layout-chooser span i { color: var(--dm-text-muted); }
html[data-theme="dark"] .jamg-layout-chooser span.active,
html[data-theme="dark"] .jamg-layout-chooser span.active i { color: var(--dm-heading); }
/* Megafilter pagination uses `li a` (not .page-link) — inactive links/arrows
   #343a40 via a deep megafilter chain → force. */
html[data-theme="dark"] .pagination li a,
html[data-theme="dark"] .ja-megafilter-wrap .pagination li a,
html[data-theme="dark"] .pagination li a span,
html[data-theme="dark"] .pagination li a::before { color: var(--dm-text) !important; }
html[data-theme="dark"] .pagination li a:hover,
html[data-theme="dark"] .pagination li a:focus { color: var(--dm-heading) !important; }
/* ACTIVE page: light is a prominent near-black pill (#212121 fill, white text) on the
   white page. On dark, #212121 sits on the #14171c page → near-invisible, and the rule
   above drops its text to body grey → the active page no longer reads. Mirror light's
   prominence with a gold accent pill + dark text (matches the other dark active states). */
html[data-theme="dark"] .ja-megafilter-wrap .products-toolbar .pagination li.active > a,
html[data-theme="dark"] .ja-megafilter-wrap .products-toolbar .pagination li.active > a > span,
html[data-theme="dark"] .pagination li.active > a,
/* current page is a <span> (not <a>) on the blog/category pagination → the rule above
   misses it, leaving the literal #212121 pill (near-invisible on dark). */
html[data-theme="dark"] .pagination .page-item.active > span,
html[data-theme="dark"] .pagination li.active > span {
  background-color: var(--dm-accent) !important;
  color: var(--dm-bg) !important;
  border-color: var(--dm-accent) !important;
}
/* Light also paints hover + disabled items the SAME #212121 pill. On dark: give hover a
   visible surface pill, and de-emphasise disabled (transparent + muted) instead of a dark
   blob that barely reads. */
html[data-theme="dark"] .pagination .page-item:not(.active):not(.disabled):hover > a,
html[data-theme="dark"] .pagination .page-item:not(.active):not(.disabled):hover > span {
  background-color: var(--dm-surface-2) !important;
  color: var(--dm-heading) !important;
}
html[data-theme="dark"] .pagination .page-item.disabled > a,
html[data-theme="dark"] .pagination .page-item.disabled > span {
  background-color: transparent !important;
  color: var(--dm-text-muted) !important;
  border-color: var(--dm-border) !important;
}
/* VM pagination links + sort-order dropdown + Bootstrap list-group items. */
html[data-theme="dark"] .pagenav,
html[data-theme="dark"] a.pagenav { color: var(--dm-text) !important; }
html[data-theme="dark"] .activeOrder,
html[data-theme="dark"] .orderlist,
html[data-theme="dark"] .vm-order-list { background-color: var(--dm-surface-2) !important; color: var(--dm-text); }
html[data-theme="dark"] .vm-order-list a,
html[data-theme="dark"] .orderlistcontainer a,
html[data-theme="dark"] .activeOrder a { color: var(--dm-text) !important; }
html[data-theme="dark"] .vm-order-list a:hover,
html[data-theme="dark"] .orderlistcontainer a:hover { color: var(--dm-heading) !important; }
html[data-theme="dark"] .list-group-item {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .list-group-item-action:focus { background-color: var(--dm-surface-2); color: var(--dm-heading); }
/* com_tags listing: item-link hover is hardcoded blue #0056b3 (2.55:1 on dark) →
   brand accent; row divider rule (.tag-category … .list-group-item, 3-class) wins
   over the generic .list-group-item border — match its specificity. */
html[data-theme="dark"] .com-tags-tag.tag-category .list-group .list-group-item a:hover,
html[data-theme="dark"] .com-tags-tag.tag-category .list-group .list-group-item a:focus,
html[data-theme="dark"] .com-tags-tag.tag-category .list-group .list-group-item a:active { color: var(--dm-accent); }
/* Tag-list rows: light is #fff on a #fff page → invisible boxes, just a faint divider +
   text. The generic .list-group-item surface (above) instead makes each row a visible box
   light never has. Mirror light → transparent rest (the divider carries the separation;
   hover still lifts to --dm-surface-2, like light's #f5f5f5). Scoped (0,5,1) beats it. */
html[data-theme="dark"] .com-tags-tag.tag-category .list-group .list-group-item {
  background-color: transparent;
  border-bottom-color: var(--dm-border);
}
/* Secondary button (#6c757d grey) → dark-surface button on dark. */
html[data-theme="dark"] .btn.btn-secondary {
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-field-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .btn.btn-secondary:hover,
html[data-theme="dark"] .btn.btn-secondary:focus {
  background-color: var(--dm-surface) !important;
  color: var(--dm-heading) !important;
}
/* Default-home feature cards (#fff solid) → surface. */
html[data-theme="dark"] .section-features .features-item,
html[data-theme="dark"] .features-item { background-color: var(--dm-surface) !important; }
/* …but the ACM feature cards (.acm-features, e.g. Decor home) are TRANSPARENT in
   light (image + text stacked, blends on the page) — keep them transparent so they
   don't read as a mismatched dark box (gotcha §11). */
html[data-theme="dark"] .acm-features .features-item,
html[data-theme="dark"] .acm-features .features-item .item-inner { background-color: transparent !important; }
/* .lead / .sub-heading section copy carries a literal #616161 the var remap can't
   reach → lift to body text (mirrors light's mid-grey-on-white). */
html[data-theme="dark"] .lead,
html[data-theme="dark"] .sub-heading,
html[data-theme="dark"] .sub-heading.lead { color: var(--dm-text) !important; }
/* Megafilter filter sidebar titles/labels (accordion "Category"/"Shop By"). */
html[data-theme="dark"] .ja-megafilter-wrap .filter-options-title,
html[data-theme="dark"] .ja-megafilter-wrap .filter-options-title span,
html[data-theme="dark"] .ja-megafilter-wrap .filter-title,
html[data-theme="dark"] .ja-megafilter-wrap .block-title,
html[data-theme="dark"] .ja-megafilter-wrap .filter-content .title { color: var(--dm-text) !important; }

/* ---------------------------------------------------------------------------
   8) Custom form controls (checkbox/radio square, native select arrow)
   --------------------------------------------------------------------------- */
html[data-theme="dark"] .custom-control-label::before {
  background-color: var(--dm-surface-2);
  border-color: var(--dm-field-border);
}
/* Native select arrow SVG (fill #343a40 — invisible on dark) → light arrow. */
html[data-theme="dark"] .custom-select,
html[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c2c9d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
}

/* ---------------------------------------------------------------------------
   9) AcyMailing (footer newsletter)
   --------------------------------------------------------------------------- */
html[data-theme="dark"] .acym_module input[type="email"],
html[data-theme="dark"] .acym_form input[type="email"],
html[data-theme="dark"] .acymailing_module_form input {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
  border-color: var(--dm-field-border);
}
html[data-theme="dark"] .acym_module_form .modal-footer { background-color: var(--dm-surface-2); }
/* AcyMailing submit "›" button (#212121 fill blends into the dark footer) → gold. */
html[data-theme="dark"] .acymailing_module input[type="button"],
html[data-theme="dark"] .acym_module input[type="button"],
html[data-theme="dark"] input.subbutt,
html[data-theme="dark"] .acysubbuttons input {
  background-color: var(--dm-accent) !important;
  border-color: var(--dm-accent) !important;
  color: #fff !important;
}

/* ---------------------------------------------------------------------------
   9b) Review-pass fixes — deep-chain literals the earlier rules didn't reach.
   --------------------------------------------------------------------------- */
/* Shopping cart H1 (.vm-cart-header h1 literal #212121, 4-class). */
html[data-theme="dark"] .com_virtuemart .vm-cart-header-container .vm-cart-header h1,
html[data-theme="dark"] .vm-cart-header h1 { color: var(--dm-heading); }
/* Cart summary table header row (#f5f5f5 bg + #e9e8e8 borders) + cells. */
html[data-theme="dark"] .cart-summary th,
html[data-theme="dark"] .cart-summary tr th,
html[data-theme="dark"] table.cart-summary tbody th,
html[data-theme="dark"] table.cart-summary tr th {
  background-color: var(--dm-surface-2) !important;
  background-image: none !important;
  border-color: var(--dm-border);
}
html[data-theme="dark"] .cart-summary th,
html[data-theme="dark"] .cart-summary th span,
html[data-theme="dark"] .cart-summary th .priceColor2 { color: var(--dm-heading) !important; }
/* Cart billing/shipping divider lines (rgba(0,0,0,.1) — invisible on dark). */
html[data-theme="dark"] .com_virtuemart #cart-view .billto-shipto,
html[data-theme="dark"] .billto-shipto {
  border-top-color: var(--dm-border);
  border-bottom-color: var(--dm-border);
}
html[data-theme="dark"] .billto-shipto .width50 { border-left-color: var(--dm-border); }
/* On-page login/register accordion panels (white #fff when expanded). */
html[data-theme="dark"] #ja-user-login,
html[data-theme="dark"] #ja-user-register { background-color: var(--dm-surface); }
html[data-theme="dark"] #ja-user-login label,
html[data-theme="dark"] #ja-user-register label { color: var(--dm-text); }
html[data-theme="dark"] .cart-summary td,
html[data-theme="dark"] table.cart-summary td { border-color: var(--dm-border); }
/* Related-product carousel image-links (.vm-product-media-container a #212121). */
html[data-theme="dark"] .vm-product-media-container a { color: var(--dm-heading); }
/* com_finder search "Search Terms:" label (literal #212121, 2-class). */
html[data-theme="dark"] .com-finder .form-inline label,
html[data-theme="dark"] .com-finder label { color: var(--dm-text); }
/* com_finder tips card outline (rgba(52,58,64,.12) — invisible on dark). */
html[data-theme="dark"] .com-finder__tips,
html[data-theme="dark"] .card-outline-secondary { border-color: var(--dm-border); }
/* T4 masthead palette section prose (#616161 ~2.9:1 on dark). Over-photo
   mastheads keep #fff via the more-specific .ja-masthead.image rules. */
html[data-theme="dark"] .t4-palette-masthead { color: var(--dm-text); }
/* Popular-tags pills (.mod-tagspopular — light #e9ecef pills). */
html[data-theme="dark"] .tagspopular li,
html[data-theme="dark"] .mod-tagspopular li,
html[data-theme="dark"] .tagspopular li a,
html[data-theme="dark"] .mod-tagspopular li a {
  background-color: var(--dm-surface-2);
  color: var(--dm-text);
}
html[data-theme="dark"] .tagspopular li a:hover,
html[data-theme="dark"] .tagspopular li a:focus,
html[data-theme="dark"] .mod-tagspopular li a:hover,
html[data-theme="dark"] .mod-tagspopular li a:focus {
  background-color: var(--dm-accent);
  color: #fff;
}

/* ---------------------------------------------------------------------------
   10) Hover states that revert to #212121 (palette/template :hover rules).
       In light these stay readably dark-on-white; mirror → keep light on dark.
   --------------------------------------------------------------------------- */
html[data-theme="dark"] .t4-megamenu .navbar-nav li li a:hover,
html[data-theme="dark"] .t4-megamenu .navbar-nav li li a:focus,
html[data-theme="dark"] .t4-megamenu .navbar-nav li li a:active,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > a:hover,
html[data-theme="dark"] .t4-megamenu .dropdown-menu li > a:focus,
html[data-theme="dark"] h2 a:hover, html[data-theme="dark"] h3 a:hover, html[data-theme="dark"] h4 a:hover,
html[data-theme="dark"] .page-header h2 a:hover,
html[data-theme="dark"] a.vmproduct-title:hover,
html[data-theme="dark"] .vmproduct-title:hover,
html[data-theme="dark"] .product-item-link:hover,
html[data-theme="dark"] .mod-articles-category-title a:hover {
  color: var(--dm-heading) !important;
}
/* Topbar account/contact links — hover darkens to #212121 in light → accent on dark. */
html[data-theme="dark"] .t4-topbar a:hover,
html[data-theme="dark"] .t4-topbar a:focus,
html[data-theme="dark"] .t4-palette-topbar a:hover,
html[data-theme="dark"] .t4-palette-topbar a:focus { color: var(--dm-accent) !important; }

/* ===========================================================================
   Theme toggle button (the ONE block visible in BOTH modes — not dark-scoped).
   Solid white header in light → transparent button, icon follows header colour.
   =========================================================================== */
.ja-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: background-color .2s ease, color .2s ease;
  vertical-align: middle;
}
/* ── Uniform theme-toggle ↔ cart-icon spacing (14px) + vertical centring across
   ALL header layouts. The toggle sits immediately before the cart on desktop in
   every layout; drive the gap from the cart's left margin so it's identical. ── */
.head-r, .mega-r { display: flex; align-items: center; }
.head-r .ja-theme-toggle, .mega-r .ja-theme-toggle,
.header-r .ja-theme-toggle { margin-right: 0; }
.head-r .head-cart, .mega-r .head-cart,
.header-r .head-cart { margin-left: 14px !important; }
/* Header-2 (Digital): .header-r is flex/space-between → margin-left:auto pulls the
   toggle (and the cart after it) into a tight group at the right. */
.header-block-2 .header-r { align-items: center; }
.header-block-2 .header-r .ja-theme-toggle { margin-left: auto; }
/* Header-3 (Decor): column has a float:right cart → flex-end groups toggle+cart. */
.header-block-3 .header-r { display: flex; align-items: center; justify-content: flex-end; }
.ja-theme-toggle:hover,
.ja-theme-toggle:focus {
  background: rgba(127, 140, 160, .14);
  color: inherit;
  outline: none;
}
/* Icon swap — show ONE icon at a time: moon in light (offer dark), sun in dark
   (offer light). Hide both by default, then reveal the right one. The reveal
   selectors carry the `.ja-theme-toggle` ancestor so they out-rank this rule. */
.ja-theme-toggle svg { display: none; }
.ja-theme-toggle .ja-theme-toggle__moon { display: block; }
html[data-theme="dark"] .ja-theme-toggle .ja-theme-toggle__moon { display: none; }
html[data-theme="dark"] .ja-theme-toggle .ja-theme-toggle__sun  { display: block; }
/* Icon stays visible in dark even when the header zone inherits a dark colour. */
html[data-theme="dark"] .ja-theme-toggle { color: var(--dm-text); }
html[data-theme="dark"] .ja-theme-toggle:hover,
html[data-theme="dark"] .ja-theme-toggle:focus { color: var(--dm-heading); }
