/* The store's public page (/). Built from the reference design at 390px (home-design.html): every size below is the
   design's. Mobile first, one column of at most 430px, works from 360px. Colors that come from the store's settings
   are --primary (blue) and --accent (green); everything else is fixed by the design.
   The global stylesheet sets a 16px base and a 1.6 line height; this page sets its own sizes and line height, so
   nothing here depends on them. */

body.store-home {
  --home-ink: #0b1b3f;
  --home-on-accent: #0b1b3f;
  --blue: var(--primary, #0155ee);
  --green: var(--accent, #a4fc01);
  background: #f6f5f3;
  color: var(--home-ink);
  font-size: 14px;
  line-height: normal;
}
/* A store with a dark green/accent gets white text on the button instead, so it stays readable. */
body.store-home.accent-light { --home-on-accent: #ffffff; }

:where(.store-home) a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:where(.store-home) ul { margin: 0; padding: 0; list-style: none; }
:where(.store-home) :is(b, h1, h2) { font-weight: 700; }
:where(.store-home) :is(h1, h2, p) { font-size: inherit; line-height: inherit; }
.store-home :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .arrow { transform: none; }
[dir="ltr"] .arrow, [dir="ltr"] .hint-arrow { transform: scaleX(-1); }

.store-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: clip;
}

/* ---------- 1. Blue header ---------- */
.home-head {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 20px 70px; /* the raffle card overlaps the bottom 48px */
  overflow: hidden;
  border-radius: 0 0 32px 32px;
  background: var(--primary-gradient, linear-gradient(135deg, #3b82ff 0%, #0155ee 55%, #0a3bb0 100%));
  color: var(--on-primary, #ffffff);
}
.head-glow { position: absolute; bottom: -90px; left: -60px; width: 240px; height: 240px; border-radius: 999px; background: radial-gradient(circle, rgba(164, 252, 1, 0.3), rgba(164, 252, 1, 0) 70%); pointer-events: none; }
.head-top { position: relative; display: flex; align-items: center; gap: 12px; }
.store-logo {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(1, 85, 238, 0.18);
  color: var(--blue);
  font-size: 22px;
  font-weight: 700;
}
.store-logo img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.store-title { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.welcome { font-size: 13px; opacity: 0.85; }
.store-title h1 { overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }

.open-pill {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 11px;
  white-space: nowrap;
}
.open-pill[hidden] { display: none; }
.open-dot { width: 7px; height: 7px; border-radius: 9px; background: #a4fc01; }
.open-pill[data-state="closing"] .open-dot { background: #ffbe3c; }
.open-pill[data-state="closed"] .open-dot, .open-pill[data-state="temporary"] .open-dot { background: #c3cde4; }

.search-row { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 16px; background: #ffffff; color: var(--blue); }
.search-bar { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; height: 100%; }
.search-bar span { overflow: hidden; color: #8a93a6; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
/* The language switch is a small "EN" / "AR" button here (the design's), not the full iOS toggle. */
.search-row .lang-switch { min-width: 0; height: 30px; padding: 0 10px; border-radius: 10px; background: #f1f4fa; color: inherit; }
.search-row .lang-track { width: auto; height: auto; background: none; color: inherit; }
.search-row .lang-thumb { display: none; }
.search-row .lang-label { position: static; width: auto; font-size: 11px; font-weight: 700; line-height: 30px; opacity: 1; }
.search-row .lang-label-ar { display: none; }
.search-row .lang-switch[aria-checked="true"] .lang-track { background: none; color: inherit; }
.search-row .lang-switch[aria-checked="true"] .lang-label-ar { display: block; }
.search-row .lang-switch[aria-checked="true"] .lang-label-en { display: none; }

/* ---------- News ticker: ONE line at a time, flips every 3 seconds ---------- */
.ticker { position: relative; height: 40px; }
.ticker[hidden] { display: none; }
.ticker-items {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.ticker-item {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  overflow: hidden;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden; /* a waiting line is never visible, so no second line peeks in */
  transform: translateY(100%);
}
.ticker-item.is-active { opacity: 1; visibility: visible; transform: none; transition: transform 0.4s ease-out, opacity 0.4s ease-out; }
.ticker-item.is-leaving { opacity: 0; visibility: visible; transform: translateY(-100%); transition: transform 0.4s ease-out, opacity 0.4s ease-out; }
.ticker-icon { display: inline-flex; flex: none; width: 17px; height: 17px; color: #a4fc01; }
.ticker-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticker-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Reduced motion: the ticker stops. Every line shows, stacked, with no sliding. */
@media (prefers-reduced-motion: reduce) {
  .ticker, .ticker-items { height: auto; }
  .ticker-items { display: flex; flex-direction: column; gap: 0; border-radius: 20px; }
  .ticker-item, .ticker-item.is-active, .ticker-item.is-leaving { opacity: 1; visibility: visible; transition: none; transform: none; }
}

.closure-note { position: relative; padding: 8px 14px; border-radius: 14px; background: #fff6dc; color: #6b4300; font-size: 12px; font-weight: 500; line-height: 1.5; }

.store-content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 26px; margin-top: -48px; padding: 0 20px calc(110px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 2. Raffle card ---------- */
.raffle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 18px 18px;
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(1, 85, 238, 0.16);
}
.card-glow { position: absolute; top: -70px; left: -50px; width: 200px; height: 200px; border-radius: 999px; background: radial-gradient(circle, rgba(59, 130, 255, 0.18) 0%, rgba(59, 130, 255, 0) 70%); pointer-events: none; }
.confetti { position: absolute; top: 14px; left: 18px; pointer-events: none; }
.raffle-top { position: relative; display: flex; align-items: center; gap: 14px; }
.gift {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #3b82ff, #0155ee);
  box-shadow: 0 10px 22px rgba(1, 85, 238, 0.35);
  color: #ffffff;
}
.gift .ic { stroke-width: 2; }
.raffle-text { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.raffle-badge { display: flex; align-items: center; align-self: flex-start; height: 22px; padding: 0 9px; border-radius: 99px; background: #e8effe; color: #0155ee; font-size: 10px; font-weight: 700; }
.raffle-title { color: #4a5570; font-size: 13px; font-weight: 400; }
.raffle-amount { color: #0155ee; font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.raffle-cur { font-size: 14px; }

.countdown { position: relative; display: flex; align-items: center; gap: 8px; }
.countdown[hidden] { display: none; }
.cd-label { flex-shrink: 0; color: #6b7590; font-size: 11px; }
.cd-box { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; height: 50px; border-radius: 14px; background: #f2f5fc; }
.cd-box b { color: #0b1b3f; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-box span { color: #6b7590; font-size: 9px; }

.joined { position: relative; display: flex; align-items: center; justify-content: space-between; }
.joined[hidden] { display: none; }
.joined-group { display: flex; align-items: center; }
.avatars { display: flex; align-items: center; }
.avatar { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: -8px; border: 2px solid #ffffff; border-radius: 99px; background: #0155ee; color: #ffffff; font-size: 10px; font-weight: 700; }
.avatar:nth-child(2) { background: #3b82ff; }
.avatar:nth-child(3) { background: #7fb0ff; }
.avatar:nth-child(4) { background: #0a3bb0; }
.joined-line { margin-right: 14px; margin-left: 0; color: #4a5570; font-size: 11px; }
[dir="ltr"] .joined-line { margin-right: 0; margin-left: 14px; }
.joined-line b { color: #0b1b3f; }

.join-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  overflow: hidden;
  isolation: isolate; /* keeps the moving shine inside the rounded button in Safari */
  border-radius: 16px;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(120, 190, 0, 0.35);
  color: var(--home-on-accent);
  font-size: 15px;
  font-weight: 700;
}
.join-button .arrow { stroke-width: 2.4; }
.shine { position: absolute; top: 0; bottom: 0; left: 0; width: 60px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); transform: translateX(-160%) skewX(-20deg); animation: shine 3s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { transform: translateX(-160%) skewX(-20deg); } 100% { transform: translateX(560%) skewX(-20deg); } }
@media (prefers-reduced-motion: reduce) {
  .shine { animation: none; display: none; }
}


/* ---------- 4. Quick actions: 54px icon squares, the label under each, one white box ---------- */
.quick { display: flex; padding: 16px 8px; border-radius: 24px; background: #ffffff; }
.quick-item { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 500; text-align: center; }
.quick-item[hidden] { display: none; }
.quick-icon { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 18px; background: #e8effe; color: #0155ee; }
.quick-track .quick-icon { background: #0155ee; color: #ffffff; }
.quick-whatsapp .quick-icon { background: #e7f9d0; color: #2e7d0f; }
.quick-label { overflow-wrap: anywhere; }

/* ---------- 5. Categories: a swipe row; the last visible one is cut off at the edge ---------- */
.cats { display: flex; flex-direction: column; gap: 14px; }
.cats[hidden] { display: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head h2, .brands-title { font-size: 17px; }
.swipe-hint { display: flex; align-items: center; gap: 4px; color: #8a93a6; font-size: 11px; }
.swipe-hint[hidden] { display: none; }
.swipe-hint .ic { stroke-width: 2.2; }
/* The scroller holds the list and its copy side by side; home.js moves it slowly and loops it with no gap. */
.cats-scroller {
  margin-inline-end: -20px; /* runs to the screen edge, so the last visible item shows it is cut */
  padding-bottom: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.cats-scroller::-webkit-scrollbar { display: none; }
.cats-strip { display: flex; width: max-content; }
.cats-row { display: flex; flex: none; gap: 14px; margin: 0; padding: 0; padding-inline-end: 14px; list-style: none; }
.cats-copy[hidden] { display: none; }
.cat-item { flex: none; width: 64px; }
.cat-link { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cat-icon { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 20px; background: #ffffff; box-shadow: 0 6px 18px rgba(11, 27, 63, 0.07); color: #0155ee; }
.cat-icon svg { width: 26px; height: 26px; stroke-width: 1.9; }
.cat-label { max-width: 100%; overflow: visible; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* ---------- 5b. Promo banners: same width and corners as the raffle card; the height is copied from it by promo-banners.js ---------- */
.banners { display: flex; flex-direction: column; gap: 10px; }
.banners[hidden] { display: none; }
.banner-viewport {
  display: flex;
  aspect-ratio: 1170 / 867; /* until the raffle card's height is known */
  height: var(--banner-h, auto);
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(1, 85, 238, 0.16);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.banner-viewport::-webkit-scrollbar { display: none; }
.banner-slide { display: block; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.banner-slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.banner-dots { display: flex; justify-content: center; gap: 6px; }
.banner-dots[hidden] { display: none; }
.banner-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 9px; background: #c9d3e6; cursor: pointer; transition: width 0.2s, background-color 0.2s; }
.banner-dot.is-active { width: 22px; background: #0155ee; }
@media (prefers-reduced-motion: reduce) { .banner-dot { transition: none; } }

/* ---------- 6. Frosted glass "browse everything" button ---------- */
.browse-button { position: relative; display: block; height: 58px; overflow: hidden; isolation: isolate; border-radius: 18px; box-shadow: 0 10px 30px rgba(1, 85, 238, 0.14); }
.browse-button[hidden] { display: none; }
.blob { position: absolute; border-radius: 999px; filter: blur(18px); pointer-events: none; }
.blob-1 { top: -10px; right: 20px; width: 150px; height: 80px; background: #3b82ff; opacity: 0.5; }
.blob-2 { top: -6px; left: 30px; width: 130px; height: 70px; background: #7fb0ff; opacity: 0.55; }
.browse-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  height: 58px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 30px rgba(1, 85, 238, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #0155ee;
  font-size: 15px;
  font-weight: 700;
}
.browse-inner .ic { stroke-width: 2; }
.browse-inner .arrow { stroke-width: 2.4; }

/* ---------- 7. Agencies: two rows of small white logo boxes sliding in opposite directions ---------- */
.brands { display: flex; flex-direction: column; gap: 14px; }
.brands[hidden] { display: none; }
.marquee {
  --marquee-duration: 30s; /* time for one full loop. The only speed setting: raise it to slow the strips down. */
  --card-w: 104px;
  --card-h: 46px;
  --card-gap: 8px;
  display: grid;
  gap: var(--card-gap);
  margin-inline: -20px; /* the rows run edge to edge */
  overflow: hidden;
}
.marquee-row { overflow: hidden; }
.marquee-track { display: flex; width: max-content; will-change: transform; }
.marquee-right { animation: marquee-right var(--marquee-duration) linear infinite; }
.marquee-left { animation: marquee-left var(--marquee-duration) linear infinite; }
.marquee-set { display: flex; flex: none; margin: 0; padding: 0; list-style: none; }
.marquee-card { flex: none; box-sizing: border-box; width: var(--card-w); height: var(--card-h); margin-right: var(--card-gap); border-radius: 14px; background: #ffffff; }
.marquee-link { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 100%; padding: 8px 12px; border-radius: 14px; }
.marquee-card img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.marquee-name { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #0b1b3f; font-size: 13px; font-weight: 700; line-height: 1.3; text-align: center; }
/* One loop is exactly one list's width and the second list is identical, so the join cannot be seen. */
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee.is-paused .marquee-track { animation-play-state: paused; }
@media (hover: hover) { .marquee:hover .marquee-track { animation-play-state: paused; } }
/* No movement: each brand once, in plain wrapped rows. */
@media (prefers-reduced-motion: reduce) {
  .marquee { margin-inline: 0; }
  .marquee-track { display: block; width: 100%; animation: none; transform: none; }
  .marquee-set { flex-wrap: wrap; justify-content: center; row-gap: var(--card-gap); }
  .marquee-row:nth-child(2), .marquee-set[aria-hidden="true"], .marquee-card.is-copy { display: none; }
}

/* ---------- 8. One small line: "follow us" with the round icons beside the word ---------- */
.follow-line, .sheet-social { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: #6b7590; font-size: 12px; }
.follow-line { margin-top: -10px; }
.follow-line[hidden], .sheet-social[hidden] { display: none; }
.social-dot { display: flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 99px; background: #ffffff; color: #0155ee; }
.social-dot[hidden] { display: none; }

/* ---------- 9. Bottom navigation: floating glass, 70px high ---------- */
.bottom-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 70px;
  max-width: 398px;
  margin-inline: auto;
  padding: 0 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(11, 27, 63, 0.15);
}
.nav-item { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 0; border: 0; background: none; color: #8a93a6; font: inherit; font-size: 10px; font-weight: 500; cursor: pointer; }
.nav-item.is-active { color: #0155ee; font-weight: 700; }

/* ---------- Contact sheet ---------- */
.contact-sheet { box-sizing: border-box; width: min(100%, 430px); max-width: 100%; margin: auto auto 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 28px 28px 0 0; background: #ffffff; color: var(--home-ink); font-size: 14px; line-height: normal; }
.contact-sheet::backdrop { background: rgb(6 14 33 / 55%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 17px; font-weight: 700; }
.sheet-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f3f8; cursor: pointer; }
.sheet-close svg { fill: none; stroke: #0b1b3f; stroke-width: 2.2; stroke-linecap: round; }
.sheet-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.sheet-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px; font-size: 14px; font-weight: 700; }
.sheet-link[hidden] { display: none; }
.sheet-whatsapp { background: #e7f9d0; color: #2e7d0f; }
.sheet-call { background: #e8effe; color: #0155ee; }
.contact-sheet .social-dot { background: #e8effe; }
