/* ==========================================================================
   custom.css — deliberately NOT one of the 5 files Dizains' "advanced
   editor" knows about (Theme::templates_info only registers index.html,
   home.html, product_info.html, main.css, head.html — all read/written by
   raw full-file overwrite). Anything here survives a Dizains CSS save that
   would otherwise clobber the same content living in main.css. Linked from
   frame.html right after main.css, so cascade order (not !important) gives
   it priority on equal-specificity collisions.
   ========================================================================== */

/* ==========================================================================
   PHASE 1 REDESIGN — TYPOGRAPHY
   Base font-size 12px -> 14px, line-height 1.5 (2026-08-12).

   font-family FINALIZED 2026-08-13: went through an A/B review (system font
   stack vs Arial/Helvetica, same size/line-height, see
   DESIGN_PHASE_CHANGES.md) — decision is Arial, Helvetica, sans-serif,
   replacing the system-stack hybrid tried initially. Reasoning: closer to
   the site's original typeface (plain Arial pre-redesign) and read as less
   "loud"/mismatched against the rest of the theme's chrome than the system
   font, per side-by-side comparison on the homepage and a product page.
   Overrides main.css's base rule (main.css:16-19 — same selector list,
   `p, body, font, div, td, input, select, textarea`) via cascade order
   (this file loads after main.css), no !important needed.

   Checked against the 3 risk areas found in recon before applying (these
   were about font-size/line-height, unaffected by the font-family decision
   above):
   - Left category sidebar (179px, main.css:62-63): long LV category names
     now wrap to 2 lines instead of 1 (e.g. "Foto un videokameru piederumi").
     Not broken - text still wraps normally with its bullet icon, just
     taller. Accepted as expected behavior of a larger base font, not
     something to preemptively work around.
   - .product_qty (35x25px, main.css:1251-1255): visually fine at 14px in
     every screenshot tested (digit not clipped) - a getBoundingClientRect()
     check gave inconsistent readings between two attempts (37px then 24px
     offsetHeight), most likely a reflow-timing artifact in the test
     environment rather than a real issue, but re-check this specific field
     on prod visually since the measurement wasn't clean.
   - Product spec tables: NOT a shared template - found live via a real
     product (id 86545, SONY NP-FZ100) that this is hand-authored HTML
     inside each product's `description` field, with hardcoded
     `<td width="170">`/`<td width="354">` columns. Tested this exact
     table at 14px: all labels (Sastāvs/Spriegums/Ietilpība (mAh)/
     Garantija) still fit on one line in the 170px column, rows just got
     taller from the added line-height. Since this lives in per-product
     content (not CSS/templates), a bad wrap on some OTHER product's
     hand-made table is possible and can't be ruled out globally - watch
     for it opportunistically, not something this stylesheet can fix.
   ========================================================================== */
p, body, font, div, td, input, select, textarea {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
}
body, p {
	line-height: 1.5;
}

/* Header bug, root cause (found via pixel-sampling the actual background
   image, not guessed): #container_top and #container_top_right are table
   cells (main.css:50-62, `.sci_topbg` table) whose shared row height is
   driven by whichever cell's content is tallest - table-cell height is a
   MINIMUM, not a cap, and grows past main.css's declared 155px as soon as
   the 6-item aux nav (#container_top_right: Par veikalu/Kā pasūtīt
   preci?/etc.) needs more room, which any future edit through the
   Dizains admin's aux-pages constructor can trigger again (more items,
   longer names) - a font-size tweak only patches today's exact wording,
   it isn't resilient to that.

   The actual visual break: `sci_hat_bg.gif` (the header's background
   image, `.sci_topbg { background:#496BAB url(sci_hat_bg.gif) left top
   repeat-x; }`) is a fixed 247x155px tile - `repeat-x` only tiles it
   horizontally, so it does not cover any row height beyond 155px at all.
   Sampled the image's own pixels directly: its bottom edge (y=153-154)
   is solid WHITE (`rgb(255,255,255)`), sitting right above whatever's
   underneath once a row exceeds 155px. That produced a hard
   light-blue -> white -> dark-blue stack exactly where wrapped menu text
   landed, reading as "text overlapping the bar" - a fixed-height image
   asset colliding with a row that can grow, not a text-sizing problem.

   Resilient fix: give both cells the same solid `#496BAB` (main.css's
   own `.sci_topbg` fallback color, not a new value) as an explicit
   background-color, so whatever area the image doesn't cover - at ANY
   row height, for ANY future number/length of aux-page items - is
   already the correct continuous blue instead of a mismatched/absent
   fallback. Verified in-browser: reverted the aux nav back to the
   standard 14px (no longer needs its own smaller size, the seam it was
   hiding from is gone) and the header renders seamlessly however tall
   the row gets. */
#container_top,
#container_top_right {
	background-color: #496BAB;
}

/* Follow-up to the fix above, found 2026-08-13 after Phase 3 widened
   #container_top_right (170px -> 190px) made a pre-existing gap far more
   visible: the flat #496BAB fallback color is OPAQUE, so it was already
   fully hiding .sci_topbg's tiled sci_hat_bg.gif pattern everywhere
   within these two cells, not just below 155px height as the comment
   above assumed - repeat-x on the table never had a chance to show
   through a cell that paints its own solid background on top of it.
   #container_top's own background-image (sci_logo.jpg, 580x148px,
   no-repeat) only covers the left 580px of a ~1200px-wide cell, so
   everything past it, plus all of #container_top_right, was rendering
   as a hard-edged solid-color block butting up against the actual
   patterned image wherever a sliver of it WAS still visible (past the
   table's own cells) - read as a rendering bug, not a design choice.

   Fix: replace the flat color with a CSS gradient built from pixels
   sampled directly from sci_hat_bg.gif itself (canvas getImageData at
   x=10 and x=120, both columns identical - it's a vertical-only
   gradient) - rgb(157,181,206) at y=0, dipping to rgb(140,170,206)
   around y=60, rising to rgb(156,187,230) by y=120, then held flat
   (deliberately NOT continuing to the image's own y=154 row, which
   samples pure white - that white edge is exactly what the background-
   color fallback above was originally added to avoid). A gradient has
   no "phase" to misalign the way a repeated tile would across two
   independently-sized adjacent cells, so it reads as one continuous
   surface without needing pixel-perfect alignment between the two cells
   or with the table's own tiling. For #container_top, layered as a
   second background BEHIND sci_logo.jpg (comma-separated
   background-image/position/repeat) so the photo collage is unaffected -
   see the note in the task about not touching that visual yet.

   Guarded to desktop only: mobile's own #container_top rule
   (main.css, @media max-width:800px) sets a completely different
   background shorthand (mobile/logo.png) - an unguarded background-image
   here would load after it in the cascade and silently replace the
   mobile logo. The background-color rule above stays unguarded since it
   only adds a fallback color behind whatever mobile already renders,
   never touching background-image.

   SUPERSEDED by Phase 4 (2026-08-14): this block used to layer
   sci_logo.jpg behind the sampled gradient. Phase 4 removed the raster
   collage entirely (replaced by the inline SVG device cluster in the
   umlp7cha content) and overrides #container_top/#container_top_right's
   background-image back to `none` further down in this file (see the
   "PHASE 4 — HEADER REDESIGN" section) - the actual gradient/jpg rule
   that used to live here is gone, not just overridden, since keeping a
   dead reference to a decommissioned asset was flagged as confusing
   (found while investigating a reported stray-photo-artifact sighting;
   this rule was already fully overridden and not the cause, but had no
   reason to keep existing either). */

/* Left category sidebar (main.css:64-65, was 179px) widened to fit the
   real category names at 14px on one line. Measured empirically in-
   browser (canvas text measurement + forced-nowrap scrollWidth on the
   live tree, not guessed): every category name in the current tree fits
   at 290px except one outlier - "Dekoderi , antenas ciparu televīzijai
   (DVB-T) un citi TV piederumi" (66 chars, root-level) - which still
   wraps to 2 lines at any width short of ~430px; not worth widening the
   whole sidebar that far for one name, accepted as an edge case.
   Verified overall page layout after widening (+111px): main content
   grid and right sidebar unaffected, nothing overlaps (that check was
   desktop-only at the time - Phase 1 predates the header redesign and
   the mobile category-tree toggle interaction wasn't part of what was
   tested then).

   @media(min-width:801px) guard added later (same day as the .all_wrapper
   mobile-width fix, found via a real-device report + explicit
   getBoundingClientRect() measurement, not visual inspection): this rule
   was completely unguarded, so its 290px silently beat main.css's own
   correct mobile rule (#container_left_sidebar{width:100%}, inside
   main.css's own @media max-width:800px) - same specificity (ID-only on
   both sides), and this file loads after main.css, so custom.css's
   unguarded 290px won the cascade tie on every viewport, not just
   desktop. Confirmed live: #container_left_sidebar measured
   width:290px on a 390px mobile viewport (after clicking .toggle to
   reveal the tree, since it's display:none by default there), causing
   document.documentElement.scrollWidth (402px) to exceed
   window.innerWidth (390px) - genuine horizontal overflow, matching the
   reported "categories cut off on the side." Guarding this to desktop
   only lets main.css's width:100% apply unopposed on mobile again, as
   it always should have. */
@media (min-width: 801px) {
#container_left_sidebar {
	width: 290px;
}
}

/* REGRESSION FIX for f43564fd (2026-09-22, same day): main.css's own
   #container_right_sidebar{width:170px} was never actually enough room for
   its own content - confirmed by checking for real overflow after the
   table->flex conversion (`el.scrollWidth > el.clientWidth` swept across
   every descendant of #container_right_sidebar at 1280px): one
   `.cpt_custom_html` card measured scrollWidth 222px against a clientWidth
   of only 168px, a 54px shortfall. Under the old <table>, table-layout:auto
   silently widened this column to its content's real min-content width
   (measured live, pre-fix table markup: 224px, unconditionally, not
   viewport-dependent) - not a deliberate design width, but a real
   requirement the raw CSS number never captured. The flex conversion
   removed that accidental accommodation (main-content's flex-basis:0 fix
   above stops main-content from ever pressuring the sidebars to shrink,
   so nothing forces right-sidebar wider than its literal 170px either),
   so the card's content started clipping/overflowing silently instead of
   the column growing to fit it. width:224px restores the same effective
   column width the design has always actually rendered at (matches what's
   currently live on prod), eliminating the content overflow - same
   @media(min-width:801px) guard as the left sidebar above, since main.css's
   own mobile block already gives this element a completely different
   width/position(absolute) treatment under 800px. */
@media (min-width: 801px) {
#container_right_sidebar {
	width: 224px;
}
}

/* ==========================================================================
   LEFT SIDEBAR — CARD REDESIGN, matching the right sidebar's look below
   for visual consistency (same header-bar/card pattern, same colors).

   Root cause of the "torn header" bug: `.col_header`'s background image
   (`sci_katalog_prod_1.gif`, 179x28px, `no-repeat`, main.css:330) was
   sized to exactly the OLD 179px sidebar width. Once the sidebar was
   widened to 290px above, the image only paints the left 179px of the
   header bar - the remaining ~111px has no background at all, reading as
   a "torn"/incomplete bar. Same underlying failure mode as the top-header
   bug above: a fixed-size image asset that can't grow with its container.

   Root cause of "categories escaping the block": there was no card
   background/border around the list at all (main.css:250/254 - the old
   `sci_katalog_bg_down.gif` card-simulation rules are already commented
   out in main.css, so currently nothing replaced them) - text just sits
   directly on the page background, unlike the right sidebar's bordered
   white cards, hence the visual mismatch the review flagged.

   Wrapped in the same `@media (min-width:801px)` guard as the right
   sidebar below, for the same reason: main.css's mobile section sets
   `.cpt_category_tree{display:none}` and `#container_left_sidebar{width:
   100%; background:none; padding:0}` (main.css:895-904) - unguarded, this
   card CSS's own background/padding/margin would load after and fight
   those mobile rules. Guarding means this only ever applies above 800px,
   same scope as everything else already added here. */

/* ==========================================================================
   RIGHT SIDEBAR — CARD REDESIGN (sci theme; index.html renders this on
   every page, so these rules apply site-wide).
   Scoped under #container_right_sidebar so the LEFT sidebar's .col_header
   ("KATALOGS") and the top nav's .cpt_custom_html usage stay untouched.

   Moved here from main.css (2026-08-12, pure relocation, no rule changes)
   as part of closing the Dizains-overwrite risk before Phase 1 typography
   work. Original comment in main.css noted this block had to sit ABOVE the
   `@media (max-width:800px)` block there so the mobile overrides for
   `.shcart_link`/`.cpt_shopping_cart_info` backgrounds still won on small
   screens - that source-order trick doesn't survive moving to a file
   loaded entirely after main.css, so it's now made explicit instead via
   `@media (min-width:801px)`, which achieves the same outcome (desktop-only)
   without depending on file position at all. Verified this doesn't change
   which properties apply on mobile for `.shcart_link`/`.cpt_shopping_cart_info`
   (those were always going to lose to the more specific mobile rules in
   main.css); the only behavior change from the guard is that the *other*,
   non-colliding desktop-card properties (padding/margin/border-radius etc.)
   now also correctly stop applying under 800px, instead of leaking into the
   80px-wide mobile cart icon as they did before - narrower scoping, matches
   what the design was actually for. Could not verify visually at a real
   narrow viewport locally (browser automation's resize_window isn't taking
   effect in this environment - window.innerWidth stayed fixed regardless).
   Check both desktop AND a resized/mobile-width view on prod after deploy.
   ========================================================================== */
@media (min-width: 801px) {

#container_left_sidebar .col_header {
	display: block;
	background: #496BAB;
	color: #ffffff;
	line-height: 1.3;
	padding: 7px 10px;
	margin: -9px -11px 8px -11px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	font-size: 11px;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
	border-radius: 5px 5px 0 0;
	box-sizing: border-box;
}

#container_left_sidebar .cpt_category_tree,
#container_left_sidebar .cpt_product_search {
	background: #ffffff;
	border: 1px solid #C7C7C7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	margin-bottom: 8px;
	padding: 9px 11px;
	box-sizing: border-box;
	overflow: hidden;
}

/* Same reasoning as .sci_box_right_b below - this empty divider div is
   redundant now that margin-bottom on the card itself provides spacing. */
#container_left_sidebar .sci_box_left_b {
	display: none;
}

