/* =========================================================
   متجر المقادمة × Jawwal Pay — Customer Storefront
   اللون الأساسي: أخضر Jawwal Pay (الدفع)
   مع لمسة أحمر المقادمة كـ accent
   ========================================================= */

:root {
  --cc-bg: #f4f7fb;
  --cc-surface: #ffffff;
  --cc-surface-2: #f8fafc;

  --cc-primary: #7CB342;
  --cc-primary-dark: #558B2F;
  --cc-primary-glow: rgba(124, 179, 66, 0.18);

  --cc-accent: #C8102E;  /* أحمر المقادمة */

  --cc-text: #0f172a;
  --cc-text-muted: #64748b;
  --cc-border: rgba(15, 23, 42, 0.08);

  --cc-btn-text: #ffffff;
  --cc-nav-bg: rgba(255, 255, 255, 0.92);

  --cc-danger: #dc2626;
  --cc-danger-bg: rgba(220, 38, 38, 0.1);
  --cc-warning: #d97706;
  --cc-warning-bg: rgba(217, 119, 6, 0.12);
  --cc-success: #16a34a;
  --cc-success-bg: rgba(22, 163, 74, 0.12);

  --cc-cart-bg: #0f172a;
  --cc-cart-text: #ffffff;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] {
  --cc-bg: #050a14;
  --cc-surface: #0b132b;
  --cc-surface-2: #121d3a;

  --cc-primary: #9CCC65;
  --cc-primary-dark: #7CB342;
  --cc-primary-glow: rgba(156, 204, 101, 0.18);

  --cc-accent: #EF4444;

  --cc-text: #ffffff;
  --cc-text-muted: #94a3b8;
  --cc-border: rgba(255, 255, 255, 0.08);

  --cc-btn-text: #050a14;
  --cc-nav-bg: rgba(11, 19, 43, 0.85);

  --cc-danger: #ef4444;
  --cc-danger-bg: rgba(239, 68, 68, 0.15);
  --cc-warning: #f59e0b;
  --cc-warning-bg: rgba(245, 158, 11, 0.15);
  --cc-success: #22c55e;
  --cc-success-bg: rgba(34, 197, 94, 0.15);

  --cc-cart-bg: rgba(18, 29, 58, 0.95);
}

html[data-theme="dark"] body { color-scheme: dark; }

/* أي عنصر يحمل [hidden] لازم يختفي حتى لو الـ display تبعه flex/grid */
[hidden] { display: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--cc-bg);
  color: var(--cc-text);
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.5;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { text-decoration: none; color: inherit; }
input { font-family: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; width: 100%; }

/* ============== HEADER ============== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--cc-nav-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--cc-border);
  transition: all 0.4s ease;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  gap: 12px;
}

.brand-logos {
  display: flex; align-items: center; gap: 12px;
}
.brand-logos img {
  height: 40px;
  width: auto;
  max-width: 88px;
  object-fit: contain;
}
.brand-logos .brand-logo-main { height: 42px; }
.brand-logos .brand-logo-partner { height: 38px; }
.brand-logos-sep {
  width: 1px; height: 26px;
  background: var(--cc-border);
}

.desktop-nav { display: none; }

.actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--cc-surface); border: 1px solid var(--cc-border);
  display: grid; place-items: center; color: var(--cc-text-muted);
  transition: 0.3s;
}
.icon-btn:hover { color: var(--cc-primary); border-color: var(--cc-primary); }

/* ============== PAGES (Single-Page App) ============== */
.app-root { padding-top: 4px; }
.page { display: none; animation: fadeIn 0.3s ease; }
.page-active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.centered-block {
  text-align: center;
  padding: 60px 24px;
}
.centered-block h2 { font-size: 20px; font-weight: 900; margin: 12px 0 8px; }

.muted { color: var(--cc-text-muted); font-weight: 700; font-size: 14px; line-height: 1.7; }

/* ============== Spinner ============== */
.spinner {
  width: 42px; height: 42px;
  margin: 0 auto 18px;
  border: 3px solid var(--cc-border);
  border-top-color: var(--cc-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== Big Icons ============== */
.big-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--cc-surface-2);
  color: var(--cc-text-muted);
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.big-icon i { width: 32px; height: 32px; }
.big-icon-success { background: var(--cc-success-bg); color: var(--cc-success); }
.big-icon-danger  { background: var(--cc-danger-bg);  color: var(--cc-danger); }
.big-icon-primary { background: var(--cc-primary-glow); color: var(--cc-primary); }

/* ============== STORE BAR (هيدر مدمج للصفحة الرئيسية) ============== */
.store-bar {
  margin: 12px 20px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: storeBarIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes storeBarIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sb-network {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
}
.sb-network-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px var(--cc-primary-glow);
}
.sb-network-info { min-width: 0; }
.sb-network-info h2 {
  font-size: 15px; font-weight: 900;
  color: var(--cc-text);
  line-height: 1.2;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-stats {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--cc-text-muted); font-weight: 700;
  margin-top: 2px;
}
.sb-stats strong { color: var(--cc-primary); font-weight: 900; }
.sb-dot {
  width: 3px; height: 3px;
  background: var(--cc-text-muted);
  border-radius: 50%; opacity: 0.5;
}

.sb-secure {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--cc-success-bg);
  color: var(--cc-success);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 900;
  flex-shrink: 0;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

/* ============== ORDERS BAR ============== */
.orders-bar {
  margin: 12px 20px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.ob-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cc-primary-glow);
  color: var(--cc-primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ob-info h2 {
  font-size: 14px; font-weight: 900;
  margin: 0; line-height: 1.2;
}
.ob-info span {
  font-size: 11.5px; font-weight: 700;
  color: var(--cc-text-muted);
}

/* موبايل: مقياس أصغر */
@media (max-width: 480px) {
  .store-bar, .orders-bar { margin: 10px 14px; padding: 9px 12px; }
  .sb-network-icon { width: 36px; height: 36px; }
  .sb-network-info h2 { font-size: 14px; }
  .sb-stats { font-size: 11px; gap: 6px; }
  .sb-secure { font-size: 10px; padding: 4px 8px; }
}

/* ============== ADS BANNER ============== */
.ads-wrap {
  padding: 8px 20px 4px;
  position: relative;
}
.ads-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.ads-track::-webkit-scrollbar { display: none; }

.ad-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: 0.25s;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}
.ad-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 50%, var(--cc-primary-glow), transparent 60%);
  pointer-events: none;
  opacity: 0.6;
}
.ad-card:hover { transform: translateY(-2px); border-color: var(--cc-primary); }

.ad-image {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--cc-primary-glow);
  color: var(--cc-primary);
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 1;
}
.ad-image img { width: 100%; height: 100%; object-fit: cover; }
.ad-image i { width: 28px; height: 28px; }

/* ============================================================
   Ad Banner — بانر صورة بحجم موحد ثابت (3:1)
   الصورة تُقص لتملأ المساحة (object-fit: cover) — بغض النظر
   عن أبعاد الأصل. يعطي مظهر موحد لكل الإعلانات.
   ============================================================ */
.ad-card.ad-banner {
  padding: 0;
  border: 0;
  background: #f1f5f9;
  min-height: 0;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 1;   /* حجم موحد */
  width: 100%;
}
.ad-card.ad-banner::before { display: none; }
.ad-card.ad-banner:hover { transform: translateY(-2px); }
.ad-banner-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;      /* الصورة تملأ الـ container، الزائد يُقص */
  object-position: center;
}

/* على الجوال — نخلي البانر أعلى شوي (2.5:1) لعرض التفاصيل */
@media (max-width: 640px) {
  .ad-card.ad-banner {
    aspect-ratio: 2.5 / 1;
  }
}

.ad-text { flex: 1; min-width: 0; z-index: 1; }
.ad-text h4 {
  font-size: 14px; font-weight: 900;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-text p {
  font-size: 12px; color: var(--cc-text-muted); font-weight: 700;
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-cta {
  font-size: 11px; font-weight: 900;
  color: var(--cc-primary);
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
}

.ads-dots {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 6px;
}
.ad-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cc-border);
  transition: 0.2s;
}
.ad-dot.active { background: var(--cc-primary); width: 18px; border-radius: 4px; }

/* =================================================
   AD-HOWTO — كرت "كيف تشتري" مع محاكاة بصرية للشراء
   ================================================= */
.ad-card.ad-howto {
  background:
    linear-gradient(135deg,
      rgba(124, 179, 66, 0.96) 0%,
      rgba(34, 197, 94, 0.94) 30%,
      rgba(14, 165, 233, 0.94) 65%,
      rgba(139, 92, 246, 0.96) 100%
    );
  background-size: 280% 280%;
  animation: htbGradient 14s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  padding: 18px 20px;
  min-height: 170px;
  box-shadow:
    0 16px 40px rgba(34, 197, 94, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ad-card.ad-howto::before { background: none; opacity: 0; }
@keyframes htbGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* sweep ضوئي */
.ad-card.ad-howto::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: htbSweep 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes htbSweep {
  0%, 25% { left: -100%; }
  70%, 100% { left: 200%; }
}

/* جسيمات عائمة في الخلفية */
.htb-bg-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.htb-particle {
  position: absolute; width: 8px; height: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  filter: blur(1px);
  animation: htbFloat 7s ease-in-out infinite;
}
.htb-particle.p1 { top: 20%; right: 12%; animation-delay: 0s;   }
.htb-particle.p2 { top: 60%; right: 6%;  animation-delay: 1.4s; width: 5px; height: 5px; }
.htb-particle.p3 { top: 70%; right: 30%; animation-delay: 2.8s; width: 6px; height: 6px; }
.htb-particle.p4 { top: 30%; right: 25%; animation-delay: 4s;   width: 4px; height: 4px; }
@keyframes htbFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  50%      { transform: translate(-12px, -18px); opacity: 1; }
}

/* الـ sparkles على الزاوية */
.htb-decor {
  position: absolute;
  top: 14px; left: 16px;
  color: rgba(255,255,255,0.95);
  z-index: 2;
  animation: htbSparkle 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.7));
}
@keyframes htbSparkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 0.85; }
  50%      { transform: scale(1.35) rotate(180deg); opacity: 1; }
}

