/* Product listing pages (/products, /c/{slug}, search): a cinematic hero in the category's hue, a glass
   filter bar, and the product grid. Loaded after shop.css. Hues come from the cg-k-* kinds (--h) shared with
   the home page category tiles; everything uses logical properties for Arabic. */

/* ---------- hero ---------- */
.lx { --px: 0; --py: 0; position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; min-block-size: 400px; margin-block: var(--s-6) var(--s-5); border-radius: 32px; color: #fff;
  background: radial-gradient(90% 90% at 78% 110%, oklch(0.42 0.16 var(--h) / .9), transparent 65%), radial-gradient(60% 80% at 0% 0%, oklch(0.3 0.1 var(--h) / .8), transparent 70%), oklch(0.13 0.03 var(--h)); }
.lx-all { --h: 268; }
.lx:not(.lx-all, [class*="cg-k-"]) { --h: 262; }
.lx::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .09), inset 0 1px 0 rgb(255 255 255 / .14); }

.lx-sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.lx-aur { position: absolute; aspect-ratio: 1; border-radius: 50%; mix-blend-mode: screen; }
.lx-aur1 { inline-size: 60%; inset-inline-end: -8%; inset-block-start: -55%; background: radial-gradient(closest-side, oklch(0.7 0.2 var(--h) / .75), transparent); animation: lx-drift 16s ease-in-out infinite alternate; }
.lx-aur2 { inline-size: 46%; inset-inline-start: -14%; inset-block-end: -60%; background: radial-gradient(closest-side, color-mix(in srgb, var(--hot) 70%, transparent), transparent); opacity: .5; animation: lx-drift 21s -6s ease-in-out infinite alternate-reverse; }
.lx-aur3 { inline-size: 36%; inset-inline-start: 38%; inset-block-end: -50%; background: radial-gradient(closest-side, oklch(0.75 0.17 calc(var(--h) + 60) / .6), transparent); opacity: .55; animation: lx-drift 25s -3s ease-in-out infinite alternate; }
@keyframes lx-drift { to { translate: 9% 11%; scale: 1.18; } }
.lx-stars { position: absolute; inset: 0; opacity: .5; animation: lx-twinkle 5s ease-in-out infinite alternate;
  background-image: radial-gradient(1.4px 1.4px at 8% 22%, #fff, transparent), radial-gradient(1px 1px at 18% 74%, #fff, transparent), radial-gradient(1.2px 1.2px at 31% 12%, #fff, transparent), radial-gradient(1px 1px at 44% 86%, #fff, transparent), radial-gradient(1.6px 1.6px at 52% 30%, #fff, transparent), radial-gradient(1px 1px at 61% 8%, #fff, transparent), radial-gradient(1.3px 1.3px at 69% 56%, #fff, transparent), radial-gradient(1px 1px at 77% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 86% 66%, #fff, transparent), radial-gradient(1px 1px at 94% 12%, #fff, transparent), radial-gradient(1.2px 1.2px at 97% 44%, #fff, transparent); }
@keyframes lx-twinkle { to { opacity: .15; } }
.lx-floor { position: absolute; inset-inline: -30%; inset-block-end: -4%; block-size: 58%; opacity: .55; background-image: linear-gradient(oklch(0.75 0.15 var(--h) / .55) 1px, transparent 1px), linear-gradient(90deg, oklch(0.75 0.15 var(--h) / .55) 1px, transparent 1px); background-size: 56px 56px; transform: perspective(380px) rotateX(68deg); transform-origin: 50% 100%; -webkit-mask-image: linear-gradient(to top, #000, transparent 78%); mask-image: linear-gradient(to top, #000, transparent 78%); animation: lx-grid 2.6s linear infinite; }
@keyframes lx-grid { to { background-position: 0 56px; } }
.lx-spot { position: absolute; inset: 0; background: radial-gradient(40% 60% at calc(70% + var(--px) * 22%) calc(50% + var(--py) * 24%), rgb(255 255 255 / .07), transparent 70%); }

/* copy */
.lx-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); padding: clamp(28px, 4.5vw, 56px); padding-inline-end: 0; }
.lx-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--s-2); padding: 0; list-style: none; font-size: var(--fs-sm); color: rgb(255 255 255 / .55); }
.lx-crumb a { color: rgb(255 255 255 / .72); text-decoration: none; transition: color var(--t-fast); }
.lx-crumb a:hover { color: #fff; }
.lx-crumb li + li::before { content: ""; display: inline-block; inline-size: 5px; block-size: 5px; margin-inline-end: 6px; border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; transform: rotate(45deg); opacity: .5; vertical-align: 2px; }
html[dir="rtl"] .lx-crumb li + li::before { transform: rotate(-135deg); }
.lx-crumb [aria-current="page"] { color: #fff; }
.store .lx-title { margin: 0; max-inline-size: 14ch; font-size: clamp(2.2rem, 4.8vw, 4rem); font-weight: 700; line-height: .96; letter-spacing: -.055em; color: #fff; text-wrap: balance; }
.lx-q .lx-title { max-inline-size: 18ch; font-size: clamp(1.9rem, 3.8vw, 3.2rem); overflow-wrap: anywhere; }
html[dir="rtl"] .store .lx-title { line-height: 1.2; letter-spacing: 0; }
.lx-sub { margin: 0; max-inline-size: 42ch; color: rgb(255 255 255 / .7); font-size: var(--fs-lg); line-height: 1.5; }
.lx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-start: var(--s-3); }
.lx-count { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border-radius: var(--r-full); background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: var(--fs-sm); color: rgb(255 255 255 / .8); }
.lx-count b { font-size: var(--fs-md); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lx-count i { position: relative; inline-size: 8px; block-size: 8px; border-radius: 50%; background: #3ddc84; }
.lx-count.zero i { background: rgb(255 255 255 / .4); } .lx-count.zero i::after { display: none; }
.lx-count i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: lx-ping 2s ease-out infinite; }
@keyframes lx-ping { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
.lx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: var(--r-full); background: #fff; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; transition: transform var(--t-med) var(--ease-out), background var(--t-fast); }
.lx-chip:hover { transform: translateY(-2px); background: oklch(0.94 0.04 var(--h)); color: var(--ink); text-decoration: none; }

/* stage: a glowing dais with the category's drawing floating above it */
.lx-stage { position: relative; z-index: 1; align-self: stretch; display: grid; place-items: end center; min-block-size: 100%; padding-block-end: 92px; }
.lx-beam { position: absolute; inset-block-start: -10%; inset-inline-start: 50%; inline-size: 70%; block-size: 95%; translate: -50% 0; background: linear-gradient(180deg, rgb(255 255 255 / .2), oklch(0.8 0.14 var(--h) / .1) 60%, transparent); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); filter: blur(12px); opacity: .7; animation: lx-beam 6s ease-in-out infinite alternate; }
html[dir="rtl"] .lx-beam { translate: 50% 0; }
@keyframes lx-beam { from { opacity: .45; } to { opacity: .85; } }
.lx-dais { position: absolute; inset-block-end: 28px; inset-inline-start: 50%; inline-size: min(92%, 440px); translate: -50% 0; overflow: visible; }
html[dir="rtl"] .lx-dais { translate: 50% 0; }
.lx-dais-glow { fill: oklch(0.7 0.18 var(--h) / .45); filter: blur(16px); }
.lx-dais-top { fill: oklch(0.32 0.1 var(--h) / .85); stroke: oklch(0.85 0.12 var(--h) / .55); stroke-width: 1.2; }
.lx-dais-ring { fill: none; stroke: oklch(0.85 0.14 var(--h) / .7); stroke-width: 1.4; stroke-dasharray: 6 4; animation: lx-ring 14s linear infinite; }
.lx-dais-ring2 { stroke: color-mix(in srgb, var(--hot) 80%, #fff); stroke-dasharray: 18 82; stroke-width: 2.4; stroke-linecap: round; animation-duration: 4.5s; filter: drop-shadow(0 0 6px var(--hot)); }
@keyframes lx-ring { to { stroke-dashoffset: -100; } }
.lx-motes { position: absolute; inset: 10% 15% 18%; }
.lx-motes i { position: absolute; inset-block-end: 0; inline-size: 4px; block-size: 4px; border-radius: 50%; background: oklch(0.9 0.1 var(--h)); box-shadow: 0 0 8px oklch(0.85 0.15 var(--h)); opacity: 0; animation: lx-mote 6s linear infinite; }
.lx-motes i:nth-child(1) { inset-inline-start: 8%; } .lx-motes i:nth-child(2) { inset-inline-start: 22%; animation-delay: -1.5s; animation-duration: 7s; }
.lx-motes i:nth-child(3) { inset-inline-start: 36%; animation-delay: -3s; } .lx-motes i:nth-child(4) { inset-inline-start: 50%; animation-delay: -4.2s; animation-duration: 8s; }
.lx-motes i:nth-child(5) { inset-inline-start: 63%; animation-delay: -.8s; } .lx-motes i:nth-child(6) { inset-inline-start: 76%; animation-delay: -2.4s; animation-duration: 6.5s; }
.lx-motes i:nth-child(7) { inset-inline-start: 88%; animation-delay: -5s; } .lx-motes i:nth-child(8) { inset-inline-start: 44%; animation-delay: -3.6s; animation-duration: 9s; inline-size: 3px; block-size: 3px; }
@keyframes lx-mote { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-260px); } }

.lx-art { position: relative; z-index: 2; display: block; inline-size: min(66%, 330px); translate: calc(var(--px) * -14px) calc(var(--py) * -10px); transition: translate 900ms var(--ease-out); animation: lx-arrive 1.1s 120ms var(--ease-out) backwards; }
.lx-in { display: block; animation: lx-bob 6s ease-in-out infinite; }
.lx-art .ca { direction: ltr; display: block; inline-size: 100%; block-size: auto; overflow: visible; filter: drop-shadow(0 28px 22px rgb(0 0 0 / .5)) drop-shadow(0 0 40px oklch(0.7 0.16 var(--h) / .35)); }
@keyframes lx-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(-1deg); } }
@keyframes lx-arrive { from { opacity: 0; translate: 0 40px; scale: .86; filter: blur(8px); } }

/* all products: a lineup of the store's own categories, the middle one in front */
.lx-line { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: center; inline-size: 100%; padding-inline: 4%; }
.lx-line .lx-p { --h2: var(--h); flex: 0 0 auto; inline-size: 30%; margin-inline: -4.5%; margin-block-end: 0; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
.lx-line .lx-p .ca { filter: drop-shadow(0 22px 18px rgb(0 0 0 / .55)) drop-shadow(0 0 30px oklch(0.7 0.16 var(--h) / .4)); }
.lx-line .lx-p:nth-child(1) { --i: 1; inline-size: 24%; translate: calc(var(--px) * -8px) calc(var(--py) * -6px - 4%); z-index: 1; }
.lx-line .lx-p:nth-child(2) { --i: 2; inline-size: 30%; translate: calc(var(--px) * -12px) calc(var(--py) * -8px - 10%); z-index: 2; }
.lx-line .lx-p:nth-child(3) { --i: 0; inline-size: 38%; translate: calc(var(--px) * -18px) calc(var(--py) * -12px); z-index: 4; }
.lx-line .lx-p:nth-child(4) { --i: 2; inline-size: 30%; translate: calc(var(--px) * -12px) calc(var(--py) * -8px - 10%); z-index: 2; }
.lx-line .lx-p:nth-child(5) { --i: 1; inline-size: 24%; translate: calc(var(--px) * -8px) calc(var(--py) * -6px - 4%); z-index: 1; }
.lx-line .lx-p:nth-child(even) .lx-in { animation-delay: -2s; } .lx-line .lx-p:nth-child(3n) .lx-in { animation-delay: -4s; }

/* ---------- filter bar ---------- */
.lx-bar { position: sticky; inset-block-start: calc(var(--lx-top, 76px) + 10px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block-end: var(--s-5); padding: 7px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 78%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent), 0 18px 40px -26px rgb(10 10 11 / .45); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); transition: box-shadow var(--t-med); }
.lx-bar.stuck { box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent), 0 22px 44px -22px rgb(10 10 11 / .5); }

