/* ============================================
   جدّد Platform - Design System
   Brand: جدّد | Colors: White + Red
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@4.6.0/fonts/remixicon.css');

/* ── CSS Variables ── */
:root {
  --primary: #e11d48;
  --primary-light: #fff1f2;
  --primary-lighter: #ffe4e6;
  --primary-dark: #be123c;
  --primary-darker: #9f1239;
  --primary-gradient: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  --primary-gradient-wide: linear-gradient(135deg, #fb7185 0%, #e11d48 50%, #9f1239 100%);

  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #fafafa;

  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-light: #f1f5f9;

  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --error: #ef4444;
  --error-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;

  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
  --shadow-primary: 0 8px 25px rgba(225,29,72,0.3);
  --shadow-primary-lg: 0 15px 40px rgba(225,29,72,0.35);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --header-height: 72px;
  --container-width: 1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Container ── */
.container {
  width: min(var(--container-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: white;
  font-size: 1.3rem;
  box-shadow: var(--shadow-primary);
  transition: var(--bounce);
}

.brand:hover .brand-icon {
  transform: rotate(15deg) scale(1.1);
}

.brand-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 16px;
  border: 2px solid transparent;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(225,29,72,0.08);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-light);
}

.search-bar button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}

.search-bar button:hover {
  background: var(--primary-dark);
  transform: scale(1.03);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}

.header-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.header-btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.header-btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-primary);
}

.header-btn .icon {
  font-size: 1.1rem;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-lighter);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  border: 2px solid var(--primary-light);
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1001;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  width: 100%;
  border: none;
  background: none;
  text-align: right;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.user-dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown .logout-btn {
  color: var(--error);
}

.user-dropdown .logout-btn:hover {
  background: var(--error-light);
  color: var(--error);
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  padding: 4px;
}

/* ── Footer ── */
.site-footer {
  background: var(--text);
  color: var(--text-inverse);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.footer-brand .brand-icon {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
}

.footer-desc {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.footer-section h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: white;
}

.footer-section a {
  display: block;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: var(--transition-fast);
}

.footer-section a:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

.footer-support {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  direction: ltr;
}

.footer-support .icon {
  font-size: 1.2rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
}

.footer-copyright span {
  color: var(--primary);
  font-weight: 800;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: var(--bounce);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-primary-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.btn-full { width: 100%; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--primary-lighter);
  box-shadow: var(--shadow-lg);
}

.card-elevated {
  box-shadow: var(--shadow-md);
  border: none;
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Product Card */
.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: var(--bounce);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-lighter);
  box-shadow: 0 16px 40px rgba(225,29,72,0.1);
}