.htb-content { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; gap: 12px; }

.htb-header {
  display: flex; flex-direction: column; gap: 6px;
}
.htb-pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.22);
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
}
.ad-card.ad-howto h4 {
  font-size: 17px; font-weight: 900;
  color: #fff; margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
  white-space: normal;
  line-height: 1.3;
}
.ad-card.ad-howto h4 .htb-num {
  display: inline-block;
  background: #fff; color: var(--cc-primary);
  width: 24px; height: 24px; border-radius: 50%;
  text-align: center; line-height: 24px;
  font-size: 14px; font-weight: 900;
  margin: 0 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  animation: htbBump 2s ease-in-out infinite;
}
@keyframes htbBump {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* الخطوات الثلاث */
.htb-steps {
  display: flex; gap: 10px;
  align-items: stretch;
}
.htb-step {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px;
  padding: 10px 8px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: htbStepIn 0.6s ease both;
  position: relative;
}
.htb-step:nth-child(1) { animation-delay: 0.1s; }
.htb-step:nth-child(2) { animation-delay: 0.25s; }
.htb-step:nth-child(3) { animation-delay: 0.4s; }
@keyframes htbStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* الخطوة النشطة دورياً — تكبير + glow */
.htb-step.active {
  background: rgba(255,255,255,0.28);
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.4);
  border-color: rgba(255,255,255,0.5);
}

/* صندوق الانيميشن — أعلى كل خطوة */
.htb-anim-box {
  width: 100%; height: 52px;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(0,0,0,0.12);
}

/* النص أسفل الانيميشن */
.htb-step-text {
  display: flex; flex-direction: column; gap: 2px;
  line-height: 1.2;
  position: relative; padding-top: 2px;
}
.htb-step-num {
  position: absolute;
  top: -36px; right: -2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cc-accent);
  color: #fff;
  font-size: 11px; font-weight: 900;
  display: grid; place-items: center;
  border: 2px solid #fff;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.htb-step-text strong {
  font-size: 12px; font-weight: 900; color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.htb-step-sub {
  font-size: 10.5px; font-weight: 700;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ─── STEP 1 ANIMATION: mini card + cursor click ─── */
.htb-mini-card {
  width: 38px; height: 36px;
  background: #fff;
  border-radius: 6px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}
.htb-mc-graphic {
  height: 18px;
  background: linear-gradient(135deg, #60a5fa, #1d4ed8);
  position: relative;
}
.htb-mc-graphic::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.9) 1px, transparent 1px);
  background-size: 5px 5px; opacity: 0.4;
}
.htb-mc-btn {
  flex: 1;
  background: var(--cc-primary);
  color: #fff;
  font-size: 8px; font-weight: 900;
  display: grid; place-items: center;
}
.htb-cursor {
  position: absolute;
  top: 50%; right: 20%;
  transform: translate(50%, -50%);
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  opacity: 0;
}
.htb-cursor i { width: 14px; height: 14px; }
.htb-click-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.htb-step.active[data-step="1"] .htb-cursor {
  animation: cursorClick 2.2s ease-in-out;
}
.htb-step.active[data-step="1"] .htb-click-ring {
  animation: clickRing 2.2s ease-out;
}
.htb-step.active[data-step="1"] .htb-mini-card {
  animation: cardPress 2.2s ease-in-out;
}
@keyframes cursorClick {
  0%   { opacity: 0; transform: translate(50%, -50%) translateX(20px) translateY(20px); }
  30%  { opacity: 1; transform: translate(50%, -50%) translateX(0) translateY(0); }
  45%  { opacity: 1; transform: translate(50%, -50%) translateX(0) translateY(0) scale(0.85); }
  55%  { opacity: 1; transform: translate(50%, -50%) translateX(0) translateY(0) scale(1); }
  100% { opacity: 0; transform: translate(50%, -50%) translateX(0) translateY(0); }
}
@keyframes clickRing {
  0%, 40% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  50%     { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80%     { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
  100%    { opacity: 0; }
}
@keyframes cardPress {
  0%, 40% { transform: scale(1); }
  50%     { transform: scale(0.92); }
  60%     { transform: scale(1.05); }
  70%     { transform: scale(1); }
}

/* ─── STEP 2 ANIMATION: phone + OTP typing ─── */
.htb-phone {
  width: 28px; height: 42px;
  background: #1f2937;
  border-radius: 6px;
  padding: 4px 3px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.htb-phone::before {
  content: '';
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 1.5px;
  background: #4b5563; border-radius: 1px;
}
.htb-phone-screen {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  gap: 1.5px;
  padding-top: 2px;
}
.htb-dot {
  display: inline-block;
  width: 4px; height: 6px;
  background: rgba(124, 179, 66, 0.3);
  border-radius: 1px;
  color: transparent;
  font-size: 5px;
  text-align: center;
  line-height: 6px;
  font-weight: 900;
}
.htb-step.active[data-step="2"] .htb-phone {
  animation: phoneRing 2.5s ease-in-out;
}
.htb-step.active[data-step="2"] .htb-dot {
  animation: dotType 2.5s ease-in-out;
}
.htb-step.active[data-step="2"] .htb-dot.d1 { animation-delay: 0.3s; }
.htb-step.active[data-step="2"] .htb-dot.d2 { animation-delay: 0.6s; }
.htb-step.active[data-step="2"] .htb-dot.d3 { animation-delay: 0.9s; }
.htb-step.active[data-step="2"] .htb-dot.d4 { animation-delay: 1.2s; }
@keyframes phoneRing {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  8%       { transform: translate(-2px, 0) rotate(-3deg); }
  16%      { transform: translate(2px, 0) rotate(3deg); }
  24%      { transform: translate(-2px, 0) rotate(-3deg); }
  32%      { transform: translate(0, 0) rotate(0); }
}
@keyframes dotType {
  0%   { background: rgba(124, 179, 66, 0.3); color: transparent; }
  100% { background: #7CB342; color: #fff; box-shadow: 0 0 4px rgba(124, 179, 66, 0.8); }
}

/* ─── STEP 3 ANIMATION: success check + confetti ─── */
.htb-check-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  display: grid; place-items: center;
  position: relative;
  z-index: 2;
}
.htb-check-svg {
  width: 22px; height: 22px;
  stroke: #fff; stroke-width: 3;
  fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.htb-step.active[data-step="3"] .htb-check-svg {
  animation: drawCheck 1.4s ease-out forwards;
}
.htb-step.active[data-step="3"] .htb-check-circle {
  animation: checkBurst 2.4s ease-out;
}
@keyframes drawCheck {
  0%   { stroke-dashoffset: 30; }
  100% { stroke-dashoffset: 0; }
}
@keyframes checkBurst {
  0%   { transform: scale(0.6); opacity: 0; }
  30%  { transform: scale(1.15); opacity: 1; }
  50%  { transform: scale(1); }
}

.htb-confetti {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 1px;
  opacity: 0;
}
.htb-confetti.c1 { background: #fbbf24; top: 50%; left: 50%; }
.htb-confetti.c2 { background: #ef4444; top: 50%; left: 50%; }
.htb-confetti.c3 { background: #3b82f6; top: 50%; left: 50%; }
.htb-confetti.c4 { background: #a78bfa; top: 50%; left: 50%; }
.htb-confetti.c5 { background: #f97316; top: 50%; left: 50%; }
.htb-step.active[data-step="3"] .htb-confetti { animation: confettiBurst 2.2s ease-out forwards; }
.htb-step.active[data-step="3"] .htb-confetti.c1 { --tx: -22px; --ty: -22px; animation-delay: 0.6s; }
.htb-step.active[data-step="3"] .htb-confetti.c2 { --tx: 22px;  --ty: -22px; animation-delay: 0.7s; }
.htb-step.active[data-step="3"] .htb-confetti.c3 { --tx: -28px; --ty: 0;     animation-delay: 0.8s; }
.htb-step.active[data-step="3"] .htb-confetti.c4 { --tx: 28px;  --ty: 0;     animation-delay: 0.7s; }
.htb-step.active[data-step="3"] .htb-confetti.c5 { --tx: 0;     --ty: -26px; animation-delay: 0.6s; }
@keyframes confettiBurst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(180deg); }
}

/* ads-wrap لا تختفي مهما كان */
.ads-wrap[hidden] { display: none !important; }

/* موبايل: مقياس مضغوط */
@media (max-width: 480px) {
  .ad-card.ad-howto { padding: 16px; min-height: 158px; }
  .ad-card.ad-howto h4 { font-size: 15px; }
  .htb-step { padding: 8px 5px 7px; }
  .htb-step-text strong { font-size: 11px; }
  .htb-step-sub { font-size: 9.5px; }
  .htb-anim-box { height: 46px; }
  .htb-phone { width: 24px; height: 36px; }
  .htb-mini-card { width: 32px; height: 30px; }
  .htb-check-circle { width: 30px; height: 30px; }
  .htb-check-svg { width: 18px; height: 18px; }
  .htb-pill { font-size: 10px; padding: 3px 8px; }
}

/* ============== FILTERS ============== */
.filters {
  padding: 10px 20px 14px;
  display: flex; gap: 10px; overflow-x: auto;
  scrollbar-width: none;
  position: sticky; top: 72px; z-index: 90;
  background: var(--cc-bg);
}
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 10px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 800;
  background: var(--cc-surface); border: 1px solid var(--cc-border);
  color: var(--cc-text-muted);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.filter-chip.active {
  background: var(--cc-primary); color: var(--cc-btn-text); border-color: var(--cc-primary);
  box-shadow: 0 6px 15px var(--cc-primary-glow); transform: translateY(-2px);
}
/* عند توفّر لون تصنيف، الشيب النشط يستخدم اللون الديناميكي */
.filter-chip.cat-colored.active {
  background: var(--cat-color);
  border-color: var(--cat-color);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cat-color) 45%, transparent);
}
.filter-chip.cat-colored:not(.active) i { color: var(--cat-color); }

/* ============================================================
   Restore Hero Button — زر "استرجاع مشترياتي" فوق الفئات
   ============================================================ */
.restore-hero-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 40px);
  margin: 14px 20px 4px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #fff;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
}
.restore-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.4);
}
.restore-hero-btn:active { transform: translateY(0); }
.restore-hero-btn > i:first-child {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 10px;
  flex-shrink: 0;
}
.restore-hero-text { flex: 1; text-align: start; }
.restore-hero-title {
  font-size: 15px; font-weight: 900; letter-spacing: -.2px;
}
.restore-hero-subtitle {
  font-size: 11.5px; opacity: .88; margin-top: 2px; font-weight: 500;
}
.restore-hero-arrow { opacity: .7; flex-shrink: 0; }

/* Modal Restore OTP */
#restoreOtpModal .modal-card { padding: 24px; }
#restoreOtpModal .form-group { margin-bottom: 14px; }
#restoreOtpModal .form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--cc-border);
  border-radius: 10px; font-size: 14px;
  font-family: inherit;
  background: var(--cc-surface);
  color: var(--cc-text);
}
#restoreOtpModal .form-control:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* ============================================================
   MOBILE: البطاقات (product cards) تحت بعضها + إخفاء البحث
   ============================================================ */
