/* app.css — أنماط مشتركة للمتجر ولوحة الإدارة (الباقي Tailwind) */
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ===== Spinner ===== */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(21, 128, 61, .2); border-top-color: #15803d;
  animation: spin .8s linear infinite; display: inline-block;
}
.spinner.light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #ecfdf5 25%, #d1fae5 37%, #ecfdf5 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 1rem;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ===== Toasts ===== */
#toast-root {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px; color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: toast-in .25s ease;
}
.toast.success { background: #15803d; }
.toast.error   { background: #dc2626; }
.toast.info    { background: #1f2937; }
.toast.out     { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ===== Drawers (سلة / شحن) ===== */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 100%; max-width: 28rem;
  background: #fff; z-index: 300; box-shadow: -10px 0 40px rgba(0,0,0,.2);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .35s ease;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
/* القوائم الداخلية تسكرول بدل ما تزق الأزرار برا الشاشة */
.drawer > .overflow-y-auto { min-height: 0; }
.drawer img { max-width: 100%; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 250; opacity: 0; pointer-events: none; transition: opacity .3s; }
.overlay.show { opacity: 1; pointer-events: auto; }

/* ===== Dialogs (تأكيد / نجاح) ===== */
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}

/* ===== Misc ===== */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-active { background: #15803d !important; color: #fff !important; border-color: #15803d !important; }
:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }
.no-scroll { overflow: hidden; }

/* ===== 404 (بدون Tailwind) ===== */
.notfound { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; background: #f0fdf4; color: #14532d; }
.notfound .nf-emoji { font-size: 72px; }
.notfound h1 { margin: 8px 0; font-size: 28px; }
.notfound .nf-btn { display: inline-block; margin-top: 16px; background: #15803d; color: #fff; text-decoration: none; padding: 12px 28px; border-radius: 999px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
