/* ═══════════════════════════════════════════════════════════
   Awesome Shop — Modern Subscription Store CSS
   Dark/Light Theme • RTL Support • Mobile First
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Shared */
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar: 'Cairo', 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* Dark Theme (Default) */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #1e293b;
  --bg-navbar: rgba(15, 23, 42, 0.85);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-light: #1e293b;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-light: rgba(37, 99, 235, 0.15);
  --accent-glow: rgba(37, 99, 235, 0.4);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --star-color: #fbbf24;
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --gradient-card: linear-gradient(145deg, #1e293b 0%, #1e293b 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #06b6d4 100%);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-navbar: rgba(248, 250, 252, 0.9);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --accent: #2563eb;
  --accent-hover: #1e40af;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --star-color: #f59e0b;
  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f8fafc 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #06b6d4 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

body.rtl { font-family: var(--font-ar); direction: rtl; }

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-navbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { color: var(--accent); }
.logo-icon { font-size: 1.5rem; }
.logo-text { background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--accent-light); }

.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rtl .cart-badge { right: auto; left: 2px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search */
.nav-search {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
}
.nav-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }

.search-input {
  background: transparent;
  border: none;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 160px;
  outline: none;
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.search-btn:hover { color: var(--accent); }

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Dropdown */
.dropdown { position: relative; }

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: var(--transition);
}
.dropdown-toggle:hover { color: var(--text-primary); border-color: var(--accent); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.rtl .dropdown-menu { right: auto; left: 0; }

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--accent-light); color: var(--text-primary); }
.dropdown-item.active { color: var(--accent); font-weight: 600; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

.admin-link { color: var(--warning); }
.text-danger { color: var(--danger) !important; }

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.mobile-menu.open { display: flex; }

.mobile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}
.mobile-link:hover { color: var(--accent); }

.hide-mobile { display: inline; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4); color: white; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background: var(--success); color: white; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: 0.6; cursor: not-allowed; }

.form-select { cursor: pointer; appearance: none; }

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-icon {
  position: relative;
}
.input-icon i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.rtl .input-icon i { left: auto; right: 14px; }
.input-icon input { padding-left: 42px; }
.rtl .input-icon input { padding-left: 16px; padding-right: 42px; }

/* ── Flash Messages ────────────────────────────────────── */
.flash-message {
  padding: 14px 0;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease;
}
.flash-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flash-success { background: rgba(16, 185, 129, 0.15); color: var(--success); border-bottom: 2px solid var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.15); color: var(--danger); border-bottom: 2px solid var(--danger); }
.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Alert ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }

/* ── Hero Section ──────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-glow), transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.2), transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Announcement Bar ──────────────────────────────────── */
.announcement-bar {
  background: var(--gradient-accent);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Sections ──────────────────────────────────────────── */
.section { padding: 60px 0; }
.main-content { margin-top: 64px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.view-all-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
}

.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-subtitle {
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Categories Grid ───────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}
.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  color: var(--text-primary);
}

.category-icon { font-size: 2rem; }
.category-name { font-weight: 600; font-size: 0.95rem; }
.category-count { font-size: 0.8rem; color: var(--text-muted); }

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

.product-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

.product-card-link { text-decoration: none; color: inherit; display: block; }

.product-image {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  overflow: hidden;
}
.product-image img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: var(--transition);
}
.product-card:hover .product-image img { transform: scale(1.05); }

.product-image-placeholder {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.product-image-placeholder.large { height: 300px; }
.product-image-placeholder.small { width: 80px; height: 80px; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
}
.rtl .product-badge { left: auto; right: 12px; }
.product-badge.featured { background: var(--gradient-accent); color: white; }

.product-info { padding: 16px; }

.product-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--star-color);
}
.rating-count { color: var(--text-muted); margin-left: 4px; }
.rtl .rating-count { margin-left: 0; margin-right: 4px; }

.product-duration { color: var(--text-muted); }

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

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.product-cta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.product-card:hover .product-cta { color: var(--accent); }

/* ── Products Page Layout ──────────────────────────────── */
.products-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 30px;
}

.products-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.filter-group {
  margin-bottom: 24px;
}
.filter-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.filter-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
  margin-bottom: 2px;
}
.filter-link:hover { background: var(--accent-light); color: var(--text-primary); }
.filter-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.search-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}

