/* ============================================================
   📱 Mobile Store - ملف التصميم الكامل
   Dark Theme Professional Design
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c28;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(99, 102, 241, 0.4);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --text-primary: #f0f0f5;
  --text-secondary: #9999b3;
  --text-muted: #5a5a7a;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
  --shadow-glow-hover: 0 0 50px rgba(99, 102, 241, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

/* ── Utility Classes ───────────────────────────────────────── */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Loader ────────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 2px;
  animation: loader-slide 1s ease-in-out infinite;
}

@keyframes loader-slide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(350%);
  }
}

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 24px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Search Bar */
.nav-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

#search-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 10px 42px 10px 18px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-glass-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 50px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  border: none;
}

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

.nav-btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.nav-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
}

.nav-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  padding: 80px 24px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
  animation: fadeInUp 0.7s ease;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 32px;
  animation: fadeInUp 0.8s ease;
}

/* ============================================================
   FILTERS SECTION
   ============================================================ */
.filters-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(22, 22, 30, 0.5);
}

.filters-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filters-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Category Filter Pills */
.categories-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.pill {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pill:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Price Filter */
.price-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

#price-select {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

#price-select:focus {
  border-color: var(--accent-primary);
}

#price-select option {
  background: var(--bg-secondary);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title span {
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 2px;
  display: inline-block;
}

.products-count {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================================
   PRODUCTS SECTION
   ============================================================ */
.products-section {
  padding: 40px 24px 80px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Product Card ───────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  animation: fadeInScale 0.5s ease both;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow-hover), var(--shadow-lg);
}

/* Card Image */
.card-image-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #111118, #1a1a25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

/* Image Placeholder (when loading) */
.card-image-wrap .img-placeholder {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  font-size: 3rem;
}

/* Offer Badge */
.offer-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--accent-red), #ff6b6b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  animation: pulse 2s infinite;
  z-index: 2;
}

/* Category Tag */
.category-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  z-index: 2;
}

/* Card Body */
.card-body {
  padding: 20px;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

/* Price */
.card-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.5px;
}

.price-old {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 50px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 16px;
}

.empty-state-icon {
  font-size: 4rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: fadeInScale 0.3s ease;
}