@media (max-width: 640px) {
  /* البطاقات (زر اشترِ لكل واحدة) في column واحد */
  .grid,
  .grid.grouped {
    grid-template-columns: 1fr !important;
    gap: 12px;
    padding: 0 16px 20px;
  }

  /* على "الكل": الـ cat-section-grid يصير عمود بدل صف أفقي */
  .cat-section-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow-x: visible !important;
    padding: 4px 0 12px !important;
    margin-inline: 0 !important;
  }

  /* كل card داخل الـ cat-section-grid يشغل عرض كامل */
  .cat-section-grid > .card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    scroll-snap-align: none !important;
  }

  /* الفئات chips تبقى أفقياً scrollable (كما كانت) */

  /* إخفاء البحث والفرز */
  #searchSortRow { display: none !important; }

  /* الزر الاسترجاع أوسع */
  .restore-hero-btn {
    padding: 14px 16px;
    margin: 12px 16px 4px;
    width: calc(100% - 32px);
  }
}


/* ============== PRODUCT GRID ============== */
.grid {
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* =================================================
   PREMIUM PRODUCT CARD
   ================================================= */
.card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 22px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.3s ease;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  cursor: default;
}

/* Shimmer sweep on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.12) 50%,
    transparent 100%
  );
  transition: left 0.85s ease-out;
  pointer-events: none;
  z-index: 4;
}
.card:hover:not(.out-of-stock) {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--cc-primary);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.12),
    0 0 0 1px var(--cc-primary-glow),
    0 0 30px var(--cc-primary-glow);
}
.card:hover:not(.out-of-stock)::before { left: 120%; }
.card:active:not(.out-of-stock) { transform: translateY(-4px) scale(1.005); }

.card.hide { display: none; }

/* Staggered entrance animation */
.card.show {
  opacity: 0;
  animation: cardEntry 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.card.show:nth-child(1)  { animation-delay: 0.04s; }
.card.show:nth-child(2)  { animation-delay: 0.08s; }
.card.show:nth-child(3)  { animation-delay: 0.12s; }
.card.show:nth-child(4)  { animation-delay: 0.16s; }
.card.show:nth-child(5)  { animation-delay: 0.20s; }
.card.show:nth-child(6)  { animation-delay: 0.24s; }
.card.show:nth-child(7)  { animation-delay: 0.28s; }
.card.show:nth-child(8)  { animation-delay: 0.32s; }
.card.show:nth-child(9)  { animation-delay: 0.36s; }
.card.show:nth-child(10) { animation-delay: 0.40s; }
.card.show:nth-child(n+11) { animation-delay: 0.45s; }

@keyframes cardEntry {
  0%   { opacity: 0; transform: translateY(28px) scale(0.94); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card.out-of-stock { opacity: 0.55; filter: grayscale(0.7); }

/* OUT-OF-STOCK badge */
.badge-out {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  background: var(--cc-danger-bg); color: var(--cc-danger);
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  border: 1px solid var(--cc-danger);
  backdrop-filter: blur(4px);
}

/* LOW STOCK urgent badge (آخر X) */
.badge-urgent {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55);
  animation: urgentPulse 2.2s ease-in-out infinite;
  display: inline-flex; align-items: center; gap: 4px;
}
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55); }
  50%      { transform: scale(1.08); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.75); }
}

/* HOT/POPULAR badge — للباقات الأكثر طلباً */
.badge-hot {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.5);
  animation: hotShake 4s ease-in-out infinite;
}
@keyframes hotShake {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-4deg); }
  94% { transform: rotate(4deg); }
  96% { transform: rotate(-4deg); }
  98% { transform: rotate(0); }
}

/* =================================================
   CARD GRAPHIC (الجزء العلوي بالـ gradient)
   ================================================= */
.card-graphic {
  height: 108px; border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -20px 40px rgba(0,0,0,0.12);
  transition: transform 0.4s ease;
}
.card:hover:not(.out-of-stock) .card-graphic { transform: scale(1.02); }

.bg-wifi  {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1e40af 100%);
}
.bg-adsl  {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #5b21b6 100%);
}
.bg-voice {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #c2410c 100%);
}
.bg-default {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #047857 100%);
}

/* Animated floating dots pattern */
.card-graphic::after {
  content: ''; position: absolute; inset: 0; opacity: 0.18;
  background-image:
    radial-gradient(rgba(255,255,255,0.9) 1px, transparent 1.5px),
    radial-gradient(rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 14px 14px, 22px 22px;
  background-position: 0 0, 7px 7px;
  animation: floatDots 25s linear infinite;
}
@keyframes floatDots {
  0%   { background-position: 0 0, 7px 7px; }
  100% { background-position: 28px 28px, 35px 35px; }
}

/* Diagonal shine band */
.card-graphic::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 40%; height: 200%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.15) 50%,
    transparent 65%
  );
  transform: rotate(15deg);
  pointer-events: none;
}

.cg-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  z-index: 2; position: relative; color: #fff;
}
.cg-top span {
  font-size: 11px; font-weight: 900;
  background: rgba(0,0,0,0.3);
  padding: 5px 10px; border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.3px;
}

.cg-data {
  z-index: 2; position: relative; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.cg-data b {
  font-size: 28px; font-weight: 900; line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  display: inline-flex; align-items: center;
}
.cg-data b svg { width: 26px !important; height: 26px !important; }
.cg-data span {
  font-size: 12px; font-weight: 800; opacity: 0.95;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* =================================================
   CARD INFO + BOTTOM
   ================================================= */
.card-info { display: flex; flex-direction: column; gap: 8px; }
.card-info h3 {
  font-size: 13.5px; font-weight: 800; line-height: 1.45;
  color: var(--cc-text); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.card-meta {
  display: flex; gap: 10px;
  font-size: 11px; color: var(--cc-text-muted); font-weight: 700;
}
.card-meta div {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--cc-surface-2);
  border-radius: 999px;
}

.card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}
.price {
  font-size: 18px; font-weight: 900;
  color: var(--cc-primary);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -0.5px;
  display: flex; align-items: baseline; gap: 2px;
}
.price::after {
  content: '';
  display: block;
  width: 100%; height: 2px;
  margin-top: 2px;
  background: linear-gradient(90deg, var(--cc-primary), transparent);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover:not(.out-of-stock) .price::after { opacity: 1; }

.btn-add {
  min-width: 92px; height: 40px; padding: 0 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
  border: none;
  color: white;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 900; font-size: 13px;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  box-shadow: 0 4px 12px var(--cc-primary-glow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Sweep shine */
.btn-add::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.45), transparent);
  transition: left 0.55s ease-out;
  z-index: -1;
}
.btn-add:not(:disabled):hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 22px var(--cc-primary-glow), 0 0 30px var(--cc-primary-glow);
}
.btn-add:not(:disabled):hover::before { left: 130%; }
.btn-add:not(:disabled):active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}
.btn-add:disabled {
  background: var(--cc-bg); color: var(--cc-text-muted);
  opacity: 0.65; cursor: not-allowed;
  box-shadow: none;
}
.btn-add.added {
  animation: addedBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes addedBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* عند وجود الباقة في السلة، نظهر quantity stepper بدل زر + */
.card-bottom .qty-stepper {
  display: flex; align-items: center; gap: 6px;
  background: var(--cc-surface-2); border: 1px solid var(--cc-primary);
  border-radius: 10px; padding: 4px;
}
.qty-stepper button {
  width: 28px; height: 28px; border-radius: 8px;
  background: transparent; color: var(--cc-primary);
  display: grid; place-items: center;
}
.qty-stepper button:hover { background: var(--cc-primary-glow); }
.qty-stepper span {
  min-width: 24px; text-align: center;
  font-weight: 900; color: var(--cc-text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
}

/* ============== FLOATING CART BAR ============== */
.cart-wrapper {
  position: fixed;
  bottom: calc(75px + env(safe-area-inset-bottom));
  left: 0; right: 0; z-index: 95;
  display: flex; justify-content: center; padding: 0 16px;
  pointer-events: none;
}
.cart-bar {
  width: 100%; max-width: 450px;
  background: var(--cc-cart-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 20px var(--cc-primary-glow);

  transform: translateY(150%); opacity: 0; pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.cart-bar.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cart-bar.bounce { animation: cartBounce 0.4s ease; }
@keyframes cartBounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

.cb-info { display: flex; align-items: center; gap: 12px; }
.cb-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.1);
  color: var(--cc-cart-text);
  display: grid; place-items: center;
  position: relative;
}
.cb-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--cc-accent); color: #fff;
  font-size: 11px; font-weight: 900;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--cc-cart-bg);
}
.cb-text h4 { font-size: 14px; font-weight: 800; color: var(--cc-cart-text); line-height: 1.2; }
.cb-text span { font-size: 15px; font-weight: 700; color: var(--cc-primary); }

.cb-btn {
  background: var(--cc-primary); color: var(--cc-btn-text);
  font-size: 14px; font-weight: 800;
  padding: 10px 18px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  transition: 0.2s;
}
.cb-btn:hover { opacity: 0.92; transform: translateY(-2px); }

