/* ================================================================
   امبليوم — حملة «تخفيضات نهاية السنة» 🎄 — طبقة عرض فقط (2026-12-03)
   * عرض بصري فقط: ما يغيّر أي سعر أو توفير أو مخزون أو عرض اليوم أو حدث تتبّع.
   * CSS فقط، بلا صور أو سكربت. كل الأصناف تبدأ بـ embye- (حتى تنشال بسهولة بعد الحملة).
   * 1. شريط علوي متحرك · 2. شريط الحملة (ثلج + كرات زينة معلّقة) · 3. بطاقة تحت السعر · 4. شارة كروت القوائم
   ================================================================ */
.embye-bar, .embye-strip, .embye-card {
  --embye-green: #0f3d2e;
  --embye-green2: #145a41;
  --embye-red: #c8102e;
  --embye-gold: #e2b65c;
  --embye-snow: #ffffff;
  direction: rtl; box-sizing: border-box; font-family: inherit; letter-spacing: 0; text-transform: none;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
.embye-bar *, .embye-strip *, .embye-card * { box-sizing: border-box; }
.embye-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 1. الشريط العلوي (حلقة لا نهائية، مثل بلاك فرايدي) ---------- */
.embye-bar {
  position: relative; display: block; width: 100%; max-width: 100%; margin: 0; overflow: hidden; contain: paint;
  background: linear-gradient(90deg, #9e0c24, var(--embye-red) 50%, #9e0c24);
  color: #fff; border-bottom: 2px solid var(--embye-gold);
}
.embye-bar__view { overflow: hidden; white-space: nowrap; }
.embye-bar__track { display: flex; width: max-content; animation: embye-tk 60s linear infinite; }
.embye-bar:hover .embye-bar__track { animation-play-state: paused; }
.embye-bar__grp { flex: none; display: flex; align-items: center; }
.embye-bar__it {
  flex: none; display: inline-flex; align-items: center; gap: 10px;
  padding-block: 7px; padding-inline: 0 30px;
  font-size: 13px; font-weight: 700; line-height: 1.4; color: #fff;
}
.embye-bar__en { color: var(--embye-green); background: var(--embye-gold); font-weight: 900; font-size: 11px; letter-spacing: .08em; padding: 1px 7px 0; border-radius: 3px; line-height: 1.6; }
.embye-bar__dot { color: var(--embye-gold); font-size: 10px; line-height: 1; }
@keyframes embye-tk { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(50%, 0, 0); } }

/* ---------- 2. شريط الحملة ---------- */
.embye-strip {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 92px;
  width: 100%; max-width: 100%; margin: 0; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(80% 150% at 50% 130%, rgba(226, 182, 92, .22), rgba(226, 182, 92, 0) 60%),
    linear-gradient(180deg, var(--embye-green2), var(--embye-green));
  color: #fff; text-align: center;
}
/* خط ذهبي بالأسفل + حافة "ثلج" */
.embye-strip::before {
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--embye-red) 0 14px, #fff 14px 28px);
}
/* ثلج يتساقط بهدوء: نقاط بيضاء صغيرة بطبقتين */
.embye-snow { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.embye-snow::before, .embye-snow::after {
  content: ''; position: absolute; left: 0; right: 0; top: -100%; height: 200%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 80px 70px, rgba(255,255,255,.8), transparent),
    radial-gradient(2px 2px at 140px 20px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 200px 90px, rgba(255,255,255,.9), transparent),
    radial-gradient(2.5px 2.5px at 260px 50px, rgba(255,255,255,.6), transparent);
  background-size: 300px 120px;
  animation: embye-fall 14s linear infinite;
}
.embye-snow::after { background-size: 220px 100px; opacity: .6; animation-duration: 20s; }
@keyframes embye-fall { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-30px, 50%, 0); } }