.skeleton-img {
  height: 240px;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.skeleton-body {
  padding: 20px;
}

.skeleton-line {
  height: 14px;
  background: var(--bg-secondary);
  border-radius: 7px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.price {
  width: 40%;
  height: 22px;
  margin-top: 16px;
}

.skeleton-img::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ============================================================
   PRODUCT DETAIL MODAL
   ============================================================ */
.product-detail-modal {
  max-width: 880px;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  max-height: 90vh;
  position: relative;
}

/* زر الإغلاق فوق المودال */
.product-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

/* قسم الصورة */
.product-modal-image-wrap {
  width: 42%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #111118, #1c1c2a);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.product-modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-img-fallback {
  font-size: 6rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* قسم المعلومات */
.product-modal-info {
  flex: 1;
  padding: 32px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-category {
  display: inline-block;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  width: fit-content;
}

.product-modal-name {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.product-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  flex: 1;
}

/* قسم السعر داخل المودال */
.product-modal-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.modal-price-current {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--accent-primary);
  letter-spacing: -1px;
}

.modal-price-old {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.modal-price-save {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 10px;
  border-radius: 50px;
}

.product-modal-divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
}

.product-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Responsive: شاشات صغيرة */
@media (max-width: 640px) {
  .product-detail-modal {
    flex-direction: column;
    max-height: 95vh;
  }

  .product-modal-image-wrap {
    width: 100%;
    min-height: 220px;
    max-height: 260px;
  }

  .product-modal-info {
    padding: 20px 18px;
  }

  .product-modal-name {
    font-size: 1.2rem;
  }

  .modal-price-current {
    font-size: 1.5rem;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 24px 24px;
  text-align: center;
}

.footer-logo {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ============================================================
   ADMIN PANEL - Specific Styles
   ============================================================ */
.admin-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.sidebar-logo .logo-text {
  font-size: 1.2rem;
}

.sidebar-label {
  padding: 8px 24px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  font-family: 'Cairo', sans-serif;
}

.sidebar-link:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.sidebar-link.active .link-icon {
  color: var(--accent-primary);
}

.link-icon {
  font-size: 1rem;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* Admin Main Content */
.admin-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}

.admin-topbar {
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-content {
  padding: 32px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.06);
  transform: translate(20px, -20px);
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.stat-purple {
  background: rgba(99, 102, 241, 0.12);
}

.stat-cyan {
  background: rgba(6, 182, 212, 0.12);
}

.stat-green {
  background: rgba(16, 185, 129, 0.12);
}

.stat-gold {
  background: rgba(245, 158, 11, 0.12);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

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

/* Data Table */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.table-title {
  font-size: 1rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255, 255, 255, 0.02);
}

th {
  padding: 12px 20px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-color);
}

th:last-child {
  text-align: left;
}

td {
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* Table Product Image */
.table-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-secondary);
}

.table-img-placeholder {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

.badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

.badge-purple {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
}

/* Action Buttons in Table */
.action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.action-btn:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.action-btn.edit:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.action-btn.delete:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.action-btn.toggle:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

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

.form-label span {
  color: var(--accent-red);
  margin-right: 2px;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.toggle-label-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
  left: 25px;
  background: var(--accent-primary);
}

/* Image Upload */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.upload-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-preview {
  display: none;
  margin-top: 16px;
  position: relative;
}

.upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.upload-preview.visible {
  display: block;
}

.upload-progress {
  margin-top: 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  display: none;
}

.upload-progress.visible {
  display: block;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #ff6b6b);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 28px;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Delete Confirm Modal */
.confirm-modal {
  max-width: 440px;
  text-align: center;
}

.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.confirm-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: slideInLeft 0.3s ease;
  backdrop-filter: blur(20px);
}

.toast.removing {
  animation: slideOutLeft 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast-success .toast-icon {
  color: var(--accent-green);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast-error .toast-icon {
  color: var(--accent-red);
}

.toast-info {
  border-color: rgba(99, 102, 241, 0.4);
}

.toast-info .toast-icon {
  color: var(--accent-primary);
}

/* ── Admin Pages: Hidden/Active ─────────────────────────────── */
.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

/* ── Admin Layout Wrapper ────────────────────────────────────── */
#admin-layout-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

/* ============================================================
   LOGIN OVERLAY
   ============================================================ */
.login-overlay-wrap {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 24px;
  animation: fadeInScale 0.4s ease;
}

.login-overlay-wrap.hidden {
  display: none;
}

/* Radial glow background */
.login-overlay-wrap::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.5s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.login-error {
  color: var(--accent-red);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
}

.login-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 16px;
}

/* Shake animation for wrong password */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-5px);
  }

  80% {
    transform: translateX(5px);
  }
}

.input-shake {
  animation: shake 0.45s ease !important;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* Staggered card animation delay */
.product-card:nth-child(1) {
  animation-delay: 0.05s;
}

.product-card:nth-child(2) {
  animation-delay: 0.1s;
}

.product-card:nth-child(3) {
  animation-delay: 0.15s;
}

.product-card:nth-child(4) {
  animation-delay: 0.2s;
}

.product-card:nth-child(5) {
  animation-delay: 0.25s;
}

.product-card:nth-child(6) {
  animation-delay: 0.3s;
}

.product-card:nth-child(7) {
  animation-delay: 0.35s;
}

.product-card:nth-child(8) {
  animation-delay: 0.4s;
}

/* ============================================================
   RESPONSIVE — FULL MOBILE OVERHAUL
   ============================================================ */

/* ── Hamburger Button (hidden on desktop) ───────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}

.hamburger-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    width 0.3s ease;
  transform-origin: center;
}

/* الـ X عند الفتح */
.sidebar-open .hamburger-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar-open .hamburger-btn span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.sidebar-open .hamburger-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Sidebar Overlay ────────────────────────────────────── */
.sidebar-overlay {
  visibility: hidden; /* الإخفاء التام من الشاشة ومنع النقر */
  opacity: 0;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); /* لدعم سفاري القديم */
  z-index: 199;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-open .sidebar-overlay {
  visibility: visible; /* إظهار الطبقة عند الفتح فقط */
  opacity: 1;
}
.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
  /* ← بس لما يكون مفتوح يتفعل الضغط للغلق */
}

/* ── Tablet: 1024px ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}


/* ── Small Tablet / Large Phone: 768px ─────────────────── */
@media (max-width: 768px) {

  /* --- Navbar --- */
  .navbar-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }

  .nav-logo .logo-text {
    font-size: 1rem;
  }

  .nav-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    flex: unset;
  }

  .nav-search .search-input-wrapper {
    width: 100%;
  }

  .nav-search input {
    width: 100%;
  }

  .nav-links {
    margin-right: auto;
  }

  /* --- Hero --- */
  .hero {
    padding: 40px 16px 32px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .hero p {
    font-size: 0.95rem;
  }

  /* --- Filters --- */
  .filters-section {
    padding: 12px 16px;
  }

  .filters-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    /* Firefox */
  }

  .filters-inner::-webkit-scrollbar {
    display: none;
  }

  .filters-label {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .categories-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .categories-pills::-webkit-scrollbar {
    display: none;
  }

  .pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .price-filter {
    flex-shrink: 0;
    margin-right: 0;
  }

  /* --- Products --- */
  .products-section {
    padding: 20px 16px 70px;
  }

  .section-header {
    margin-bottom: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* --- Admin Layout: Drawer Sidebar ─────────────── */
  .admin-layout {
    flex-direction: row;
    /* يبقى row لكن السايدبار off-screen */
    min-height: 100vh;
  }

  /* إظهار زر الـ Hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* إظهار الـ Overlay (بدون pointer-events حتى لا يحجب النقر) */
  .sidebar-overlay {
    display: block;
    pointer-events: none;
    /* مخفي = لا يحجب */
  }

  /* السايدبار يختبئ يمين الشاشة (RTL) */
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0;
    bottom: 0;
    left: auto;
    width: 280px !important;
    height: 100vh !important;
    max-height: 100vh;
    min-height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden;
    z-index: 200;
    flex-direction: column !important;
    padding: 0 !important;
    border-left: 1px solid var(--border-color);
    border-top: none;
    /* off-screen translation (RTL: يمين الشاشة) */
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary) !important;
    backdrop-filter: none !important;
  }

  /* عند الفتح: السايدبار يدخل الشاشة */
  .sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  /* إعادة تنسيق العناصر داخل الـ drawer */
  .sidebar-logo {
    display: flex !important;
  }

  .sidebar-label {
    display: block !important;
  }

  .sidebar-nav {
    flex-direction: column !important;
    gap: 0;
    padding: 8px 12px !important;
    flex: unset !important;
  }

  .sidebar-link {
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 11px 16px !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-md) !important;
    min-width: unset !important;
    flex: unset !important;
  }

  .sidebar-link .link-icon {
    font-size: 1.15rem !important;
    display: inline !important;
  }

  .sidebar-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 16px !important;
    border-top: 1px solid var(--border-color) !important;
    border-right: none !important;
    margin-top: auto !important;
  }

  .sidebar-footer .btn {
    flex-direction: row !important;
    width: 100% !important;
    height: auto !important;
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
    border-radius: var(--radius-md) !important;
    justify-content: center !important;
    border: 1px solid var(--border-color) !important;
    margin: 0 !important;
    min-width: unset !important;
  }

  /* المحتوى الرئيسي: لا padding سفلي، يأخذ كامل العرض */
  .admin-main {
    flex: 1;
    order: unset;
    padding-bottom: 0;
    width: 100%;
    min-width: 0;
  }

  /* Topbar */
  .admin-topbar {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    gap: 12px;
    z-index: 50;
  }

  .admin-topbar h2 {
    font-size: 0.95rem;
    flex: 1;
  }

  .topbar-right span {
    display: none;
  }

  /* Admin Content */
  .admin-content {
    padding: 16px 12px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  /* Forms */
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-container {
    padding: 16px;
  }

  /* Page Header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 1.2rem;
  }

  /* Tables: horizontal scroll */
  .table-container {
    overflow: hidden;
  }

  .table-container>div,
  .table-container [style*="overflow-x"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

}

/* ── Phone: 480px ──────────────────────────────────────── */
@media (max-width: 480px) {

  /* --- Navbar --- */
  .nav-btn span:last-child {
    display: none;
  }

  /* نص "الإدارة" */
  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  /* --- Hero --- */
  .hero {
    padding: 28px 14px 24px;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  /* --- Products Grid: 2 columns --- */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card-image-wrap {
    height: 160px;
  }

  .card-body {
    padding: 12px;
  }

  .card-name {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .card-description {
    display: none;
  }

  /* إخفاء الوصف لتوفير المساحة */

  .price-current {
    font-size: 1rem;
  }

  .offer-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  /* --- Admin Stats: 1 column --- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Admin Sidebar links: smaller --- */
  .sidebar-link {
    min-width: 54px;
    font-size: 0.6rem;
    padding: 6px 6px;
  }

  .sidebar-link .link-icon {
    font-size: 1.15rem;
  }

  /* --- Modals: full screen --- */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Product detail modal: full screen stack */
  .product-detail-modal {
    flex-direction: column;
    max-height: 95vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
  }

  .product-modal-image-wrap {
    width: 100%;
    min-height: 200px;
    max-height: 240px;
  }

  .product-modal-info {
    padding: 16px;
    gap: 10px;
  }

  .product-modal-name {
    font-size: 1.1rem;
  }

  .modal-price-current {
    font-size: 1.4rem;
  }

  .product-modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .product-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Login card */
  .login-card {
    padding: 28px 20px;
    border-radius: var(--radius-xl);
  }

}