/* ==========================================================================
   nexus-store — "Our Shop" neon shelves (Concept 3) — nx-shelves.rN.css
   2026-10-14, front-end round (docs/design/menu-shelves.md). Behaviour: nx-shelves.rN.js.
   ".rN" = Cloudflare cache-buster: bump N (file name + config/theme.yml) on every change.
   r3 (2026-10-16, with nx-shelves.r5.js): no small icon beside tile names; "Popular today" list (6b).
   r4 (2026-10-16, with r6.js, Rich): desktop panel without shelf names, "Popular today" as a left sidebar, one fluid
   row of tiles per shelf at every width (no 10 -> 5 jump at 1279px), panel never taller than the window.
   r5 (2026-10-16, with r7.js, Rich): image centred in its square (was 4:3 pinned to the top and scaled 1.22, so it
   spilled past the outline); own menu images unmasked at 92%; smoke wisp inside the highlighted tile (4b).
   r7: denser wisp (own tokens). r6: .nx-shelves scope on the image rule: CE's `.elementor img { height: auto }` outranked it (4:3 box at the top).

   Everything here keys on classes the script adds (html.nx-shelves-on, .nx-shelves*), so with the script off or
   failed nothing applies and CE's own dropdown and burger menu work exactly as before.
     1 tokens           4 tiles + hover          7 reduced motion
     2 desktop panel    5 neon flicker-on        8 phone drawer
     3 smoke            6 shelves layout
   Motion is transform/opacity only (compositor): smoke drifts, tiles lift, tubes and outlines flicker. Nothing
   animates while the panel is closed (display:none) and the flicker plays on the first open per visit only.
   ========================================================================== */