.product-card .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.product-card-img {
  width: 100%;
  height: 220px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.product-card-img img {
  max-height: 180px;
  width: auto;
  object-fit: contain;
  transition: var(--bounce);
}

.product-card:hover .product-card-img img {
  transform: scale(1.08) rotate(-2deg);
}

.product-card-body {
  padding: 16px 20px 20px;
}

.product-card-brand {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-card-price .current {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary);
}

.product-card-price .original {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-card-price .currency {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.product-card-condition {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.product-card-action {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
}

.product-card-action:hover {
  background: var(--primary);
  color: white;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-new { background: #dcfce7; color: #166534; }
.badge-used { background: #fef9c3; color: #854d0e; }
.badge-refurbished { background: #e0e7ff; color: #3730a3; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fecaca; color: #991b1b; }
.badge-sold { background: #e0e7ff; color: #3730a3; }
.badge-seller { background: var(--primary-lighter); color: var(--primary-dark); }

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.form-label .required {
  color: var(--primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(225,29,72,0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-left: 40px;
}

.form-error {
  font-size: 0.82rem;
  color: var(--error);
  font-weight: 600;
  display: none;
}

.form-group.error .form-input,
.form-group.error .form-select {
  border-color: var(--error);
  background: var(--error-light);
}

.form-group.error .form-error {
  display: block;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Category Tabs (horizontal scroll) */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  padding: 10px 22px;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

.cat-tab:hover {
  border-color: var(--primary-lighter);
  color: var(--text);
}

.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

/* ── Product Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Hero / Banner ── */
.hero-section {
  padding: 60px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  animation: fadeInRight 0.8s ease-out;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--primary);
  opacity: 0.15;
  border-radius: 4px;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 500px;
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-tag {
  background: var(--primary-light);
  border: 1px solid var(--primary-lighter);
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: float 6s ease-in-out infinite;
}

.hero-visual::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--primary-lighter), transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: pulse-slow 4s infinite alternate;
}

.hero-visual img {
  position: relative;
  z-index: 1;
  max-width: 320px;
  width: 100%;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15));
  border-radius: var(--radius-2xl);
  transform: perspective(800px) rotateY(-8deg);
  transition: var(--bounce);
}

.hero-visual img:hover {
  transform: perspective(800px) rotateY(-3deg) scale(1.03);
}

/* Trade-In Banner (middle of store) */
.trade-banner {
  background: var(--primary-gradient-wide);
  border-radius: var(--radius-3xl);
  padding: 48px 40px;
  margin: 40px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-primary-lg);
}

.trade-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -30%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.trade-banner::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.trade-banner-content {
  position: relative;
  z-index: 1;
}

.trade-banner h2 {
  font-size: 2rem;
  font-weight: 900;
  color: white;
  margin-bottom: 12px;
}

.trade-banner p {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 500px;
}

.trade-banner .btn {
  position: relative;
  z-index: 1;
  background: white;
  color: var(--primary);
  border-color: white;
  font-size: 1.1rem;
  padding: 16px 36px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.trade-banner .btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  transform: scale(0.9) translateY(20px);
  transition: var(--bounce);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--error-light);
  color: var(--error);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 280px;
}

.toast.success { border-right: 4px solid var(--success); }
.toast.error { border-right: 4px solid var(--error); }
.toast.warning { border-right: 4px solid var(--warning); }
.toast.info { border-right: 4px solid var(--info); }

.toast .icon { font-size: 1.2rem; }

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin: 0 auto 12px;
}

.stat-icon.red { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.blue { background: var(--info-light); }
.stat-icon.yellow { background: var(--warning-light); }

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Step Wizard ── */
.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  position: relative;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.wizard-step:not(:last-child)::after {
  content: '';
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  transition: var(--transition);
}

.wizard-step.done:not(:last-child)::after {
  background: var(--primary);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.wizard-step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.wizard-step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.wizard-step.active .step-label { color: var(--primary); }
.wizard-step.done .step-label { color: var(--success); }

/* ── Image Upload ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--text-muted);
  font-weight: 600;
}

.upload-zone .btn {
  margin-top: 12px;
}

.upload-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.upload-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview .remove-btn {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--error);
  color: white;
  border: none;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: var(--transition-fast);
}

.upload-preview:hover .remove-btn { opacity: 1; }

/* ── Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px;
  background: var(--primary-gradient);
  border-radius: var(--radius-2xl);
  color: white;
  margin-bottom: 32px;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-info h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.profile-info p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ── Admin Table ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
}

.data-table th {
  text-align: right;
  padding: 12px 16px;
  background: var(--bg-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.data-table th:first-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.data-table th:last-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--primary-light);
}

.data-table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-table .mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-lighter);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
}

/* ── Loader / Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 5px;
}

.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.page-loader p {
  color: var(--text-muted);
  font-weight: 700;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Section Titles ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon { font-size: 1.5rem; }

.section-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.section-link:hover {
  color: var(--primary-dark);
}

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 40px 20px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

.hidden { display: none !important; }
.show { display: block; }

.page-content {
  padding: 24px 0 60px;
}

/* ── Admin Sidebar Layout ── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--text);
  color: white;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand {
  color: white;
  margin-bottom: 32px;
  padding: 0 8px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  margin-bottom: 4px;
}

.admin-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.06);
}

.admin-nav a.active {
  color: white;
  background: var(--primary);
}

.admin-nav .icon { font-size: 1.1rem; }

.admin-main {
  padding: 32px;
  background: var(--bg-secondary);
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.admin-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
}

/* ── Animations ── */
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes pulse-slow {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin: 0 auto 24px; }
  .hero-tags { justify-content: center; }
  .hero-visual { margin-top: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    right: -280px;
    z-index: 100;
    transition: var(--transition);
    width: 260px;
  }
  .admin-sidebar.show { right: 0; }
}

@media (max-width: 768px) {
  .container { padding: 0 8px; }
  .header-inner { gap: 10px; }
  .search-bar { display: none; }
  .mobile-toggle { display: block; }
  .header-btn .btn-text { display: none; }
  .header-btn { padding: 8px 10px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card-img { height: 160px; padding: 12px; }
  .product-card-body { padding: 12px 14px 14px; }
  .product-card-name { font-size: 0.9rem; }
  .trade-banner { grid-template-columns: 1fr; text-align: center; padding: 32px 24px; }
  .trade-banner h2 { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .profile-header { flex-direction: column; text-align: center; }
  .wizard-steps { flex-wrap: wrap; gap: 12px; }
  .wizard-step:not(:last-child)::after { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 24px; }
  .hero-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Page Transitions ── */
.page-enter {
  animation: fadeInUp 0.5s ease-out;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ── Selection ── */
::selection {
  background: var(--primary-lighter);
  color: var(--primary-darker);
}