/* ============== BOTTOM NAV (Mobile) ============== */
.nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--cc-nav-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--cc-border);
  display: flex; justify-content: space-around;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--cc-text-muted); font-size: 11px; font-weight: 700;
  transition: 0.3s;
  flex: 1;
}
.nav-item.active { color: var(--cc-primary); }
.nav-item.active svg { stroke-width: 2.5; filter: drop-shadow(0 0 5px var(--cc-primary-glow)); }

/* Global: تأكيد إن HTML hidden attribute يخفي العنصر دائماً (يتجاوز أي display:* محدد) */
[hidden] { display: none !important; }

.nav-cart-icon { position: relative; display: inline-flex; }
.nav-cart-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--cc-accent); color: #fff;
  font-size: 10px; font-weight: 900;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  display: inline-grid; place-items: center;
  border: 2px solid var(--cc-bg);
  font-family: 'IBM Plex Mono', monospace;
}
/* badge في الـ desktop nav */
.desktop-nav .nav-cart {
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
.desktop-nav .nav-cart-badge {
  position: static;
  border: 0;
  background: var(--cc-primary);
  color: var(--cc-btn-text);
}

/* ============== EMPTY STATES ============== */
.empty-block {
  text-align: center; padding: 50px 20px;
}
.empty-block h3 { font-size: 16px; font-weight: 900; margin-bottom: 6px; }

.orders-state {
  text-align: center; padding: 40px 24px;
  background: var(--cc-surface); border: 1px solid var(--cc-border);
  border-radius: 20px; margin: 20px;
}
.orders-state h3 { font-size: 18px; font-weight: 900; margin: 4px 0 10px; }
.orders-state .otp-inputs { margin: 20px auto; }
.orders-state .btn { margin-top: 16px; min-width: 200px; }

/* ============== ORDERS LIST (Accordion) ============== */
#ordersList { padding: 10px 20px 20px; }
.order-batch {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}
.order-batch.open { border-color: var(--cc-primary); }

.order-batch-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  user-select: none;
  background: var(--cc-surface);
  transition: background 0.2s;
}
.order-batch-head:hover { background: var(--cc-surface-2); }
.order-batch-head .meta-left {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0;
}
.order-network-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 900;
  color: var(--cc-primary);
  background: var(--cc-primary-glow);
  padding: 3px 8px; border-radius: 6px;
  width: fit-content;
  margin-bottom: 2px;
}
.order-batch-head .date {
  font-size: 12px; color: var(--cc-text-muted);
  font-weight: 700; display: flex; align-items: center; gap: 4px;
}
.order-batch-head .qty {
  font-size: 13px; font-weight: 800; color: var(--cc-text);
}
.order-batch-head .meta-right {
  display: flex; align-items: center; gap: 12px;
}
.order-batch-head .total {
  font-size: 16px; font-weight: 900;
  color: var(--cc-primary);
}
.order-batch-head .chevron {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--cc-surface-2); border: 1px solid var(--cc-border);
  display: grid; place-items: center;
  color: var(--cc-text-muted);
  transition: transform 0.3s;
}
.order-batch.open .chevron { transform: rotate(180deg); color: var(--cc-primary); }

.order-batch-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 18px;
}
.order-batch.open .order-batch-body {
  /* قيمة كبيرة لاستيعاب batches فيها عدد كروت كبير (حتى 50+ بطاقة).
     2000px القديمة كانت تقص بعد ~6 بطاقات (كل بطاقة ~290px) + overflow:hidden
     يخفي الباقي بدون أي scrollbar — كأن البطاقات ما موجودة في الـ UI. */
  max-height: 20000px;
  padding: 0 18px 18px;
  border-top: 1px dashed var(--cc-border);
  padding-top: 14px;
}
.order-card {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.order-card:last-child { margin-bottom: 0; }
.order-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.order-card-head .name {
  font-size: 14px; font-weight: 900;
  flex: 1; min-width: 0;
}
.order-card-head .amt {
  font-size: 13px; font-weight: 800;
  color: var(--cc-primary);
  font-family: 'IBM Plex Mono', monospace;
}
.card-short-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-inline-start: 6px;
  padding: 2px 8px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: middle;
  cursor: help;
}
.card-short-badge i { opacity: 0.85; }

/* ============== CARD STATES (داخل بطاقة الطلب) ============== */
.card-state-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 0 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid;
}
.card-state-badge .when {
  color: var(--cc-text-muted);
  font-weight: 700;
  font-size: 10.5px;
}

/* بطاقة جديدة (لم تُستخدم ولم تُنسخ) — أخضر */
.card-state-badge.state-fresh {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}
.order-card.is-fresh { border-color: rgba(16, 185, 129, 0.35); }

/* تم نسخها — أصفر/كهرماني */
.card-state-badge.state-copied {
  background: rgba(245, 158, 11, 0.13);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.32);
}
.order-card.is-copied { border-color: rgba(245, 158, 11, 0.4); }

/* تم استخدامها — أزرق */
.card-state-badge.state-used {
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
  border-color: rgba(20, 184, 166, 0.3);
}
.order-card.is-used { border-color: rgba(20, 184, 166, 0.35); }

/* ملاحظة معروضة (تحت كلمة المرور) */
.order-card-note-display {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 7px 10px;
  background: rgba(99, 102, 241, 0.07);
  border-right: 3px solid var(--cc-primary);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--cc-text);
  cursor: pointer;
  transition: background 0.15s;
}
.order-card-note-display:hover { background: rgba(99, 102, 241, 0.12); }
.order-card-note-display .note-text { flex: 1; font-weight: 700; }
.order-card-note-display i { color: var(--cc-primary); flex-shrink: 0; }
.order-card-note-display .note-edit-btn {
  background: none; border: 0; cursor: pointer; color: var(--cc-text-muted);
  padding: 2px; display: inline-flex; align-items: center;
}
.order-card-note-display .note-edit-btn:hover { color: var(--cc-primary); }

/* زر إضافة/تعديل الملاحظة */
.btn-note {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  background: var(--cc-surface-2);
  color: var(--cc-text);
  border: 1px dashed var(--cc-border);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
  width: 100%;
}
.btn-note:hover { border-color: var(--cc-primary); color: var(--cc-primary); }

/* زر "دخول" للبطاقة */
.order-card-actions {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--cc-border);
}
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--cc-primary); color: var(--cc-btn-text);
  border-radius: 10px;
  font-size: 13px; font-weight: 900;
  text-decoration: none;
  transition: 0.2s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--cc-primary-glow); }
.btn-login.disabled {
  background: var(--cc-surface-2);
  color: var(--cc-text-muted);
  cursor: not-allowed;
  pointer-events: none;
  border: 1px dashed var(--cc-border);
}
.order-card-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.order-card-row .lbl {
  font-size: 11px; color: var(--cc-text-muted); font-weight: 800;
  min-width: 70px;
}
.order-card-row .val {
  font-size: 14px; font-weight: 800;
  background: var(--cc-bg);
  padding: 6px 10px; border-radius: 8px;
  flex: 1;
  word-break: break-all;
  font-family: 'IBM Plex Mono', monospace;
}
.copy-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--cc-primary-glow); color: var(--cc-primary);
  display: grid; place-items: center;
  transition: 0.2s;
}
.copy-btn:hover { background: var(--cc-primary); color: var(--cc-btn-text); }
.copy-btn.copied { background: var(--cc-success); color: #fff; }

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 10, 20, 0.55);
  z-index: 2000;
  display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 0;
}
.modal-overlay.show { display: flex; animation: fadeOverlay 0.3s ease; }
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--cc-surface);
  width: 100%; max-width: 480px;
  border-radius: 22px 22px 0 0;
  padding: 22px;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.3);
  position: relative;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cc-border);
}
.modal-header h3 {
  font-size: 17px; font-weight: 900;
  display: flex; align-items: center; gap: 8px;
}
.modal-header h3 i { color: var(--cc-primary); }
.modal-close {
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--cc-text-muted);
  display: grid; place-items: center;
  transition: 0.2s;
}
.modal-close:hover { background: var(--cc-surface-2); color: var(--cc-danger); }

.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--cc-border);
}

/* ============== CART MODAL ============== */
.cart-items { display: flex; flex-direction: column; gap: 10px; max-height: 50dvh; overflow-y: auto; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
}
.cart-item-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--cc-primary-glow); color: var(--cc-primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 {
  font-size: 13px; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-info .price-line {
  font-size: 12px; color: var(--cc-text-muted); font-weight: 700;
  margin-top: 2px;
}
.cart-item-info .price-line strong {
  color: var(--cc-primary); font-family: 'IBM Plex Mono', monospace;
}
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.cart-qty-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--cc-surface); border: 1px solid var(--cc-border);
  color: var(--cc-text);
  display: grid; place-items: center;
  transition: 0.2s;
}
.cart-qty-btn:hover { border-color: var(--cc-primary); color: var(--cc-primary); }
.cart-qty-btn.remove:hover { border-color: var(--cc-danger); color: var(--cc-danger); }
.cart-qty-val { min-width: 24px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-weight: 900; }

.cart-empty { text-align: center; padding: 30px 20px; }

.cart-footer {
  display: flex; flex-direction: column; gap: 12px;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; font-weight: 900;
}
.cart-total-row span:last-child { color: var(--cc-primary); font-size: 20px; }

/* ============== CHECKOUT MODAL ============== */
.checkout-summary {
  background: var(--cc-surface-2); border: 1px solid var(--cc-border);
  border-radius: 12px; padding: 14px;
}
.checkout-summary .row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; padding: 4px 0;
  color: var(--cc-text-muted);
}
.checkout-summary .row.total {
  border-top: 1px dashed var(--cc-border);
  margin-top: 6px; padding-top: 10px;
  font-size: 15px; font-weight: 900;
  color: var(--cc-text);
}
.checkout-summary .row.total strong { color: var(--cc-primary); font-size: 17px; }

.field { margin-bottom: 4px; }
.field label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 8px; }

