/* المتجر — نسخة مرحة وفرندلي (كريمي + ألوان كاندي). بيتحمّل بعد public.v10.css وبيشتغل بس تحت body.shop-page.
   أي تعديل = اسم ملف جديد (Cloudflare بيكاشي CSS 30 يوم). */

body.shop-page {
  --bg: #fff7e8;
  --text: #2b2d42;
  --muted: #5f6280;
  --border: rgba(43, 45, 66, .14);
  --accent: #e5484d;
  --teal: #19b394;
  --coral: #ff6b6b;
  --sun: #ffd84d;
  --sky: #4db6ff;
  --mint: #3ddc97;
  --grape: #b49bff;
  --pink: #ff8fc7;
  --ink: #2b2d42;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  background: var(--bg);
  color: var(--text);
}
body.shop-page::before {
  background:
    radial-gradient(14px 14px at 8% 12%, #ffd84d 98%, transparent),
    radial-gradient(10px 10px at 92% 9%, #ff8fc7 98%, transparent),
    radial-gradient(12px 12px at 86% 38%, #4db6ff 98%, transparent),
    radial-gradient(9px 9px at 6% 46%, #3ddc97 98%, transparent),
    radial-gradient(12px 12px at 94% 72%, #ffd84d 98%, transparent),
    radial-gradient(10px 10px at 10% 84%, #b49bff 98%, transparent),
    radial-gradient(60% 40% at 15% 0%, rgba(255, 216, 77, .35), transparent 70%),
    radial-gradient(55% 40% at 95% 6%, rgba(255, 143, 199, .28), transparent 70%),
    radial-gradient(70% 45% at 50% 108%, rgba(77, 182, 255, .26), transparent 70%);
}

/* ---- الشريط العلوي والتاببار بنسخة فاتحة ---- */
body.shop-page .pbar { background: rgba(255, 247, 232, .85); border-bottom: 2px solid var(--ink); }
body.shop-page .pbrand span { background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); }
body.shop-page .pbrand img { background: var(--sun); }
body.shop-page .pnav-link:hover { background: rgba(43, 45, 66, .07); }
body.shop-page .pnav-link.active { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink) !important; }
body.shop-page .chip-btn { background: #fff; color: var(--ink) !important; border: 2px solid var(--ink); }
body.shop-page .chip-btn:hover { background: var(--sun); }
body.shop-page .tabbar { background: #fff; border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
body.shop-page .tab.active { background: var(--sun); color: var(--ink) !important; }
body.shop-page .tab.active .ic { stroke: var(--ink); filter: none; }
body.shop-page .site-foot, body.shop-page .site-foot a { color: var(--muted); }
body.shop-page .social-btn { background: #fff; color: var(--ink) !important; border: 2px solid var(--ink); }

/* ---- الهيرو ---- */
.shop-hero { position: relative; text-align: center; margin: 4px 0 26px; padding: 14px 8px 4px; }
.shop-hero h1 {
  position: relative; display: inline-block; margin: 6px 0 8px;
  font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 9vw, 52px); line-height: 1.15; color: var(--ink);
  background: linear-gradient(transparent 60%, var(--sun) 60%, var(--sun) 92%, transparent 92%);
  padding: 0 10px;
}
.shop-hero p { margin: 0 auto; max-width: 440px; font-size: 17px; color: var(--muted); }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 16px 6px 12px;
  background: var(--mint); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg);
}
.hero-badge .ic { width: 20px; height: 20px; }
.deco { position: absolute; pointer-events: none; z-index: 0; }
.deco svg { display: block; width: 100%; height: 100%; }
.deco-star { width: 38px; height: 38px; top: 6px; inset-inline-start: 6%; color: var(--sun); }
.deco-heart { width: 30px; height: 30px; top: 70px; inset-inline-end: 7%; color: var(--pink); }
.deco-cloud { width: 62px; height: 40px; top: 0; inset-inline-end: 18%; color: var(--sky); }
.deco-dot { width: 18px; height: 18px; bottom: 6px; inset-inline-start: 14%; color: var(--grape); }
@media (prefers-reduced-motion: no-preference) {
  .deco-star { animation: bob 3.6s ease-in-out infinite; }
  .deco-heart { animation: bob 4.2s ease-in-out -1s infinite; }
  .deco-cloud { animation: bob 5s ease-in-out -2s infinite; }
  .deco-dot { animation: bob 3.2s ease-in-out -.5s infinite; }
  @keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(8deg); } }
}

/* ---- شبكة المنتجات ---- */
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-bottom: 26px; position: relative; z-index: 1; }
@media (min-width: 640px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; } }