/* ROOT CAUSE of the left sidebar looking like a flat blue bar instead of a
   card (found by measuring live, not guessed): MEKLĒŠANA/KATALOGS/PARTNERI
   are each their own separate `cpt_custom_html` block containing just a
   `.col_header` label div - same structure as the right sidebar's MANS
   GROZS/KONTAKTI ON-LINE/etc labels. But unlike the right sidebar, there
   was no card rule for `#container_left_sidebar .cpt_custom_html` itself,
   so `.col_header`'s `margin: -9px -11px 8px -11px` (designed to bleed
   flush to a padded card's edges) had no padding to land in. Measured in
   DevTools: the first header's box top sat 9px ABOVE the sidebar's own top
   edge (bounding-rect gap of -9px, vs 0px on the right sidebar's first
   card) - it was overlapping the blue site header above by exactly its
   negative margin, both the same blue color, so the overlap read as "no
   gap" and the rounded top corners were invisible against the identical
   backdrop they were sitting on top of. Adding the same card treatment
   the right sidebar already has for `.cpt_custom_html` gives the negative
   margin something to bleed into instead of escaping the container -
   verified this brings the gap to exactly 0px, matching the right
   sidebar's measured value. */
#container_left_sidebar .cpt_custom_html {
	background: #ffffff;
	border: 1px solid #C7C7C7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	margin-bottom: 8px;
	padding: 9px 11px;
	box-sizing: border-box;
	overflow: hidden;
}
#container_left_sidebar .cpt_custom_html:empty,
#container_left_sidebar .cpt_custom_html:has(> .sci_box_left_b:only-child) {
	display: none;
}

/* Root-cause fix for header bars overflowing their 170px column: a
   full-width color bar that wraps normally, instead of the old fixed
   170x28px no-repeat background image, which a long unbreakable label
   (e.g. "Kontaktinformācija") could force wider than the 170px column. */
#container_right_sidebar .col_header,
#container_right_sidebar .cpt_shopping_cart_info .shcart_link {
	display: block;
	background: #496BAB;
	color: #ffffff;
	line-height: 1.3;
	padding: 7px 10px;
	margin: -9px -11px 8px -11px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	font-size: 11px;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
	border-radius: 5px 5px 0 0;
	box-sizing: border-box;
}
#container_right_sidebar .cpt_shopping_cart_info .shcart_link:hover {
	text-decoration: underline;
}

/* Card look for every sidebar widget block (cart + each custom-html
   block). The header rule above bleeds out to the card edges via negative
   margin so it sits flush with the card's rounded top corners. */
#container_right_sidebar .cpt_custom_html,
#container_right_sidebar .cpt_shopping_cart_info {
	background: #ffffff;
	border: 1px solid #C7C7C7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	margin-bottom: 8px;
	padding: 9px 11px;
	box-sizing: border-box;
	overflow: hidden;
}

/* The old divider blocks (empty <div class="sci_box_right_b">, and a
   couple of fully empty custom-html blocks) are redundant now that real
   spacing comes from margin-bottom above — collapse their card chrome
   instead of showing small empty boxes. The :has() rule degrades
   gracefully on very old browsers (a few ~20px empty rounded boxes would
   show instead) — cosmetic only, not a functional break. */
#container_right_sidebar .sci_box_right_b {
	display: none;
}
#container_right_sidebar .cpt_custom_html:empty,
#container_right_sidebar .cpt_custom_html:has(> .sci_box_right_b:only-child) {
	display: none;
}

/* Currency selector - found completely invisible at every desktop width
   during the sidebar table->flex sweep (2026-09-22), pre-existing and
   unrelated to the flex conversion itself: main.css:831
   (.cpt_currency_selection, .prdbrief_comparison, .callus, .contact -
   display none) sits two lines above its own Mobile-section comment
   marker but OUTSIDE the actual max-width:800px media block that starts
   right after it - same unguarded-rule bug shape already seen elsewhere in
   this codebase (custom.css's own .hdr-actions-wa history). Left main.css
   itself untouched (Dizains-overwrite risk, same reasoning as the rest of
   this sidebar redesign) and overridden here instead - this selector's ID
   + class beats main.css's bare class unconditionally, no source-order
   dependency. Given the same card treatment as its sibling blocks above so
   it doesn't render as unstyled bare text floating between them. */
#container_right_sidebar .cpt_currency_selection {
	display: block;
	background: #ffffff;
	border: 1px solid #C7C7C7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	margin-bottom: 8px;
	padding: 9px 11px;
	box-sizing: border-box;
}

/* WhatsApp button (Stage B content, code 'ie7rr50s' in SC_htmlcodes) —
   CSS button with an inline SVG icon instead of the old low-res raster
   badge image, so it stays crisp at any zoom/DPI. */
#container_right_sidebar .sb-wa-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #25D366;
	color: #ffffff !important;
	text-decoration: none !important;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding: 7px 14px;
	border-radius: 16px;
	margin: 4px 0;
}
#container_right_sidebar .sb-wa-btn:hover {
	background: #1EBE57;
}
#container_right_sidebar .sb-wa-btn svg {
	flex-shrink: 0;
}

/* Kontaktinformācija card content (Stage C, code 'phtjnbda' in
   SC_htmlcodes) — left-aligned icon rows instead of the old centered
   blob, plus a language row that reuses the same flag images/links as
   the real language switcher (cpt_language_selection) used in the page
   header, so LV/RU/EN here actually switch language too. */
#container_right_sidebar .sb-contact {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333333;
}
#container_right_sidebar .sb-contact-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 3px 0;
}
#container_right_sidebar .sb-contact-icon {
	flex-shrink: 0;
	font-size: 13px;
}
#container_right_sidebar .sb-contact-wa-mini {
	display: inline-flex;
	margin-left: 2px;
}
#container_right_sidebar .sb-contact-divider {
	border-top: 1px solid #e2e2e2;
	margin: 8px 0;
}
#container_right_sidebar .sb-lang-row {
	display: flex;
	align-items: center;
	gap: 6px;
}
#container_right_sidebar .sb-lang-label {
	font-size: 11px;
	font-weight: bold;
	color: #777777;
}
#container_right_sidebar .sb-lang-flag {
	display: inline-block;
	line-height: 0;
	opacity: 0.45;
	filter: grayscale(60%);
	transition: opacity .15s ease;
}
#container_right_sidebar .sb-lang-flag:hover {
	opacity: 0.8;
}
#container_right_sidebar .sb-lang-flag.sb-lang-active {
	opacity: 1;
	filter: none;
}
#container_right_sidebar .sb-lang-flag img {
	width: 18px;
	height: auto;
	display: block;
	border-radius: 2px;
}

} /* @media (min-width: 801px) */

/* ==========================================================================
   PHASE 2 — "Uzmanību !!!" STOREFRONT NOTICE (2026-08-13)
   This text is NOT an SC_htmlcodes block like the sidebar cards above - two
   separate SC_local translation rows, no shared source: id='welcome_to_
   storefront' (homepage: home.html -> {cpt_custom_html code='njr3gga6'} ->
   SC_htmlcodes njr3gga6 -> {lbl_welcome_to_storefront}) and id='Go_Welcome'
   (product page: product_info.html's {'Go_Welcome'|translate} directly, no
   SC_htmlcodes layer). Both rows' `value` were rewritten (all 3 languages)
   from `<font color="red"><strong>...</strong></font>` to this `.notice`
   markup - this rule is what actually styles it. See
   DESIGN_PHASE_CHANGES.md for the full chain and the SQL used.

   Not scoped to a container id or the sidebar's @media(min-width:801px)
   guard above - this sits in the main content column, not sidebar chrome,
   and needs to render at every viewport width.

   Amber/warning tone (not red "error", not blue "info") - operational
   notice, not a failure state. Colors/radius/icon from the approved Phase 2
   mockup (Variant 1). No font-family/font-size here on purpose - inherits
   Phase 1's finalized Arial/Helvetica 14px/1.5 from the base rule instead
   of the old inline-styled shouting-all-bold-red text.
   ========================================================================== */
.notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: #FDF3DC;
	border: 1px solid #E8C878;
	border-left: 4px solid #C98A1E;
	border-radius: 6px;
	padding: 14px 16px;
	margin: 10px 0 16px;
	color: #4A3A18;
	box-sizing: border-box;
}
.notice svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
	color: #C98A1E;
}
.notice p {
	margin: 0;
}

/* ==========================================================================
   PHASE 3 — HEADER CART BADGE + AUX-PAGES MENU RELOCATION (2026-08-13)
   {cpt_auxpages_navigation} (header) and {cpt_shopping_cart_info} (sidebar)
   swapped containers in index.html: the cart now renders in
   #container_top_right, the aux-pages menu now renders in
   #container_right_sidebar (as a new card, title block key 'nfo9kx4w' -
   "NODERĪGA INFORMĀCIJA" - added ahead of it, same pattern as the other
   sidebar card titles). Width math and mockup approved in the Phase 3
   recon session - see DESIGN_PHASE_CHANGES.md.

   .shcart_icon baseline hidden here (unguarded) so it never shows on
   mobile by default; re-enabled only inside the desktop block below.
   Mobile keeps using the existing raster mobile/cart.png treatment,
   retargeted to the new container in the @media(max-width:800px) block
   further down - not replaced, so nothing on mobile visually changes.
   ========================================================================== */
#container_top_right .shcart_icon {
	display: none;
}

@media (min-width: 801px) {

/* Row of 170px -> 190px: measured empirically (canvas text measurement,
   same method as the left sidebar in Phase 1) against the widest realistic
   cart-badge content - "24 prece(es)" bold 16px (~93px) and "2 499,00
   Euro" 14px (~88px, based on the highest product price in the catalog).
   40px icon + 12px gap + ~93-100px text column + 32px card padding =
   ~184px minimum; 190px leaves a little breathing room without padding it
   out arbitrarily. Row height is no longer forced to 252px now that the
   6-item aux-pages list is gone - it settles back to #container_top's own
   155px (logo-driven) minimum, per the table-cell-height-is-a-floor
   finding from the Phase 1 header work. */
#container_top_right {
	width: 190px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	box-sizing: border-box;
}
#container_top_right .cpt_language_selection {
	width: auto;
	float: none;
	margin-top: 0;
	display: flex;
	justify-content: flex-end;
	gap: 6px;
}

/* Cart badge: icon spans both text rows via CSS Grid placement - no
   change needed to shopping_cart_info.html's existing sibling-div
   structure (.shcart_link, #shpcrtgc, #shpcrtca are still plain siblings;
   Grid just places them without requiring a wrapper element). */
#container_top_right .cpt_shopping_cart_info {
	display: grid;
	grid-template-columns: 40px 1fr;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 10px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	padding: 8px 10px;
	box-sizing: border-box;
}
#container_top_right .shcart_link {
	grid-row: 1 / 3;
	grid-column: 1;
}
#container_top_right .shcart_link a {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	text-decoration: none;
}
#container_top_right .shcart_icon {
	display: block;
	width: 34px;
	height: 34px;
}
/* "🛒 Mans grozs" text stays in the DOM for accessibility/SEO but isn't
   part of this compact badge's visual design - the icon + count + sum
   already say "this is your cart"; kept off-screen rather than removed. */
#container_top_right .shcart_link_text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
#container_top_right #shpcrtgc {
	grid-row: 1;
	grid-column: 2;
	color: #ffffff;
	font-weight: bold;
	font-size: 15px;
	line-height: 1.25;
}
#container_top_right #shpcrtca {
	grid-row: 2;
	grid-column: 2;
	color: #DCE6F7;
	font-size: 13px;
	line-height: 1.25;
}

/* Aux-pages menu card in the sidebar - same white/bordered/rounded
   treatment as every other sidebar card (Phase 1 pattern), independent
   card from its 'nfo9kx4w' title block above it (two stacked rounded
   cards with a gap, same as MEKLĒŠANA/KATALOGS on the left sidebar -
   not one merged card). */
#container_right_sidebar .cpt_auxpages_navigation {
	background: #ffffff;
	border: 1px solid #C7C7C7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	margin-bottom: 8px;
	padding: 9px 11px;
	box-sizing: border-box;
	overflow: hidden;
}
#container_right_sidebar .cpt_auxpages_navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#container_right_sidebar .cpt_auxpages_navigation li {
	padding: 5px 0;
	border-bottom: 1px solid #EFEFEF;
}
#container_right_sidebar .cpt_auxpages_navigation li:last-child {
	border-bottom: none;
}

} /* @media (min-width: 801px) */

/* ==========================================================================
   PHASE 4 v4 — HEADER REDESIGN, ROUND 2 (2026-08-14)
   Second round after live feedback on the first applied version (which is
   why this replaces rather than patches the original Phase 4 block - see
   DESIGN_PHASE_CHANGES.md for the full before/after per point):
   - Cart made visually bigger (icon 34->38px, text 15/13->17/14px, more
     padding). #container_top_right widened 190->212px to fit it.
   - Account button gained a visible "Konts" label next to the icon.
   - Phone + WhatsApp moved OUT of the thin utility row entirely, into a
     new bigger centered row directly above search (.hdr-center wraps
     .hdr-contact-row + the search component).
   - Flags moved OUT of the utility row's left side into the right side,
     next to the account button, reordered LV/RU/EN (site's primary
     language first) via :has() on each flag's real alt text.

   DOM changes in index.html this depends on: .hdr-util-left is now an
   EMPTY div (kept only so #container_top's utility row still matches
   #container_top_right's utility row height - otherwise the pixel
   background would show a seam between the two cells at different
   heights). .hdr-brand-left now wraps the logo AND a new .hdr-center
   div (contact row + search). .hdr-util-right now renders
   {cpt_language_selection} before the account <details>, and the
   account <summary> gained a .hdr-acct-label span.

   Height budget (still the same concern as the first Phase 4 pass -
   sci_hat_bg.gif is a fixed 155px-tall tile, repeat-x only, so total
   content height must stay at or under that): utility row 34px + brand
   row (contact row ~34px + 8px gap + search 48px = 90px content, +20px
   top/bottom padding = 110px) = 144px, ~11px under the 155px ceiling.
   ========================================================================== */

/* Account dropdown click/tap toggle - unguarded (not inside either @media
   block) because it drives the account menu at every viewport width: on
   mobile it's the ONLY way to open the menu (no hover), on desktop it's a
   click/tap fallback alongside the hover behavior defined in the desktop
   block below. Same checkbox-hack mechanism either way, no JS.
   .hdr-acct-checkbox itself must also be hidden unguarded, not just inside
   the desktop block - found live on mobile (a visible checkbox square sat
   next to the account icon) since the original hiding rule only existed
   inside @media(min-width:801px). */
