/* ==========================================================================
   SaharShop Design System — tokens + shared components
   Source of truth: homepage (np- / s26- / sf- approved language)
   ========================================================================== */

:root,
body.lang-rtl {
  /* Brand / surfaces */
  --ss-ink: #08153b;
  --ss-ink-soft: #0f172a;
  --ss-muted: #64748b;
  --ss-line: #e7ebf4;
  --ss-surface: #f1f5f9;
  --ss-bg: #f5f7fb;
  --ss-white: #ffffff;

  /* Accents from homepage */
  --ss-primary: #0f172a;
  --ss-accent: #f7931a;
  --ss-accent-soft: #f7efe9;
  --ss-cta: #f51a76;
  --ss-cta-deep: #970039;
  --ss-money: #9a3412;
  --ss-teal: #0e7490;

  /* Status */
  --ss-success: #15803d;
  --ss-warning: #b45309;
  --ss-error: #b91c1c;

  /* Elevation */
  --ss-shadow: 0 18px 40px rgba(36, 56, 99, 0.1);
  --ss-shadow-sm: 0 8px 20px rgba(36, 56, 99, 0.08);

  /* Radius */
  --ss-radius-sm: 12px;
  --ss-radius: 18px;
  --ss-radius-lg: 28px;
  --ss-radius-pill: 999px;

  /* Spacing */
  --ss-space-1: 4px;
  --ss-space-2: 8px;
  --ss-space-3: 12px;
  --ss-space-4: 16px;
  --ss-space-5: 24px;
  --ss-space-6: 32px;
  --ss-space-7: 48px;

  /* Type */
  --ss-fs-xs: 0.75rem;
  --ss-fs-sm: 0.875rem;
  --ss-fs: 1rem;
  --ss-fs-lg: 1.125rem;
  --ss-fs-xl: clamp(1.35rem, 1vw + 1rem, 1.85rem);
  --ss-fs-2xl: clamp(1.55rem, 1.2vw + 1.1rem, 2.15rem);

  /* Shell */
  --ss-shell-max: 1778px;
  --ss-shell: min(1778px, max(1140px, 86.3vw));
  --ss-shell-tablet: min(1778px, 92vw);

  /* Controls */
  --ss-btn-h: 48px;
  --ss-input-h: 48px;
  --ss-touch: 44px;
}