.phone-input {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--cc-border); border-radius: 14px;
  background: var(--cc-surface-2); overflow: hidden;
  transition: 0.2s;
}
.phone-input:focus-within {
  background: var(--cc-surface); border-color: var(--cc-primary);
  box-shadow: 0 0 0 4px var(--cc-primary-glow);
}
.phone-prefix {
  padding: 14px 14px;
  background: rgba(0,0,0,0.04);
  color: var(--cc-text); font-weight: 900; font-size: 15px;
  border-inline-end: 1px solid var(--cc-border);
}
.phone-input input {
  flex: 1; border: 0; outline: 0;
  background: transparent;
  font-size: 16px; font-weight: 700;
  padding: 14px 12px;
  direction: ltr; text-align: start;
  color: var(--cc-text);
}
.phone-input input::placeholder { color: #94a3b8; }
.phone-input.no-prefix input { direction: rtl; text-align: start; }

.hint { font-size: 11px; color: var(--cc-text-muted); margin-top: 6px; font-weight: 700; }

/* ============== "كروتي" pulse — تنبيه بصري بكروت جديدة ============== */
.cards-pulse-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #dc2626; border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65);
  animation: cards-pulse 1.4s ease-out infinite;
  margin-inline-start: 6px;
  vertical-align: middle;
  position: relative;
}
.cards-pulse-dot[hidden] { display: none; }
@keyframes cards-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65); }
  70%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Mobile nav-item: السهم الحمراء + الـ shake لما في كروت جديدة */
.nav-item[data-view="orders"].has-new-cards {
  animation: cards-shake 1.6s ease-in-out infinite;
}
.nav-item[data-view="orders"].has-new-cards::before {
  content: "←";
  position: absolute;
  top: -8px; right: 8px;
  color: #dc2626; font-size: 20px; font-weight: 900;
  animation: arrow-bounce 0.9s ease-in-out infinite;
}
@keyframes cards-shake {
  0%, 100% { transform: translateY(0); }
  10%, 30%, 50% { transform: translateY(-2px); }
  20%, 40%      { transform: translateY(2px); }
}
@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Desktop nav link: لون أحمر + bold لما في كروت جديدة */
.desktop-nav a.has-new-cards {
  color: #dc2626 !important;
  font-weight: 900;
}

/* ============== OTP / PIN INPUTS ============== */
.otp-center { text-align: center; }
.otp-inputs {
  display: flex; gap: 8px; justify-content: center; direction: ltr;
  margin: 16px 0;
}
.otp-cell {
  width: 46px; height: 54px;
  border: 1.5px solid var(--cc-border); border-radius: 12px;
  background: var(--cc-surface-2);
  font-size: 22px; font-weight: 900; text-align: center;
  color: var(--cc-text); outline: 0;
  transition: 0.15s;
}
.otp-cell:focus {
  background: var(--cc-surface); border-color: var(--cc-primary);
  box-shadow: 0 0 0 4px var(--cc-primary-glow);
}
.otp-cell.filled { background: var(--cc-surface); border-color: var(--cc-primary); }

.otp-timer {
  text-align: center;
  color: var(--cc-text-muted); font-size: 13px; font-weight: 800;
  margin: 14px 0;
  display: flex; align-items: center; gap: 6px; justify-content: center;
}
.otp-timer.expiring { color: var(--cc-danger); }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 14px;
  font-size: 15px; font-weight: 900;
  transition: 0.2s; cursor: pointer;
  border: 1px solid transparent;
}
.btn-block { width: 100%; }
.btn-primary {
  background: var(--cc-primary); color: var(--cc-btn-text);
  box-shadow: 0 6px 14px var(--cc-primary-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--cc-surface-2); color: var(--cc-text);
  border-color: var(--cc-border);
}
.btn-secondary:hover { background: var(--cc-bg); }
.btn-ghost { color: var(--cc-text-muted); }
.btn-ghost:hover { background: var(--cc-surface-2); color: var(--cc-text); }

/* ============== Biometric banner ============== */
.biometric-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--cc-primary-glow), var(--cc-surface));
  border: 1px solid var(--cc-primary);
  border-radius: 16px;
  padding: 16px;
  margin: 0 20px 18px;
  flex-wrap: wrap;
}
.bm-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--cc-primary); color: var(--cc-btn-text);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 12px var(--cc-primary-glow);
}
.bm-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.bm-text strong { font-size: 14px; font-weight: 900; }
.bm-text span { font-size: 12px; color: var(--cc-text-muted); font-weight: 700; line-height: 1.5; }
.bm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bm-actions .btn-sm { padding: 8px 14px; font-size: 13px; }