/* ── Product Detail ────────────────────────────────────── */
.product-detail-page { padding-top: 100px; }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.product-detail-image {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 350px;
}
.product-detail-image img { max-height: 300px; object-fit: contain; }

.product-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.product-breadcrumb a { color: var(--text-secondary); }
.product-breadcrumb a:hover { color: var(--accent); }

.product-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.product-detail-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.product-detail-rating .stars { color: var(--star-color); display: flex; gap: 2px; }

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
}
.price-tag {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.price-duration {
  font-size: 1rem;
  color: var(--text-muted);
}

.product-detail-desc {
  margin-bottom: 24px;
}
.product-detail-desc h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.product-detail-desc p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.product-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.meta-item i { color: var(--accent); width: 20px; text-align: center; }

.product-detail-actions { margin-top: 16px; }
.inline-form { display: inline; }

/* ── Reviews ───────────────────────────────────────────── */
.reviews-section { margin-top: 60px; margin-bottom: 60px; }
.reviews-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }

.review-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}
.review-form-card h3 { font-size: 1.1rem; margin-bottom: 16px; }

/* Star Rating Input */
.star-rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 8px;
}
.star-rating-input input { display: none; }
.star-rating-input label {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
  color: var(--star-color);
}

.review-login-prompt {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  text-align: center;
}

.reviews-list { display: flex; flex-direction: column; gap: 16px; }

.review-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}
.review-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.review-avatar { font-size: 2rem; color: var(--text-muted); }
.review-item-info { flex: 1; }
.review-item-info strong { display: block; }
.review-date { font-size: 0.8rem; color: var(--text-muted); }
.review-item-stars { color: var(--star-color); }
.review-item-text { color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }

/* Home Reviews Grid */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}
.review-card:hover { border-color: var(--accent); }
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-author { font-weight: 600; font-size: 0.9rem; }
.review-product { font-size: 0.8rem; color: var(--text-muted); }
.review-product a { color: var(--accent); }
.review-stars { color: var(--star-color); margin-bottom: 8px; font-size: 0.85rem; }
.review-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }

/* ── Why Us ────────────────────────────────────────────── */
.section-why { background: var(--bg-secondary); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.why-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.why-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.why-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent);
}

.why-card h3 { font-size: 1.05rem; margin-bottom: 8px; font-weight: 600; }
.why-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ── Auth Pages ────────────────────────────────────────── */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding-top: 100px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-form { margin-bottom: 24px; }
.auth-footer { text-align: center; font-size: 0.9rem; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); font-weight: 500; }

/* ── Cart Page ─────────────────────────────────────────── */
.cart-page { padding-top: 100px; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.cart-item-image { width: 80px; height: 80px; flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); }

.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 1rem; margin-bottom: 4px; }
.cart-item-info h3 a { color: var(--text-primary); }
.cart-item-info h3 a:hover { color: var(--accent); }
.cart-item-duration { font-size: 0.8rem; color: var(--text-muted); }