.hdr-acct-checkbox {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
}
.hdr-acct-checkbox:checked ~ .hdr-acct-menu {
	display: block;
}
.hdr-acct-checkbox:checked ~ .hdr-acct-btn .hdr-acct-chev {
	transform: rotate(180deg);
}
/* Unguarded (not inside either @media block): .hdr-actions-wa is a leftover
   span from round 6-8's mobile actions row (a third WhatsApp render
   location, since removed - round 9 puts WhatsApp back in the contact
   row for both viewports). The only other hide rule for it lives inside
   @media(min-width:801px) below, which - same recurring bug shape as
   several earlier rounds - never applied on mobile at all, so the bare
   <span> rendered inline and unstyled there (a real regression, caught
   via live screenshot immediately after building round 9's grid, not
   assumed safe). This one rule now covers both viewports; the
   media-scoped one below is redundant but left in place rather than
   removed, matching how other belt-and-suspenders fixes in this file
   already work. */
.hdr-actions-wa {
	display: none;
}

@media (min-width: 801px) {

#container_top,
#container_top_right {
	background-color: transparent;
	background-image: none;
}

/* .sci_lt is a pre-existing theme decoration (not something this redesign
   added), a fixed 24x150px corner accent (sci_img_l_up.gif) layered over
   the top-left of the header, independent of #container_top/_right's own
   backgrounds above. It was tuned to taper into the OLD flat-color header
   background; found live (pixel-identified via elementFromPoint at the
   exact reported artifact location, not guessed) that its own hard
   diagonal edge now reads as a visible seam against the busier pixel-tile
   background this phase restored. Removing just its background-image
   here (desktop only) - the element itself, and the actual continuous
   page-side border it sits in front of, come from separate elements
   (.sci_lb/.sci_rb) and are untouched. Mobile already hides .sci_lt
   entirely via main.css's own unguarded mobile rule, so no mobile-side
   change was needed. */
.sci_lt {
	background-image: none;
}

/* Client-feedback pass: the yellow-olive decorative stripe (sci_t1_bg_l/r.gif
   tiled the full page height via .sci_lb_body/.sci_rb_body, plus the bottom
   corner accents sci_img_l/r_down.gif via .sci_lb/.sci_rb) reads as visual
   noise with no functional purpose, site-wide, not just the header. Same
   fix shape as .sci_lt above: these 4 classes carry nothing but `background`
   in main.css (no width/height/position/float), so zeroing it here can't
   affect layout - only the corner-gif decoration goes away. Desktop only:
   mobile already replaces these same 4 classes' background with the header
   tile (main.css, unguarded @media max-width:800px rule) instead of the
   yellow gifs, so mobile's gutter is untouched and out of scope here. */
.sci_lb_body,
.sci_rb_body,
.sci_lb,
.sci_rb {
	background: none;
}

#container_top {
	vertical-align: top;
	height: auto;
	padding: 0;
}
#container_top .cpt_custom_html {
	margin-left: 0;
}

.hdr-util-left {
	height: 34px;
}

.hdr-util-right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	height: 34px;
	padding: 0 22px;
	box-sizing: border-box;
	position: relative;
	z-index: 2;
}
/* Mobile-only third render of the WhatsApp component (round 6) - desktop
   already has it in the contact row above search, doesn't need it here
   too. Hidden by default (a bare <span> would otherwise render inline,
   unstyled) and shown only inside @media(max-width:800px) below. */
.hdr-actions-wa {
	display: none;
}
/* Flags: moved here from .hdr-util-left this round. Reorder to LV/RU/EN
   via :has() on the real alt text each flag <img> carries (confirmed
   live: Latviski/Русский/English) - no DB/admin change needed. */
#container_top_right .hdr-util-right .cpt_language_selection {
	display: flex;
	align-items: center;
	gap: 6px;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="Latviski"]) {
	order: 1;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="Русский"]) {
	order: 2;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="English"]) {
	order: 3;
}

/* Account dropdown mechanics REWRITTEN this round (2026-08-14, live
   feedback): was <details>/<summary>, which only opens/closes on click and
   stays open until clicked again - live testing confirmed it does NOT
   close on mouseleave (getComputedStyle on the menu read display:block
   even while closed, proving the browser hides <details> content through
   an internal mechanism that a CSS display override can't reach - not
   fixable by overriding [open] styling). Replaced with the "checkbox hack":
   a visually-hidden checkbox + <label for> as the visible button, menu
   visibility driven by :hover/:focus-within on .hdr-acct (desktop) and by
   the checkbox's :checked state (works everywhere, including a tap on
   mobile, no JS). This is what actually gives standard hover-to-open,
   mouseleave-to-close behavior. Desktop's hover mechanism is defined here;
   .hdr-acct-checkbox:checked's own display rule lives further down since
   it applies at every width, not just desktop. .hdr-acct-checkbox's own
   hiding rule now lives unguarded too, for the same reason. */
.hdr-acct {
	position: relative;
}
.hdr-acct-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, .12);
	border: 1px solid rgba(255, 255, 255, .3);
	color: #F2F6FA;
	font-size: 12px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	padding: 6px 11px 6px 9px;
	border-radius: 20px;
	line-height: 1;
	cursor: pointer;
}
.hdr-acct-btn:hover {
	background: rgba(255, 255, 255, .2);
}
.hdr-acct-checkbox:focus-visible ~ .hdr-acct-btn {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
.hdr-acct-btn svg {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
}
.hdr-acct-chev {
	font-size: 8px;
	opacity: .85;
	transition: transform .15s ease;
}
.hdr-acct:hover .hdr-acct-chev,
.hdr-acct-checkbox:checked ~ .hdr-acct-btn .hdr-acct-chev {
	transform: rotate(180deg);
}
.hdr-acct-menu {
	display: none;
	position: absolute;
	right: 0;
	top: 40px;
	width: 250px;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(20, 30, 45, .24);
	border: 1px solid #E1E6ED;
	padding: 6px;
	z-index: 50;
}
/* Desktop: opens on hover OR keyboard focus (Tab to the checkbox, or Tab
   into the menu's own links keeps :focus-within active), closes as soon
   as the pointer leaves .hdr-acct - plain CSS :hover, no timers/JS needed
   for the mouseleave behavior that was the actual ask. */
.hdr-acct:hover .hdr-acct-menu,
.hdr-acct:focus-within .hdr-acct-menu {
	display: block;
}
/* #container_top_right prefix needed to out-specificity main.css's
   "#container_top_right .cpt_divisions_navigation a{text-decoration:
   underline;color:#fff}" (ID beats any number of classes). */
#container_top_right .hdr-acct-menu .cpt_divisions_navigation {
	padding: 0;
}
#container_top_right .hdr-acct-menu ul.horizontal {
	width: auto;
	overflow: visible;
}
#container_top_right .hdr-acct-menu ul.horizontal li {
	float: none;
	display: block;
	margin: 0;
	padding: 0;
	border-right: none;
}
#container_top_right .hdr-acct-menu ul.horizontal li a {
	display: block;
	padding: 9px 10px;
	font-size: 13px;
	font-weight: normal;
	color: #26313D;
	text-decoration: none;
	border-radius: 6px;
}
#container_top_right .hdr-acct-menu ul.horizontal li a:hover {
	background: #E4F3F8;
	color: #0085B0;
	text-decoration: none;
}

.hdr-brand-left {
	display: flex;
	align-items: center;
	flex: 1;
	padding: 10px 26px;
	box-sizing: border-box;
	overflow: visible;
}
.hdr-brand-left .cpt_custom_html {
	position: relative;
	flex: 0 0 auto;
	overflow: visible;
}

/* Device silhouettes (phone/laptop/camera), replacing the old sci_logo.jpg
   raster collage - inline SVG living inside the umlp7cha content itself
   (SC_htmlcodes), single-color currentColor strokes, same visual language
   as the cart/WhatsApp/notice icons already shipped. */
.hdr-devices {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 230px;
	height: 118px;
	color: #ffffff;
	-webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .95) 58%, transparent 100%);
	        mask-image: linear-gradient(90deg, rgba(0, 0, 0, .95) 58%, transparent 100%);
	pointer-events: none;
}
.hdr-devices svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.hdr-logo {
	display: flex;
	align-items: center;
	gap: 11px;
	margin-left: 196px;
	text-decoration: none;
	position: relative;
	z-index: 1;
}
.hdr-mark {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
}
.hdr-word {
	font-family: Arial, Helvetica, sans-serif;
	line-height: 1;
}
.hdr-word b {
	display: block;
	font-size: 28px;
	font-weight: 800;
	font-style: normal;
	color: #ffffff;
	letter-spacing: .01em;
}
.hdr-word span {
	display: block;
	font-size: 28px;
	font-weight: 800;
	color: #DCEEF6;
	letter-spacing: .07em;
	margin-top: -2px;
}

/* Center column: phone+WhatsApp row above search, both now much more
   prominent than the compact utility-bar treatment from the first Phase 4
   pass - moved here per live feedback ("слишком мелкие... перенеси по
   центру, НАД полем поиска, заметно крупнее"). */
.hdr-center {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-left: 28px;
	position: relative;
	z-index: 1;
}
.hdr-contact-row {
	display: flex;
	align-items: center;
	gap: 26px;
}
.hdr-contact-row .hdr-phone {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #ffffff;
	font-size: 21px;
	font-weight: bold;
	text-decoration: none;
	letter-spacing: .01em;
	white-space: nowrap;
	font-family: Arial, Helvetica, sans-serif;
}
.hdr-contact-row .hdr-phone:hover {
	text-decoration: underline;
}
/* Feather-style icon (viewBox 0 0 24 24, stroke=currentColor, stroke-width:2),
   same spec already used by the account icon (index.html) and the footer
   phone line (ftr-contact-line) - not the WhatsApp button, which is a
   filled brand icon, not stroke-based. Approved in the round-1 mockup. */
.hdr-contact-row .hdr-phone svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	color: #ffffff;
}
/* WhatsApp: same 'ie7rr50s' SC_htmlcodes row as the sidebar copy (single
   source of truth for the number/link) - full-size pill here now,
   replacing the compact utility-bar treatment from the first pass. */
#container_top .hdr-center .cpt_custom_html {
	margin: 0;
	display: flex;
	align-items: center;
	position: static;
}
#container_top .hdr-center .sb-wa-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #25D366;
	color: #ffffff !important;
	text-decoration: none !important;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13.5px;
	padding: 9px 18px;
	border-radius: 22px;
}
#container_top .hdr-center .sb-wa-btn:hover {
	background: #1EBE57;
}
#container_top .hdr-center .sb-wa-btn svg {
	width: 18px;
	height: 18px;
}

/* Search, moved from the left sidebar (was 120x22px in a small card) to a
   large pill under the contact row. Per-corner border-radius on the
   input/button instead of overflow:hidden on the form, deliberately - the
   autocomplete dropdown (product_autocomplete.js) appends itself as a
   child of the form (`input.parentNode`) and is positioned top:100%, so an
   overflow:hidden form would clip the whole dropdown out of view. */
.hdr-center .cpt_product_search {
	width: 100%;
	max-width: 620px;
	margin: 0;
	padding: 0;
}
.hdr-center .cpt_product_search form {
	display: flex;
	align-items: stretch;
	height: 48px;
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 3px 12px rgba(10, 20, 35, .22);
	padding: 0 !important;
	margin: 0 !important;
}
/* Variant 1: magnifying-glass icon inside the input (CSS background-image
   on the real <input> - product_search.html is a shared cross-theme
   template with no icon markup, so this is the only DOM-free way to add
   it), a vertical divider before the button (layered gradient background
   on the button itself, since ::before/::after don't render on replaced
   form controls like <input type=submit>), and an arrow icon on the
   button (same background-image technique, right-aligned). */
.hdr-center .cpt_product_search input#searchstring {
	flex: 1 1 auto;
	width: auto;
	border: none;
	outline: none;
	padding: 0 20px 0 46px;
	font-size: 14px;
	color: #26313D;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C8B9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.2' y2='16.2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 18px center;
	background-size: 19px 19px;
	border-radius: 24px 0 0 24px;
}
.hdr-center .cpt_product_search input[type=submit] {
	border: none;
	background-color: #0085B0;
	background-image:
		linear-gradient(to bottom, transparent 20%, rgba(255, 255, 255, .4) 20%, rgba(255, 255, 255, .4) 80%, transparent 80%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
	background-repeat: no-repeat, no-repeat;
	background-position: left center, right 20px center;
	background-size: 1px 100%, 14px 14px;
	color: #ffffff;
	font-weight: bold;
	font-size: 13px;
	text-align: center;
	padding: 0 40px 0 22px;
	cursor: pointer;
	flex: 0 0 auto;
	border-radius: 0 24px 24px 0;
}
.hdr-center .cpt_product_search input[type=submit]:hover {
	background-color: #006D91;
}

/* Right cell: bigger cart, wider column (190->212px) to fit it without
   crowding. */
#container_top_right {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 0;
	padding: 0;
	width: 212px;
	vertical-align: top;
}
.hdr-brand-right {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 12px 16px;
	box-sizing: border-box;
}
#container_top_right .cpt_shopping_cart_info {
	display: grid;
	grid-template-columns: 52px 1fr;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 12px;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 8px;
	padding: 11px 16px;
	box-sizing: border-box;
}
#container_top_right .shcart_link {
	grid-row: 1 / 3;
	grid-column: 1;
}
#container_top_right .shcart_link a {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	text-decoration: none;
}
#container_top_right .shcart_icon {
	display: block;
	width: 46px;
	height: 46px;
}
#container_top_right .shcart_link_text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
#container_top_right #shpcrtgc {
	grid-row: 1;
	grid-column: 2;
	color: #ffffff;
	font-weight: bold;
	font-size: 17px;
	line-height: 1.25;
}
#container_top_right #shpcrtca {
	grid-row: 2;
	grid-column: 2;
	color: #DCE6F7;
	font-size: 14px;
	line-height: 1.25;
}

} /* @media (min-width: 801px) */