/* ============== Recovery Options (in forgot modal) ============== */
.recover-option {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: start;
  padding: 16px; margin-bottom: 10px;
  background: var(--cc-surface-2);
  border: 1.5px solid var(--cc-border);
  border-radius: 14px;
  transition: 0.2s;
  cursor: pointer;
}
.recover-option:hover { border-color: var(--cc-primary); background: var(--cc-surface); transform: translateY(-2px); }
.recover-option-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--cc-primary-glow); color: var(--cc-primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.recover-option-info { flex: 1; min-width: 0; }
.recover-option-info h4 { font-size: 14px; font-weight: 900; margin-bottom: 4px; }
.recover-option-info p { font-size: 12px; color: var(--cc-text-muted); font-weight: 700; line-height: 1.5; }
.recover-option-chev { color: var(--cc-text-muted); flex-shrink: 0; }

/* ============== Step Indicator (1 → 2 → 3) ============== */
.step-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 12px 18px 4px;
  margin-bottom: 4px;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  background: var(--cc-bg);
  color: var(--cc-text-muted);
  border: 2px solid var(--cc-border);
  transition: 0.25s ease;
}
.step-lbl {
  font-size: 11px; font-weight: 800;
  color: var(--cc-text-muted);
}
.step.active .step-num {
  background: var(--cc-primary); color: white;
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 4px var(--cc-primary-glow);
}
.step.active .step-lbl { color: var(--cc-primary); }
.step.done .step-num {
  background: var(--cc-success, #10b981); color: white;
  border-color: var(--cc-success, #10b981);
}
.step.done .step-lbl { color: var(--cc-success, #10b981); }
.step-line {
  flex: 1; height: 2px; background: var(--cc-border);
  border-radius: 2px;
  max-width: 60px;
  transition: 0.25s ease;
}
.step-line.done { background: var(--cc-success, #10b981); }

/* ============== Trust Row (small reassurance line under buttons) ============== */
.trust-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px;
  font-size: 12px; font-weight: 700;
  color: var(--cc-text-muted);
}
.trust-row i { color: var(--cc-success, #10b981); }

/* ============== OTP — تحسين عرض الرقم ============== */
.otp-phone-display {
  display: inline-block;
  font-size: 18px; font-weight: 900;
  background: var(--cc-primary-glow);
  color: var(--cc-primary);
  padding: 8px 16px;
  border-radius: 10px;
  letter-spacing: 1px;
  margin: 8px auto;
  direction: ltr;
}
.link-btn {
  background: none; border: none;
  color: var(--cc-primary); font-weight: 800;
  font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  margin-bottom: 12px;
}
.link-btn:hover { background: var(--cc-primary-glow); }

/* ============== WhatsApp Share Button ============== */
.btn-whatsapp {
  background: #25D366; color: #fff;
  border: none; font-weight: 900;
  padding: 12px 18px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-size: 14px;
  transition: 0.2s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:hover { background: #1eb558; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5); }
.btn-whatsapp i { stroke-width: 2.5; }

/* ============== Repeat purchase button (orders) ============== */
.btn-repeat {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cc-primary-glow); color: var(--cc-primary);
  font-weight: 800; font-size: 12px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--cc-primary);
  cursor: pointer; transition: 0.2s;
}
.btn-repeat:hover { background: var(--cc-primary); color: #fff; }

/* ============== ALERTS ============== */
.alert {
  padding: 12px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--cc-danger-bg);  color: #991b1b; border-color: rgba(220, 38, 38, 0.2); }
.alert-warning { background: var(--cc-warning-bg); color: #92400e; border-color: rgba(217, 119, 6, 0.2); }
html[data-theme="dark"] .alert-danger  { color: #fecaca; }
html[data-theme="dark"] .alert-warning { color: #fde68a; }

/* ============== OTP ERROR CARD (احترافي مع shake + animation) ============== */
.otp-error-card {
  padding: 12px 14px; border-radius: 14px;
  display: flex; align-items: flex-start; gap: 11px;
  border: 1px solid; margin: 4px 0 2px;
  animation: otpErrIn 0.22s cubic-bezier(.2,.7,.3,1.4);
  text-align: start;
}
.otp-error-card.kind-error {
  background: var(--cc-danger-bg); color: #991b1b;
  border-color: rgba(220, 38, 38, 0.32);
}
.otp-error-card.kind-warn {
  background: var(--cc-warning-bg); color: #92400e;
  border-color: rgba(217, 119, 6, 0.32);
}
.otp-error-card.kind-info {
  background: rgba(59, 130, 246, 0.08); color: #1e40af;
  border-color: rgba(59, 130, 246, 0.28);
}
.otp-error-card .err-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.42);
}
.otp-error-card .err-body { flex: 1; min-width: 0; }
.otp-error-card .err-title { font-size: 13.5px; font-weight: 900; line-height: 1.3; margin-bottom: 2px; display: block; }
.otp-error-card .err-msg   { font-size: 12.5px; font-weight: 600; line-height: 1.5; opacity: 0.88; }

html[data-theme="dark"] .otp-error-card.kind-error { color: #fecaca; background: rgba(220, 38, 38, 0.14); }
html[data-theme="dark"] .otp-error-card.kind-warn  { color: #fde68a; background: rgba(217, 119, 6, 0.14); }
html[data-theme="dark"] .otp-error-card.kind-info  { color: #bfdbfe; background: rgba(59, 130, 246, 0.14); }
html[data-theme="dark"] .otp-error-card .err-icon  { background: rgba(255, 255, 255, 0.10); }

@keyframes otpErrIn {
  0%   { opacity: 0; transform: translateY(-6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  18%, 58% { transform: translateX(-8px); }
  38%, 78% { transform: translateX(8px); }
}
.otp-inputs.shake { animation: otpShake 0.42s cubic-bezier(.36,.07,.19,.97); }
.otp-cell.err-flash { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }

/* Resend button — disabled state with countdown */
#btnResendOtp:disabled,
#btnResendOtp[disabled] {
  opacity: 0.6; cursor: not-allowed;
}
#resendCountdown {
  font-size: 12px; text-align: center; margin-top: 6px;
  color: var(--cc-text-muted); font-weight: 700;
}
#resendCountdown .mono { color: var(--cc-text); font-weight: 900; }

/* ============== RESUME PAYMENT MODE (cart CTA = "أكمل الدفع") ============== */
.cb-btn.resume-mode,
#btnGoCheckout.resume-mode {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
  animation: cbResumePulse 2s ease-in-out infinite;
}
.cb-btn.resume-mode:hover,
#btnGoCheckout.resume-mode:hover {
  background: linear-gradient(135deg, #ea8b08 0%, #c0680a 100%) !important;
  filter: brightness(1.05);
}
.cb-btn.resume-mode .mono,
#btnGoCheckout.resume-mode .mono {
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 8px; border-radius: 8px;
  font-weight: 900;
  margin-inline-start: 4px;
}
@keyframes cbResumePulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.30), 0 0 0 0 rgba(245, 158, 11, 0.45); }
  50%      { box-shadow: 0 4px 24px rgba(245, 158, 11, 0.55), 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* أظهر cart bar حتى لو السلة فاضية لما في resume mode */
.cart-bar.force-show { display: flex !important; }

/* ============== SUCCESS MODAL ============== */
.modal-success-card { text-align: center; padding: 30px 22px 22px; }
.success-burst { margin-bottom: 4px; }
.success-title { font-size: 22px; font-weight: 900; margin-bottom: 8px; }

.success-cards { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; text-align: start; }
.success-card-row {
  background: var(--cc-surface-2); border: 1px solid var(--cc-border);
  border-radius: 14px; padding: 14px;
}
.success-card-row .product-line {
  font-size: 13px; font-weight: 900; color: var(--cc-text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--cc-border);
}
.success-card-actions {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--cc-border);
  display: flex; justify-content: stretch;
}
.btn-use {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 10px; border: 0;
  background: linear-gradient(90deg, var(--cc-primary), #6366f1);
  color: #fff; font-weight: 900; font-size: 13.5px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-use:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--cc-primary-glow); }
.btn-use i { opacity: 0.95; }

.success-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.success-actions .btn { flex: 1; min-width: 130px; }

/* ============== TOAST ============== */
/* ============== SUPPORT CHAT (Nav-link + Drawer) ============== */
/* FAB removed — replaced by nav-link with red dot for clarity */
.support-fab { display: none !important; }

/* Red-dot pulse على nav links */
.nav-support-dot {
    position: absolute;
    top: 4px; inset-inline-end: 22%;
    width: 9px; height: 9px;
    background: #ef4444;
    border: 2px solid var(--cc-bg);
    border-radius: 50%;
    animation: supDotPulse 1.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
.nav-support-dot[hidden] { display: none !important; }
.nav-support-icon { position: relative; display: inline-block; }
@keyframes supDotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
/* Desktop nav-link variant */
.desktop-nav .nav-support { position: relative; }
.desktop-nav .nav-support .nav-support-dot {
    inset-inline-end: -10px; top: -2px;
}

@keyframes supBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.support-drawer {
    position: fixed; inset-inline-end: 16px; bottom: calc(80px + env(safe-area-inset-bottom));
    width: min(380px, calc(100vw - 32px));
    height: 70vh; max-height: 600px; min-height: 400px;
    background: var(--cc-surface); border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid var(--cc-border);
    display: flex; flex-direction: column;
    z-index: 1001;
    animation: supDrawerIn 0.28s cubic-bezier(.2,.7,.3,1.4);
}
.support-drawer[hidden] { display: none !important; }
@keyframes supDrawerIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.support-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 18px 18px 0 0;
}
.support-head-info { display: flex; align-items: center; gap: 12px; }
.support-head-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.22);
    display: grid; place-items: center;
}
.support-head-title { font-size: 14px; font-weight: 900; }
.support-head-sub { font-size: 11px; opacity: 0.85; }
.support-close {
    background: transparent; border: 0; color: #fff;
    padding: 6px; border-radius: 8px; cursor: pointer;
}
.support-close:hover { background: rgba(255,255,255,0.18); }

.support-body {
    flex: 1; overflow-y: auto;
    padding: 14px; display: flex; flex-direction: column; gap: 8px;
    background: var(--cc-bg);
}
.support-empty {
    text-align: center; padding: 32px 16px;
    color: var(--cc-text-muted);
}
.support-empty i { display: block; margin: 0 auto 10px; color: var(--cc-text-muted); opacity: 0.5; }
.support-empty p { font-size: 13px; font-weight: 700; line-height: 1.6; }

/* Welcome message احترافي */
.support-welcome-msg {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin: 8px 0;
    animation: supMsgIn 0.32s ease-out;
}
.support-empty-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: grid; place-items: center;
    margin: 0 auto 10px;
}
.support-welcome-text {
    font-size: 13px; font-weight: 700; line-height: 1.7;
    color: var(--cc-text);
    white-space: pre-wrap;
}

/* WhatsApp/contact button في header */
.support-contact-btn {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border: 0;
    padding: 8px; border-radius: 50%;
    text-decoration: none;
    display: grid; place-items: center;
    margin-inline-end: 6px;
    transition: 0.18s;
}
.support-contact-btn:hover { background: rgba(255, 255, 255, 0.36); transform: scale(1.08); }

.sup-msg {
    max-width: 80%; padding: 10px 13px; border-radius: 14px;
    font-size: 13px; line-height: 1.5; word-wrap: break-word;
    animation: supMsgIn 0.22s ease-out;
}
.sup-msg-customer {
    align-self: flex-start;
    background: var(--cc-surface);
    color: var(--cc-text);
    border: 1px solid var(--cc-border);
    border-bottom-left-radius: 4px;
}
.sup-msg-merchant {
    align-self: flex-end;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sup-msg-time {
    font-size: 10px; opacity: 0.6;
    margin-top: 2px;
    display: block;
}
@keyframes supMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-input-row {
    display: flex; gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--cc-border);
    background: var(--cc-surface);
    border-radius: 0 0 18px 18px;
}
.support-input-row input {
    flex: 1; padding: 10px 14px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: 999px;
    color: var(--cc-text);
    font: inherit; font-size: 13px;
    outline: none;
}
.support-input-row input:focus { border-color: var(--cc-primary); }
.support-send-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff; border: 0; cursor: pointer;
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: 0.18s;
}
.support-send-btn:hover { transform: scale(1.08); }
.support-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile (≤ 768px): full-screen chat experience */
@media (max-width: 768px) {
    .support-drawer {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%; max-height: 100%; min-height: 100%;
        border-radius: 0;
        border: 0;
        animation: supDrawerInMobile 0.3s cubic-bezier(.2,.7,.3,1.4);
        z-index: 9990;
    }
    .support-head { border-radius: 0; padding-top: calc(14px + env(safe-area-inset-top)); }
    .support-input-row { padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
}
@keyframes supDrawerInMobile {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============== TOAST SYSTEM (احترافي + stackable + RTL-aware) ============== */
#toastHost {
  position: fixed;
  bottom: calc(120px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 24px));
}
.toast-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 14px;
  background: var(--cc-surface); color: var(--cc-text);
  border: 1px solid var(--cc-border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(.2, .7, .3, 1.4), opacity 0.28s ease;
  pointer-events: auto;
  cursor: pointer;
  text-align: start;
  direction: rtl;
}
.toast-card.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-card.out  { opacity: 0; transform: translateY(20px) scale(0.92); }

.toast-card .toast-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0; color: #fff;
}
.toast-card .toast-msg {
  flex: 1; font-size: 13px; font-weight: 700; line-height: 1.55; min-width: 0; word-wrap: break-word;
}
.toast-card .toast-close {
  background: transparent; border: 0; color: var(--cc-text-muted);
  cursor: pointer; padding: 5px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  transition: 0.18s;
}
.toast-card .toast-close:hover { background: var(--cc-surface-2); color: var(--cc-text); }

.toast-success .toast-icon { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
.toast-error   .toast-icon { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }
.toast-warn    .toast-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.toast-info    .toast-icon { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }

.toast-success { border-color: rgba(16, 185, 129, 0.35); }
.toast-error   { border-color: rgba(239, 68, 68, 0.35); }
.toast-warn    { border-color: rgba(245, 158, 11, 0.35); }
.toast-info    { border-color: rgba(59, 130, 246, 0.35); }

html[data-theme="dark"] .toast-card {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
  #toastHost { bottom: calc(100px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .toast-card { padding: 10px 12px; }
}

/* ============== RESPONSIVE ============== */
@media (min-width: 768px) {
  body { padding-bottom: 40px; }
  .nav-bar { display: none; }

  .desktop-nav { display: flex; align-items: center; gap: 24px; }
  .desktop-nav a {
    font-size: 15px; font-weight: 800;
    color: var(--cc-text-muted); transition: 0.3s;
    padding: 6px 10px; border-radius: 8px;
  }
  .desktop-nav a:hover, .desktop-nav a.active { color: var(--cc-primary); }

  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; padding: 0 20px 30px; }

  .cart-wrapper { bottom: 24px; }
  .filters { top: 78px; }

  .modal-overlay { align-items: center; padding: 20px; }
  .modal-card { border-radius: 22px; max-width: 520px; }

  .hero-title { font-size: 26px; }
}

@media (max-width: 380px) {
  .brand-logos img { height: 34px; }
  .brand-logos .brand-logo-main { height: 36px; }
  .brand-logos .brand-logo-partner { height: 32px; }
  .otp-cell { width: 40px; height: 50px; font-size: 18px; }
}

/* =================================================
   SKELETON LOADING (للباقات قبل التحميل)
   ================================================= */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  padding: 0 20px 20px;
}
.skeleton-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 22px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  overflow: hidden;
}
.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.5),
    transparent
  );
  animation: shimmer 1.4s infinite;
}
html[data-theme="dark"] .skeleton-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 100%; }
}
.sk-graphic {
  height: 108px;
  border-radius: 16px;
  background: linear-gradient(120deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
}
.sk-line {
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
}
.sk-line.short { width: 60%; }
.sk-line.medium { width: 80%; }
html[data-theme="dark"] .sk-graphic,
html[data-theme="dark"] .sk-line { background: rgba(255,255,255,0.06); }

/* =================================================
   FILTER CHIPS ANIMATIONS
   ================================================= */
.filter-chip {
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.filter-chip:hover:not(.active) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.filter-chip.active {
  animation: chipActivate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chipActivate {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* =================================================
   MODAL ENHANCEMENTS — smoother + backdrop blur
   ================================================= */
.modal-overlay {
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}
.modal-overlay.show {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  animation: modalIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =================================================
   TOAST IMPROVEMENTS — slide-in + progress
   ================================================= */
/* (Old .toast duplicate removed — uses new #toastHost / .toast-card system above) */

/* =================================================
   CART BAR ENHANCED — shimmer when active
   ================================================= */
.cart-bar.active {
  position: relative;
  overflow: hidden;
}
.cart-bar.active::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.1) 50%,
    transparent 100%
  );
  animation: cartShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cartShimmer {
  0%, 100% { left: -100%; }
  60%      { left: 120%; }
}
.cb-btn {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.cb-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.15);
}
.cb-btn:active {
  transform: scale(0.96);
}

/* =================================================
   FLOATING ANIMATIONS — for empty states
   ================================================= */
.big-icon {
  animation: floatY 4s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* =================================================
   GO-HOME / SMOOTH SCROLLING
   ================================================= */
html { scroll-behavior: smooth; }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =================================================
   CARD HEADER DESIGNS — 5 تصاميم احترافية
   يختار التاجر التصميم لكل منتج من لوحة التحكم
   ================================================= */

/* تحييد ::after الافتراضي لكل التصاميم — كل تصميم يفعّله بنفسه */
.card-graphic[data-design]::after { content: none; }

/* ─────────── DESIGN 1: CLASSIC ─────────── */
/* نقاط متحركة + شعاع diagonal — هادئ احترافي للباقات العادية */
.card-graphic[data-design="classic"]::after {
  content: ''; position: absolute; inset: 0; opacity: 0.18;
  background-image:
    radial-gradient(rgba(255,255,255,0.9) 1px, transparent 1.5px),
    radial-gradient(rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 14px 14px, 22px 22px;
  background-position: 0 0, 7px 7px;
  animation: floatDots 25s linear infinite;
}

/* ─────────── DESIGN 2: WAVE ─────────── */
/* موجات SVG ناعمة في الأسفل — مناسب للباقات المتوسطة */
.card-graphic[data-design="wave"]::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M0,140 C100,100 200,180 400,120 L400,200 L0,200 Z' fill='rgba(255,255,255,0.18)'/><path d='M0,160 C150,130 250,200 400,150 L400,200 L0,200 Z' fill='rgba(255,255,255,0.12)'/></svg>");
  background-size: 100% 100%;
  background-position: bottom;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;
}
.card-graphic[data-design="wave"]::after {
  content: ''; position: absolute; top: 12px; right: 12px;
  width: 50px; height: 50px;
  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 70%);
  filter: blur(8px);
  animation: waveBubble 4s ease-in-out infinite;
}
@keyframes waveBubble {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.2) translateY(-6px); }
}

