/* ==========================================================================
   design-system.css — نظام التصميم الموحّد لـ Nadibox
   3 ألوان فقط: برتقالي (العلامة) + داكن + رمادي فاتح  (+ ألوان الحالات الوظيفية)
   الخط: Cairo للعربية — Poppins للفرنسية
   يُحمَّل بعد theme.css و responsive.css لذلك تكون له الأولوية على المتغيرات
   ========================================================================== */
:root {
  --nb-primary:       #f68b1e;
  --nb-primary-dark:  #dd7d1b;   /* hover / active */
  --nb-primary-soft:  #fff4e6;   /* خلفيات خفيفة */
  --nb-dark:          #1a1a1a;
  --nb-text:          #2b2f36;
  --nb-muted:         #6c757d;
  --nb-light:         #f5f7fb;
  --nb-border:        #e5e8ec;
  --nb-white:         #ffffff;
  --nb-success:       #28a745;
  --nb-danger:        #dc3545;
  --nb-whatsapp:      #25d366;

  --nb-radius:        12px;
  --nb-radius-lg:     18px;
  --nb-shadow:        0 2px 10px rgba(0,0,0,.06);
  --nb-shadow-lg:     0 10px 30px rgba(0,0,0,.12);
  --nb-space:         16px;
  --nb-tap:           46px;      /* ارتفاع الأزرار المريح للمس */

  /* ربط متغيرات theme.css القديمة بنفس القيم */
  --color-primary:       var(--nb-primary);
  --color-primary-hover: var(--nb-primary-dark);
  --color-primary-dark:  var(--nb-primary-dark);
  --color-secondary:     var(--nb-dark);
  --color-accent:        var(--nb-primary);
  --color-bg-body:       var(--nb-light);
  --bs-primary:          var(--nb-primary);
  --bs-primary-rgb:      246,139,30;
  --bs-link-color:       var(--nb-dark);
  --bs-link-color-rgb:   26,26,26;
  --bs-link-hover-color-rgb: 221,125,27;
  --color-link:          var(--nb-dark);
  --color-link-hover:    var(--nb-primary-dark);
  --color-link-visited:  var(--nb-dark);
}
html[lang="ar"] { --font-main: 'Cairo', system-ui, sans-serif; }
html[lang="fr"] { --font-main: 'Poppins', system-ui, sans-serif; }
body { font-family: var(--font-main); color: var(--nb-text); background: var(--nb-light); line-height: 1.6; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { color: var(--nb-dark); font-weight: 700; line-height: 1.35; }
a { color: var(--nb-dark); text-decoration: none; }
a:hover { color: var(--nb-primary-dark); }
/* الروابط داخل الخلفيات الداكنة تبقى بيضاء ناصعة */
footer a, .bg-dark a, .top-bar a, .sidebar-header a { color: #fff; }
footer a:hover, .bg-dark a:hover, .top-bar a:hover { color: #fff; text-decoration: underline; }

/* ---------- الأزرار الموحّدة ---------- */
.nb-btn, .btn, .btn-cart, .btn-add-to-cart, .btn-order, .btn-primary-cart, .btn-primary-custom,
.btn-confirm, .btn-submit-review, .submit-btn, .btn-load-more, .view-all-btn, .promo-btn, .slide-btn,
.btn-action, .btn-whatsapp, .btn-whatsapp-order, .btn-outline-cart, .btn-dark-cart, .btn-back, .btn-profile {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--nb-tap); padding: 10px 22px; border: 2px solid transparent;
  border-radius: var(--nb-radius); font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .1s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.nb-btn:active, .btn:active, .btn-cart:active, .btn-order:active { transform: scale(.98); }
.btn-primary, .nb-btn-primary, .btn-cart, .btn-add-to-cart, .btn-order, .btn-primary-cart, .btn-primary-custom,
.btn-confirm, .btn-submit-review, .submit-btn, .btn-load-more, .view-all-btn, .promo-btn, .slide-btn, .btn-action-primary,
.btn-dark, .btn-dark-cart, .btn-secondary, .nb-btn-dark {
  background: #111 !important; border-color: #111 !important; color: #fff !important;
}
.btn-primary:hover, .nb-btn-primary:hover, .btn-cart:hover, .btn-add-to-cart:hover, .btn-order:hover, .btn-primary-cart:hover,
.btn-primary-custom:hover, .btn-confirm:hover, .btn-submit-review:hover, .submit-btn:hover, .btn-load-more:hover,
.view-all-btn:hover, .promo-btn:hover, .slide-btn:hover, .btn-action-primary:hover,
.btn-dark:hover, .btn-dark-cart:hover, .btn-secondary:hover, .nb-btn-dark:hover {
  background: #2b2b2b !important; border-color: #2b2b2b !important; color: #fff !important;
}
.btn-outline-primary, .nb-btn-outline, .btn-outline-cart, .btn-action-outline, .btn-back {
  background: transparent; border-color: #111; color: #111;
}
.btn-outline-primary:hover, .nb-btn-outline:hover, .btn-outline-cart:hover, .btn-action-outline:hover, .btn-back:hover {
  background: #111; color: #fff;
}
.btn-whatsapp, .btn-whatsapp-order { background: var(--nb-whatsapp); border-color: var(--nb-whatsapp); color: #fff; }
.btn-whatsapp:hover, .btn-whatsapp-order:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.btn:disabled, .btn[disabled], button[disabled], .btn-cart[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 12px 28px; font-size: 16px; }

/* ---------- الحقول ---------- */
.form-control, .form-select, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  border: 1.5px solid var(--nb-border); border-radius: var(--nb-radius); min-height: var(--nb-tap);
  padding: 10px 14px; background: #fff; color: var(--nb-text);
}
textarea.form-control, textarea { min-height: 96px; }
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,.12); outline: none;
}
.form-label { font-weight: 600; margin-bottom: 6px; color: var(--nb-dark); }
.req { color: var(--nb-danger); }

/* ---------- البطاقات والعناوين ---------- */
.card, .product-card, .category-card { border: 1px solid var(--nb-border); border-radius: var(--nb-radius-lg); box-shadow: var(--nb-shadow); background: #fff; }
.section-title, .page-title { color: var(--nb-dark); font-weight: 800; }
.section-title::after { background: var(--nb-primary) !important; }
.badge-sale, .discount-pill { background: var(--nb-danger); color: #fff; border-radius: 999px; }

/* ---------- أقسام الصفحة (مسافات متناسقة) ---------- */
section, .section { margin-block: 0; }
.nb-section { padding-block: 28px; }
@media (max-width: 767.98px) { .nb-section { padding-block: 20px; } }

/* ---------- شريط الشراء الثابت (صفحة المنتج - هاتف) ---------- */
.sticky-buy { display: none; }
@media (max-width: 991.98px) {
  body.has-sticky-buy { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .sticky-buy {
    display: flex; align-items: center; gap: 10px; position: fixed; inset-inline: 0; bottom: 0; z-index: 1030;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff;
    border-top: 1px solid var(--nb-border); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  }
  .sticky-buy .sb-price { display: flex; flex-direction: column; line-height: 1.2; min-width: 84px; }
  .sticky-buy .sb-price small { color: var(--nb-muted); font-size: 11px; }
  .sticky-buy .sb-price strong { color: #111; font-size: 17px; }
  .sticky-buy .nb-btn { flex: 1; }
  .sticky-buy .sb-wa { flex: 0 0 var(--nb-tap); width: var(--nb-tap); padding: 0; font-size: 22px; }
}

/* ---------- شريط التنقل السفلي (هاتف) ---------- */
.mobile-nav { display: none; }
@media (max-width: 991.98px) {
  body:not(.no-mobile-nav):not(.has-sticky-buy) { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.has-sticky-buy .mobile-nav, body.no-mobile-nav .mobile-nav { display: none !important; }
  .mobile-nav {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 1030; background: #111;
    border-top: 1px solid #000; box-shadow: 0 -4px 16px rgba(0,0,0,.25);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; color: #fff !important; opacity: .75; text-decoration: none; font-size: 11px; font-weight: 600; position: relative;
  }
  .mobile-nav a i { font-size: 20px; color: #fff; }
  .mobile-nav a.active, .mobile-nav a:active { opacity: 1; color: #fff !important; }
  .mobile-nav a.active::before { content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 4px 4px; background: var(--nb-primary); }
  .mobile-nav .mn-badge {
    position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--nb-primary); color: #111; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800;
  }
}

/* ---------- إزالة الفراغ الأبيض أسفل بطاقات المنتجات ---------- */
.product-card { margin-bottom: 0; }
@media (max-width: 767.98px) {
  .product-card, .home-products-scope .product-card { margin-bottom: 0 !important; }
  .slider-container, .slider-track, .categories-slider-track, .products-slider-track { padding-bottom: 6px; margin-bottom: 0; }
  .slider-wrapper, .catalog-row { margin-bottom: 0; }
  .catalog-row { padding-bottom: 8px; }
}