.lx-seg { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: color-mix(in srgb, var(--text) 6%, transparent); overflow-x: auto; scrollbar-width: none; max-inline-size: 100%; }
.lx-seg::-webkit-scrollbar { display: none; }
.lx-seg a { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; min-block-size: 38px; padding: 0 16px; border-radius: var(--r-full); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; transition: color var(--t-med), background var(--t-med); }
.lx-seg a:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--text) 6%, transparent); }
.lx-seg a[aria-current="true"] { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 18px -10px rgb(10 10 11 / .7); }
/* app.js adds a pill that slides to the chosen option when one is clicked */
.lx-seg-pill { position: absolute; z-index: 0; inset-block: 3px; border-radius: var(--r-full); background: var(--ink); box-shadow: 0 8px 18px -10px rgb(10 10 11 / .7); transition: inset-inline-start 380ms var(--ease-out), inline-size 380ms var(--ease-out); }
.lx-seg.sliding a[aria-current="true"] { background: transparent; box-shadow: none; color: var(--text-2); }
.lx-seg.sliding a.to { color: var(--on-ink); }

.lx-sw { display: inline-flex; align-items: center; gap: 10px; min-block-size: 44px; padding: 0 16px 0 10px; border-radius: var(--r-full); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background var(--t-fast); }
.lx-sw:hover { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; color: var(--text); }
.lx-sw-t { position: relative; flex: none; inline-size: 38px; block-size: 22px; border-radius: var(--r-full); background: var(--border-strong); transition: background var(--t-med); }
.lx-sw-t span { position: absolute; inset-block-start: 3px; inset-inline-start: 3px; inline-size: 16px; block-size: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: inset-inline-start 300ms var(--ease-out); }
.lx-sw.on .lx-sw-t { background: #16a34a; }
.lx-sw.on .lx-sw-t span { inset-inline-start: 19px; }

.lx-price { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; padding: 3px 3px 3px 14px; border-radius: var(--r-full); background: color-mix(in srgb, var(--text) 6%, transparent); transition: box-shadow var(--t-med), background var(--t-med); }
.lx-price:focus-within { background: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.lx-price-l { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-inline-end: 4px; }
html[dir="rtl"] .lx-price-l { letter-spacing: 0; }
.lx-price input { inline-size: 92px; min-block-size: 38px; padding: 0 8px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; outline: none; }
.lx-price input::placeholder { color: var(--text-3); font-weight: 500; }
.lx-price input:focus { background: color-mix(in srgb, var(--text) 5%, transparent); }
.lx-price-dash { inline-size: 10px; block-size: 2px; border-radius: 2px; background: var(--text-3); }
.lx-price button { display: grid; place-items: center; inline-size: 38px; block-size: 38px; border: 0; border-radius: 50%; background: var(--blue); color: #fff; cursor: pointer; transition: transform var(--t-med) var(--ease-out), background var(--t-fast); }
.lx-price button:hover { background: color-mix(in srgb, var(--blue) 86%, #000); transform: translateX(2px); }
html[dir="rtl"] .lx-price button:hover { transform: translateX(-2px); }
.lx-clear { display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding: 0 14px; border-radius: var(--r-full); color: var(--blue); font-size: var(--fs-sm); font-weight: 650; text-decoration: none; }
.lx-clear:hover { background: var(--blue-soft); color: var(--blue); text-decoration: none; }

.lx-showing { margin: 0 0 var(--s-6); padding-inline: 6px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 550; font-variant-numeric: tabular-nums; }

/* ---------- grid: cards rise in as they scroll into view (app.js marks them) ---------- */
.js .lx-grid > .pc.lx-wait { opacity: 0; transform: translateY(26px) scale(.98); animation: none; }
.lx-grid > .pc.lx-shown { animation: lx-card 800ms var(--d, 0ms) var(--ease-out) both; }
@keyframes lx-card { from { opacity: 0; transform: translateY(26px) scale(.98); } }

/* ---------- pagination ---------- */
.lx-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-block: var(--s-16) var(--s-4); }
.lx-pg { display: inline-flex; align-items: center; gap: 8px; min-block-size: 50px; padding: 0 24px; border-radius: var(--r-full); background: var(--surface); box-shadow: 0 0 0 1px var(--border); color: var(--text); font-weight: 650; text-decoration: none; transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med); }
.lx-pg:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--text-3), 0 14px 26px -16px rgb(10 10 11 / .5); color: var(--text); text-decoration: none; }
.lx-pg-next { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.lx-pg-next:hover { color: var(--on-ink); box-shadow: 0 14px 26px -12px rgb(10 10 11 / .6); }
.lx-pg-now { padding: 0 14px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- empty ---------- */
.lx-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-16) var(--s-6); border-radius: 28px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); text-align: center; }
.lx-empty h2 { margin: 0; font-size: var(--fs-3xl); }
.lx-empty p { margin: 0 0 var(--s-3); max-inline-size: 44ch; color: var(--text-2); }
.lx-empty-ico { display: grid; place-items: center; inline-size: 72px; block-size: 72px; margin-block-end: var(--s-2); border-radius: 50%; background: var(--panel); color: var(--text-2); box-shadow: 0 0 0 10px color-mix(in srgb, var(--panel) 50%, transparent); }
.lx-empty-ico .i { inline-size: 28px; block-size: 28px; }
.lx-empty .q-cats { margin-block-start: var(--s-3); }