/* ==========================================================================
   HEADER OVERFLOW FIX — intermediate desktop tier, 801-1050px (2026-08-25)
   Recon session (CDP getBoundingClientRect sweep, live style injection, not
   guessed) found the plain 801px+ desktop layout above floors out around
   ~1043px - #container_top is a plain <table> cell (no table-layout:fixed,
   no flex-wrap anywhere in the header), so below that width it overflows
   horizontally instead of shrinking. The single biggest lever, measured
   live: the decorative device-silhouette SVG (.hdr-devices - position:
   absolute, pointer-events:none, aria-hidden, purely decorative) plus the
   .hdr-logo margin-left reserved only to visually clear space for it.
   Hiding both took the measured floor from 1043px down to 863px, covering
   this whole range with room to spare (clean from ~864px up; a small
   residual overflow up to ~62px remains measurable right at 801-863px but
   doesn't show visually - the vertical scrollbar's own width absorbs it -
   so it's left alone, not chased further, per the approved scope).
   Same fix shape already shipped for the actual mobile breakpoint below
   (.hdr-devices is display:none there too) - this is that exact precedent
   applied one tier earlier, not a new idea. Compacting the WhatsApp pill
   (mobile's .sb-wa-btn treatment, the other candidate mirrored from mobile)
   was also tested live and made zero difference - the contact row was never
   the binding constraint once the devices/margin reservation is gone - so
   it's intentionally not touched here.
   Upper bound 1050px: just above the measured 1043px floor of the plain
   desktop rules in the block above, so there is no gap in between where
   neither treatment is safe. */
@media (min-width: 801px) and (max-width: 1050px) {

.hdr-devices {
	display: none;
}
.hdr-logo {
	margin-left: 16px;
}

} /* @media (min-width: 801px) and (max-width: 1050px) */

/* ==========================================================================
   PHASE 3 MOBILE FIX (2026-08-13) — SUPERSEDED by the Phase 4 v3 mobile
   redesign below (2026-08-14). Kept for history (matches this file's usual
   practice of not rewriting past decisions) but every property this block
   set is redeclared in the new block, which loads later in the cascade and
   fully wins. Specifically: #container_top_right is no longer
   position:absolute at all on mobile (the v3 redesign stacks it as a plain
   block below #container_top instead of overlapping it), so the -73px
   compensation trick below has nothing to compensate for any more, and the
   cart switches from the raster mobile/cart.png background to the same SVG
   icon used on desktop.
   ========================================================================== */
@media (max-width: 800px) {

#container_top_right .cpt_shopping_cart_info {
	display: block;
	background: none;
	color: #fff;
	text-shadow: 1px 1px #000;
	padding: 0;
	width: 80px;
	position: absolute;
	top: -73px;
	right: 8px;
	overflow: hidden;
	box-sizing: border-box;
}
#container_top_right .cpt_shopping_cart_info,
#container_top_right .cpt_shopping_cart_info div {
	background: none;
}
#container_top_right .cpt_shopping_cart_info .shcart_link {
	background: url(../../images/mobile/cart.png) no-repeat center center;
	background-size: 35px;
	text-indent: -9999px;
	height: 50px;
}
#container_top_right #shpcrtgc,
#container_top_right #shpcrtca {
	font-size: 11px;
	line-height: 1.3;
	white-space: normal;
	word-break: break-word;
	text-align: center;
}

/* Aux-pages menu: was hidden via "#container_top_right ul{display:none}"
   in its old location; now lives in #container_right_sidebar - hide the
   whole component there instead (matches how every other block in that
   column is already hidden via main.css's
   ".cpt_custom_html,.cpt_currency_selection{display:none}"). Not affected
   by the v3 mobile redesign below - still current, not superseded. */
#container_right_sidebar .cpt_auxpages_navigation {
	display: none;
}

} /* @media (max-width: 800px) */

/* ==========================================================================
   PHASE 4 v3 — MOBILE HEADER REDESIGN, FROM SCRATCH (2026-08-14)
   Replaces the original Phase 4 mobile block entirely (not a patch) - live
   feedback confirmed the first pass ("retarget old selectors to new
   locations") produced a genuinely broken mobile layout: unstyled cart
   text, logo overlapping the collage, an unaligned account icon, search
   overflowing the header, WhatsApp reduced to a bare text link. Root cause
   was structural, not a missing rule: mobile was still relying on the old
   #container_top (60% width) / #container_top_right (position:absolute,
   overlapping) split designed for a much thinner Phase-3-era header, which
   the v4 desktop content (bigger cart, centered contact row, flags+account
   together) had already outgrown. See DESIGN_PHASE_CHANGES.md for the
   before/after screenshots and the full four-bug writeup.

   New approach: stop overlapping the two cells via position:absolute and
   let them stack as plain full-width blocks in DOM order instead -
   #container_top first (logo + phone/WhatsApp + search, all centered in
   one column), #container_top_right second, itself a flex ROW splitting
   into flags+account on the left and the cart on the right (its two
   children, .hdr-util-right and .hdr-brand-right, sit side by side instead
   of stacked - this is what turns two separately-styled sub-blocks into
   the single compact "actions row" from the approved mockup).

   Collage/Δ/device silhouettes stay out of scope for mobile, same decision
   as before - but this pass also drops mobile's OWN pre-existing raster
   mobile/logo.png background (main.css) rather than keep patching text
   spacing around it, since the approved mobile mockup shows a clean
   text-only wordmark with no image behind it at all - simpler and removes
   the overlap failure mode entirely instead of compensating for it.
   ========================================================================== */
@media (max-width: 800px) {

/* #container_top: full width, plain block (not position:relative/absolute
   anymore - nothing inside it needs that now that the collage is gone and
   the account dropdown anchors to its own button, see .hdr-acct below).
   Round 5: gets its OWN copy of the sci_hat_bg tile instead of relying on
   the parent <table class="sci_topbg">'s background - once #container_top
   became display:block (taken out of table-cell layout), the table's own
   painted background stopped reliably covering this cell's full rendered
   height, leaving a white gap starting partway down the column. It landed
   right where the search field sits (last child in .hdr-brand-left), so
   the field visually straddled a blue/white seam - real bug, found via a
   genuine CDP mobile viewport screenshot, not a false positive. Painting
   the tile directly on #container_top sidesteps the table-layout ambiguity
   entirely: this is now a plain block box, height:auto = exactly its own
   content height, background covers it fully regardless of what the
   ancestor table does. Same image/color as .sci_topbg (main.css) and the
   desktop-only reintroduction below in this file. */
/* Round 7: #container_top and #container_top_right now show two
   PHASE-MATCHED, adjacent slices of the exact same scaled tile image,
   not a texture-then-flat-colour or texture-then-gradient approximation
   (both of those were rejected on review - a flat/gradient fill can
   never truly match a photographic/textured tile, confirmed visually
   both times). Mechanism: both elements share the identical
   background-size (574x360, preserving the tile's 247:155 aspect ratio)
   and background-image; #container_top starts its copy at
   background-position-y:0, #container_top_right starts ITS copy at
   background-position-y:-163px (matching #container_top's own
   live-measured height, 162.75px rounded) - so #container_top_right
   shows exactly the continuation of the same image #container_top left
   off at, as if one uninterrupted image ran behind both boxes. This is
   the same "picture behind two apertures" idea as film-strip framing,
   not a new technique invented for this fix.

   background-size:574x360 (not the tile's natural 247x155) exists for
   two independent reasons, both already true before this round and
   still true now: (1) an old main.css rule for this same #container_top
   (its pre-redesign raster-logo background) separately declares
   background-size:150px, which silently survives since this rule uses
   longhand background-* properties that don't reset it - without an
   explicit override here the tile would render squashed to 150px wide.
   (2) the raw image's own natural bottom ~15px (y>=140 of its 155px
   height) is a near-white edge, sampled via canvas getImageData - the
   same characteristic the original desktop seam fix (3ee3c9ff) already
   had to work around. The combined visible height of both zones together
   is 268.75px (162.75+106, live-measured) - 574x360 scales the tile up
   enough that the white edge (at ~87% of its own height) lands at
   ~313px, past the combined 268.75px with real margin, so it's clipped
   by the box boundaries before either element can ever show it. One
   scaled image comfortably covers both zones without needing to actually
   repeat vertically at all (no risk of the white edge recurring via
   tiling) - background-repeat stays repeat-x only, for horizontal
   coverage, same as before. */
/* ==========================================================================
   ROUND 9 — MOBILE HEADER, SECOND STRUCTURAL REBUILD (2026-08-17)
   User feedback after round 8's real-phone check: the actions row (4
   chips: languages/WhatsApp/account/cart) still felt crowded. Approved
   mockup regroups by function instead of just thinning the row: a
   2-column "zone 1" (brand identity left: logo+phone/WhatsApp; user
   context right: account+languages), full-width search below both
   columns, then a minimal 2-item actions row (category-tree toggle +
   cart) below that.

   Why display:contents + a grid on the shared <tr>, not another round of
   flex/absolute patching: the target layout needs content from BOTH
   table cells - #container_top (logo, contact row, search) and
   #container_top_right (languages, account, cart) - interleaved into one
   coherent 2-column-then-full-width flow. Two adjacent table cells can't
   visually interleave rows via CSS alone while remaining separate boxes;
   actually moving the Smarty tags in index.html was ruled out as the
   fix here specifically because #container_top/#container_top_right's
   DOM position is shared with desktop, and desktop's own layout (already
   correct, not part of this round's brief) depends on account/languages
   living inside #container_top_right - moving the tags would require
   rebuilding desktop's positioning too, for no desktop-side benefit.
   Flattening both cells' box generation via display:contents while
   keeping the CSS scoped to @media(max-width:800px) leaves desktop's own
   rules (a completely separate media block) untouched: the tags stay
   exactly where they are in the DOM, only their mobile-computed display
   changes.

   The background-painting element also moves up a level, from
   #container_top and #container_top_right individually (round 7's
   phase-matched-tile-continuation approach, needed because they were two
   separate boxes) to the shared <tr> itself (via the .sci_topbg tr
   selector - scoped to the header's own table specifically, not every
   <tr> on the page). This isn't just a consequence of the display:contents
   refactor - it's strictly simpler than round 7's approach: one box, one
   background, no seam to phase-match in the first place, since
   #container_top/#container_top_right no longer generate boxes of their
   own for a background to seam against. */

.sci_topbg tr {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-areas:
		"logo    acct"
		"contact lang"
		"search  search"
		"cartrow cartrow";
	row-gap: 10px;
	column-gap: 12px;
	padding: 18px 16px 16px;
	box-sizing: border-box;
	background-color: #496BAB;
	background-image: url(../../images/sci_hat_bg.gif);
	background-repeat: repeat-x;
	background-position: left top;
	/* background-size: same reasoning as round 7's #container_top rule -
	   an old main.css rule for the pre-redesign raster logo separately
	   declares background-size:150px for #container_top specifically,
	   which no longer matters now that #container_top isn't the element
	   painting the background at all (display:contents strips its own
	   background-size out of the equation entirely) - but the tile's own
	   near-white bottom ~15px still needs to land past this box's real
	   height. Confirmed live, not just carried over as a guess: this
	   <tr> now measures 226px tall (getBoundingClientRect() @ 390px
	   width). At 574x360 the scale factor off the tile's 247x155
	   natural size is 360/155=2.323x; round 7's own pixel sampling
	   placed the near-white transition at y~=140 of 155, which scales
	   to 140*2.323=~325px - comfortably past this box's 226px, so no
	   washed-out edge is visible within the rendered height. Kept at
	   574x360 rather than rescaled down to this shorter box, since a
	   smaller value would zoom the digit pattern in and the current
	   size already satisfies the only real constraint (white edge past
	   the visible area); confirmed clean on the live screenshot too. */
	background-size: 574px 360px;
}

#container_top,
#container_top_right,
.hdr-brand-left,
.hdr-center,
.hdr-util-right,
.hdr-brand-right {
	display: contents;
}
.hdr-util-left {
	display: none;
}

/* Zone 1, column 1, row 1: logo/wordmark. */
#container_top .hdr-brand-left .hdr-logo {
	font-size: 14px;
	/* Same ID-beats-classes trap documented in round 6 - an old main.css
	   rule (#container_top .cpt_custom_html a{font-size:35px}) still
	   matches this <a> regardless of its new grid-item role, and a plain
	   .hdr-logo{font-size} selector doesn't have enough specificity to
	   beat it. #container_top .hdr-brand-left .hdr-logo (1 ID + 2
	   classes) does. */
}
#container_top .hdr-brand-left > .cpt_custom_html {
	grid-area: logo;
	display: flex;
	justify-content: flex-start;
	margin: 0;
}
.hdr-logo {
	display: flex;
	align-items: center;
	margin-left: 0;
	justify-content: flex-start;
}
.hdr-devices,
.hdr-mark {
	display: none;
}
.hdr-word b,
.hdr-word span {
	display: inline;
	font-size: 20px;
	color: #ffffff;
	margin-top: 0;
	letter-spacing: .01em;
}

/* Zone 1, column 1, row 2: phone + WhatsApp. WhatsApp is back in this
   row (round 6-8 had moved it into the actions row; the approved round 9
   mockup pairs it with the phone number again, its original round 5/6
   placement) - so the round 6/7 "hide the contact-row WhatsApp instance"
   rule is gone, and no replacement hide rule is needed: the shared
   ie7rr50s markup just renders visibly here again. */
.hdr-contact-row {
	grid-area: contact;
	display: flex;
	align-items: center;
	gap: 6px;
}
.hdr-contact-row .hdr-phone {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12.5px;
	font-weight: normal;
	color: rgba(255, 255, 255, .8);
	text-decoration: none;
}
.hdr-contact-row .hdr-phone::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.79.63 2.65a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.43-1.27a2 2 0 0 1 2.11-.45c.86.3 1.75.51 2.65.63A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
	opacity: .85;
}
/* The desktop fix added a real <svg> inside .hdr-phone (index.html) -
   mobile keeps its own pre-existing ::before icon above unguarded, so hide
   the new element here to avoid a double icon / unstyled 300x150 default
   SVG size on mobile. Mobile markup/appearance stays unchanged. */
.hdr-contact-row .hdr-phone svg {
	display: none;
}
#container_top .hdr-center .cpt_custom_html {
	margin: 0;
	display: flex;
	align-items: center;
}
/* WhatsApp, contact-row instance: same compact circular chip treatment
   round 6-8 used for its actions-row instance, just relocated here. */
#container_top .hdr-center .sb-wa-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border-radius: 50%;
	background: #25D366;
	border: 1px solid rgba(255, 255, 255, .3);
	font-size: 0;
	box-sizing: border-box;
}
#container_top .hdr-center .sb-wa-btn svg {
	width: 13px;
	height: 13px;
}