/* 1. Tokens: the brand green (--nx-accent) as neon. Literal colours live only in this block. */
.nx-shelves {
  --nxsh-neon: var(--nx-accent, #8EB364);
  --nxsh-neon-core: #E4FBC9;                     /* tube core / lit text: 17:1 on the panel */
  --nxsh-glow: rgba(142, 179, 100, .8);
  --nxsh-glow-soft: rgba(142, 179, 100, .45);
  --nxsh-glow-faint: rgba(142, 179, 100, .25);
  --nxsh-bg: #060906;                            /* opaque: at any transparency the hero's white ad text shows through */
  --nxsh-bg-phone: #060906;
  --nxsh-line: rgba(242, 242, 242, .10);
  --nxsh-tile-bg: rgba(242, 242, 242, .025);
  --nxsh-smoke: rgba(200, 215, 190, .11);
  --nxsh-smoke-green: rgba(142, 179, 100, .10);
  --nxsh-wisp: rgba(215, 230, 205, .26);          /* the highlighted tile's wisp: denser than the panel haze */
  --nxsh-wisp-green: rgba(142, 179, 100, .30);
  --nxsh-shadow: 0 28px 70px rgba(0, 0, 0, .6);
  --nxsh-ink: var(--nx-text-strong, #F2F2F2);
  --nxsh-soft: var(--nx-text, #C9C9C9);
  --nxsh-muted: var(--nx-text-muted, #8A918A);
  --nxsh-head-w: 150px;
  font-family: var(--nx-font, Montserrat, sans-serif);
  color: var(--nxsh-ink);
  text-align: left;
}
.nx-shelves[hidden] { display: none !important; }
.nx-shelves ul { list-style: none; margin: 0; padding: 0; }
.nx-shelves a:not(#nx-x),
.nx-shelves a:not(#nx-x):hover,
.nx-shelves a:not(#nx-x):focus { color: var(--nxsh-ink); text-decoration: none; }
.nx-shelves a:focus-visible { outline: 3px solid var(--nx-amber, #F5B800); outline-offset: 2px; }

/* the CE sub-menu of the item the script took over; the caret turns while the panel is open */
html.nx-shelves-on .elementor-nav--main li.nx-shelves-trigger > ul.sub-menu { display: none !important; }
html.nx-shelves-on .elementor-nav--main li.nx-shelves-trigger > a .sub-arrow { transition: transform .2s ease; }
html.nx-shelves-on .elementor-nav--main li.nx-shelves-open > a .sub-arrow { transform: rotate(180deg); }

/* 2. Desktop panel: hangs under the header pill, full pill width */
.nx-shelves-host { position: relative; }
.nx-shelves--panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 40;
  padding: 18px 22px 20px;
  overflow: hidden;
  background: var(--nxsh-bg);
  border: 1px solid var(--nxsh-line);
  border-radius: 18px;
  box-shadow: var(--nxsh-shadow);
  max-height: calc(100vh - 110px);                /* short laptop screens: the panel scrolls instead of running off */
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity .16s ease, transform .16s ease;
}
.nx-shelves--panel.is-open { opacity: 1; transform: none; }
.nx-shelves--panel::after {                       /* hover bridge across the 10px gap to the pill */
  content: "";
  position: absolute;
  left: 0; right: 0; top: -12px; height: 12px;
}
.nx-shelves__body { position: relative; z-index: 1; }

/* 3. Smoke: four soft blobs (static gradients, no filter) drifting behind the shelves; transform only */
.nx-shelves__smoke {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}
.nx-shelves__smoke i {
  position: absolute;
  width: 520px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--nxsh-smoke), transparent);
  will-change: transform;
  animation: nxsh-drift 22s ease-in-out infinite alternate;
}
.nx-shelves__smoke i:nth-child(1) { left: -120px; top: 40%; }
.nx-shelves__smoke i:nth-child(2) { left: 30%; top: -140px; animation-duration: 28s; animation-delay: -6s; background: radial-gradient(closest-side, var(--nxsh-smoke-green), transparent); }
.nx-shelves__smoke i:nth-child(3) { right: -160px; top: 20%; animation-duration: 25s; animation-delay: -12s; }
.nx-shelves__smoke i:nth-child(4) { left: 55%; bottom: -180px; animation-duration: 31s; animation-delay: -3s; }
@keyframes nxsh-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(90px, -30px, 0) scale(1.15); }
  100% { transform: translate3d(-60px, 25px, 0) scale(.95); }
}

/* 4. Tiles: image, icon + name, optional count. Hover/focus: the outline lights, the tile lifts, the product glows */
.nx-shelves__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 8px 4px 10px;
  border-radius: 14px;
  text-align: center;
  transition: transform .2s ease;
}
.nx-shelves__tile::after {                        /* the neon outline: rests dark, lit on hover/focus */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1.5px solid var(--nxsh-neon-core);
  box-shadow: 0 0 3px var(--nxsh-neon), 0 0 10px var(--nxsh-neon), 0 0 24px var(--nxsh-glow-soft), inset 0 0 10px var(--nxsh-glow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.nx-shelves__fig { position: relative; z-index: 1; display: block; width: 100%; aspect-ratio: 1; }
.nx-shelves .nx-shelves__img {                   /* (two classes: beats CE's .elementor img { height: auto }) */
  position: absolute;                             /* fills the square box: centred, never pinned to the top */
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.22);
  transition: transform .3s ease, opacity .3s ease;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 54%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 54%, #000 62%, transparent 100%);
}
.nx-shelves__label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; }
.nx-shelves__ico {
  flex: none;
  width: 15px;
  height: 15px;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
  color: var(--nxsh-neon);
}
.nx-shelves__name {
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--nxsh-soft);
  transition: color .15s ease;
  overflow-wrap: break-word;
}
.nx-shelves__count { font-size: 11px; font-weight: 500; color: var(--nxsh-muted); }
.nx-shelves__tile:hover,
.nx-shelves__tile:focus-visible { transform: translate3d(0, -3px, 0); }
.nx-shelves .nx-shelves__tile:hover::after,
.nx-shelves .nx-shelves__tile:focus-visible::after { opacity: 1 !important; animation: none !important; }   /* (!: beats the flicker-on fill) */
.nx-shelves__tile:hover .nx-shelves__name,
.nx-shelves__tile:focus-visible .nx-shelves__name { color: var(--nxsh-neon-core); text-shadow: 0 0 8px var(--nxsh-glow); }
.nx-shelves__tile:hover .nx-shelves__img { transform: scale(1.32); }
.nx-shelves__tile:focus-visible { outline-offset: 3px; }
/* no image at all (no menu thumbnail and no category tile): the category icon stands in, large */
.nx-shelves__tile.is-noimg .nx-shelves__img { visibility: hidden; }
.nx-shelves__tile.is-noimg .nx-shelves__fig {
  background-color: var(--nxsh-neon);
  opacity: .5;
  -webkit-mask: var(--ico, none) center / 38% no-repeat;
  mask: var(--ico, none) center / 38% no-repeat;
}
/* own menu images (Mario's transparent 3D icons): no soft-edge mask (that was for photos with a background), drawn
   inside the box so they stay within the neon outline; hover lifts them a little */
.nx-shelves__tile--own .nx-shelves__img { transform: scale(.92); -webkit-mask-image: none; mask-image: none; }
.nx-shelves__tile--own:hover .nx-shelves__img,
.nx-shelves__tile--own:focus-visible .nx-shelves__img { transform: scale(1); }

/* 4b. Smoke wisp inside the highlighted tile (hover / keyboard focus only): two soft blobs rise from behind the
   product and thin out, clipped to the tile's rounded box */
.nx-shelves__wisp {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 14px;
  pointer-events: none;
}
.nx-shelves__wisp i {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 120%;
  aspect-ratio: 1.4;
  margin-left: -60%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--nxsh-wisp), transparent);
  opacity: 0;
}
.nx-shelves__wisp i:nth-child(2) { width: 90%; margin-left: -45%; background: radial-gradient(closest-side, var(--nxsh-wisp-green), transparent); }
.nx-shelves__tile:hover .nx-shelves__wisp i,
.nx-shelves__tile:focus-visible .nx-shelves__wisp i { animation: nxsh-wisp 2.6s ease-out infinite; }
.nx-shelves__tile:hover .nx-shelves__wisp i:nth-child(2),
.nx-shelves__tile:focus-visible .nx-shelves__wisp i:nth-child(2) { animation-delay: 1.3s; }
@keyframes nxsh-wisp {
  0%   { opacity: 0; transform: translate3d(0, 30%, 0) scale(.6); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate3d(0, -55%, 0) scale(1.25); }
}