/* ---------- smaller screens ---------- */
@media (max-width: 1024px) {
  .lx { min-block-size: 340px; }
  .lx-copy { padding: 32px; padding-inline-end: 0; }
}
@media (max-width: 760px) {
  .lx { grid-template-columns: minmax(0, 1fr) 42%; min-block-size: 0; margin-block-start: var(--s-4); border-radius: 24px; }
  .lx-copy { gap: 8px; padding: 22px 0 24px 20px; padding-inline-end: 0; }
  html[dir="rtl"] .lx-copy { padding: 22px 20px 24px 0; }
  .lx-crumb { margin-block-end: 4px; font-size: var(--fs-xs); }
  .store .lx-title { font-size: clamp(1.75rem, 8vw, 2.3rem); }
  .lx-q .lx-title { font-size: clamp(1.45rem, 6.2vw, 1.9rem); }
  .lx-sub { display: none; }
  .lx-meta { margin-block-start: 6px; }
  .lx-count { padding: 7px 12px 7px 10px; }
  .lx-stage { padding-block-end: 34px; }
  .lx-art { inline-size: 84%; }
  .lx-dais { inline-size: 118%; inset-block-end: 6px; }
  .lx-line { padding-inline: 0; }
  .lx-crumb li:first-child { display: none; }
  .lx-crumb li:nth-child(2)::before { display: none; }
  .lx-line .lx-p:nth-child(n+4) { display: none; }
  .lx-line .lx-p { margin-inline: -5%; }
  .lx-line .lx-p:nth-child(1), .lx-line .lx-p:nth-child(3) { inline-size: 36%; translate: 0 -10%; z-index: 1; } .lx-line .lx-p:nth-child(2) { inline-size: 48%; translate: 0 0; z-index: 3; }

  .lx-bar { inset-block-start: calc(var(--lx-top, 64px) + 6px); gap: 4px; padding: 5px; border-radius: 22px; }
  .lx-seg { flex: 1 1 100%; }
  .lx-seg a { flex: 1 0 auto; justify-content: center; padding: 0 12px; }
  .lx-sw { padding-inline: 8px 10px; }
  .lx-price { flex: 1 1 0; min-inline-size: 0; margin-inline-start: 0; padding-inline-start: 10px; }
  .lx-price-l { display: none; }
  .lx-price input { inline-size: 0; flex: 1 1 0; min-inline-size: 0; padding-inline: 6px; }
  .lx-clear { flex: 1 1 100%; justify-content: center; min-block-size: 36px; }
  .lx-showing { margin-block-end: var(--s-4); }
}
@media (max-width: 420px) { .lx-sw { font-size: var(--fs-xs); } }

@media (prefers-reduced-motion: reduce) {
  .lx-aur, .lx-stars, .lx-floor, .lx-beam, .lx-dais-ring, .lx-motes i, .lx-in, .lx-art, .lx-count i::after, .lx-grid > .pc.lx-shown { animation: none !important; }
  .js .lx-grid > .pc.lx-wait { opacity: 1; transform: none; }
  .lx-motes { display: none; }
}