.shop-card {
  --c: var(--coral); --cs: #ffe3e3;
  position: relative; display: flex; flex-direction: column;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 26px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 8px 8px 12px;
  transition: transform .35s var(--pop), box-shadow .2s ease;
}
.shop-card:nth-child(6n+1) { --c: var(--coral); --cs: #ffe3e3; transform: rotate(-1.2deg); }
.shop-card:nth-child(6n+2) { --c: var(--sky); --cs: #def2ff; transform: rotate(1deg); }
.shop-card:nth-child(6n+3) { --c: var(--mint); --cs: #d9f8ea; transform: rotate(-.8deg); }
.shop-card:nth-child(6n+4) { --c: var(--sun); --cs: #fff3bf; transform: rotate(1.2deg); }
.shop-card:nth-child(6n+5) { --c: var(--grape); --cs: #ece5ff; transform: rotate(-1deg); }
.shop-card:nth-child(6n+6) { --c: var(--pink); --cs: #ffe0f0; transform: rotate(.9deg); }
.shop-card:hover { transform: rotate(0) translateY(-4px) scale(1.02); box-shadow: 0 10px 0 var(--ink); }
.shop-card.is-selected { box-shadow: 0 6px 0 var(--ink), 0 0 0 5px var(--c); }
.shop-card.is-sold { opacity: .7; filter: grayscale(.5); }
.shop-card.is-sold:hover { transform: none; box-shadow: 0 6px 0 var(--ink); }

.shop-media { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: var(--cs); border: 2px solid var(--ink); }
.shop-media::after { display: none; }
.shop-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--pop); }
.shop-card:hover .shop-media img { transform: scale(1.07) rotate(1deg); }
.shop-ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.shop-ph .ic { width: 64px; height: 64px; stroke-width: 2.2; color: var(--ink); }
.shop-card .shop-flag.badge { position: absolute; z-index: 2; bottom: 8px; inset-inline: 8px; top: auto; justify-content: center; text-align: center; background: var(--ink); color: #fff; border: 0; font-size: 13px; font-weight: 700; }

.shop-price {
  position: absolute; z-index: 2; top: -4px; inset-inline-end: -4px;
  display: grid; place-items: center; min-width: 58px; height: 58px; padding: 0 8px;
  background: var(--c); color: var(--ink) !important; -webkit-text-fill-color: var(--ink);
  border: 3px solid var(--ink); border-radius: 50%; transform: rotate(10deg);
  font-family: var(--font-head); font-size: 19px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 var(--ink);
}
@media (prefers-reduced-motion: no-preference) { .shop-card:hover .shop-price { animation: wiggle .6s ease; } @keyframes wiggle { 30% { transform: rotate(-8deg) scale(1.12); } 60% { transform: rotate(16deg) scale(1.05); } } }

.shop-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 6px 0; flex: 1; }
.shop-cat { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--cs); border: 2px solid var(--ink); padding: 1px 10px; border-radius: 999px; }
.shop-body h3 { margin: 0; font-size: 19px; line-height: 1.3; color: var(--ink); }
.shop-desc { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shop-desc.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.shop-more { align-self: flex-start; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.shop-more:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.shop-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }

/* ---- عدّاد الكمية ---- */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px; border-radius: 999px; background: var(--cs); border: 2px solid var(--ink); }
.st-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer;
  display: grid; place-items: center; color: var(--ink); background: #fff; touch-action: manipulation;
  box-shadow: 0 3px 0 var(--ink); transition: transform .15s var(--pop), box-shadow .15s ease, background .2s ease;
}
.st-btn .ic { stroke-width: 3; }
.st-btn[data-step="1"] { background: var(--c); }
.st-btn:hover { background: var(--sun); }
.st-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.st-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.stepper input[type=number] {
  width: 100%; min-width: 0; height: 44px; padding: 0; text-align: center; border: 0; background: transparent; box-shadow: none; border-radius: 0;
  font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper input[type=number]::-webkit-outer-spin-button, .stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number]:focus { box-shadow: none; background: transparent; border: 0; }
.stepper:focus-within { box-shadow: 0 0 0 4px var(--sky); }

/* ---- بطاقة الطلب ---- */
.shop-checkout {
  position: relative; z-index: 1; margin-bottom: 120px; scroll-margin-top: 90px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink); padding: 22px 18px 20px;
}
.shop-checkout h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 22px; color: var(--ink); }
.shop-checkout h3 .ic { display: none; }
.step-no {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 2px solid var(--ink); font-family: var(--font-head); font-size: 18px; font-weight: 800; background: var(--sun); box-shadow: 0 2px 0 var(--ink);
}
.co-sub { margin-top: 26px !important; }
.co-sub .step-no { background: var(--pink); }
.sum-list { list-style: none; margin: 0 0 6px; padding: 0; }
.sum-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px dashed rgba(43, 45, 66, .2); font-size: 16px; font-weight: 600; }
.sum-list li bdi { font-family: var(--font-head); font-weight: 800; font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-totals { margin: 8px 0 0; }
.sum-totals[hidden], .shop-bar[hidden], .empty-note[hidden] { display: none; }
.sum-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--muted); font-size: 15px; }
.sum-totals dt, .sum-totals dd { margin: 0; }
.sum-totals .grand { margin-top: 8px; padding: 12px 14px; border-radius: 18px; background: var(--sun); border: 2px solid var(--ink); color: var(--ink); font-size: 18px; font-weight: 800; }
.sum-totals .grand dd { font-family: var(--font-head); font-size: 26px; background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); }
.shop-checkout .empty-note { color: var(--muted); font-size: 16px; padding: 14px 0; }