/* Zone 1, column 2, row 1: account. */
.hdr-acct {
	grid-area: acct;
	justify-self: end;
	position: relative;
}
.hdr-acct-btn {
	display: flex;
	align-items: center;
	gap: 3px;
	height: 34px;
	padding: 0 10px;
	border-radius: 17px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .32);
}
.hdr-acct-btn svg {
	width: 15px;
	height: 15px;
	color: #ffffff;
}
.hdr-acct-label {
	display: none;
}
.hdr-acct-chev {
	font-size: 7px;
	color: #ffffff;
}
/* right:0 - the account chip sits at the right edge of column 2, so
   anchoring the dropdown menu from its own right edge keeps the menu
   on-screen (same reasoning as round 8, re-verified for this layout by
   actually opening the menu live, not assumed). top:40px accounts for
   the chip's 34px height. */
.hdr-acct-menu {
	display: none;
	position: absolute;
	right: 0;
	top: 40px;
	width: 210px;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(20, 30, 45, .3);
	border: 1px solid #E1E6ED;
	padding: 6px;
	z-index: 60;
}
#container_top_right .hdr-acct-menu .cpt_divisions_navigation {
	padding: 0;
}
/* Same main.css "#container_top_right ul{display:none}" specificity trap
   documented since Phase 4's first pass - still applies since the
   dropdown's <ul> is still a DOM descendant of #container_top_right,
   regardless of its grid-area role. */
#container_top_right .hdr-acct-menu ul.horizontal {
	display: block;
	width: auto;
	overflow: visible;
}
#container_top_right .hdr-acct-menu ul.horizontal li {
	float: none;
	display: block;
	margin: 0;
	padding: 0;
	border-right: none;
}
#container_top_right .hdr-acct-menu ul.horizontal li a {
	display: block;
	padding: 8px 9px;
	font-size: 12px;
	font-weight: normal;
	color: #26313D;
	text-decoration: none;
	border-radius: 6px;
}

/* Zone 1, column 2, row 2: languages. */
#container_top_right .hdr-util-right .cpt_language_selection {
	grid-area: lang;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 4px;
	float: none;
	width: auto;
	margin: 0;
	padding: 0 10px;
	height: 34px;
	border-radius: 17px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .32);
}
#container_top_right .hdr-util-right .cpt_language_selection img {
	width: 14px;
	height: auto;
	border-radius: 2px;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="Latviski"]) {
	order: 1;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="Русский"]) {
	order: 2;
}
#container_top_right .hdr-util-right .cpt_language_selection a:has(img[alt="English"]) {
	order: 3;
}

/* .hdr-actions-wa is no longer used on mobile (WhatsApp moved back to
   the contact row above) - round 6-8's mobile override that turned it
   on has simply been removed rather than overridden back, since nothing
   needs it visible anywhere now. This comment originally assumed the
   desktop-scoped default (@media min-width:801px, further down this
   file) alone was enough to keep it hidden on mobile too - that was
   wrong, caught live: a stray unstyled "Chat on WhatsApp" link rendered
   between the search field and the notice box on the first post-splice
   screenshot, because that rule never applies below 801px. Fixed with
   an unguarded .hdr-actions-wa{display:none} placed outside any @media
   block (see near line 696) that now covers both viewports. */

/* Zone 2: search, spanning both columns. Unchanged from round 5-8. */
.hdr-center .cpt_product_search {
	grid-area: search;
	width: 100%;
	max-width: none;
}
.hdr-center .cpt_product_search form {
	display: flex;
	align-items: stretch;
	height: 40px;
	border-radius: 20px;
}
.hdr-center .cpt_product_search input#searchstring {
	flex: 1 1 auto;
	width: auto;
	border-radius: 20px 0 0 20px;
	padding-left: 38px;
	font-size: 13px;
	color: #26313D;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C8B9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.2' y2='16.2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 14px center;
	background-size: 15px 15px;
	text-shadow: none;
}
.hdr-center .cpt_product_search input[type=submit] {
	border-radius: 0 20px 20px 0;
	padding: 0 30px 0 16px;
	min-width: 100px;
	font-size: 12px;
	color: #ffffff;
	background-color: #0085B0;
	background-image:
		linear-gradient(to bottom, transparent 20%, rgba(255, 255, 255, .4) 20%, rgba(255, 255, 255, .4) 80%, transparent 80%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
	background-repeat: no-repeat, no-repeat;
	background-position: left center, right 14px center;
	background-size: 1px 100%, 12px 12px;
	text-align: center;
	font-weight: bold;
	text-shadow: none;
	flex: 0 0 auto;
}

/* Zone 3: actions row - cart is the only real grid item here now
   (.toggle, the sidebar hamburger, lives in a completely separate
   <table> outside this grid entirely - see the .toggle rule below for
   how it's aligned to this same visual row without being a grid item).
   justify-self:end puts cart at the row's right edge; .toggle is
   separately positioned to align with the row's left edge. */
#container_top_right .cpt_shopping_cart_info {
	grid-area: cartrow;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 6px;
	position: static;
	height: 34px;
	padding: 0 12px;
	border-radius: 17px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .32);
	width: auto;
	color: #ffffff;
	text-shadow: none;
	overflow: visible;
}
#container_top_right .cpt_shopping_cart_info div {
	background: none;
}
#container_top_right .shcart_icon {
	display: block;
	width: 17px;
	height: 17px;
}
#container_top_right .shcart_link {
	display: flex;
}
#container_top_right .shcart_link a {
	display: flex;
	align-items: center;
	color: #ffffff;
	text-decoration: none;
}
#container_top_right #shpcrtgc,
#container_top_right #shpcrtca {
	font-size: 11.5px;
	line-height: 1.15;
	white-space: nowrap;
	color: #ffffff;
}
#container_top_right #shpcrtgc {
	font-weight: bold;
}
#container_top_right #shpcrtca {
	font-weight: normal;
	opacity: .9;
}

/* .toggle (the category-tree hamburger, main.css, a completely separate
   <a> outside the header's own <table> entirely) is positioned to align
   with the cart row above, via position:absolute against .all_wrapper as
   before - not made a real grid item, since it isn't a DOM descendant of
   the header's <tr> at all and moving it there would risk whatever JS
   elsewhere targets .toggle by its current DOM location. Per the
   approved round 9 mockup, hamburger and cart sit at opposite ends of
   the cartrow, roughly under the search bar's own start/end - so this
   moves .toggle from main.css's right-anchored position to a
   left-anchored one instead of just adjusting its right offset.
   Live-measured (getBoundingClientRect() @ 390px width, not judged
   visually): .hdr-center .cpt_product_search is left:16/right:374, and
   .cpt_shopping_cart_info (justify-self:end in the cartrow grid area)
   already lands at right:374 - i.e. cart already matches the search
   bar's right edge with no changes needed. The cartrow grid row itself
   spans top:176/bottom:210 (34px tall, confirmed via
   .sci_topbg tr's own rect: 226px total height, minus the 16px bottom
   padding and 34px cart height leaves 176px, matching search's own
   bottom of 166 plus the grid's 10px row-gap - the numbers reconcile
   exactly). left:16px mirrors the search bar's own left edge; top:180px
   vertically centers the 25px-tall icon inside that 34px row
   (176 + (34-25)/2 = 180.5, rounded down to 180). */
.toggle {
	left: 16px;
	right: auto;
	top: 180px;
}

/* Round 7 continued: .all_wrapper{margin:0 24px} (main.css, completely
   unguarded - no @media wraps it anywhere in the file) is load-bearing
   for DESKTOP's decorative corner-border system (.sci_lt{left:-24px} and
   friends need that exact 24px of margin to have somewhere to render
   their corner graphics into) but was never given a mobile override.
   On a 390px viewport that's 48px total - over 12% of the screen -
   burned as blank white margin on both sides, live-measured via
   getBoundingClientRect() (.all_wrapper: left:24, right:366, width:342
   against window.innerWidth:390) rather than judged from a screenshot.
   Confirmed this is a real, static CSS margin, not a testing-tool
   artifact: margin values don't vary with devicePixelRatio by spec (DPR
   only affects pixel density, never CSS layout math), and the gap is
   plainly visible on re-inspection of round 7's own earlier "after"
   screenshot too - missed then because that check focused on the
   internal zone1/zone2 seam and never explicitly measured the outermost
   container's edges against the viewport width. Removing the margin on
   mobile (not reducing it) is safe: nothing else was found relying on it
   there - the desktop-only corner decorations it exists for
   (.sci_lt/.sci_lb/.sci_rb corner GIFs) are separately unaffected since
   this rule only touches .all_wrapper's own margin, not those elements'
   own positioning rules. */
.all_wrapper {
	margin: 0;
}

} /* @media (max-width: 800px) */


/* ============================================================================
   PHASE 5 (2026-08-18) - homepage category grid: icon cards, no subcategories
   ============================================================================
   Subcategories removed from the homepage entirely per approved decision -
   card is icon + name + [count], click goes straight to the category page.
   Root cause of the previously-flagged mobile 8px overflow
   (td.cat_image/td.cat_name, ~right:398 vs innerWidth:390, first found round
   8/9 above) is fixed as a side effect: this block no longer relies on the
   table's cellpadding="5" HTML attribute at all (padding is 0'd below and
   real spacing comes from the grid's own gap), so the old
   content-box-width:100%-plus-padding conflict can't recur.

   ARCHITECTURE - category_id -> icon key mapping:
   Smarty in this install is 2.6.9 (confirmed in Smarty.class.php) - no
   array-literal syntax in templates - and {php} template blocks are blocked
   (class.view.php/class.viewsc.php both set security=true,
   php_handling=SMARTY_PHP_QUOTE), so a real "config array, ID-keyed, one
   line per category, with fallback" can only live in PHP. It lives in
   Test::$CategoryGridIcons (modules/test/class.test.php, cpt_root_categories()) -
   every row gets $row['grid_icon'] (falls back to 'tag' if the categoryID
   isn't in the map - a new category added in admin never renders a blank
   card) and $row['grid_label'] (falls back to the real name - only used for
   the one category whose real name is too long for 2-3 lines on a card).
   root_categories.html (shared across every theme, not just sci - confirmed
   via Theme::templates_info, which only lets themes override index.html/
   home.html/product_info.html/main.css/head.html, not component templates
   like this one) only gained two inert attributes (data-cat-id, data-icon)
   and a label swap that defaults back to the original value - byte-identical
   output on every other theme, since $category_icon_map is never assigned
   there.

   Icon key -> actual pictogram is entirely here (sci-only), as CSS
   mask-image data-URIs (feather-style: viewBox 0 0 24 24, stroke-width 2,
   round caps/joins, no fill - same language as the header silhouettes/cart/
   WhatsApp icons) so they inherit color via mask + background-color instead
   of needing real inline <svg> markup in a shared template. Paths here are
   the same ones reviewed in the approved mockup; consider them draft/legible
   rather than pixel-final vector work.

   Desktop grid uses the approved "Compact" density (5 columns). Mobile ships
   the "2 columns compact" density below; "2 columns spacious" is kept as a
   commented-out alternate block immediately after it - swap by commenting/
   uncommenting the relevant rules if the real-phone check (still required
   before commit, see tracking doc) prefers the roomier version. */