/* r3: the small icon beside the name is gone (the markup no longer prints it); keep the rule harmless if cached */
.nx-shelves__label .nx-shelves__ico { display: none; }
/* "All flower" ends the first shelf: its name reads brighter */
.nx-shelves__tile--all .nx-shelves__name { color: var(--nxsh-ink); }

/* 5. Neon flicker-on (first open per visit: .is-ignite); later opens: .is-lit = already on */
.nx-shelves__h {
  display: block;
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--nxsh-neon-core) !important;
  text-shadow: 0 0 4px var(--nxsh-neon), 0 0 14px var(--nxsh-glow), 0 0 34px var(--nxsh-glow-soft);
  overflow-wrap: anywhere;
}
.nx-shelves__tube {
  position: absolute;
  left: var(--nxsh-head-w);
  right: 0;
  bottom: 4px;
  height: 3px;
  border-radius: 3px;
  background: var(--nxsh-neon-core);
  box-shadow: 0 0 4px var(--nxsh-neon), 0 0 12px var(--nxsh-neon), 0 0 30px var(--nxsh-glow), 0 -10px 40px var(--nxsh-glow-faint);
  pointer-events: none;
}
.nx-shelves.is-ignite .nx-shelves__tube { animation: nxsh-ignite 1.1s steps(1, end) both; }
.nx-shelves.is-ignite .nx-shelves__shelf + .nx-shelves__shelf .nx-shelves__tube { animation-delay: .25s; }
.nx-shelves.is-ignite .nx-shelves__h { animation: nxsh-ignite 1.1s steps(1, end) .1s both; }
.nx-shelves.is-ignite .nx-shelves__tile::after { animation: nxsh-blink .7s ease-out both; animation-delay: calc(.35s + var(--i, 0) * 45ms); }
.nx-shelves.is-ignite .nx-shelves__img { animation: nxsh-glowin .5s ease-out both; animation-delay: calc(.35s + var(--i, 0) * 45ms); }
@keyframes nxsh-ignite { 0% { opacity: 0; } 10% { opacity: .9; } 16% { opacity: .05; } 26% { opacity: 1; } 31% { opacity: .25; } 40%, 100% { opacity: 1; } }
@keyframes nxsh-blink { 0% { opacity: 0; } 25% { opacity: 1; } 40% { opacity: .3; } 55% { opacity: .9; } 100% { opacity: 0; } }
@keyframes nxsh-glowin { from { opacity: 0; } to { opacity: 1; } }

