@import url('https://fonts.googleapis.com/css2?family=Playpen+Sans+Arabic:wght@500;600;700;800&family=Almarai:wght@300;400;700;800&display=swap');

/* ============ DESIGN SYSTEM — Soft UI Evolution + Bento Grid ============
   Source: ui-ux-pro-max skill. Switched from Claymorphism (thick borders,
   hard offset shadows — read as toy/retro) to a modern 2025-2026 aesthetic:
   subtle multi-layer shadows, soft depth, generous whitespace, hover-scale
   cards (Bento Grid pattern, Apple-style). Same validated color palette
   (query "soft modern warm family kids product" --domain color confirmed
   it). Typography unchanged: Playpen Sans Arabic (headlines) + Almarai
   (body, arabic sans, popularity #61). */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #F59E0B;
  --secondary-dark: #D97706;
  --accent: #EC4899;
  --accent-dark: #DB2777;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --ink: #0F172A;
  --muted: #475569;
  --muted-bg: #F1F5FD;
  --border: #E4ECFC;
  --green: #15803D;
  --green-bg: #EAF7EE;
  --red: #DC2626;
  --red-bg: #FFEAEA;
  --radius: 24px;
  --radius-sm: 18px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.06);
  --shadow-md: 0 2px 4px rgba(15,23,42,.04), 0 12px 28px rgba(15,23,42,.10);
  --shadow-lg: 0 4px 8px rgba(15,23,42,.05), 0 20px 40px rgba(15,23,42,.12);
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: "Almarai", "Tahoma", sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, .cta, .price-badge, .story-card .name, .spotlight-item .name {
  font-family: "Playpen Sans Arabic", "Almarai", sans-serif;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
header.top {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
header.top .brand-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  text-decoration: none; color: inherit;
}
header.top img { width: 40px; height: 40px; border-radius: 50%; }
header.top strong { font-family: "Playpen Sans Arabic", sans-serif; font-size: 18px; }

/* promo strip is its OWN sticky bar, independent of the header — only the
   discount stays pinned while scrolling, not the logo. Gradient + soft
   shadow + rounded bottom corners (matches this site's soft-UI system,
   just carried into red) instead of a flat color band, so it floats as a
   modern pill-bar rather than a plain notice strip. The countdown chip
   pulses gently to pull the eye — killed under prefers-reduced-motion. */
.promo-strip {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 16px; flex-wrap: wrap; color: #fff;
  background: linear-gradient(135deg, #EF4444, #DC2626 65%, #B91C1C);
  box-shadow: 0 4px 16px rgba(220,38,38,.35);
  border-radius: 0 0 14px 14px;
  font-size: 11.5px; font-weight: 800;
}
.promo-strip-timer { color: #fff; }
.promo-strip-timer #promoCountdown {
  direction: ltr; display: inline-block; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.24); padding: 3px 9px; border-radius: 8px;
  animation: promoPulse 1.6s ease-in-out infinite;
}
.promo-strip-price { color: #fff; white-space: nowrap; }
.promo-strip-price .free-ship { color: #FDE68A; }
@keyframes promoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .promo-strip-timer #promoCountdown { animation: none; }
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 20px 0 8px; }
.hero h1 { font-size: 24px; margin: 10px 16px; }
.hero p.sub { font-size: 16px; color: var(--muted); margin: 0 16px 14px; }

.carousel {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 16px 16px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.carousel img {
  flex: none; width: 78%; max-width: 300px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  scroll-snap-align: center;
}
.carousel::-webkit-scrollbar { display: none; }

/* ---------- feature icons row ---------- */
.features { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 16px 18px; text-align: center; }
.feature {
  width: 96px; font-size: 12px; color: var(--ink); font-weight: 700;
  background: var(--card); padding: 14px 6px 12px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.feature:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-md); }
.feature .ico { font-size: 26px; display: block; margin-bottom: 4px; }

.price-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--secondary); color: var(--ink); font-weight: 800;
  font-size: 20px; padding: 10px 22px; border-radius: 999px; margin: 0 0 14px;
  box-shadow: var(--shadow-sm);
}
.cod-line { font-size: 14px; color: var(--green); font-weight: 800; margin-bottom: 18px; }

.cta {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: var(--accent-dark); color: #fff; font-size: 19px; font-weight: 700;
  padding: 16px; border-radius: 999px; border: none; font-family: inherit;
  box-shadow: 0 8px 20px rgba(219,39,119,.35); cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(219,39,119,.4); filter: brightness(1.08); }