.cart-item-price { text-align: right; }
.rtl .cart-item-price { text-align: left; }
.cart-item-price .price { display: block; font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.cart-item-price .quantity { font-size: 0.8rem; color: var(--text-muted); }

.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  position: sticky;
  top: 80px;
}
.cart-summary h3 { font-size: 1.1rem; margin-bottom: 20px; }

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.summary-row.total {
  border-top: 2px solid var(--border-color);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.summary-price { font-weight: 700; color: var(--accent); }

.cart-summary .btn { margin-top: 12px; }

/* ── Orders ────────────────────────────────────────────── */
.orders-page { padding-top: 100px; }
.orders-list { display: flex; flex-direction: column; gap: 16px; }

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.order-number strong { font-size: 0.95rem; }
.order-date { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 2px; }

.status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending .status-badge { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-processing .status-badge { background: rgba(37, 99, 235, 0.15); color: var(--accent); }
.status-completed .status-badge { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-cancelled .status-badge { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-refunded .status-badge { background: rgba(107, 107, 128, 0.15); color: var(--text-muted); }

.order-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.order-product { display: flex; align-items: center; gap: 12px; }
.order-thumb { width: 50px; height: 50px; border-radius: var(--radius-sm); object-fit: contain; background: var(--bg-input); }
.order-product h4 { font-size: 0.95rem; }
.order-product a { color: var(--text-primary); }
.order-product a:hover { color: var(--accent); }
.order-amount { font-weight: 700; font-size: 1.1rem; color: var(--accent); }

.order-delivery {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: rgba(16, 185, 129, 0.05);
  font-size: 0.9rem;
}
.order-delivery strong { color: var(--success); }

/* Order Detail */
.order-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.order-status-banner {
  padding: 20px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.order-status-banner.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.order-status-banner.status-processing { background: rgba(37, 99, 235, 0.15); color: var(--accent); }
.order-status-banner.status-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.order-status-banner.status-cancelled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.order-detail-body { padding: 30px; }
.order-detail-body h3 { font-size: 1.3rem; margin-bottom: 12px; }
.order-detail-body p { color: var(--text-secondary); margin-bottom: 20px; }
.order-detail-meta { display: flex; gap: 30px; margin-bottom: 24px; font-size: 0.95rem; }

.delivery-box, .notes-box {
  background: var(--bg-input);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
.delivery-box h4, .notes-box h4 { font-size: 0.95rem; margin-bottom: 8px; color: var(--accent); }

/* ── Profile Page ──────────────────────────────────────── */
.profile-page { padding-top: 100px; }

.profile-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.stat-card i { font-size: 1.5rem; color: var(--accent); margin-bottom: 8px; }
.stat-number { font-size: 2rem; font-weight: 800; margin-bottom: 4px; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; }

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}
.profile-card h2 { font-size: 1.2rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state.small { padding: 30px 20px; }
.empty-state i { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { margin-bottom: 16px; color: var(--text-secondary); }

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}
.pagination-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
}
.pagination-btn:hover { border-color: var(--accent); color: var(--accent); }
.pagination-info { color: var(--text-muted); font-size: 0.9rem; }

/* ── Error Page ────────────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding-top: 80px;
}
.error-content { text-align: center; }
.error-code {
  font-size: 8rem;
  font-weight: 900;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.error-text { font-size: 1.2rem; color: var(--text-secondary); margin: 16px 0 32px; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-col h4 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }

.footer-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; }

.footer-social { display: flex; gap: 10px; }
.social-link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: var(--transition);
}
.social-link:hover { color: var(--accent); border-color: var(--accent); }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }

.newsletter-form { display: flex; gap: 8px; }
.newsletter-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.newsletter-input:focus { border-color: var(--accent); }

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

/* ── Admin Pages ───────────────────────────────────────── */
.admin-page { padding-top: 100px; }

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.admin-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.admin-nav a:hover { border-color: var(--accent); color: var(--accent); }
.admin-nav a.active { background: var(--accent); color: white; border-color: var(--accent); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.admin-stat-icon.users { background: rgba(37, 99, 235, 0.15); color: var(--accent); }
.admin-stat-icon.orders { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.admin-stat-icon.products { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.admin-stat-icon.revenue { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.admin-stat-number { font-size: 1.5rem; font-weight: 800; }
.admin-stat-label { font-size: 0.8rem; color: var(--text-muted); }

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}
.rtl .admin-table th { text-align: right; }
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-card-hover); }

.admin-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-form h3 { font-size: 1.1rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }

.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.rtl .status-dot { margin-right: 0; margin-left: 6px; }
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .hide-mobile { display: none !important; }

  .nav-search { width: auto; }
  .search-input { width: 100px; }

  .hero { min-height: 380px; padding: 100px 20px 60px; }
  .hero-title { font-size: 2rem; }

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

  .products-layout { grid-template-columns: 1fr; }
  .products-sidebar { position: static; }
  .filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
  .filter-group h3 { width: 100%; }

  .product-detail { grid-template-columns: 1fr; }
  .product-detail-image { min-height: 250px; }

  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }

  .form-row { grid-template-columns: 1fr; }

  .auth-card { padding: 24px; margin: 0 16px; }

  .footer-grid { grid-template-columns: 1fr; }

  .profile-stats { flex-direction: column; }

  .admin-stats { grid-template-columns: 1fr 1fr; }

  .reviews-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }

  .order-detail-meta { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 80px; }
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card { animation: fadeIn 0.4s ease both; }
.product-card:nth-child(2) { animation-delay: 0.05s; }
.product-card:nth-child(3) { animation-delay: 0.1s; }
.product-card:nth-child(4) { animation-delay: 0.15s; }
.product-card:nth-child(5) { animation-delay: 0.2s; }
.product-card:nth-child(6) { animation-delay: 0.25s; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Selection ─────────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: white;
}
