/* ═══════════════════════════════════════════════════════════════
   nc-v32.css — تحسينات v32 (Dark Mode، Toasts، Skeletons، Wishlist)
   يُضاف على كل صفحات الموقع بدون كسر شي.
   ═══════════════════════════════════════════════════════════════ */

/* ───── 1. Dark Mode (opt-in بـ data-theme="dark") ───── */
[data-theme="dark"] {
  --gold: #E8B84B;
  --gold-mid: #D4A536;
  --gold-bright: #F5CE6F;
  --gold-pale: #2A2515;
  --gold-dim: rgba(232, 184, 75, .15);
  --gold-b: rgba(232, 184, 75, .35);
  --gold-glow: 0 6px 24px rgba(232, 184, 75, .35);
  --ink: #F5F4F0;
  --ink-2: #D4CEBD;
  --ink-3: #8A7F6E;
  --surface: #14130F;
  --white: #1F1D17;
  --border: #2D2A22;
  --border-2: #3D3A30;
  --green: #4AB680;
  --green-pale: #1A2B22;
  --green-b: rgba(74, 182, 128, .3);
  --red: #E66B5C;
  --red-pale: #2B1A18;
  --red-b: rgba(230, 107, 92, .3);
  --blue: #6FA5F5;
  --blue-pale: #182238;
  --blue-b: rgba(111, 165, 245, .3);
  --shadow-xs: 0 1px 4px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.45);
  --shadow-md: 0 8px 28px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 56px rgba(0,0,0,.55);
}
[data-theme="dark"] body {
  background: var(--surface);
  color: var(--ink);
}
[data-theme="dark"] .navbar,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content {
  background: var(--white);
}
[data-theme="dark"] img:not(.no-invert) {
  /* حافظ على الصور، لكن حسّن الـ logos الداكنة */
}
[data-theme="dark"] .field__input {
  background: #1A1813;
  color: var(--ink);
  border-color: var(--border-2);
}

/* ───── 2. Theme toggle button (يضاف لأي مكان) ───── */
.nc-theme-toggle {
  position: fixed;
  bottom: 20px;
  inset-inline-start: 20px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 1px solid var(--border, #E8E4DA);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform .2s, box-shadow .2s;
}
.nc-theme-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.nc-theme-toggle::before { content: "🌙"; }
[data-theme="dark"] .nc-theme-toggle::before { content: "☀️"; }
@media (max-width: 600px) {
  .nc-theme-toggle { width: 42px; height: 42px; bottom: 16px; }
}

/* ───── 3. Toast notifications (موحّد) ───── */
.nc-toast-container {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}
.nc-toast {
  background: var(--white, #fff);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.08);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-inline-start: 4px solid #B8860B;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1A1810);
  pointer-events: auto;
  animation: ncToastIn .4s cubic-bezier(.34,1.56,.64,1);
  opacity: 1;
  transform: translateX(0);
  transition: opacity .3s, transform .3s;
  max-width: 380px;
}
.nc-toast.nc-toast-out {
  opacity: 0;
  transform: translateX(20px);
}
[dir="rtl"] .nc-toast.nc-toast-out { transform: translateX(-20px); }
.nc-toast-success { border-color: #1A6B43; }
.nc-toast-error { border-color: #B83228; }
.nc-toast-info { border-color: #1D4ED8; }
.nc-toast-warning { border-color: #C9982A; }
.nc-toast-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.nc-toast-text { flex: 1; line-height: 1.5; word-wrap: break-word; }
.nc-toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-3, #8A7F6E);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
.nc-toast-close:hover { background: rgba(0,0,0,.06); }
@keyframes ncToastIn {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .nc-toast-container { top: 12px; inset-inline-end: 12px; inset-inline-start: 12px; max-width: none; }
  .nc-toast { font-size: 13px; padding: 12px 14px; }
}

/* ───── 4. Skeleton loaders ───── */
.nc-skeleton {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.04) 25%,
    rgba(0,0,0,.08) 50%,
    rgba(0,0,0,.04) 75%
  );
  background-size: 200% 100%;
  animation: ncShimmer 1.4s infinite;
  border-radius: 6px;
}
[data-theme="dark"] .nc-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
}
.nc-skel-line { height: 14px; margin: 8px 0; }
.nc-skel-line-sm { height: 10px; }
.nc-skel-circle { border-radius: 50%; aspect-ratio: 1; }
.nc-skel-card {
  padding: 18px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #E8E4DA);
  border-radius: 16px;
}
@keyframes ncShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
[dir="rtl"] @keyframes ncShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ───── 5. Wishlist heart button ───── */
.nc-wish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border, #E8E4DA);
  cursor: pointer;
  transition: all .2s;
  font-size: 18px;
  position: relative;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}
.nc-wish-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(184, 50, 40, .25);
}
.nc-wish-btn::before {
  content: "♡";
  color: #8A7F6E;
  transition: color .2s;
}
.nc-wish-btn.is-active {
  background: #FDE8E5;
  border-color: rgba(184, 50, 40, .3);
}
.nc-wish-btn.is-active::before {
  content: "♥";
  color: #B83228;
}
.nc-wish-btn.is-loading::before { content: "⏳"; }

/* heart pulse animation عند الإضافة */
.nc-wish-btn.just-added::before {
  animation: ncHeartPulse .6s ease;
}
@keyframes ncHeartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ───── 6. Empty states محسّنة ───── */
.nc-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3, #8A7F6E);
}
.nc-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: .55;
}
.nc-empty-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #1A1810);
  margin-bottom: 8px;
}
.nc-empty-text {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
  max-width: 360px;
  margin-inline: auto;
}