/* ─────────── DESIGN 3: AURORA ─────────── */
/* تدرّج متحرك متعدد الألوان — للباقات المميزة الشهرية */
.card-graphic[data-design="aurora"] {
  background: linear-gradient(125deg,
    #8b5cf6 0%,
    #ec4899 25%,
    #f59e0b 50%,
    #06b6d4 75%,
    #8b5cf6 100%
  ) !important;
  background-size: 250% 250% !important;
  animation: auroraShift 9s ease-in-out infinite;
}
.card-graphic[data-design="aurora"]::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.25), transparent 50%),
    radial-gradient(ellipse at 70% 70%, rgba(255,255,255,0.15), transparent 50%);
  mix-blend-mode: overlay;
}
@keyframes auroraShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─────────── DESIGN 4: NEON ─────────── */
/* خطوط نيون مضيئة على خلفية داكنة — للباقات السريعة (طاقة) */
.card-graphic[data-design="neon"] {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1b3a 50%, #0a0e27 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 30px rgba(124, 179, 66, 0.15);
}
.card-graphic[data-design="neon"]::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(135deg, transparent 48%, rgba(124, 220, 255, 0.4) 49%, rgba(124, 220, 255, 0.7) 50%, rgba(124, 220, 255, 0.4) 51%, transparent 52%),
    linear-gradient(135deg, transparent 73%, rgba(255, 80, 200, 0.3) 74%, rgba(255, 80, 200, 0.6) 75%, rgba(255, 80, 200, 0.3) 76%, transparent 77%);
  background-size: 100% 100%;
  filter: drop-shadow(0 0 4px rgba(124,220,255,0.8));
  animation: neonPulse 3s ease-in-out infinite;
}
.card-graphic[data-design="neon"]::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(124, 220, 255, 0.18), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255, 80, 200, 0.18), transparent 40%);
}
.card-graphic[data-design="neon"] .cg-top span {
  background: rgba(124, 220, 255, 0.15);
  border-color: rgba(124, 220, 255, 0.4);
  color: #fff;
  text-shadow: 0 0 8px rgba(124, 220, 255, 0.8);
}
.card-graphic[data-design="neon"] .cg-data b {
  text-shadow: 0 0 12px rgba(124, 220, 255, 0.9);
}
@keyframes neonPulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ─────────── DESIGN 5: NOIR (فاخر داكن مع ذهبي) ─────────── */
/* أسود ذهبي — للباقات الفاخرة الشهرية */
.card-graphic[data-design="noir"] {
  background: linear-gradient(135deg, #0a0a0a 0%, #1f1f1f 50%, #0a0a0a 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(212, 175, 55, 0.2),
    inset 0 -20px 40px rgba(0,0,0,0.5);
}
.card-graphic[data-design="noir"]::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(135deg, transparent 35%, rgba(212, 175, 55, 0.12) 50%, transparent 65%);
  pointer-events: none;
}
.card-graphic[data-design="noir"]::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0,
      transparent 18px,
      rgba(212, 175, 55, 0.06) 18px,
      rgba(212, 175, 55, 0.06) 19px
    );
}
.card-graphic[data-design="noir"] .cg-top span {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.5);
  color: #fde68a;
  letter-spacing: 1px;
}
.card-graphic[data-design="noir"] .cg-data b {
  background: linear-gradient(135deg, #fde68a, #d4af37);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.4));
}
.card-graphic[data-design="noir"] .cg-data span {
  color: #fde68a;
  opacity: 0.9;
}

/* =================================================
   SAVE-PHONE BANNER (داخل success modal)
   ================================================= */
.save-phone-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--cc-primary-glow), rgba(124, 179, 66, 0.08));
  border: 1.5px solid var(--cc-primary);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 18px 0 4px;
  text-align: start;
  animation: spbSlide 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
@keyframes spbSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.spb-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
  color: #fff;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--cc-primary-glow);
  animation: spbPulse 2.4s ease-in-out infinite;
}
.spb-icon i { width: 22px; height: 22px; }
@keyframes spbPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px var(--cc-primary-glow); }
  50%      { transform: scale(1.08); box-shadow: 0 6px 18px var(--cc-primary-glow), 0 0 20px var(--cc-primary-glow); }
}
.spb-content { flex: 1; min-width: 0; }
.spb-content strong {
  display: block; font-size: 14px; font-weight: 900;
  color: var(--cc-primary);
  margin-bottom: 4px;
}
.spb-content p {
  font-size: 12px; font-weight: 700;
  color: var(--cc-text-muted);
  line-height: 1.6;
  margin: 0;
}
.spb-phone {
  display: inline-block;
  background: var(--cc-surface);
  color: var(--cc-text);
  padding: 1px 8px; border-radius: 6px;
  font-weight: 900;
  border: 1px solid var(--cc-border);
  direction: ltr;
}
.spb-actions {
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}
.spb-actions button { white-space: nowrap; min-width: 92px; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

@media (max-width: 480px) {
  .save-phone-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .spb-icon { margin: 0 auto; }
  .spb-actions { flex-direction: row; }
  .spb-actions button { flex: 1; }
}

/* =================================================
   PHONE INPUT — حالة "محفوظ"
   ================================================= */
.phone-input { position: relative; }
#phone.has-saved {
  background: linear-gradient(90deg, var(--cc-success-bg) 0%, transparent 30%);
  border-color: var(--cc-success);
  padding-inline-end: 80px; /* مكان للشارة */
}
#phone.has-saved + .phone-saved-badge,
.phone-input:has(#phone.has-saved)::after {
  content: '✓ محفوظ';
  position: absolute;
  top: 50%; left: 12px;
  transform: translateY(-50%);
  background: var(--cc-success);
  color: #fff;
  font-size: 10px; font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

/* =================================================
   QUICK BUY WIDGET — شراء بضغطة للزبون العائد
   ================================================= */
.quick-buy {
  margin: 8px 20px 4px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 14px 16px;
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  position: relative;
  overflow: hidden;
  animation: qbSlide 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes qbSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quick-buy::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 50%; height: 200%;
  background: radial-gradient(ellipse at center, var(--cc-primary-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: qbGlow 5s ease-in-out infinite;
}
@keyframes qbGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50%      { transform: translate(15px, -8px) scale(1.15); opacity: 1; }
}
.qb-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  position: relative; z-index: 1;
}
.qb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.5);
  animation: qbBadgePulse 1.8s ease-in-out infinite;
}
@keyframes qbBadgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.qb-header strong {
  font-size: 13px; font-weight: 900; color: #fff;
}
.qb-close {
  margin-inline-start: auto;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.qb-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.qb-items {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.qb-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.85);
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.qb-item:last-child { border-bottom: 0; }
.qb-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-item-qty { color: var(--cc-primary); font-weight: 900; }

.qb-cta {
  width: 100%;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 900;
  cursor: pointer;
  position: relative; z-index: 1;
  box-shadow: 0 6px 18px var(--cc-primary-glow);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.qb-cta::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: qbCtaShine 3s ease-in-out infinite;
}
@keyframes qbCtaShine {
  0%, 60% { left: -100%; }
  100%    { left: 200%; }
}
.qb-cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 24px var(--cc-primary-glow), 0 0 30px var(--cc-primary-glow); }
.qb-cta:active { transform: translateY(0) scale(0.98); }
.qb-cta-icon {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.qb-cta-text { flex: 1; text-align: center; }
.qb-cta-arrow { opacity: 0.8; }

/* =================================================
   SEARCH + SORT
   ================================================= */
.search-sort {
  display: flex; gap: 10px;
  margin: 6px 20px 12px;
}
.search-wrap {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap:focus-within {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-glow);
}
.search-wrap i { color: var(--cc-text-muted); flex-shrink: 0; }
.search-wrap input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; font-weight: 700;
  color: var(--cc-text);
  height: 100%; outline: none;
  font-family: inherit;
}
.search-wrap input::placeholder { color: var(--cc-text-muted); font-weight: 700; }
.search-clear {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--cc-bg);
  color: var(--cc-text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.search-clear:hover { background: var(--cc-danger-bg); color: var(--cc-danger); }

.sort-wrap {
  display: flex; align-items: center; gap: 6px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 0 10px;
  height: 42px;
  flex-shrink: 0;
}
.sort-wrap i { color: var(--cc-text-muted); }
.sort-wrap select {
  border: none; background: transparent;
  font-size: 13px; font-weight: 800;
  color: var(--cc-text);
  height: 100%; outline: none;
  font-family: inherit;
  cursor: pointer;
  padding-inline-end: 4px;
}

/* لا نتائج للبحث */
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}
.grid-empty h3 { font-weight: 900; margin: 8px 0; }
.grid-empty .big-icon { margin: 0 auto 8px; }