.cta:active { transform: translateY(0) scale(.98); box-shadow: 0 4px 12px rgba(219,39,119,.3); }
.cta:disabled { opacity: .6; cursor: not-allowed; transform: none; filter: none; }
.cta--narrow { max-width: 280px; margin: 0 auto; }

/* ---------- sections ---------- */
section { padding: 30px 16px; }
section h2 { font-size: 21px; text-align: center; margin: 0 0 18px; }

.steps { display: grid; gap: 12px; }
.step {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), transform .25s var(--ease);
  border: 1.5px solid transparent;
}
.step:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.step .num {
  flex: none; width: 38px; height: 38px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.step p { margin: 0; font-size: 15px; font-weight: 600; }

/* one tint per step, cycling through the brand palette instead of flat white */
.step:nth-child(3n+1) { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); border-color: #BFDBFE; }
.step:nth-child(3n+1) .num { background: var(--primary); }
.step:nth-child(3n+2) { background: linear-gradient(135deg, #FDF2F8, #FCE7F3); border-color: #FBCFE8; }
.step:nth-child(3n+2) .num { background: var(--accent-dark); }
.step:nth-child(3n+3) { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border-color: #FDE68A; }
.step:nth-child(3n+3) .num { background: #D97706; }

.gallery { display: grid; gap: 12px; }
.gallery img { width: 100%; border-radius: var(--radius-sm); display: block; box-shadow: var(--shadow-md); }
.gallery .cap { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 700; }

.guarantee {
  background: var(--green-bg); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; font-size: 15px; box-shadow: var(--shadow-sm);
}
.guarantee b { color: var(--green); }

/* ---------- photo guide (reference TIPS image, used as-is) ---------- */
.photo-guide {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.photo-guide-img { display: block; width: 100%; height: auto; }

/* ---------- avant / après ---------- */
.avant-apres { display: flex; align-items: center; gap: 10px; justify-content: center; }
.avant-apres figure { margin: 0; flex: 1; text-align: center; }
.avant-apres img { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.avant-apres figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 700; }
.avant-apres .arrow { font-size: 22px; color: var(--primary); flex: none; }

/* ---------- trust pillars ---------- */
.trust { display: grid; gap: 12px; }
.trust .pillar {
  background: var(--card); border-radius: var(--radius-sm); padding: 16px;
  display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease);
}
.trust .pillar:hover { box-shadow: var(--shadow-md); }
.trust .pillar .ico { font-size: 24px; flex: none; }
.trust .pillar b { display: block; font-size: 14px; }
.trust .pillar span { font-size: 13px; color: var(--muted); }

/* ---------- full-bleed hero (homepage style) ---------- */
.hero-full {
  position: relative; aspect-ratio: 1024 / 1016; max-height: 70vh; display: flex; align-items: flex-end;
  background-size: cover; background-position: center; color: #fff; text-align: center;
}
.hero-full::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.1) 0%, rgba(15,23,42,.85) 88%);
}
.hero-full .content { position: relative; width: 100%; padding: 26px 20px 30px; }
.hero-full h1 { font-size: 30px; margin: 0 0 8px; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
.hero-full p.sub { font-size: 16px; margin: 0 0 16px; opacity: .95; }
.hero-full a.cta-outline {
  display: inline-block; margin-top: 12px; color: #fff; text-decoration: underline;
  font-size: 14px; font-weight: 700; opacity: .9;
}

/* ---------- limited-time promo (tag + free-delivery highlight) ---------- */
.promo-tag {
  display: inline-block; background: var(--secondary); color: #fff; font-size: 12.5px;
  font-weight: 800; padding: 5px 14px; border-radius: 999px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.free-ship { color: var(--green); font-weight: 800; }

/* variant for a bright/white-background source photo — dark text, light
   gradient panel at the bottom instead of a dark one (white text on a
   near-white photo would be invisible otherwise) */
.hero-full.light-bg { color: var(--ink); }
.hero-full.light-bg::before {
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.65) 55%, rgba(255,255,255,.97) 100%);
}
.hero-full.light-bg h1 { text-shadow: none; }
.hero-full.light-bg a.cta-outline { color: var(--primary); }

/* ---------- book carousel (Wonderwraps-style bestseller cards) ---------- */
/* NOTE: no scroll-snap-type here on purpose — this carousel is driven by a
   continuous JS auto-scroll (order.js setupAutoScroll). CSS scroll-snap
   actively fights small per-frame scrollLeft nudges and freezes the
   animation after a few pixels — confirmed live, cost a real debugging
   session. Manual swipe still works fine as free (non-snapped) scrolling. */
.book-carousel {
  display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.book-carousel::-webkit-scrollbar { display: none; }
.book-card {
  flex: none; width: 168px;
  display: flex; flex-direction: column; gap: 8px;
}
.book-cover-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-md); }
.book-cover {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--muted-bg);
}
.book-cover.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  background: linear-gradient(160deg, #DBEAFE, #FBCFE8);
}
.book-badge {
  position: absolute; left: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px); padding: 5px;
}
.book-title { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.3; }
.book-tagline { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.4; min-height: 32px; }
.book-price-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.book-price { font-size: 14px; font-weight: 800; color: var(--accent-dark); white-space: nowrap; }
.book-cta {
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--accent-dark);
  background: #fff; border: 1.5px solid var(--accent-dark); border-radius: 999px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap; min-height: 32px;
  transition: background .2s, color .2s;
}
.book-cta:hover, .book-cta.selected { background: var(--accent-dark); color: #fff; }

.hint-note { font-size: 13px; color: var(--muted); text-align: center; margin: 2px 16px 0; }
.field-note { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }

/* ---------- real examples trio (cover + real page + "+N pages" teaser) ---------- */
.examples-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.example-card {
  border-radius: var(--radius-sm); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow-sm); aspect-ratio: 3/4; position: relative;
}
.example-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.example-card .cap {
  position: absolute; bottom: 0; right: 0; left: 0; padding: 5px 7px 6px;
  background: linear-gradient(0deg, rgba(15,23,42,.72), transparent);
  color: #fff; font-size: 11px; font-weight: 700;
}
.more-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 2px; padding: 8px; overflow: hidden;
  background: linear-gradient(155deg, var(--muted-bg), #fff);
}
.more-card .leaf-stack { position: absolute; inset: 0; }
.more-card .leaf-stack i {
  position: absolute; inset: 14% 10%; border-radius: 10px; background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
}
.more-card .leaf-stack i:nth-child(1) { transform: rotate(-7deg) translateY(2px); opacity: .55; }
.more-card .leaf-stack i:nth-child(2) { transform: rotate(5deg) translateY(4px); opacity: .75; }
.more-card .leaf-stack i:nth-child(3) { transform: rotate(-2deg); opacity: .95; }
.more-card .num {
  position: relative; font-family: 'Playpen Sans Arabic', sans-serif; font-size: 26px;
  font-weight: 800; line-height: 1; direction: ltr; color: var(--accent-dark);
}
.more-card .label { position: relative; font-size: 11px; font-weight: 700; color: var(--muted); }
.more-card .spark { position: relative; font-size: 15px; margin-top: 2px; }
.examples-hint { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.examples-hint b { color: var(--accent-dark); }

/* ---------- story example: cover+teaser row, then a full uncropped spread
   below — story pages are generated as 3:2 two-page spreads, not single
   portrait pages, so forcing one into the 3:4 trio card cropped half of it
   off. This card's aspect-ratio matches the source exactly (3/2), so the
   full spread — art AND the story text printed on the right-hand page —
   shows edge to edge, nothing cut. ---------- */
.examples-story { display: flex; flex-direction: column; gap: 9px; }
.examples-top { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.spread-card {
  width: 100%; aspect-ratio: 3/2; border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-sm); position: relative; background: var(--muted-bg);
}
.spread-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spread-card .cap {
  position: absolute; bottom: 0; right: 0; left: 0; padding: 8px 10px;
  background: linear-gradient(0deg, rgba(15,23,42,.75), transparent 85%);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5;
}

/* ---------- footer CTA banner ---------- */
.footer-cta {
  position: relative; min-height: 42vh; display: flex; align-items: center;
  justify-content: center; text-align: center; color: #fff;
  background-size: cover; background-position: center; margin-top: 10px;
}
.footer-cta::before { content: ""; position: absolute; inset: 0; background: rgba(15,23,42,.65); }
.footer-cta .content { position: relative; padding: 20px; }
.footer-cta h2 { font-size: 22px; margin: 0 0 8px; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
.footer-cta p { font-size: 14px; margin: 0 0 16px; opacity: .95; text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.footer-cta .cta { display: inline-block; width: auto; padding: 14px 28px; }

/* ---------- sticky bottom CTA ---------- */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(15,23,42,.08);
  display: flex; align-items: center; gap: 10px;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.sticky-cta a.cta { margin: 0; padding: 12px; font-size: 16px; }

/* ---------- form ---------- */
form.order { display: grid; gap: 14px; background: var(--card); padding: 20px;
  border-radius: var(--radius); box-shadow: var(--shadow-md); }
form.order label { font-size: 14px; font-weight: 800; display: block; margin-bottom: 6px; }
form.order input[type=text], form.order input[type=tel], form.order select {
  width: 100%; font-size: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--muted-bg); font-family: inherit; min-height: 44px;
  transition: border-color .2s, background .2s;
}
form.order input:focus, form.order select:focus { border-color: var(--primary); background: #fff; }
.radio-row { display: flex; gap: 10px; }
.radio-row label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin: 0;
  font-size: 14px; cursor: pointer; min-height: 44px; background: var(--muted-bg);
  transition: border-color .2s, background .2s;
}
.radio-row input { accent-color: var(--primary); }
.radio-row label:has(input:checked) { border-color: var(--primary); background: #EFF6FF; }

/* ---------- 2-book pack picker ---------- */
.pack-choice { display: flex; gap: 10px; margin-top: 4px; }
.pack-opt {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 14px 8px 12px;
  cursor: pointer; background: var(--muted-bg); transition: border-color .2s, background .2s, transform .2s;
}
.pack-opt input { display: none; }
.pack-opt.selected { border-color: var(--accent-dark); background: #FDF2F8; }

/* the pack option gets a little extra shine to pull the eye — gradient
   border + a floating "save" ribbon, since it's the upsell we want noticed */
.pack-opt--deal {
  border: 2px solid transparent;
  background:
    linear-gradient(#FFF7FB, #FFF7FB) padding-box,
    linear-gradient(135deg, var(--accent-dark), var(--secondary)) border-box;
}
.pack-opt--deal.selected {
  background:
    linear-gradient(#FDF2F8, #FCE7F3) padding-box,
    linear-gradient(135deg, var(--accent-dark), var(--secondary)) border-box;
}
.pack-opt-ribbon {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-dark), #F472B6); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(219,39,119,.35); white-space: nowrap;
}
.pack-opt-title { font-weight: 700; font-size: 14px; }
.pack-opt-price { font-weight: 800; font-size: 15px; color: var(--accent-dark); }
.pack-opt-price s { color: var(--muted); font-weight: 400; font-size: 12px; margin-right: 4px; }

.child-block {
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 14px 12px 2px;
  margin-bottom: 16px; background: rgba(255,255,255,.4);
}
.child-block-title { font-size: 14px; margin: 0 0 12px; color: var(--accent-dark); }

.upload-box { text-align: center; cursor: pointer; }
.upload-box input { display: none; }
.upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 16px;
  border-radius: 999px; padding: 16px; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), background .2s;
}
.upload-box:hover .upload-btn { background: var(--primary-dark); }
.upload-box.has-file .upload-btn { background: var(--green); }
.upload-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; font-weight: 700; }
.upload-preview { max-width: 110px; border-radius: var(--radius-sm); margin-top: 12px; display: none; box-shadow: var(--shadow-sm); }

.recap { background: #FFFBEB; border-radius: var(--radius-sm);
  padding: 16px; font-size: 15px; text-align: center; box-shadow: var(--shadow-sm); }

.faq details { background: var(--card); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.faq summary { font-weight: 800; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.faq p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

footer { text-align: center; padding: 26px 16px 40px; font-size: 12px; color: var(--muted); }

.msg { display: none; text-align: center; padding: 16px; border-radius: var(--radius-sm); font-weight: 800; }
.msg.show { display: block; }
.msg.ok { background: var(--green-bg); color: var(--green); padding: 24px 18px; font-size: 17px; line-height: 1.7; }
.msg.ok .ok-icon { font-size: 44px; line-height: 1; }
.msg.ok .ok-title { font-size: 21px; margin: 8px 0 6px; }
.msg.ok p { margin: 4px 0; font-weight: 600; }
.msg.err { background: var(--red-bg); color: var(--red); }

@media (min-width: 520px) {
  .gallery { grid-template-columns: 1fr 1fr; }
}