#container_main_content .cpt_root_categories td.cat_image img,
#container_main_content .cpt_root_categories .home_page_category_logo {
	display: none;
}
#container_main_content .cpt_root_categories .rcat_child_categories {
	display: none;
}
#container_main_content .cpt_root_categories td.cat_image::before {
	content: '';
	display: block;
	background-color: #0085B0;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="battery_cell"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='3' width='10' height='19' rx='2'/%3E%3Crect x='10' y='1' width='4' height='2'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='10' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='3' width='10' height='19' rx='2'/%3E%3Crect x='10' y='1' width='4' height='2'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='10' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="battery_block"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='8' width='20' height='12' rx='1'/%3E%3Crect x='6' y='4' width='3' height='4'/%3E%3Crect x='15' y='4' width='3' height='4'/%3E%3Cline x1='6.5' y1='12' x2='9.5' y2='12'/%3E%3Cline x1='8' y1='10.5' x2='8' y2='13.5'/%3E%3Cline x1='14.5' y1='12' x2='17.5' y2='12'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='8' width='20' height='12' rx='1'/%3E%3Crect x='6' y='4' width='3' height='4'/%3E%3Crect x='15' y='4' width='3' height='4'/%3E%3Cline x1='6.5' y1='12' x2='9.5' y2='12'/%3E%3Cline x1='8' y1='10.5' x2='8' y2='13.5'/%3E%3Cline x1='14.5' y1='12' x2='17.5' y2='12'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="plug"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2v5'/%3E%3Cpath d='M15 2v5'/%3E%3Cpath d='M6 7h12v4a6 6 0 0 1-6 6 6 6 0 0 1-6-6V7z'/%3E%3Cpath d='M12 17v5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2v5'/%3E%3Cpath d='M15 2v5'/%3E%3Cpath d='M6 7h12v4a6 6 0 0 1-6 6 6 6 0 0 1-6-6V7z'/%3E%3Cpath d='M12 17v5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="smartphone"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cline x1='11' y1='18' x2='13' y2='18'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cline x1='11' y1='18' x2='13' y2='18'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="camera"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h3l2-2h6l2 2h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h3l2-2h6l2 2h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="screwdriver"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='13' y='1' width='7' height='4' rx='1' transform='rotate(45 16.5 3)'/%3E%3Cline x1='14' y1='7' x2='5' y2='19'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='13' y='1' width='7' height='4' rx='1' transform='rotate(45 16.5 3)'/%3E%3Cline x1='14' y1='7' x2='5' y2='19'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="remote"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='3'/%3E%3Ccircle cx='12' cy='7' r='1.3'/%3E%3Cline x1='9' y1='11' x2='15' y2='11'/%3E%3Cline x1='9' y1='14' x2='15' y2='14'/%3E%3Cline x1='9' y1='17' x2='15' y2='17'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='3'/%3E%3Ccircle cx='12' cy='7' r='1.3'/%3E%3Cline x1='9' y1='11' x2='15' y2='11'/%3E%3Cline x1='9' y1='14' x2='15' y2='14'/%3E%3Cline x1='9' y1='17' x2='15' y2='17'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="watch"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='7' width='10' height='10' rx='2'/%3E%3Cpath d='M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3'/%3E%3Cpath d='M9 17v3a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-3'/%3E%3Cline x1='12' y1='10' x2='12' y2='12'/%3E%3Cline x1='12' y1='12' x2='13.5' y2='13'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='7' width='10' height='10' rx='2'/%3E%3Cpath d='M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3'/%3E%3Cpath d='M9 17v3a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-3'/%3E%3Cline x1='12' y1='10' x2='12' y2='12'/%3E%3Cline x1='12' y1='12' x2='13.5' y2='13'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="cube3d"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4.5v9L12 20l-8-4.5v-9z'/%3E%3Cpath d='M12 11V2M12 11l8-4.5M12 11l-8-4.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4.5v9L12 20l-8-4.5v-9z'/%3E%3Cpath d='M12 11V2M12 11l8-4.5M12 11l-8-4.5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="touchpanel"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='14' height='10' rx='1'/%3E%3Cline x1='7' y1='18' x2='13' y2='18'/%3E%3Ccircle cx='19' cy='17' r='1'/%3E%3Ccircle cx='19' cy='17' r='3.2'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='14' height='10' rx='1'/%3E%3Cline x1='7' y1='18' x2='13' y2='18'/%3E%3Ccircle cx='19' cy='17' r='1'/%3E%3Ccircle cx='19' cy='17' r='3.2'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="pin"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-7.58 7-13a7 7 0 1 0-14 0c0 5.42 7 13 7 13z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-7.58 7-13a7 7 0 1 0-14 0c0 5.42 7 13 7 13z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="disc"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="tablet_home"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='2'/%3E%3Ccircle cx='12' cy='19' r='1.2'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='2'/%3E%3Ccircle cx='12' cy='19' r='1.2'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="laptop"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='10' rx='1'/%3E%3Cpath d='M2 18h20l-2-4H4z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='10' rx='1'/%3E%3Cpath d='M2 18h20l-2-4H4z'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="tablet_plain"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='12' rx='2'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='12' rx='2'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="tv_mount"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='12' rx='1'/%3E%3Cpath d='M12 15v3'/%3E%3Cpath d='M12 18h4'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='12' rx='1'/%3E%3Cpath d='M12 15v3'/%3E%3Cpath d='M12 18h4'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="pda"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='10' height='17' rx='2'/%3E%3Ccircle cx='11' cy='16.5' r='1'/%3E%3Cline x1='18' y1='4' x2='20' y2='2'/%3E%3Cline x1='19' y1='5' x2='21' y2='3'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='10' height='17' rx='2'/%3E%3Ccircle cx='11' cy='16.5' r='1'/%3E%3Cline x1='18' y1='4' x2='20' y2='2'/%3E%3Cline x1='19' y1='5' x2='21' y2='3'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="converter"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M13 7l-4 6h3l-1 4 4-6h-3z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M13 7l-4 6h3l-1 4 4-6h-3z'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="cable"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12c3-4 6 4 9 0s6 4 9 0'/%3E%3Crect x='1' y='10' width='4' height='4' rx='1'/%3E%3Crect x='19' y='10' width='4' height='4' rx='1'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12c3-4 6 4 9 0s6 4 9 0'/%3E%3Crect x='1' y='10' width='4' height='4' rx='1'/%3E%3Crect x='19' y='10' width='4' height='4' rx='1'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="sdcard"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h8l4 4v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cline x1='9' y1='3' x2='9' y2='9'/%3E%3Cline x1='12' y1='3' x2='12' y2='9'/%3E%3Cline x1='15' y1='3' x2='15' y2='9'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h8l4 4v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cline x1='9' y1='3' x2='9' y2='9'/%3E%3Cline x1='12' y1='3' x2='12' y2='9'/%3E%3Cline x1='15' y1='3' x2='15' y2='9'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="drill"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='9' width='10' height='6' rx='1'/%3E%3Cpath d='M13 10h4l3 2-3 2h-4z'/%3E%3Cpath d='M6 15v3'/%3E%3Cline x1='20' y1='12' x2='23' y2='12'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='9' width='10' height='6' rx='1'/%3E%3Cpath d='M13 10h4l3 2-3 2h-4z'/%3E%3Cpath d='M6 15v3'/%3E%3Cline x1='20' y1='12' x2='23' y2='12'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="music"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 15V8l6-1.5V13'/%3E%3Ccircle cx='9' cy='15.5' r='1.7'/%3E%3Ccircle cx='15' cy='13.5' r='1.7'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 15V8l6-1.5V13'/%3E%3Ccircle cx='9' cy='15.5' r='1.7'/%3E%3Ccircle cx='15' cy='13.5' r='1.7'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="home"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7'/%3E%3Cpath d='M6 10v10h5v-6h2v6h5V10'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7'/%3E%3Cpath d='M6 10v10h5v-6h2v6h5V10'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="tower"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='10' height='16' rx='1'/%3E%3Ccircle cx='10' cy='6' r='0.8'/%3E%3Cline x1='7' y1='10' x2='13' y2='10'/%3E%3Cline x1='7' y1='13' x2='13' y2='13'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='10' height='16' rx='1'/%3E%3Ccircle cx='10' cy='6' r='0.8'/%3E%3Cline x1='7' y1='10' x2='13' y2='10'/%3E%3Cline x1='7' y1='13' x2='13' y2='13'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="headphones"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2'/%3E%3Crect x='2' y='14' width='5' height='7' rx='2'/%3E%3Crect x='17' y='14' width='5' height='7' rx='2'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2'/%3E%3Crect x='2' y='14' width='5' height='7' rx='2'/%3E%3Crect x='17' y='14' width='5' height='7' rx='2'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="shield"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="antenna"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='19' r='1.5'/%3E%3Cpath d='M8 15a6 6 0 0 1 8 0'/%3E%3Cpath d='M5 12a10 10 0 0 1 14 0'/%3E%3Cpath d='M2 9a14 14 0 0 1 20 0'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='19' r='1.5'/%3E%3Cpath d='M8 15a6 6 0 0 1 8 0'/%3E%3Cpath d='M5 12a10 10 0 0 1 14 0'/%3E%3Cpath d='M2 9a14 14 0 0 1 20 0'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="car"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5'/%3E%3Crect x='2' y='13' width='20' height='5' rx='1.5'/%3E%3Ccircle cx='7' cy='18' r='1.5'/%3E%3Ccircle cx='17' cy='18' r='1.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5'/%3E%3Crect x='2' y='13' width='20' height='5' rx='1.5'/%3E%3Ccircle cx='7' cy='18' r='1.5'/%3E%3Ccircle cx='17' cy='18' r='1.5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="gamepad"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='10' rx='5'/%3E%3Cline x1='6' y1='10' x2='6' y2='14'/%3E%3Cline x1='4' y1='12' x2='8' y2='12'/%3E%3Ccircle cx='16' cy='11' r='1'/%3E%3Ccircle cx='18' cy='13' r='1'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='10' rx='5'/%3E%3Cline x1='6' y1='10' x2='6' y2='14'/%3E%3Cline x1='4' y1='12' x2='8' y2='12'/%3E%3Ccircle cx='16' cy='11' r='1'/%3E%3Ccircle cx='18' cy='13' r='1'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="tag"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12l-8 8-9-9V3h8z'/%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12l-8 8-9-9V3h8z'/%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3C/svg%3E");
}

#container_main_content .cpt_root_categories td.cat_image[data-icon="shirt"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3l4 2 4-2 3 4-3 2v10a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9L5 7z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3l4 2 4-2 3 4-3 2v10a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9L5 7z'/%3E%3C/svg%3E");
}


/* ---- desktop: Compact density, 5 columns (approved variant) ---- */
/* minmax(0, 1fr) not bare 1fr (2026-09-22, part of the sidebar table-to-flex
   fix): a plain 1fr grid track has an implicit min-width of auto, i.e. the
   track cannot shrink below its content's own min-content width - the exact
   same trap that caused the old 3-column table to freeze instead of shrink.
   At 801-870px this grid's own 5 fixed-floor columns needed ~629px no
   matter how much room the flex row above actually gave #container_main_content,
   causing internal overflow even after the outer sidebar row itself could
   shrink correctly. minmax(0, 1fr) removes that inner floor the same way
   min-width:0 removed it on the outer flex row. */
@media (min-width: 801px) {

#container_main_content .cpt_root_categories table {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 14px;
	width: 100%;
	border: 0;
}
#container_main_content .cpt_root_categories tbody {
	display: contents;
}
#container_main_content .cpt_root_categories tr {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	background: #ffffff;
	border: 1px solid #C7C7C7;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	padding: 14px;
	box-sizing: border-box;
	min-width: 0;
	transition: box-shadow .15s ease, transform .15s ease;
}
#container_main_content .cpt_root_categories tr:hover {
	box-shadow: 0 4px 14px rgba(20, 30, 45, .12);
	transform: translateY(-1px);
}
#container_main_content .cpt_root_categories td.cat_image,
#container_main_content .cpt_root_categories td.cat_name {
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
	vertical-align: top;
}
#container_main_content .cpt_root_categories td.cat_image a:not(.home_page_category_logo) {
	position: static;
	display: block;
}
#container_main_content .cpt_root_categories td.cat_image::before {
	width: 32px;
	height: 32px;
	margin: 0 auto 8px;
}
#container_main_content .cpt_root_categories .rcat_root_category {
	font-size: 12.5px;
	line-height: 1.3;
	font-weight: bold;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	text-decoration: none;
	border-bottom: none;
	color: #496BAB;
}
#container_main_content .cpt_root_categories .rcat_products_num {
	display: block;
	margin-top: 4px;
	font-size: 10.5px;
	color: #8A97A3;
}

}

/* ---- mobile: 2 columns, "compact" density (build+test this one first) ---- */
@media (max-width: 800px) {

#container_main_content .cpt_root_categories table {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	width: 100%;
	border: 0;
}
#container_main_content .cpt_root_categories tbody {
	display: contents;
}
#container_main_content .cpt_root_categories tr {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	background: #ffffff;
	border: 1px solid #C7C7C7;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	padding: 12px;
	box-sizing: border-box;
}
#container_main_content .cpt_root_categories td.cat_image,
#container_main_content .cpt_root_categories td.cat_name {
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
}
#container_main_content .cpt_root_categories td.cat_image a:not(.home_page_category_logo) {
	position: static;
	display: block;
}
#container_main_content .cpt_root_categories td.cat_image::before {
	width: 36px;
	height: 36px;
	margin: 0 auto 6px;
}
#container_main_content .cpt_root_categories .rcat_root_category {
	font-size: 12px;
	line-height: 1.3;
	font-weight: bold;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	text-decoration: none;
	border-bottom: none;
	color: #496BAB;
}
#container_main_content .cpt_root_categories .rcat_products_num {
	display: block;
	margin-top: 4px;
	font-size: 10px;
	color: #8A97A3;
}

/* ---- mobile alternate: "spacious" density - both variants CDP-tested
   2026-08-18 (390px, full-page overflow scan, explicit getBoundingClientRect
   on the longest label): compact = 2432px block height, spacious = 2972px,
   zero overflow offenders and zero label clipping on either one. Compact is
   left active by default (denser, ~18% shorter). Swap in this block by
   commenting the compact declarations above out and uncommenting these -
   final call is the real-phone check per the tracking doc, not this diff. ----
#container_main_content .cpt_root_categories tr {
	padding: 18px;
}
#container_main_content .cpt_root_categories td.cat_image::before {
	width: 48px;
	height: 48px;
	margin: 0 auto 8px;
}
#container_main_content .cpt_root_categories .rcat_root_category {
	font-size: 13px;
}
#container_main_content .cpt_root_categories .rcat_products_num {
	font-size: 11px;
}
---- end spacious alternate ---- */

}

/* ============================================================================
   PHASE 5 (2026-08-18) - mobile menu drill-down (slide-in), #mcatnav
   ============================================================================
   Markup/JS: sci's own index.html (#mcatnav, empty container) + head.js
   (renders/drives it from the #mcatnav-data JSON, see the class.test.php
   entry in the tracking doc for where that data comes from). Unguarded
   display:none below is the universal safe default - #mcatnav can only ever
   be opened by clicking .toggle, which main.css only makes visible/sized
   inside its own @media(max-width:800px) block, but this file has been
   burned before by relying on that alone (round 8's sidebar-width bug) so
   the real "is-open" styling is also kept mobile-only on purpose. */
#mcatnav {
	display: none;
}

@media (max-width: 800px) {

#mcatnav.is-open {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	background: #ffffff;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	font-family: Arial, Helvetica, sans-serif;
}

body.mcatnav-locked {
	overflow: hidden;
}