/* =================================================
   GROUPED SECTIONS BY CATEGORY
   ================================================= */
.grid.grouped {
  display: flex; flex-direction: column;
  gap: 24px;
}
.cat-section { display: flex; flex-direction: column; gap: 12px; }
.cat-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 2px;
}
.cat-section-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--cat-color, var(--cc-primary));
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cat-color, var(--cc-primary)) 35%, transparent);
}
.cat-section-head h3 {
  font-size: 16px; font-weight: 900;
  color: var(--cc-text);
  margin: 0;
}
.cat-section-count {
  background: var(--cc-surface-2);
  color: var(--cc-text-muted);
  font-size: 11px; font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--cc-border);
}
/* صف أفقي واحد لكل تصنيف — لا يلتفّ لسطر ثانٍ، يسكرول أفقياً عند الزحمة. */
.cat-section-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: clip;
  overflow-clip-margin: 40px; /* يسمح لظلال الـ hover بالظهور خارج الحدود */
  padding: 8px 20px 18px;
  margin-inline: -20px;       /* edge-to-edge: نكسر padding الـ .grid حتى يظهر طرف الكرت التالي */
  scroll-snap-type: x proximity;
  scroll-padding-inline-start: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--cc-text-muted) 35%, transparent) transparent;
}
.cat-section-grid::-webkit-scrollbar { height: 6px; }
.cat-section-grid::-webkit-scrollbar-track { background: transparent; }
.cat-section-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--cc-text-muted) 35%, transparent);
  border-radius: 999px;
}
.cat-section-grid::-webkit-scrollbar-thumb:hover {
  background: var(--cc-text-muted);
}
.cat-section-grid > .card {
  flex: 0 0 170px;
  scroll-snap-align: start;
}
/* hover ألطف داخل الصف الأفقي حتى لا يولّد رجّة في الـ scroll عند الكرت الأخير. */
.grid.grouped .card:hover:not(.out-of-stock) {
  transform: translateY(-4px);
}

/* =================================================
   BESTSELLER BADGE + SOCIAL PROOF
   ================================================= */
.badge-bestseller {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 6;
  transform-origin: top right;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 900; line-height: 1.2;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.4);
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 60%;
  white-space: nowrap;
  pointer-events: none;
  animation: bestsellerPulse 2.5s ease-in-out infinite;
}
.badge-bestseller i { width: 11px; height: 11px; }
@keyframes bestsellerPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 3px 10px rgba(220, 38, 38, 0.4); }
  50%      { transform: scale(1.025); box-shadow: 0 5px 16px rgba(220, 38, 38, 0.55); }
}
/* أعطِ بطاقة المنتج padding-top كافي عند العنوان حتى لا تتداخل الشارة معه */
.card:has(.badge-bestseller) .card-info { padding-top: 18px; }
.card:has(.badge-bestseller) .card-info h3 { padding-inline-end: 70px; }

.social-proof {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800;
  color: var(--cc-warning);
  background: var(--cc-warning-bg);
  padding: 3px 8px;
  border-radius: 999px;
  align-self: flex-start;
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.social-proof i { color: var(--cc-warning); }

/* =================================================
   PWA INSTALL BANNER
   ================================================= */
.install-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 16px; right: 16px;
  background: linear-gradient(135deg, var(--cc-surface) 0%, var(--cc-surface-2) 100%);
  border: 1px solid var(--cc-primary);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.18),
    0 0 0 1px var(--cc-primary-glow);
  z-index: 999;
  max-width: 480px;
  margin: 0 auto;
  animation: ibSlideUp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ibSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ib-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--cc-primary-glow);
  animation: ibIconBob 2.5s ease-in-out infinite;
}
@keyframes ibIconBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.ib-content { flex: 1; min-width: 0; }
.ib-content strong {
  display: block; font-size: 13px; font-weight: 900;
  color: var(--cc-text);
  margin-bottom: 2px;
}
.ib-content span {
  font-size: 11px; font-weight: 700;
  color: var(--cc-text-muted);
  line-height: 1.5;
}
.ib-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.ib-actions button { white-space: nowrap; min-width: 72px; }

@media (max-width: 480px) {
  .install-banner { padding: 12px 14px; gap: 10px; }
  .ib-icon { width: 38px; height: 38px; }
  .ib-content strong { font-size: 12px; }
  .ib-content span { font-size: 10px; }
}

/* ============== Customer Profile Card ============== */
.profile-card {
    background: linear-gradient(135deg, #fff 0%, #fafbff 100%);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.profile-card-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 4px 10px rgba(99,102,241,0.25);
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 900; font-size: 15px; color: #0f172a; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 12px; }
.profile-meta .mono { font-family: 'SF Mono', Consolas, monospace; color: #64748b; }
.profile-meta .muted { color: #94a3b8; }
.profile-edit-btn {
    background: rgba(99,102,241,0.1); color: #4f46e5;
    border: 0; padding: 6px 12px; border-radius: 8px;
    font-weight: 800; font-size: 12px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    transition: 0.2s;
}
.profile-edit-btn:hover { background: rgba(99,102,241,0.18); }

/* ============== Profile Modal ============== */
.profile-modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.55);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(4px);
}
.profile-modal {
    background: #fff; border-radius: 20px; max-width: 480px; width: 100%;
    padding: 28px 24px; animation: profile-modal-in 0.3s ease-out;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
@keyframes profile-modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.profile-modal-head { text-align: center; margin-bottom: 22px; }
.profile-modal-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px; box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}
.profile-modal-head h3 { font-size: 20px; font-weight: 900; color: #0f172a; margin-bottom: 6px; }
.profile-modal-head p { color: #64748b; font-size: 13.5px; line-height: 1.6; }
.profile-form .profile-field { margin-bottom: 16px; }
.profile-form label { display: block; font-size: 13px; font-weight: 800; color: #334155; margin-bottom: 6px; }
.profile-form label .required { color: #dc2626; }
.profile-form input {
    width: 100%; padding: 11px 14px; border: 1.5px solid #e5e7eb;
    border-radius: 10px; font-size: 14px; font-family: inherit;
    transition: border-color 0.2s; box-sizing: border-box;
}
.profile-form input:focus { outline: none; border-color: #6366f1; }
.profile-form .hint { font-size: 11.5px; color: #94a3b8; margin-top: 5px; line-height: 1.5; }
.profile-error {
    padding: 10px 14px; background: #fee2e2; border: 1px solid #fca5a5;
    border-radius: 10px; color: #991b1b; font-size: 12.5px; font-weight: 700; margin-bottom: 12px;
}
.profile-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.profile-actions .btn-ghost {
    background: transparent; color: #64748b; border: 1.5px solid #e5e7eb;
    padding: 10px 18px; border-radius: 10px; font-weight: 800; cursor: pointer;
}
.profile-actions .btn-ghost:hover { background: #f1f5f9; }
.profile-actions .btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
    border: 0; padding: 10px 22px; border-radius: 10px;
    font-weight: 800; cursor: pointer; box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
@media (max-width: 480px) {
    .profile-card-head { flex-wrap: wrap; }
    .profile-edit-btn { width: 100%; justify-content: center; margin-top: 8px; }
    .profile-modal { padding: 20px 16px; border-radius: 16px; }
}

/* ============== User incomplete dot (badge أحمر على أيقونة اليوزر) ============== */
.icon-btn-with-dot { position: relative; }
.user-incomplete-dot {
    position: absolute; top: 6px; right: 6px;
    width: 10px; height: 10px;
    background: #dc2626;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(220,38,38,0.3);
    animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.85; }
}

/* ============== Profile Page (صفحة كاملة) ============== */
#viewProfile { padding: 20px 0; }
.profile-page-head {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border-radius: 18px;
    margin-bottom: 18px;
}
.profile-page-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(99,102,241,0.3);
    font-size: 32px;
    font-weight: 900;
}
.profile-page-title { font-size: 22px; font-weight: 900; color: #0f172a; margin-bottom: 6px; }
.profile-page-sub   { color: #64748b; font-size: 14px; line-height: 1.7; }

.profile-page-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.profile-page-form .profile-field { margin-bottom: 18px; }
.profile-page-form label {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 8px;
}
.profile-page-form label .required { color: #dc2626; }
.profile-page-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.profile-page-form input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.profile-page-form input[readonly],
.profile-page-form input[disabled] {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}
.profile-page-form .hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.5;
}

.profile-error, .profile-success {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
    text-align: center;
}
.profile-error  { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.profile-success{ background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }

.profile-page-actions { display: flex; gap: 10px; }
.btn-block { width: 100%; justify-content: center; }
