/* Q Store — navy & silver skin (colours of the Q logo) over the ALFA storefront (same markup, same API).
   Only applies on <body data-brand="q">; vendor shops keep their own theme. */

body[data-brand="q"][data-theme="alfa"] {
  --bg: linear-gradient(180deg, #b8c9e6 0%, #d3ddef 30%, #eaf0fa 70%, #f6f8fc 100%);
  --bg-solid: #e6ecf6;
  --surface: rgba(255, 255, 255, .9);
  --surface-2: #f1f5fb;
  --text: #0c1f42;
  --muted: #4b5f80;
  --primary: #1d4f9e;
  --primary-2: #a9c4ec;
  --primary-ink: #ffffff;
  --accent: #4f8fe0;
  --gold: #8aa9d8;
  --gold-2: #e3ebf8;
  --ink: #0a1a38;
  --border: #c9d6ea;
  --ring: #1d4f9e;
  --cloud: #ffffff;
  --c1: #ffffff; --c2: #a9c4ec; --c3: #e3ebf8;
  --font-head: 'Cinzel', 'Playfair Display', serif;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(29, 79, 158, .16);
  --tile-border: 2px solid #ffffff;
  --cloud-opacity: .85;
}
/* Night sky in dark mode */
html[data-mode="dark"] body[data-brand="q"][data-theme="alfa"] {
  --bg: radial-gradient(1200px 700px at 50% -10%, #152f63 0%, #0a1834 55%, #050d1f 100%);
  --bg-solid: #081530;
  --surface: #0f2247;
  --surface-2: #142b58;
  --text: #e8eef8;
  --muted: #a3b4d0;
  --primary: #7fa9ec;
  --primary-2: #1f3f78;
  --primary-ink: #040c20;
  --accent: #a6c6f5;
  --gold: #b9cff2;
  --gold-2: #e3ebf8;
  --ink: #e8eef8;
  --border: #22396a;
  --ring: #7fa9ec;
  --cloud: #11254d;
  --cloud-opacity: .35;
}

/* ---- top utility bar + category bar ---- */
body[data-brand="q"] .util { background: linear-gradient(90deg, #0c2552, #1d4f9e 55%, #4f8fe0); color: #f2f6fc; }
body[data-brand="q"] .util a:hover { color: #ffffff; text-shadow: 0 0 10px #c9d9f3; }
body[data-brand="q"][data-theme="alfa"] .catnav { background: rgba(236, 241, 249, .92); }
html[data-mode="dark"] body[data-brand="q"][data-theme="alfa"] .catnav { background: rgba(8, 21, 48, .94); }
body[data-brand="q"] .mh-search { background: rgba(255, 255, 255, .95); border-color: #a9c4ec; }

/* ---- diamond wordmark: Q Store ---- */
body[data-brand="q"] .mh-word,
body[data-brand="q"] .h-word,
body[data-brand="q"] .pd-word {
  font-family: 'Cinzel Decorative', 'Cinzel', serif; font-weight: 900; letter-spacing: .12em;
  background: linear-gradient(115deg, #0c2552 0%, #2d63b8 22%, #9fc0f5 36%, #0c2552 52%, #1d4f9e 72%, #6d97dc 86%, #0c2552 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 1px #0c4f9a) drop-shadow(0 2px 6px rgba(29, 79, 158, .45));
  animation: kz-shine 5s linear infinite;
}
.promo.dark .pd-word { filter: drop-shadow(0 0 6px rgba(160, 220, 255, .7)); }
body[data-brand="q"] .mh-logo { position: relative; }
body[data-brand="q"] .mh-logo::before, body[data-brand="q"] .mh-logo::after {
  content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, transparent 20%), conic-gradient(from 45deg, transparent 0 20%, #fff 22% 28%, transparent 30% 45%, #fff 47% 53%, transparent 55% 70%, #fff 72% 78%, transparent 80%);
  border-radius: 50%; animation: kz-glint 3.2s ease-in-out infinite;
}
body[data-brand="q"] .mh-logo::before { top: 12%; left: 18%; }
body[data-brand="q"] .mh-logo::after { top: 30%; right: 12%; animation-delay: 1.6s; }
body[data-brand="q"] .mh-tag em { color: var(--primary); letter-spacing: .3em; text-transform: uppercase; font-family: 'Cinzel', serif; font-size: 12px; }
body[data-brand="q"] .mh-tag i { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
body[data-brand="q"] .crown-gold { filter: hue-rotate(175deg) saturate(1.6) brightness(1.15) drop-shadow(0 2px 4px rgba(29, 79, 158, .35)); }

@keyframes kz-shine { to { background-position: -250% 0; } }
@keyframes kz-glint { 0%, 70%, 100% { transform: scale(0) rotate(0); opacity: 0; } 80% { transform: scale(1.2) rotate(45deg); opacity: 1; } 90% { transform: scale(.6) rotate(90deg); opacity: .8; } }

/* ---- hero: glass card over the mall photo ---- */
body[data-brand="q"] .hero { border-radius: 26px; border: 3px solid #fff; box-shadow: 0 18px 50px rgba(29, 79, 158, .25); }
body[data-brand="q"] .hslide { background: linear-gradient(90deg, #dbe6f6 0%, #f2faff 50%, #dbe6f6 100%); }
body[data-brand="q"] .hslide.brand { background: radial-gradient(120% 140% at 50% 0%, #2a5fb3 0%, #0f2a5c 55%, #071733 100%); }
body[data-brand="q"] .hslide.brand .h-copy {
  margin: 14px 0; border-radius: 22px; background: rgba(8, 22, 52, .55); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(200, 216, 245, .5);
}
body[data-brand="q"] .hslide.brand .h-kicker, body[data-brand="q"] .hslide.brand .h-line { color: #eaf0fa; }
body[data-brand="q"] .hslide.brand .h-img img { border-radius: 18px; border: 3px solid rgba(255, 255, 255, .8); }
body[data-brand="q"] .hslide.brand .h-img { padding: 14px 10px; }
body[data-brand="q"] .btn, body[data-brand="q"] .pill-btn { background: linear-gradient(135deg, #1d4f9e, #4f8fe0); border-radius: 999px; }
html[data-mode="dark"] body[data-brand="q"] .btn { color: #fff; }

/* ---- cards & sections ---- */
body[data-brand="q"] .sec-title h2 { letter-spacing: .04em; }
body[data-brand="q"] .sec-title h2::after { content: ''; display: block; height: 3px; width: 64px; margin-top: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent), transparent); }
body[data-brand="q"] .pcard, body[data-brand="q"] .quick a, body[data-brand="q"] .trust-i { border-color: #fff; }
body[data-brand="q"] .main-store { border: 3px solid #fff; box-shadow: 0 0 0 3px #a9c4ec, var(--shadow); }
body[data-brand="q"] .main-store .badge { background: linear-gradient(135deg, #1d4f9e, #4f8fe0); color: #fff; }
body[data-brand="q"] .etc-tile { background: linear-gradient(135deg, #1d4f9e, #4f8fe0); }
body[data-brand="q"] .promo.dark { background: radial-gradient(circle at 20% 10%, #1f4a95, #081733 70%); }
body[data-brand="q"] .join { border-color: #a9c4ec; }
body[data-brand="q"] .cloud { filter: blur(6px); }
body[data-brand="q"] .story-ring, body[data-brand="q"] .stories .ring { outline-color: #4f8fe0; }

/* ================= Q Store wow layer (fx.js) ================= */
#kz-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body[data-brand="q"] #confetti { display: none; }
#kz-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #1d4f9e, #4f8fe0, #ffffff, #4f8fe0); box-shadow: 0 0 10px #7aa3e3; pointer-events: none; }
[dir="rtl"] #kz-progress { transform-origin: 100% 50%; }
#kz-glow { position: fixed; left: -160px; top: -160px; width: 320px; height: 320px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(150, 185, 245, .28), transparent 65%); mix-blend-mode: screen; transition: transform .12s linear; }
.kz-trail { position: fixed; width: 12px; height: 12px; margin: -6px; pointer-events: none; z-index: 70;
  background: conic-gradient(from 45deg, transparent 0 20%, #fff 22% 28%, transparent 30% 45%, #c9d9f3 47% 53%, transparent 55% 70%, #fff 72% 78%, transparent 80%);
  border-radius: 50%; animation: kz-trail .8s ease-out forwards; }
@keyframes kz-trail { from { transform: scale(1.2) rotate(0); opacity: 1; } to { transform: scale(0) rotate(180deg) translateY(14px); opacity: 0; } }

/* photos spinning on themselves */
body[data-brand="q"] .pcard .ph, body[data-brand="q"] .vtile { perspective: 900px; }
.kz-spin { animation: kz-spin 3.2s cubic-bezier(.45, .05, .55, .95); backface-visibility: visible; }
@keyframes kz-spin { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(180deg) scale(1.08); filter: brightness(1.25); } 100% { transform: rotateY(360deg) scale(1); } }
@media (hover: hover) { body[data-brand="q"] .pcard:hover .ph img { animation: kz-spin 2.6s cubic-bezier(.45, .05, .55, .95); } }

/* shine sweep on cards */
body[data-brand="q"] .pcard { position: relative; overflow: hidden; }
body[data-brand="q"] .pcard::after { content: ''; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: rotate(20deg) translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); pointer-events: none; }
@media (hover: hover) { body[data-brand="q"] .pcard:hover::after { transition: transform .9s ease; transform: rotate(20deg) translateX(520%); } }

/* glowing rotating border on Main Store + hero */
@property --kz-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
body[data-brand="q"] .main-store, body[data-brand="q"] .hero { border: 3px solid transparent !important;
  background-image: linear-gradient(var(--bg-solid), var(--bg-solid)), conic-gradient(from var(--kz-a), #1d4f9e, #bcd0f0, #ffffff, #4f8fe0, #1d4f9e) !important;
  background-origin: border-box !important; background-clip: padding-box, border-box !important; animation: kz-border 4s linear infinite; }
@keyframes kz-border { to { --kz-a: 360deg; } }

/* vendor tiles flip in when revealed */
body[data-brand="q"] .market.reveal .tile-wrap { transform: perspective(800px) rotateY(80deg); opacity: 0; transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .6s; }
body[data-brand="q"] .market.reveal.in .tile-wrap { transform: none; opacity: 1; animation: floaty 6s ease-in-out infinite; }
body[data-brand="q"] .market.reveal.in .tile-wrap:nth-child(2n) { transition-delay: .12s; }
body[data-brand="q"] .market.reveal.in .tile-wrap:nth-child(3n) { transition-delay: .24s; }
body[data-brand="q"] .reveal { transform: translateY(40px) scale(.97); }
body[data-brand="q"] .reveal.in { transform: none; }

/* ribbons crossing in an X */
.kz-x { position: relative; height: 150px; margin: 18px -12px 0; overflow: hidden; direction: ltr; }
.kz-ribbon { position: absolute; left: -10%; right: -10%; top: 50%; overflow: hidden; border-block: 2px solid #fff; }
.kz-ribbon.kz-blue { transform: translateY(-50%) rotate(-5deg); z-index: 2; background: linear-gradient(90deg, #0c2552, #1d4f9e, #4f8fe0, #1d4f9e, #0c2552);
  box-shadow: 0 12px 30px rgba(12, 37, 82, .4); }
.kz-ribbon.kz-white { transform: translateY(-50%) rotate(5deg); z-index: 1; background: linear-gradient(90deg, #ffffff, #eef2f9, #ffffff); border-color: #a9c4ec;
  box-shadow: 0 10px 26px rgba(29, 79, 158, .25); }
.kz-ribbon-track { display: flex; gap: 26px; width: max-content; padding: 11px 0; animation: scrollx 38s linear infinite; }
.kz-white .kz-ribbon-track { animation-direction: reverse; animation-duration: 44s; }
.kz-ribbon span { color: #fff; font: 800 15px/1 'Cinzel', 'Cairo', sans-serif; letter-spacing: .25em; white-space: nowrap; }
.kz-ribbon b { color: #c9d9f3; text-shadow: 0 0 10px #fff; }
.kz-white span { color: #0c2552; letter-spacing: .12em; font-family: 'Cairo', 'Cinzel', sans-serif; }
.kz-white b { color: #4f8fe0; text-shadow: none; }
html[data-mode="dark"] .kz-ribbon.kz-white { background: linear-gradient(90deg, #e4ebf7, #ffffff, #e4ebf7); }
@media (max-width: 640px) { .kz-x { height: 170px; } .kz-ribbon span { font-size: 13px; }
  .kz-ribbon.kz-blue { transform: translateY(-50%) rotate(-10deg); } .kz-ribbon.kz-white { transform: translateY(-50%) rotate(10deg); } }

/* 3D diamond showroom */
.kz-showroom { margin: 34px 0 10px; text-align: center; }
.kz-show-head h2 { margin: 0; font-family: 'Cinzel Decorative', 'Cairo', serif; font-size: clamp(24px, 6vw, 40px);
  background: linear-gradient(115deg, #1d4f9e, #4f8fe0 40%, #0c2552 70%, #1d4f9e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kz-show-head small { color: var(--muted); }
.kz-stage { position: relative; height: clamp(300px, 46vw, 430px); perspective: 1100px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; overflow: hidden; }
.kz-stage:active { cursor: grabbing; }
.kz-ring { --w: clamp(130px, 20vw, 190px); --r: calc(var(--w) * var(--n) / 5.6); position: absolute; left: 50%; top: 42%; width: var(--w); height: calc(var(--w) * 1.32);
  margin: calc(var(--w) * -0.66) 0 0 calc(var(--w) * -0.5); transform-style: preserve-3d; }
.kz-card { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; text-decoration: none; color: #fff;
  transform: rotateY(calc(360deg / var(--n) * var(--i))) translateZ(var(--r)); border: 3px solid #fff;
  box-shadow: 0 18px 40px rgba(12, 37, 82, .35), 0 0 0 1px #a9c4ec; background: #fff; -webkit-box-reflect: below 6px linear-gradient(transparent 70%, rgba(255, 255, 255, .25)); }
.kz-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.kz-card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 8px; font-weight: 800; font-size: 13px; background: linear-gradient(transparent, rgba(5, 25, 55, .85)); }
.kz-floor { position: absolute; left: 10%; right: 10%; bottom: 4%; height: 40px; border-radius: 50%; background: radial-gradient(ellipse, rgba(29, 79, 158, .35), transparent 70%); filter: blur(6px); }

/* stats */
.kz-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.kz-stat { text-align: center; padding: 18px 8px; border-radius: 22px; background: rgba(255, 255, 255, .55); border: 2px solid #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); }
html[data-mode="dark"] .kz-stat { background: rgba(15, 34, 71, .6); border-color: #22396a; }
.kz-stat b { display: block; font: 900 clamp(28px, 6vw, 46px)/1 'Cinzel', 'Cairo', serif; background: linear-gradient(180deg, #4f8fe0, #1d4f9e);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.kz-stat small { color: var(--muted); font-weight: 700; }
@media (max-width: 640px) { .kz-stats { grid-template-columns: repeat(2, 1fr); } }

/* Arabic typography */
[dir="rtl"] body[data-brand="q"], html[lang="ar"] body[data-brand="q"] { font-family: 'Cairo', 'Inter', sans-serif; }

@media (prefers-reduced-motion: reduce) {
  .kz-ribbon-track, body[data-brand="q"] .mh-word, body[data-brand="q"] .mh-word::after, body[data-brand="q"] .main-store, body[data-brand="q"] .hero { animation: none; }
  body[data-brand="q"] .market.reveal .tile-wrap, body[data-brand="q"] .reveal { transform: none; opacity: 1; }
}
@keyframes kz-wait-spin { to { transform: rotate(360deg); } }
/* site frozen and hidden while the intro plays (older phones could not decode the film otherwise) */
/* "Message the shop" bubble on the side opposite Q Store AI (both sat bottom-end: the AI hid it) */
body[data-brand="q"] .chat-fab, [dir="rtl"] body[data-brand="q"] .chat-fab { right: auto; left: auto; inset-inline-start: 18px; z-index: 81; }

/* ================= Q logo: spinning coin (header, hero, stage above the hero) ================= */
body[data-brand="q"] .mh-logo { display: grid; justify-items: center; }
.q-coin { display: block; width: 64px; perspective: 600px; margin-bottom: 2px; }
.q-coin img { display: block; width: 100%; height: auto; animation: t-coin 6s linear infinite; filter: drop-shadow(0 4px 8px rgba(12, 37, 82, .35)); }
.q-coin.big { width: clamp(90px, 14vw, 130px); margin: 0 auto 4px; }
.q-coin.big img { filter: drop-shadow(0 0 16px rgba(170, 200, 255, .75)); }
body[data-brand="q"] .mh-word { font-size: clamp(26px, 4.6vw, 40px); }
body[data-brand="q"] .hslide.brand .h-word { color: transparent; }
body[data-brand="q"] .mh-tag em { text-transform: none; letter-spacing: .08em; font-family: 'Cairo', 'Cinzel', serif; font-size: 13px; }

.q-stage { position: relative; display: grid; place-items: center; padding: 22px 0 6px; isolation: isolate; }
.q-stage .t-stage { width: 300px; height: 270px; }
.q-shop { --ray: rgba(79, 143, 224, .35); --orbit: rgba(79, 143, 224, .6); --dot: #8fb6ff; }
.q-shop .t-glow { background: radial-gradient(circle, rgba(79, 143, 224, .55), rgba(29, 79, 158, .15) 70%, transparent); }
.q-spin { width: 210px !important; filter: drop-shadow(0 10px 18px rgba(12, 37, 82, .4)) !important; }
.q-shop .t-txt b { background-image: linear-gradient(90deg, #0c2552, #2d63b8 50%, #0c2552); font-family: 'Cairo', sans-serif; font-size: clamp(22px, 3.4vw, 32px); }
html[data-mode="dark"] .q-shop .t-txt b { background-image: linear-gradient(90deg, #a9c4ec, #ffffff 50%, #a9c4ec); }
html[data-mode="dark"] .q-spin { filter: drop-shadow(0 0 18px rgba(150, 190, 255, .55)) brightness(1.25) !important; }
.q-stage .ts-sparkles i { color: #7fa9ec; }
.q-stage .ts-sparkles i:nth-child(3n) { color: #c9d9f3; }
@media (max-width: 640px) { .q-stage .t-stage { width: 230px; height: 210px; } .q-spin { width: 160px !important; } .q-coin { width: 52px; } }
@media (prefers-reduced-motion: reduce) { .q-coin img { animation: none; } }

/* ================= intro (intro.js): glass mall rising from the ground + fireball drawing the Q ================= */
#q-intro { position: fixed; inset: 0; z-index: 9999; background: #02040a; overflow: hidden; color: #fff; }
#q-intro[hidden] { display: none; }
#q-intro.out { opacity: 0; transition: opacity 1s ease; pointer-events: none; }
#q-intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#q-intro .qi-fire { pointer-events: none; mix-blend-mode: screen; }
#q-intro .qi-q { position: absolute; left: 50%; top: var(--qy, 38%); width: var(--qw, min(56vmin, 460px)); transform: translate(-50%, -50%); perspective: 900px; pointer-events: none; }
#q-intro .qi-q svg, #q-intro .qi-q img { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#q-intro .qi-q .qi-box { position: relative; width: 100%; aspect-ratio: 990 / 946; transform-style: preserve-3d; }
#q-intro .qi-q img { opacity: 0; }
#q-intro .qi-slogan { position: absolute; left: 0; right: 0; top: calc(var(--qy, 38%) + var(--qw, min(56vmin, 460px)) * .56); text-align: center; font: 700 clamp(18px, 3.6vw, 34px) 'Cairo', sans-serif;
  color: #e8eef8; opacity: 0; text-shadow: 0 0 18px rgba(120, 170, 255, .8), 0 2px 8px #000; pointer-events: none; padding: 0 16px; }
#q-intro .qi-slogan b { display: block; font: 900 clamp(26px, 6vw, 56px) 'Cinzel Decorative', 'Cinzel', serif; letter-spacing: .18em; margin-bottom: 4px;
  background: linear-gradient(115deg, #6d97dc, #fff 25%, #a9c4ec 45%, #fff 60%, #2d63b8 80%, #fff); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: kz-shine 3s linear infinite; }
#q-intro .qi-skip, #q-intro .qi-sound { position: absolute; top: max(14px, env(safe-area-inset-top)); z-index: 3; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .35);
  color: #fff; border-radius: 999px; min-height: 44px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#q-intro .qi-skip { right: 14px; padding: 10px 18px; font: 600 14px Inter, Cairo, sans-serif; }
#q-intro .qi-sound { left: 14px; width: 48px; font-size: 20px; }
#q-intro .qi-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% var(--qy, 38%), #fff 0%, rgba(255, 200, 120, .6) 25%, transparent 60%); opacity: 0; pointer-events: none; }
html.kz-intro-on body > :not(#q-intro) { visibility: hidden; }
html.kz-intro-on body > :not(#q-intro), html.kz-intro-on body > :not(#q-intro) * { animation-play-state: paused !important; }
/* wordmark on dark backgrounds (hero brand slide, dark promo, dark mode): silver instead of navy */
body[data-brand="q"] .hslide.brand .h-word, body[data-brand="q"] .promo.dark .pd-word, html[data-mode="dark"] body[data-brand="q"] .mh-word {
  background-image: linear-gradient(115deg, #a9c4ec 0%, #ffffff 20%, #c9d9f3 38%, #ffffff 52%, #7fa9ec 70%, #ffffff 86%, #a9c4ec 100%); }