/* 6. Desktop shelves (r4): no names on screen, one row per shelf whatever the count, tiles share the width evenly
   and the names scale with the viewport; the tube runs the full width underneath */
.nx-shelves--panel .nx-shelves__shelf { position: relative; padding: 4px 0 18px; }
.nx-shelves--panel .nx-shelves__shelf + .nx-shelves__shelf { margin-top: 10px; }
.nx-shelves--panel .nx-shelves__tube { left: 0; }
.nx-shelves--panel .nx-shelves__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(4px, .6vw, 8px); }
.nx-shelves__h--sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* narrow tiles: the icon sits above the name so names keep whole words */
.nx-shelves--panel .nx-shelves__label,
.nx-shelves__shelf--strip .nx-shelves__label { flex-direction: column; gap: 5px; }
.nx-shelves--panel .nx-shelves__name { font-size: clamp(10.5px, .85vw, 12.5px); }
@media (max-width: 1279px) {
  .nx-shelves--panel { padding: 14px 16px 16px; }
}

/* 6b. "Popular today": a sidebar down the left of the desktop panel (nxShelves.popular from nxmenuicons 1.3.0).
   Without data there is no sidebar and the shelves take the full width. */
.nx-shelves__body.has-side {
  display: grid;
  grid-template-columns: clamp(150px, 15%, 200px) minmax(0, 1fr);
  column-gap: clamp(12px, 1.4vw, 20px);
  align-items: center;
}
.nx-shelves__main { min-width: 0; }
.nx-shelves__pop { padding: 10px 10px 8px; border-radius: 12px; border: 1px solid var(--nxsh-line); background: var(--nxsh-tile-bg); }
.nx-shelves__pop-h {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nxsh-neon);
}
.nx-shelves ol.nx-shelves__pop-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.nx-shelves__pop-link { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 6px; }
.nx-shelves__pop-item + .nx-shelves__pop-item .nx-shelves__pop-link { border-top: 1px solid var(--nxsh-line); }
.nx-shelves__pop-rank {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--nxsh-neon-core);
  box-shadow: 0 0 0 1.5px var(--nxsh-neon), 0 0 8px var(--nxsh-glow-soft);
}
.nx-shelves__pop-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--nxsh-soft); transition: color .15s ease; }
.nx-shelves__pop-link:hover .nx-shelves__pop-name,
.nx-shelves__pop-link:focus-visible .nx-shelves__pop-name { color: var(--nxsh-neon-core); text-shadow: 0 0 8px var(--nxsh-glow); }
.nx-shelves.is-ignite .nx-shelves__pop { animation: nxsh-glowin .5s ease-out .3s both; }