/* ───── 7. Search bar محسّن ───── */
.nc-search-wrap {
  position: relative;
  margin: 18px 0;
}
.nc-search-input {
  width: 100%;
  height: 50px;
  padding: 0 50px 0 18px;
  border: 1.5px solid var(--border-2, #D4CEBD);
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  background: var(--white, #fff);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
[dir="rtl"] .nc-search-input { padding: 0 18px 0 50px; }
.nc-search-input:focus {
  border-color: var(--gold, #B8860B);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, .12);
}
.nc-search-icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 16px;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--ink-3, #8A7F6E);
  pointer-events: none;
}
.nc-search-clear {
  position: absolute;
  top: 50%;
  inset-inline-start: 16px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-3, #8A7F6E);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: none;
}
.nc-search-input:not(:placeholder-shown) ~ .nc-search-clear { display: block; }

/* ───── 8. Filter chips ───── */
.nc-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding-bottom: 4px;
}
.nc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  background: var(--white, #fff);
  border: 1.5px solid var(--border-2, #D4CEBD);
  color: var(--ink-2, #4A4232);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.nc-chip:hover {
  border-color: var(--gold, #B8860B);
  color: var(--gold, #B8860B);
}
.nc-chip.is-active {
  background: var(--gold, #B8860B);
  border-color: var(--gold, #B8860B);
  color: #fff;
}

/* ───── 9. Cookie consent banner ───── */
.nc-cookie-banner {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 9997;
  background: var(--white, #fff);
  border-top: 1px solid var(--border, #E8E4DA);
  box-shadow: 0 -10px 30px rgba(0,0,0,.08);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: 'Cairo', sans-serif;
  animation: ncCookieIn .4s cubic-bezier(.34,1.56,.64,1);
  flex-wrap: wrap;
  justify-content: center;
}
.nc-cookie-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2, #4A4232);
  min-width: 250px;
}
.nc-cookie-text a {
  color: var(--gold, #B8860B);
  text-decoration: underline;
  font-weight: 700;
}
.nc-cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.nc-cookie-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.nc-cookie-btn-accept {
  background: linear-gradient(135deg, #B8860B, #E8B84B);
  color: #fff;
  box-shadow: 0 4px 12px rgba(184, 134, 11, .25);
}
.nc-cookie-btn-accept:hover { transform: translateY(-1px); }
.nc-cookie-btn-decline {
  background: transparent;
  color: var(--ink-3, #8A7F6E);
  border: 1px solid var(--border-2, #D4CEBD);
}
@keyframes ncCookieIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 600px) {
  .nc-cookie-banner { padding: 14px 16px; }
  .nc-cookie-text { font-size: 12px; }
  .nc-cookie-actions { width: 100%; justify-content: center; }
}

/* ───── 10. Print stylesheet للفواتير ───── */
@media print {
  .navbar, .nc-theme-toggle, .nc-toast-container,
  .nc-cookie-banner, .btn, .nav-pill,
  [data-no-print] { display: none !important; }
  body { background: white !important; }
  .card, .modal-content { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ───── 11. Activity log timeline ───── */
.nc-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nc-activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #E8E4DA);
  border-radius: 12px;
  align-items: flex-start;
}
.nc-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--gold-dim, rgba(184,134,11,.1));
  flex-shrink: 0;
}
.nc-activity-body { flex: 1; min-width: 0; }
.nc-activity-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #1A1810);
  margin-bottom: 2px;
}
.nc-activity-meta {
  font-size: 12px;
  color: var(--ink-3, #8A7F6E);
}

/* ───── 12. Notification preferences switch ───── */
.nc-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.nc-switch input { opacity: 0; width: 0; height: 0; }
.nc-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: .25s;
}
.nc-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  inset-inline-start: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .25s;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.nc-switch input:checked + .nc-switch-slider {
  background: linear-gradient(135deg, #B8860B, #E8B84B);
}
.nc-switch input:checked + .nc-switch-slider:before {
  transform: translateX(20px);
}
[dir="rtl"] .nc-switch input:checked + .nc-switch-slider:before {
  transform: translateX(-20px);
}

/* ───── 13. تحسينات a11y بسيطة ───── */
.nc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
*:focus-visible {
  outline: 2px solid var(--gold, #B8860B);
  outline-offset: 2px;
  border-radius: 4px;
}