.embye-strip__in {
  position: relative; z-index: 1; width: 100%;
  max-width: 1280px; margin: 0 auto; padding: 14px 16px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px;
}
.embye-strip__lead { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.embye-strip__en {
  display: inline-block; margin: 0; padding: 2px 9px 1px; border-radius: 3px;
  background: var(--embye-red); color: #fff;
  font-size: 11px; font-weight: 900; letter-spacing: .12em; line-height: 1.5; white-space: nowrap;
  animation: embye-capglow 4.5s ease-in-out infinite alternate;
}
.embye-strip__t { margin: 0; padding: 0; font-size: 22px; font-weight: 900; line-height: 1.3; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.embye-strip__s { margin: 0; padding: 0; font-size: 14px; font-weight: 600; line-height: 1.5; color: #e7f1ec; }
.embye-strip__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .25); }
@keyframes embye-capglow { from { box-shadow: 0 0 0 0 rgba(226, 182, 92, 0); } to { box-shadow: 0 0 14px 3px rgba(226, 182, 92, .55); } }

/* كرات زينة معلّقة من أعلى الشريط (تتمايل بهدوء) */
.embye-orns { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.embye-orn {
  --w: 24px; --h: 22px;
  position: absolute; top: 0; width: var(--w); height: calc(var(--h) + var(--w));
  transform-origin: 50% 0; animation: embye-sway var(--d, 6s) ease-in-out var(--dl, 0s) infinite alternate;
}
.embye-orn::before {   /* الخيط */
  content: ''; position: absolute; left: 50%; top: 0; width: 1px; height: var(--h); background: rgba(226, 182, 92, .8);
}
.embye-orn::after {    /* الكرة */
  content: ''; position: absolute; left: 0; bottom: 0; width: var(--w); height: var(--w); border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.65), rgba(255,255,255,0) 26%),
              radial-gradient(circle at 50% 50%, var(--c1), var(--c2) 75%);
  box-shadow: inset -3px -4px 8px rgba(0,0,0,.3), 0 6px 12px rgba(0,0,0,.3);
}
.embye-orn--r { --c1: #ec3b52; --c2: #8a0a1c; }
.embye-orn--g { --c1: #f3d488; --c2: #a77d26; }
.embye-orn--w { --c1: #ffffff; --c2: #b9cfc6; }
.embye-orn:nth-child(1) { right: 3%;   --h: 18px; --w: 26px; --d: 6s; }
.embye-orn:nth-child(2) { right: 7.5%; --h: 38px; --w: 18px; --d: 7s; --dl: -2s; }
.embye-orn:nth-child(3) { right: 11.5%;--h: 12px; --w: 22px; --d: 5.5s; --dl: -4s; }
.embye-orn:nth-child(4) { left: 3%;    --h: 26px; --w: 26px; --d: 6.5s; --dl: -1s; }
.embye-orn:nth-child(5) { left: 7.5%;  --h: 10px; --w: 18px; --d: 7.5s; --dl: -3s; }
.embye-orn:nth-child(6) { left: 11.5%; --h: 34px; --w: 22px; --d: 6s; --dl: -5s; }
@keyframes embye-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@media (max-width: 1099px) {
  .embye-orn:nth-child(2), .embye-orn:nth-child(3), .embye-orn:nth-child(5), .embye-orn:nth-child(6) { display: none; }
  .embye-orn:nth-child(1) { right: 1.5%; } .embye-orn:nth-child(4) { left: 1.5%; }
}
@media (max-width: 599px) {
  .embye-strip { min-height: 0; }
  .embye-strip__in { flex-direction: column; gap: 3px; padding: 12px 40px 14px; }
  .embye-strip__sep { display: none; }
  .embye-strip__lead { flex-direction: column; gap: 5px; }
  .embye-strip__t { font-size: 19px; }
  .embye-strip__s { font-size: 13px; }
  .embye-orn:nth-child(1) { right: 8px; --w: 16px; --h: 10px; }
  .embye-orn:nth-child(4) { left: 8px;  --w: 16px; --h: 22px; }
  .embye-bar__it { font-size: 12px; gap: 8px; padding-inline-end: 24px; }
}

/* ---------- 3. بطاقة تحت السعر بصفحة المنتج (بلا أرقام) ---------- */
.embye-card {
  position: relative; display: block; width: 100%; max-width: 100%; flex: 1 1 100%; grid-column: 1 / -1;
  margin: 14px 0 8px; padding: 13px 16px 14px; overflow: hidden;
  border-radius: 12px; border: 1px solid #1d5a45; border-inline-start: 4px solid var(--embye-red);
  background: linear-gradient(155deg, var(--embye-green2), var(--embye-green) 72%);
  box-shadow: 0 6px 18px rgba(15, 61, 46, .18);
  color: #fff; text-align: start; line-height: 1.5;
}
.embye-card::after {
  content: '❄'; position: absolute; inset-inline-end: 12px; top: 6px; font-size: 44px; line-height: 1;
  color: rgba(255, 255, 255, .12); pointer-events: none;
}
.embye-card__en { display: block; margin: 0 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: var(--embye-gold); line-height: 1.5; }
.embye-card__h { margin: 0; padding: 0; font-size: 18px; font-weight: 900; line-height: 1.4; color: #fff; }
.embye-card__t { margin: 4px 0 0; padding: 0; font-size: 14.5px; font-weight: 600; line-height: 1.6; color: #e7f1ec; }
.embye-card__s {
  display: inline-flex; align-items: center; gap: 6px; margin: 9px 0 0; padding: 3px 11px;
  border-radius: 999px; border: 1px solid rgba(226, 182, 92, .6); background: rgba(226, 182, 92, .16);
  font-size: 13px; font-weight: 700; line-height: 1.5; color: #fff;
}
.emb-soldout .embye-card { display: none !important; }

/* ---------- 4. شارة كروت القوائم: فقط المنتجات المخفّضة فعلاً وغير النافذة ---------- */
article.card[data-id]:not(.card--soldout):is(:has(> .card__media .badge--offer), :has(.embdo)) > .card__body::before {
  content: "🎄 تخفيضات نهاية السنة";
  display: inline-block; align-self: center; max-width: 100%; margin: 0 0 5px; padding: 1px 10px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 999px; background: #0f3d2e; color: #fff; box-shadow: inset 0 -2px 0 #c8102e;
  font-size: 10.5px; font-weight: 800; line-height: 1.75; direction: rtl;
}

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  .embye-bar__track { animation: none; display: block; width: 100%; }
  .embye-bar__view { white-space: normal; }
  .embye-bar__grp { display: block; width: 100%; text-align: center; }
  .embye-bar__grp + .embye-bar__grp, .embye-bar__it + .embye-bar__it { display: none; }
  .embye-bar__it { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; width: 100%; padding-inline: 16px; }
  .embye-snow::before, .embye-snow::after, .embye-orn, .embye-strip__en { animation: none; }
}

/* ================= v2 (2026-12-03): بلا شريط علوي — زلاجة بابا نويل + ثلج على الصفحة + زر الأجراس ================= */
/* زلاجة بابا نويل تعبر الشريط الأخضر من اليمين لليسار كل 14 ثانية، خلف النص */
.embye-sleigh {
  position: absolute; top: 6px; right: 0; z-index: 0; pointer-events: none; white-space: nowrap;
  font-size: 26px; line-height: 1; direction: ltr;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
  animation: embye-fly 14s linear infinite;
}
.embye-sleigh span { display: inline-block; animation: embye-bob 1.2s ease-in-out infinite alternate; }
@keyframes embye-fly {
  0%   { transform: translate3d(110%, 8px, 0); opacity: 0; }
  4%   { opacity: 1; }
  45%  { transform: translate3d(calc(-100vw - 100%), -6px, 0); opacity: 1; }
  46%, 100% { transform: translate3d(calc(-100vw - 100%), -6px, 0); opacity: 0; }
}
@keyframes embye-bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@media (max-width: 599px) { .embye-sleigh { font-size: 19px; top: 4px; } }

/* ثلج خفيف على كل الصفحة: فوق المحتوى بصرياً، بس ما يمسك أي لمسة (pointer-events: none) */
.embye-flakes { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; overflow: hidden; }
.embye-flakes i {
  position: absolute; top: -30px; font-style: normal; color: #8fc3e6; line-height: 1;
  text-shadow: 0 0 2px #fff, 0 0 6px rgba(143, 195, 230, .6);
  opacity: .85; animation: embye-flake var(--d, 12s) linear var(--dl, 0s) infinite;
}
@keyframes embye-flake {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(var(--x, 20px), 52vh, 0) rotate(180deg); }
  100% { transform: translate3d(0, 106vh, 0) rotate(360deg); }
}
.embye-flakes i:nth-child(1)  { left: 4%;  font-size: 22px; --d: 13s; --dl: -2s; }
.embye-flakes i:nth-child(2)  { left: 13%; font-size: 18px; --d: 10s; --dl: -7s; --x: -18px; }
.embye-flakes i:nth-child(3)  { left: 22%; font-size: 24px; --d: 15s; --dl: -4s; }
.embye-flakes i:nth-child(4)  { left: 31%; font-size: 19px; --d: 11s; --dl: -9s; --x: -24px; }
.embye-flakes i:nth-child(5)  { left: 42%; font-size: 21px; --d: 14s; --dl: -1s; }
.embye-flakes i:nth-child(6)  { left: 53%; font-size: 17px;  --d: 9s;  --dl: -5s; --x: -14px; }
.embye-flakes i:nth-child(7)  { left: 62%; font-size: 23px; --d: 16s; --dl: -11s; }
.embye-flakes i:nth-child(8)  { left: 71%; font-size: 18px; --d: 12s; --dl: -3s; --x: -20px; }
.embye-flakes i:nth-child(9)  { left: 80%; font-size: 22px; --d: 13.5s; --dl: -8s; }
.embye-flakes i:nth-child(10) { left: 89%; font-size: 19px; --d: 10.5s; --dl: -6s; --x: -16px; }
.embye-flakes i:nth-child(11) { left: 96%; font-size: 21px; --d: 15.5s; --dl: -12s; }
@media (max-width: 599px) {
  .embye-flakes i:nth-child(2n) { display: none; }
}

/* زر الأجراس داخل الشريط الأخضر (يضيفه year-end.js) */
.embye-bell {
  position: absolute; z-index: 2; inset-inline-start: 50%; bottom: 8px; transform: translateX(50%);
  display: none;
}
.embye-strip .embye-bell {
  position: static; transform: none; display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(226, 182, 92, .7); background: rgba(0, 0, 0, .18); color: #fff;
  font: inherit; font-size: 13px; font-weight: 700; line-height: 1.5;
}
.embye-strip .embye-bell:hover { background: rgba(0, 0, 0, .3); }
.embye-strip .embye-bell:focus-visible { outline: 2px solid var(--embye-gold); outline-offset: 2px; }
.embye-bell__i { display: inline-block; transform-origin: 50% 10%; }
.embye-bell.is-ringing .embye-bell__i { animation: embye-ring .25s ease-in-out 10 alternate; }
@keyframes embye-ring { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }

@media (prefers-reduced-motion: reduce) {
  .embye-sleigh, .embye-sleigh span, .embye-flakes i, .embye-bell.is-ringing .embye-bell__i { animation: none; }
  .embye-sleigh, .embye-flakes { display: none; }
}