/* —— Buttons —— */
body.lang-rtl .btn,
body.lang-rtl .ss-btn {
  border-radius: var(--ss-radius-pill);
  font-weight: 800;
  min-height: var(--ss-btn-h);
  padding: 0.55rem 1.25rem;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

body.lang-rtl .btn-primary,
body.lang-rtl .ss-btn--primary,
body.lang-rtl .add-to-cart,
body.lang-rtl button[data-button-action="add-to-cart"] {
  background: linear-gradient(180deg, var(--ss-cta), var(--ss-cta-deep)) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(245, 26, 118, 0.28);
}

body.lang-rtl .btn-primary:hover,
body.lang-rtl .btn-primary:focus,
body.lang-rtl .add-to-cart:hover {
  filter: brightness(1.05);
  color: #fff !important;
  transform: translateY(-1px);
}

body.lang-rtl .btn-secondary,
body.lang-rtl .btn-outline-dark,
body.lang-rtl .ss-btn--secondary {
  background: linear-gradient(90deg, #f7efe9, #f2f2f8) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  color: var(--ss-ink) !important;
  box-shadow: var(--ss-shadow-sm);
}

body.lang-rtl .btn-outline-primary {
  border-radius: var(--ss-radius-pill);
  border-color: var(--ss-line) !important;
  color: var(--ss-ink) !important;
  background: #fff !important;
}

/* —— Forms —— */
body.lang-rtl .form-control,
body.lang-rtl select.form-control,
body.lang-rtl .custom-select,
body.lang-rtl input[type="text"],
body.lang-rtl input[type="email"],
body.lang-rtl input[type="tel"],
body.lang-rtl input[type="password"],
body.lang-rtl input[type="number"],
body.lang-rtl textarea.form-control {
  min-height: var(--ss-input-h);
  border-radius: var(--ss-radius-sm) !important;
  border: 1px solid var(--ss-line) !important;
  background: #fff !important;
  color: var(--ss-ink);
  box-shadow: none !important;
}

body.lang-rtl .form-control:focus,
body.lang-rtl select.form-control:focus {
  border-color: var(--ss-accent) !important;
  box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.18) !important;
  outline: none;
}

body.lang-rtl .form-control.is-invalid,
body.lang-rtl .has-error .form-control {
  border-color: var(--ss-error) !important;
}

body.lang-rtl label,
body.lang-rtl .form-control-label {
  color: var(--ss-ink);
  font-weight: 700;
  font-size: var(--ss-fs-sm);
  margin-bottom: 0.35rem;
}

/* —— Surfaces / cards (flatten Bootstrap chrome) —— */
body.lang-rtl:not(#index) .card {
  border: 1px solid var(--ss-line) !important;
  border-radius: var(--ss-radius) !important;
  box-shadow: var(--ss-shadow-sm) !important;
  background: #fff !important;
  overflow: hidden;
}

body.lang-rtl:not(#index) .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--ss-line) !important;
  font-weight: 900;
  color: var(--ss-ink);
  padding: 1rem 1.15rem;
}

body.lang-rtl .breadcrumb {
  background: transparent !important;
  padding: 0.65rem 0;
  margin: 0 0 1rem;
  font-size: var(--ss-fs-sm);
}

body.lang-rtl .breadcrumb a {
  color: var(--ss-muted);
}

body.lang-rtl .breadcrumb .breadcrumb-item.active,
body.lang-rtl .breadcrumb [aria-current="page"] {
  color: var(--ss-ink);
  font-weight: 700;
}

/* —— Badges / chips —— */
body.lang-rtl .product-flag,
body.lang-rtl .ss-badge,
body.lang-rtl .np-badge {
  border-radius: var(--ss-radius-pill);
  font-weight: 850;
}

body.lang-rtl .active_filters .filter-block,
body.lang-rtl .active-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-accent-soft);
  border: 1px solid rgba(247, 147, 26, 0.25);
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  color: var(--ss-ink);
}

/* —— Pagination —— */
body.lang-rtl .pagination .page-link {
  border-radius: var(--ss-radius-pill) !important;
  border: 1px solid var(--ss-line);
  color: var(--ss-ink);
  min-width: var(--ss-touch);
  min-height: var(--ss-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
}

body.lang-rtl .pagination .page-item.active .page-link {
  background: var(--ss-ink);
  border-color: var(--ss-ink);
  color: #fff;
}

/* —— Alerts / toasts —— */
body.lang-rtl .alert {
  border-radius: var(--ss-radius-sm);
  border: 1px solid var(--ss-line);
}

body.lang-rtl .alert-success {
  background: #ecfdf5;
  color: var(--ss-success);
}

body.lang-rtl .alert-danger {
  background: #fef2f2;
  color: var(--ss-error);
}

/* —— Empty / skeleton —— */
.ss-empty {
  text-align: center;
  padding: var(--ss-space-7) var(--ss-space-4);
  color: var(--ss-muted);
}

.ss-empty__title {
  color: var(--ss-ink);
  font-weight: 900;
  font-size: var(--ss-fs-xl);
  margin-bottom: var(--ss-space-3);
}

.ss-skeleton {
  background: linear-gradient(90deg, #eef1f8, #f8fafc, #eef1f8);
  background-size: 200% 100%;
  animation: ss-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--ss-radius-sm);
}

@keyframes ss-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-skeleton { animation: none; }
  body.lang-rtl .btn,
  body.lang-rtl .ss-btn {
    transition: none;
  }
}