.mcatnav-screen {
	min-height: 100%;
	display: flex;
	flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) {
	.mcatnav-anim-forward { animation: mcatnavInRight .2s ease both; }
	.mcatnav-anim-back { animation: mcatnavInLeft .2s ease both; }
}
@keyframes mcatnavInRight {
	from { transform: translateX(24px); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}
@keyframes mcatnavInLeft {
	from { transform: translateX(-24px); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}

.mcatnav-hdr {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 12px;
	background: linear-gradient(180deg, #5c82c4, #496bab);
	color: #ffffff;
}
.mcatnav-back,
.mcatnav-close {
	flex: none;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(255, 255, 255, .16);
	border-radius: 9px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}
.mcatnav-back svg {
	width: 18px;
	height: 18px;
}
.mcatnav-close {
	font-size: 22px;
	line-height: 1;
	margin-left: auto;
}
.mcatnav-title,
.mcatnav-crumbs {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .3px;
	text-align: center;
}
.mcatnav-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mcatnav-crumbs {
	/* Deliberately NOT nowrap+ellipsis: the JS side already caps this to at
	   most "Katalogs / … / parent / current" (see crumbHtml() in head.js),
	   so a second, CSS-level truncation on top of that would silently eat
	   the most useful part - the level you're actually looking at - behind
	   the browser's own "...". Confirmed live on the deepest real branch
	   (Mobilo telefonu piederumi > Rezerves daļas > Klaviatūras): single-line
	   ellipsis cut it down to "KATALOGS / ... / REZERVES DAĻAS / ...",
	   losing "Klaviatūras" entirely. Wrapping to up to 2 lines costs a little
	   header height but never hides the current level. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 1.25;
}
.mcatnav-crumb-sep {
	opacity: .6;
	text-transform: none;
	font-weight: 400;
	margin: 0 1px;
}

.mcatnav-viewall {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 10px 12px 0;
	padding: 11px 13px;
	background: #eef4fb;
	border: 1px solid #cfe0f2;
	border-radius: 9px;
	color: #0085b0;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
}
.mcatnav-viewall-count {
	font-size: 12px;
	font-weight: 600;
	color: #496bab;
	white-space: nowrap;
	flex: none;
}

.mcatnav-list {
	list-style: none;
	margin: 8px 0 24px;
	padding: 0;
	flex: 1 1 auto;
}
.mcatnav-row {
	display: flex;
	align-items: stretch;
	border-bottom: 1px solid #eef1f4;
}
.mcatnav-name {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 14px;
	font-size: 14.5px;
	font-weight: 600;
	color: #26313d;
	text-decoration: none;
}
.mcatnav-name:active {
	background: #f5f8fb;
}
.mcatnav-count {
	margin-left: 6px;
	font-size: 11.5px;
	font-weight: 400;
	color: #8a97a3;
	font-variant-numeric: tabular-nums;
}
.mcatnav-chev {
	flex: none;
	width: 52px;
	min-height: 44px;
	border: none;
	border-left: 1px solid #eef1f4;
	background: #ffffff;
	color: #0085b0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}
.mcatnav-chev:active {
	background: #f0f7fa;
}
.mcatnav-chev svg {
	width: 16px;
	height: 16px;
}
.mcatnav-empty,
.mcatnav-empty-row {
	padding: 24px 16px;
	color: #8a97a3;
	font-size: 13.5px;
	text-align: center;
}

}

/* ==========================================================================
   PHASE 6 — PREORDER WARNING, RED/DANGER VARIANT OF .notice (2026-08-19)
   Reuses the Phase 2 .notice structure (flex/icon/box) for a second,
   higher-severity tone: paid-in-advance preorder items from an external
   warehouse (delayed delivery), as opposed to .notice's amber operational
   tone above. Modifier only - adds a class alongside .notice, does not
   redefine display/layout/spacing, only the color set.

   Three call sites (all verified via SC_local + template grep, see
   DESIGN_PHASE_CHANGES.md for the full audit):
     - shopping_cart.html (cart_preorder_warning) - shared (non-theme)
       template. Kept the pre-existing .error_block/.error_flag classes
       ADDITIVELY alongside notice/notice--danger (not replaced) so any
       other theme, if ever activated, still gets its own main.css's
       .error_block{color:red;font-weight:bold} fallback instead of an
       unstyled block - same reasoning already applied to root_categories.html
       in Phase 5 (CONF_CURRENT_THEME is fixed to sci, but degrade gracefully
       rather than assume).
     - product_price.html -> prd_preorder (SC_local, all 3 languages) -
       markup lives in the translation value itself, same pattern as
       Go_Welcome/welcome_to_storefront in Phase 2.
   Icon markup is byte-identical to .notice's (Feather/Lucide alert-triangle,
   stroke="currentColor") - only re-colored via CSS, per the ask.
   ========================================================================== */
.notice--danger {
	/* width:100% - the shared .notice rule relies on block auto-width, which
	   is fine everywhere .notice is already used (verified working, not
	   touched here) but a sibling of this box (.cpt_product_price on the
	   product page) sits inside a <table> using auto layout, where a flex
	   container's own box can resolve to a shrink-to-fit width instead of
	   filling its parent (mobile 390px: measured 86px instead of 386px,
	   found via CDP inspection 2026-08-19) - forcing width explicitly here,
	   scoped to the danger modifier only, sidesteps it without touching the
	   base .notice rule other call sites already depend on. */
	width: 100%;
	box-sizing: border-box;
	background: #FBE4E4;
	border-color: #E8A3A3;
	border-left-color: #C23B3B;
	color: #4A1818;
}
.notice--danger svg {
	color: #C23B3B;
}
.notice--danger p {
	min-width: 0;
}

/* ==========================================================================
   PHASE 7 — SITE-WIDE ALERT MODAL (2026-08-19)
   Admin-editable popup (Ruki > Alert, replaces the old Printeshanai tab -
   see sql/site_alert_division.sql, modules/adminscreens/_methods/site_alert.php)
   shown centered over every storefront page via templates/frontend/frame.html.
   Reuses .notice's amber tokens/icon as-is (same visual language as the
   Phase 2 storefront notice) inside a fixed-position overlay - this is a
   layout/positioning modifier only, no new color palette.
   ========================================================================== */
.site-alert-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 24, 30, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 9999;
}
.notice--modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	margin: 0;
	padding-right: 40px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}
.notice-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: #4A3A18;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.notice-modal-close:hover {
	background: rgba(74, 58, 24, .08);
}

/* ==========================================================================
   Footer redesign (2026-08-20) — Variant B (Full): flexbox/grid + SVG icons,
   replaces the old <table>-based #container_footer / .contact / .callus /
   .sci_down_l / .sci_down_r / .url_subscr markup and GIF sprites entirely.
   None of the old classes/ids above are referenced by the new markup in
   index.html, so their old main.css rules are simply dead now - left alone
   there on purpose per the "new CSS goes in custom.css, don't touch
   main.css" rule (Dizains' theme-CSS editor overwrites main.css wholesale,
   no versioning).
   ========================================================================== */

#site-footer.ftr {
	background: #F7F8FA;
	border-top: 3px solid #496BAB;
	margin: 0;
	padding: 0;
	color: #333;
}

.ftr-navrow {
	background: #F0F0F0;
	padding: 12px 24px;
}
.ftr-navrow .cpt_divisions_navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	max-width: 1200px;
	margin: 0 auto;
}
.ftr-navrow .cpt_divisions_navigation a {
	color: #496BAB;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}
.ftr-navrow .cpt_divisions_navigation a:hover {
	text-decoration: underline;
	color: #0085B0;
}

.ftr-info {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 28px 24px;
}

.ftr-card {
	background: #FFFFFF;
	border: 1px solid #C7C7C7;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s ease, transform .15s ease;
}
.ftr-card:hover {
	box-shadow: 0 4px 14px rgba(20, 30, 45, .12);
	transform: translateY(-1px);
}
.ftr-card__head {
	background: #496BAB;
	color: #fff;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: .04em;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ftr-card__head svg {
	width: 15px;
	height: 15px;
	flex: none;
}
.ftr-card__body {
	padding: 14px 14px 16px;
	font-size: 13px;
}

.ftr-contact-line {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}
.ftr-contact-line:last-child {
	margin-bottom: 0;
}
.ftr-contact-line svg {
	width: 16px;
	height: 16px;
	flex: none;
	color: #0085B0;
}
.ftr-contact-line a {
	color: #333;
	text-decoration: none;
	font-weight: 600;
}
.ftr-contact-line a:hover {
	color: #0085B0;
	text-decoration: underline;
}

.ftr-legal-name {
	font-weight: bold;
	color: #496BAB;
	margin: 0 0 6px;
}
.ftr-legal-lines {
	margin: 0;
	color: #777;
}
.ftr-legal-address {
	margin-top: 8px;
	font-weight: 600;
	color: #333;
}

.ftr-hours {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}
.ftr-hours td {
	/* main.css has a blanket "td { display:none; }" inside its own
	   @media(max-width:800px) block (a pre-existing mobile hack for a
	   different table elsewhere) - it would otherwise hide every cell
	   in this table too below 800px. ".ftr-hours td" outranks the bare
	   "td" selector on specificity regardless of source order, so this
	   explicit display wins and actually shows the hours on mobile. */
	display: table-cell;
	padding: 3px 0;
}
.ftr-hours td:first-child {
	font-weight: bold;
	color: #496BAB;
	width: 30px;
}
.ftr-hours td:last-child {
	text-align: right;
	color: #777;
}
.ftr-hours--off td:last-child {
	color: #B8442E;
}

.ftr-card--map .ftr-card__body {
	padding: 0;
}
.ftr-card--map iframe {
	width: 100%;
	height: 180px;
	border: 0;
	display: block;
}

.ftr-copyright {
	border-top: 1px solid #C7C7C7;
	padding: 14px 24px;
	text-align: center;
	font-size: 12.5px;
	color: #777;
}
.ftr-copyright a {
	color: #777;
	text-decoration: underline;
}

@media (max-width: 800px) {
	.ftr-info {
		grid-template-columns: 1fr;
		padding: 20px 16px;
		gap: 14px;
	}
	.ftr-navrow .cpt_divisions_navigation ul {
		flex-direction: column;
		gap: 10px;
	}
}

/* Desktop-only Rekvizīti text block (2026-08-24) — replaces the 4-card
   .ftr-info grid above on desktop, where it 1:1 duplicates the right
   sidebar (Kontakti/Darba laiks/Atrašanās vieta). Sidebar content is
   display:none below 800px (main.css's mobile block), so .ftr-info stays
   untouched and remains mobile's only source for this info. Hidden by
   default so a media-query miss fails closed (no duplicate), not open. */
.ftr-legal-desktop {
	display: none;
	text-align: center;
	padding: 20px 24px;
}
.ftr-legal-desktop__name {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: bold;
	color: #496BAB;
}
.ftr-legal-desktop__line {
	margin: 2px 0 0;
	font-size: 12.5px;
	color: #777;
}

/* ==========================================================================
   Checkout mobile layout rework (2026-09-16) — table -> flex
   Recon found checkout.html / checkout.your_info_ajax.html were raw <table>
   layouts with hardcoded px widths, and neither this file's own mobile work
   nor main.css's older @media(max-width:800px) block ever touched checkout -
   the redesign's mobile pass was scoped to header/footer/sidebar only. This
   converts checkout.html, checkout.your_info_ajax.html, the shipping/billing
   method radio lists (checkout.shipping_ajax.html / checkout.billing_ajax.html)
   and the confirmation step's submit/terms block to a flex-based .chk-*
   pattern. #cart_content_tbl (the actual line-item table in
   checkout.confirmation_ajax.html) is left as a real <table> - it's genuine
   tabular data, not layout, and already has its own mobile handling further
   up in this file / in main.css.

   address_form.html / address_form_light.html (shared with register.html and
   the account address editor) got a new opt-in `flexrows` param - only
   checkout's own {include} calls pass flexrows=1; every other caller
   (register.html's wholesaler address block, address_editor.tpl.html,
   change_address.html) doesn't pass it and keeps emitting the original bare
   <tr> rows unchanged, so this rework has zero effect on those pages.

   Base rules below intentionally reproduce today's desktop table look (label
   column ~180px, field ~275px, .row_odd/.row_even striping moved from the
   old `<td>`-scoped main.css rules onto the whole .chk-row) so there's no
   desktop regression. The @media(max-width:800px) block further down is the
   actual mobile fix: stacked label-above-field, full-width inputs, and
   shipping/payment method rows that wrap the price/service-select onto its
   own line instead of compressing the radio+logo+name into an overflow. */

.chk-block {
	width: 100%;
	box-sizing: border-box;
}
.chk-section {
	padding: 6px 0;
}
.chk-divider {
	border-top: 1px solid #CCCCCC;
	margin: 4px 0;
}
.chk-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 6px 0;
}
.chk-row.row_odd {
	background-color: #F2F8FF;
}
.chk-row.row_even {
	border-top: 1px solid #D9E9FF;
	border-bottom: 1px solid #D9E9FF;
}
.chk-row__label {
	flex: 0 0 180px;
	max-width: 180px;
	padding-top: 4px;
	box-sizing: border-box;
}
.chk-row__field {
	flex: 1 1 auto;
	min-width: 0;
}
.chk-field-input {
	width: 275px;
	max-width: 100%;
	box-sizing: border-box;
}
.chk-ccode {
	display: flex;
	align-items: center;
	gap: 8px;
}

.chk-methods {
	display: flex;
	flex-direction: column;
}
.chk-method {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #EEEEEE;
}
.chk-method:last-child {
	border-bottom: none;
}
/* Fixed-size box regardless of the source image's own dimensions (2026-09-16
   fix) - logos are raw admin-uploaded files (bank.gif/paypal.gif/cash.gif/
   makecommerce.svg/...) with wildly different native pixel sizes and no
   shared aspect ratio. Left unconstrained, each card's icon column took a
   different width, which is what was actually making the radio/title
   position "different" between methods (e.g. PayPal vs the card/internet
   banking option) - not a different template path, both render through the
   exact same loop; verified by reading the loop in checkout.billing_ajax.html.
   A wide unconstrained logo could also eat most of a narrow screen's width,
   forcing the title to wrap onto its own line below the icon - this fixed
   box removes that failure mode everywhere, not just on mobile. */
.chk-method__logo {
	flex: 0 0 44px;
	width: 44px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.chk-method__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}
.chk-method__radio {
	flex: 0 0 auto;
}
.chk-method__info {
	flex: 1 1 auto;
	min-width: 0;
}
.chk-method__price {
	flex: 0 0 auto;
	white-space: nowrap;
	text-align: right;
	margin-left: auto;
	padding-left: 10px;
}

.chk-confirm-actions {
	text-align: center;
}
.chk-terms-agree {
	display: block;
	font-weight: normal;
	margin: 8px 0;
}
.chk-checkout-btn-row {
	text-align: center;
	margin-top: 8px;
}
.chk-checkout-btn {
	font-size: 20px;
}

@media (max-width: 800px) {
	/* Comfortable side margin (2026-09-16) - text/fields/radios were sitting
	   flush against the screen edges with zero side inset. border-box above
	   keeps this padding from adding to .chk-block's own 100% width (which
	   would reintroduce horizontal overflow). */
	.chk-block {
		padding-left: 14px;
		padding-right: 14px;
	}

	.chk-row {
		flex-direction: column;
		gap: 4px;
		padding: 10px 0;
	}
	.chk-row__label {
		flex: 0 0 auto;
		max-width: 100%;
		padding-top: 0;
		font-weight: bold;
	}
	.chk-row__field {
		width: 100%;
	}
	.chk-field-input {
		width: 100%;
	}

	.chk-method {
		gap: 8px;
		padding: 12px 0;
	}
	/* Bigger logo box on mobile (2026-09-17) - on a real phone the logos
	   (PayPal especially) looked noticeably smaller than the method name text
	   next to them. First attempt at this only grew the box's HEIGHT
	   (44x30 -> 44x40) and had zero visible effect - checked the actual files
	   (bank.gif/cash.gif/paypal.gif/makecommerce.svg) and every one of them is
	   168x40, a ~4.2:1 wide/flat aspect ratio. With
	   max-width:100%/max-height:100%/width:auto/height:auto (.chk-method__logo
	   img below), a 44px-WIDE box is always what caps the rendered size
	   (44/4.2 ≈ 10.5px tall) - box height was never the limiting dimension, on
	   desktop either, so raising it did nothing. Widening the box instead
	   (44 -> 72px, confirmed via real headless-Chrome screenshots comparing
	   44/72/88) gets a genuinely bigger, legible logo (~72/4.2 ≈ 17px tall)
	   without forcing the shipping row's name+price back onto two lines (see
	   the .chk-method__price select comment below) - 88px started eating
	   into that same margin for no real readability gain over 72px. Height is
	   bumped to 36px only to keep the box tall enough to vertically center
	   that ~17px image with breathing room; it isn't the acting constraint. */
	.chk-method__logo {
		flex-basis: 72px;
		width: 72px;
		height: 36px;
	}
	/* Price/service-select now stays on the same line as the name (2026-09-16)
	   - it used to be forced to flex-basis:100%, dropping to its own row
	   under the icon on every method that had a price. With the logo now a
	   fixed 44px box (see the base .chk-method__logo rule above), there's
	   consistently enough room for name + price on one line; select is
	   capped so a rare multi-rate shipping method's dropdown can't force a
	   wrap on its own. */
	.chk-method__price select {
		max-width: 110px;
	}

	.chk-checkout-btn {
		width: 100%;
	}

	/* Density pass (2026-09-16): shipping/payment method descriptions
	   ("Norādīt pasūtījumā pakomāts...", PayPal's commission blurb, etc.)
	   are real content, not layout noise - kept in the DOM/markup (screen
	   readers, no-JS, desktop) and only hidden here below 800px so the
	   method list stays scannable (name + icon + price) without the page
	   growing a full paragraph per option on a narrow screen. */
	.chk-method__desc {
		display: none;
	}
}
/* ====================== end checkout mobile rework ====================== */