/* 7. Reduced motion: no flicker, no smoke, no fades, no lift (the outline still lights on hover/focus) */
@media (prefers-reduced-motion: reduce) {
  .nx-shelves, .nx-shelves *, .nx-shelves *::after { animation: none !important; transition: none !important; }
  .nx-shelves__smoke { display: none; }
  .nx-shelves--panel { transform: none; }
  .nx-shelves__tile:hover, .nx-shelves__tile:focus-visible { transform: none; }
  .nx-shelves__tile:hover .nx-shelves__img { transform: scale(1.22); }
  .nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__tile:hover .nx-shelves__img { transform: none; }
}

/* 8. Phone / tablet drawer (CE burger mode, <=1024px): fixed under the header bar, page scroll locked */
html.nx-shelves-lock, html.nx-shelves-lock body { overflow: hidden; }
.nx-shelves--drawer {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--nx-shelves-top, 56px);
  bottom: 0;
  z-index: 9990;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--nxsh-bg-phone);
  border-top: 1px solid var(--nxsh-line);
  opacity: 0;
  transition: opacity .16s ease;
}
.nx-shelves--drawer.is-open { opacity: 1; }
.nx-shelves--drawer .nx-shelves__smoke { position: fixed; top: var(--nx-shelves-top, 56px); }
.nx-shelves--drawer .nx-shelves__body { padding: 4px 0 24px; }
.nx-shelves--drawer .nx-shelves__shelf { position: relative; padding-bottom: 6px; }
.nx-shelves--drawer .nx-shelves__h { margin: 20px 16px 10px; font-size: 22px; text-shadow: 0 0 4px var(--nxsh-neon), 0 0 14px var(--nxsh-glow); }
.nx-shelves--drawer .nx-shelves__tube { position: relative; display: block; left: auto; right: auto; bottom: auto; margin: 4px 16px 8px; }
/* first shelf: swipeable strip */
.nx-shelves--drawer .nx-shelves__shelf--strip .nx-shelves__list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}
.nx-shelves--drawer .nx-shelves__shelf--strip .nx-shelves__list::-webkit-scrollbar { display: none; }
.nx-shelves--drawer .nx-shelves__shelf--strip .nx-shelves__item { flex: 0 0 112px; scroll-snap-align: start; }
/* the rest: two columns (three or four on tablets) */
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 0 12px;
}
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__tile { background: var(--nxsh-tile-bg); }
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__fig { aspect-ratio: 4 / 3; }
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__img { transform: none; }
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__tile:hover .nx-shelves__img { transform: scale(1.06); }
.nx-shelves--drawer .nx-shelves__shelf--grid .nx-shelves__name { font-size: 14px; }
.nx-shelves--drawer .nx-shelves__shelf--strip .nx-shelves__name { font-size: 12.5px; }
.nx-shelves--drawer .nx-shelves__tile { min-height: 44px; }
.nx-shelves--drawer .nx-shelves__ico { width: 16px; height: 16px; }
/* the other menu pages as pills */
.nx-shelves__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 20px 16px 8px;
  border-top: 1px solid var(--nxsh-line);
}
.nx-shelves__pages a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--nx-border-strong, rgba(242, 242, 242, .16));
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}
/* the CE burger, while it controls the drawer: same X as CE's own open state */
.elementor-menu-toggle.nx-shelves-active i { background: 0 0; }
.elementor-menu-toggle.nx-shelves-active i::before { top: 0; transform: rotate(45deg); transition-delay: 0s, .16s; }
.elementor-menu-toggle.nx-shelves-active i::after { bottom: 0; transform: rotate(-45deg); transition-delay: 0s, .16s; }
.elementor-menu-toggle:focus-visible { outline: 3px solid var(--nx-amber, #F5B800); outline-offset: 2px; }
.nx-shelves--drawer:focus { outline: none; }