.shop-checkout .field { margin-bottom: 14px; }
.shop-checkout .field > label { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.shop-checkout input[type=text], .shop-checkout input[type=tel], .shop-checkout textarea {
  width: 100%; background: #fffdf6; color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 16px; min-height: 48px;
}
.shop-checkout textarea { min-height: 84px; }
.shop-checkout input::placeholder { color: rgba(43, 45, 66, .45); }
.shop-checkout input:focus, .shop-checkout textarea:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px var(--sky); }
.shop-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pay-note { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; padding: 10px 14px; background: #d9f8ea; border: 2px dashed var(--ink); border-radius: 16px; color: var(--ink); font-size: 15px; font-weight: 600; }
.pay-note .ic { color: var(--ink); }

.shop-checkout .btn, .done-box .btn, .shop-bar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  background: #fff; color: var(--ink) !important; border: 3px solid var(--ink); border-radius: 999px; font-family: var(--font-head); font-size: 18px; font-weight: 800; text-decoration: none;
  box-shadow: 0 5px 0 var(--ink); transition: transform .15s var(--pop), box-shadow .15s ease; cursor: pointer;
}
.shop-checkout .btn-primary, .done-box .btn-primary, .shop-bar .btn-primary { background: var(--coral); }
.shop-checkout .btn:hover, .done-box .btn:hover, .shop-bar .btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); filter: none; }
.shop-checkout .btn:active, .done-box .btn:active, .shop-bar .btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.shop-checkout .btn:focus-visible, .done-box .btn:focus-visible, .shop-bar .btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.shop-bar .btn { min-height: 44px; padding: 0 18px; font-size: 16px; }
.shop-submit { width: 100%; }
.shop-submit[aria-disabled="true"] { opacity: .65; pointer-events: none; }
.shop-error { margin-bottom: 18px; background: #ffe3e3 !important; border: 3px solid var(--ink) !important; color: var(--ink); border-radius: 20px; }
.shop-error p, .shop-error strong { color: var(--ink) !important; }
.shop-error .ic { color: var(--accent) !important; }
.shop-page .empty-note { color: var(--muted); }

/* ---- الشريط الثابت ---- */
.shop-bar {
  position: fixed; z-index: 55; inset-inline: 12px; margin-inline: auto; max-width: 540px; bottom: calc(92px + var(--safe-b));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px;
  background: var(--sun); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 6px 0 var(--ink);
  backdrop-filter: none;
}
.bar-info { font-size: 16px; font-weight: 700; }
.bar-info .muted { color: var(--ink); }
.bar-info strong { font-family: var(--font-head); font-size: 22px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .shop-bar:not([hidden]) { animation: pop-in .45s var(--pop); } @keyframes pop-in { from { transform: translateY(30px) scale(.9); opacity: 0; } } }
@media (min-width: 760px) { .shop-bar { bottom: 18px; } }

/* ---- صفحة التأكيد ---- */
.done-box { position: relative; overflow: hidden; background: #fff !important; color: var(--ink); border: 3px solid var(--ink) !important; border-radius: 30px !important; box-shadow: 0 8px 0 var(--ink) !important; text-align: center; }
.done-box h2 { font-family: var(--font-head); font-size: clamp(25px, 7vw, 34px); line-height: 1.25; color: var(--ink); margin: 6px 0 8px; }
.done-box p { color: var(--muted); font-size: 16px; }
.done-box p strong { color: var(--ink); }
.done-box .fic { width: 84px; height: 84px; border-radius: 50%; background: var(--mint); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); margin: 0 auto 10px; }
.done-box .fic .ic { width: 42px; height: 42px; stroke-width: 3; }
.done-list { text-align: start; margin-top: 18px; }
.done-box .sum-totals { text-align: start; }
.done-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.done-actions .btn { width: 100%; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 10px; height: 16px; border-radius: 3px; background: var(--sun); opacity: .95; }
.confetti i:nth-child(5n+1) { background: var(--coral); }
.confetti i:nth-child(5n+2) { background: var(--sky); }
.confetti i:nth-child(5n+3) { background: var(--mint); }
.confetti i:nth-child(5n+4) { background: var(--pink); }
@media (prefers-reduced-motion: no-preference) {
  .confetti i { animation: fall 3.4s linear infinite; }
  @keyframes fall { to { transform: translateY(560px) rotate(540deg); opacity: .2; } }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .shop-card, .shop-media img, .st-btn, .shop-checkout .btn { transition: none; }
  .shop-card:hover { transform: none; }
}

/* ---- شارات الثقة ---- */
.trust { list-style: none; margin: 4px 0 26px; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; position: relative; z-index: 1; }
.trust li {
  --tc: var(--sun); --ts: #fff3bf;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 12px;
  background: var(--ts); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink);
}
.trust .trust-2 { --tc: var(--mint); --ts: #d9f8ea; }
.trust .trust-3 { --tc: var(--pink); --ts: #ffe0f0; }
.trust-ic { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--tc); border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.trust-ic .ic { width: 24px; height: 24px; stroke-width: 2.4; color: var(--ink); }
.trust strong { display: block; font-family: var(--font-head); font-size: 18px; line-height: 1.25; font-weight: 800; }
.trust li div > span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (min-width: 640px) {
  .trust { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .trust li { flex-direction: column; text-align: center; padding: 14px 12px 16px; gap: 8px; }
  .trust-ic { width: 52px; height: 52px; }
}