/* ==========================================================================
   JivoChat floating widget - mobile compacting (2026-09-16)
   Third-party live-chat embed (code.jivosite.com/widget.js, tag lives in
   index.html - the site-wide shell every storefront page renders through,
   confirmed live: same #jvLabelWrap/#jcont markup present on the homepage,
   search results, and checkout). Its default "ON-LINE Konsultants..." label
   pill is position:fixed, ~300px wide, pinned bottom-left - on a narrow
   phone that's most of the screen width, sitting over whatever form field
   happens to scroll into that bottom band (reported: E-pasts/Tālruņa
   numurs on checkout).

   Jivo injects its own stylesheet asynchronously, after this file, so a
   plain override on width/sizing loses the cascade war even with
   !important (verified live - width stayed 300px regardless). What DOES
   reliably win: !important on properties Jivo's own dynamic CSS doesn't
   also fight for the same specificity - background, display, and
   pointer-events. So instead of trying to resize Jivo's box, this hides
   the promotional text label and the wrapper's own painted gradient
   background (leaving only its actual small logo icon visible), then uses
   pointer-events to make the now-invisible remainder of that 300px box
   click/tap-through to whatever is underneath (verified via
   elementFromPoint at several points across the old label's footprint -
   only the visible icon itself still intercepts taps). Result: a small
   corner icon instead of a near-full-width bar, and the invisible leftover
   space no longer blocks input on the fields under it either. #jcont (the
   actual chat window, opened only on a deliberate tap) is left untouched -
   that covering the screen when the visitor asked for it is expected,
   unlike the passive label. */
@media (max-width: 800px) {
	#jvLabelWrap {
		pointer-events: none !important;
		background: transparent !important;
		background-image: none !important;
	}
	#jvLabelWrap [class*="text__"] {
		display: none !important;
	}
	#jvLabelWrap [class*="hoverArea__"] {
		pointer-events: none !important;
	}
	#jvLabelWrap [class*="container__"] {
		pointer-events: auto !important;
	}
}
/* ==================== end JivoChat mobile compacting ==================== */

/* ==========================================================================
   Product page mobile layout rework (2026-09-16) — table -> flex
   product_info.html was a raw <table> wrapping every product block (name,
   the site-wide "Uzmanību!!!" notice, then images/price/add2cart/
   description/details/related-products all in one <td>). Two compounding
   bugs on top of the table itself:
   1. product_images.html's main picture wrapper had a hardcoded inline
      width (CONF_PRDPICT_STANDARD_SIZE+32 = 432px on this shop, admin-
      configurable, not a theme constant) with no viewport-relative cap at
      all - guaranteed horizontal overflow under ~432px. Fixed in the
      template itself by adding max-width:100%/box-sizing:border-box
      alongside the existing inline width (so width still wins on desktop,
      max-width clamps it on mobile), not fought via CSS here.
   2. .cpt_product_images{float:left} (main.css, unconditional, no
      media-query override) never clears on mobile, so price/button/
      description text had nowhere to flow once the oversized image
      claimed the row.
   The "Uzmanību!!!" notice clipping itself needed no separate CSS patch -
   it's a display:flex box (.notice, see the Phase 2/6 rules above) that
   was shrinking to fit inside the <table>'s auto-layout <td> (the exact
   failure mode already documented on .notice--danger above, measured
   86px instead of 386px) - removing the table removes that failure mode
   at the root, same reasoning as .notice--danger's fix without touching
   the base .notice rule other pages depend on.
   Also restores product info main.css's mobile block was silently
   dropping: its `#prddeatailed_container span{display:none}` rule (partial
   pre-redesign mobile support) only re-shows .totalPrice, so .regularPrice
   (strikethrough old price), the savings badge, and the SKU were invisible
   on mobile - re-shown below using the same technique. */
.prd-block {
	width: 100%;
	box-sizing: border-box;
}
.prd-gallery__main img,
.prd-thumbs img {
	max-width: 100%;
	height: auto;
}
.prd-related__thumb {
	max-width: 100px;
	height: auto;
}

@media (max-width: 800px) {
	.prd-block {
		padding-left: 14px;
		padding-right: 14px;
	}

	/* main.css floats .cpt_product_images with no mobile override - clear
	   it here so price/button/description stack below the gallery instead
	   of being squeezed into whatever width is left beside it. */
	#prddeatailed_container .cpt_product_images {
		float: none;
		width: 100%;
	}
	/* No width override needed here - product_images.html's own inline
	   max-width:100% (added alongside the existing inline width) already
	   clamps the gallery to whatever room is left once the float above is
	   cleared; margin:auto just centers it within that space. */
	.prd-gallery, .prd-thumbs {
		margin: 0 auto;
	}

	/* main.css's own mobile block hides every <span> inside
	   #prddeatailed_container and only re-shows .totalPrice - these are
	   the other real price/SKU spans from product_price.html that were
	   silently dropped as a side effect, not intentionally hidden content. */
	#prddeatailed_container .regularPrice,
	#prddeatailed_container .youSaveLabel,
	#prddeatailed_container .youSavePrice,
	#prddeatailed_container .productCodeLabel,
	#prddeatailed_container .productCode {
		display: inline !important;
	}

	.prd-related {
		width: 100%;
	}
}
/* ==================== end product page mobile rework ==================== */

/* ==========================================================================
   Shopping cart mobile layout rework (2026-09-16) — table -> flex
   shopping_cart.html's #cart_content_tbl was a <table> with a <colgroup>
   of PERCENTAGE column widths (10/50/15/20/5). Percentages only look
   viewport-proportional; with the default table-layout:auto the browser
   still sizes columns from their content, and the price cell's
   `nowrap="nowrap"` (plus the thumbnail's own pixel width attribute)
   claims its full natural width regardless of the colgroup hint - on a
   narrow screen that squeezes whatever's left for the name column into a
   sliver, so a long product name wraps one or two words per line instead
   of using the actual available width (reported live: "Akumulators
   (analogs) HP Pavilion 14,15, Touchsmart 14, 15, 248 G1, 340 G1, 350 G1,
   LA04 (14.8V 2200mAh)" rendered as a ~10-line-tall single-word column).
   main.css's own mobile block does set table-layout:fixed under
   max-width:800px, which would make the colgroup's 50% actually binding -
   but 50% of a 320-375px screen is still only ~160-190px, nowhere near
   "full width", so a genuinely long name is still badly cramped even with
   that legacy fix working as intended. Converting to flex removes the
   percentage-column ceiling entirely: the name cell gets 100% of the row
   width on mobile via the .cart-row-break trick below, not a fixed share
   of it.

   #cart_content_tbl is also the id used by checkout.confirmation_ajax.html's
   order summary table - that one is genuine tabular data (real <table>,
   deliberately left alone in the checkout rework) and is NOT touched here;
   these .cart-* rules only match the shopping-cart page's own markup
   (divs, no <td>), so the two don't interact despite sharing the id
   across different pages.

   .cart-row-break is the standard flexbox "force a new line" trick: a
   zero-height, flex-basis:100% spacer between the name cell and the
   qty/price/remove cells. Hidden (not in flow) on desktop so the row
   stays a single line there; only takes effect inside the mobile
   media query. */
.cart-page-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
}
.cart-items {
	width: 100%;
}
.cart-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	box-sizing: border-box;
}
.cart-row--item {
	align-items: flex-start;
}
.cart-row--header {
	font-weight: bold;
}
.cart-row.row_odd {
	background-color: #F2F8FF;
}
.cart-row.row_even {
	border-top: 1px solid #D9E9FF;
	border-bottom: 1px solid #D9E9FF;
}
.cart-row-break {
	display: none;
}
.cart-cell--thumb {
	flex: 0 0 60px;
	text-align: center;
}
.cart-cell--name {
	flex: 1 1 auto;
	min-width: 0;
}
.cart-cell--qty {
	flex: 0 0 90px;
	text-align: center;
}
.cart-cell--price {
	flex: 0 0 100px;
	text-align: center;
	white-space: nowrap;
}
.cart-cell--remove {
	flex: 0 0 32px;
	text-align: center;
}
.cart-cell--wide {
	flex: 1 1 auto;
}
.cart-row-spacer {
	height: 30px;
}
.cart-row--checkout {
	text-align: right;
}

@media (max-width: 800px) {
	.cart-page-header {
		padding-left: 14px;
		padding-right: 14px;
		box-sizing: border-box;
	}
	.cart-items {
		padding-left: 14px;
		padding-right: 14px;
		box-sizing: border-box;
	}

	.cart-row--header {
		display: none;
	}

	.cart-row--item {
		flex-wrap: wrap;
	}
	.cart-row-break {
		display: block;
		flex-basis: 100%;
		height: 0;
	}
	.cart-cell--qty, .cart-cell--price, .cart-cell--remove {
		flex: 0 0 auto;
		text-align: left;
	}
	.cart-cell--qty {
		margin-left: 68px;
	}

	.cart-row--summary, .cart-row--total {
		flex-wrap: wrap;
	}
	.cart-cell--wide {
		flex-basis: 100%;
	}

	.cart-row--checkout {
		text-align: center;
	}

	/* main.css's own mobile block relatively-offsets #cart_total
	   (position:relative; top:57px; right:15px) - a hand-tuned nudge built
	   for the old table row's geometry, so it could sit next to the
	   checkout button below it. In this flex layout that offset instead
	   drags the total price down on top of the checkout button. Reset it
	   here rather than in main.css (Dizains overwrites that file wholesale
	   on save, per the existing project convention - all new CSS goes in
	   this file). */
	#cart_total {
		position: static;
		top: auto;
		right: auto;
	}
}
/* ==================== end shopping cart mobile rework ==================== */

@media (min-width: 801px) {
	.ftr-info {
		display: none;
	}
	.ftr-legal-desktop {
		display: block;
	}
	.ftr-navrow .cpt_divisions_navigation ul {
		justify-content: center;
	}
}

/* ==========================================================================
   SIDEBAR 3-COLUMN LAYOUT: table -> flex (2026-09-22)
   Replaces the old <table><td id="container_left_sidebar">/... structure
   (index.html) with a plain <div id="sci-3col"> flex row wrapping divs of
   the same three IDs. Root cause fixed: table-layout:auto froze all three
   columns at their combined intrinsic min-content width (measured live,
   801-1122px inclusive on the homepage - MIGRATION_CHECKLIST.md §52.3
   recon) once that combined min-content exceeded the viewport - overflow,
   not shrink. A flex row has the exact same trap by default (flex items
   also default to min-width:auto = their own min-content) unless the
   flexing item is given an explicit min-width:0, which is the actual fix
   here - #container_main_content can now compress below its own intrinsic
   content width instead of forcing the row to overflow.
   align-items:stretch (flex default) replicates the table's own default
   cross-axis behavior - sidebar card backgrounds/borders still span the
   full row height like they did as <td>. Left/right sidebar widths are
   untouched (main.css's own width:179px/170px still apply as flex-basis
   via `width` when flex-basis is auto; the existing
   @media(min-width:801px){#container_left_sidebar{width:290px}} override
   further up this file is unaffected).

   CORRECTION same day: `flex: 1 1 auto` (first shipped version) was wrong
   for wide desktop widths - caught by live getBoundingClientRect() A/B
   measurement against the pre-fix table markup (git-show of the parent
   commit), not visually. `flex-basis:auto` falls back to the item's own
   intrinsic/content-based width when it has no CSS `width` (main.css's
   `#container_main_content{width:"*"}` is invalid CSS, so it has none) -
   and that intrinsic width can exceed the row's actual available space
   even when there's no real overflow. The flex algorithm treats that as
   negative free space and shrinks EVERY item with the (default) `flex-
   shrink:1`, including the sidebars, which have no explicit `flex` of
   their own. Measured live at 1280px: left sidebar 290px->221px, right
   170->... wait, right's OWN width:170px also got shrunk to measured
   224px->170px (both sidebars shrank ~24%, not just the right one the
   owner happened to notice) - a real proportions regression, never
   deployed (caught pre-FTP). Fix: `flex-basis:0%` instead of `auto` - the
   standard "fill remaining space" flex idiom, which makes the row's
   free-space math start from 0 for this item instead of its content size,
   so grow supplies 100% of the leftover space and shrink is never
   triggered on the sidebars at any width where the row actually fits.
   min-width:0 is still required (a min-width:auto item's own min-content
   floor is a separate axis from flex-basis and still applies) - re-tested
   the full 700-1400px sweep after this change, see MIGRATION_CHECKLIST.md
   §53 correction entry.
   ========================================================================== */
#sci-3col {
	display: flex;
	align-items: stretch;
}
#container_main_content {
	flex: 1 1 0%;
	min-width: 0;
}

@media (max-width: 800px) {
	/* Mobile already fully restacks via main.css's own width:100%/display:
	   block (left sidebar, main content) and position:absolute (right
	   sidebar, compact cart icon) - those rules work identically on a <div>
	   as they did on a <td>. The one thing that DOES need an explicit
	   override is #sci-3col's own display:flex above, which would otherwise
	   force the block children into a flex row and fight the intended
	   vertical stack. Reverting to display:block restores the exact
	   pre-existing mobile layout. */
	#sci-3col {
		display: block;
	}
}
