/* --- DESIGN SYSTEM & VARIABLES --- */
:root {
  --font-en: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Cairo', 'Tajawal', sans-serif;

  /* Premium Dark Theme Palette */
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e2638;
  --bg-input: #1a2336;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --secondary: #06b6d4; /* Cyan */
  --secondary-hover: #0891b2;
  
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(21, 28, 44, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- GENERAL RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* Fallback/Override font for Arabic text */
body[dir="rtl"] {
  font-family: var(--font-ar);
}

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

button, input, select, textarea {
  font-family: inherit;
}

/* --- GRADIENT OVERLAYS --- */
.gradient-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(11, 15, 25, 0) 100%);
  z-index: -1;
  pointer-events: none;
}

/* --- CONTAINER --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* --- HEADER & NAVIGATION --- */
.header {
  position: sticky;
  top: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  padding: 16px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

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

.nav-link {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.cart-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.cart-badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lang-switch {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Nav Toggler */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
  padding: 100px 0 60px 0;
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--primary) 70%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* --- HERO SLIDER --- */
.hero-slider {
  position: relative;
  max-width: 900px;
  margin: 40px auto 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.slider-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  border-radius: var(--radius-md);
}

.slide-img.active {
  opacity: 1;
}

.slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  background: rgba(11, 15, 25, 0.6);
  padding: 8px 16px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active, .dot:hover {
  background: var(--primary);
  transform: scale(1.2);
}

/* --- COURSE CARDS SECTION --- */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: 80px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.course-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-md);
}

.course-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  position: relative;
  background: #152033;
}

.course-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(6px);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
}

.course-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-category {
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.course-title-link h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.course-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-dark);
}

.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.course-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.course-price.free {
  color: var(--success);
}

/* --- FORMS & AUTH PAGES --- */
.auth-wrapper {
  max-width: 480px;
  width: 100%;
  margin: 60px auto;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

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

.auth-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

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

/* --- STUDENT DASHBOARD --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  margin-bottom: 80px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  align-self: start;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-email {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.profile-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.profile-badge.admin {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* --- CATALOG SEARCH/FILTER BAR --- */
.filter-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.search-input-wrapper {
  flex-grow: 1;
}

.category-select {
  width: 200px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --- COURSE DETAILS PAGE --- */
.course-hero {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  padding: 60px 0;
  align-items: center;
}

.course-hero-info h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.course-hero-info .meta-items {
  display: flex;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.course-hero-info .desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.course-hero-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.widget-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.widget-content {
  padding: 32px;
}

.widget-price {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.widget-price.free {
  color: var(--success);
}

.curriculum-section {
  margin-bottom: 80px;
}

.curriculum-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.curriculum-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.curriculum-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.curriculum-item:last-child {
  border-bottom: none;
}

.curriculum-item:hover {
  background: var(--bg-card-hover);
}

.lesson-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lesson-number {
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 700;
}

.lesson-title {
  font-weight: 600;
}

.lesson-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.lesson-badge.preview {
  background: rgba(6, 182, 212, 0.1);
  color: var(--secondary);
}

.lesson-badge.locked {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* --- SECURE CHECKOUT PAGE --- */
.checkout-wrapper {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 40px;
  margin: 60px 0;
}

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.simulated-card-badge {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 24px;
}

.checkout-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  align-self: start;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
  border-bottom: none;
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 16px;
  color: var(--text-primary);
}

/* --- WATCH INTERACTIVE PLAYER --- */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  margin: 40px 0 80px 0;
}

.player-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-title {
  font-size: 1.8rem;
  font-weight: 800;
}

.locked-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #111827 0%, #030712 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.lock-icon {
  font-size: 3.5rem;
  color: var(--warning);
  margin-bottom: 20px;
}

.lock-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.lock-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 400px;
}

.playlist-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.playlist-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.playlist-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.playlist-items {
  overflow-y: auto;
  flex-grow: 1;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.playlist-item.active {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--primary);
}

/* Adjust active item borders for RTL in separate rules */
body[dir="rtl"] .playlist-item.active {
  border-left: none;
  border-right: 4px solid var(--primary);
}

.playlist-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex-grow: 1;
}

/* --- ADMIN PANEL VIEWS --- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

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

.stat-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

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

.admin-table-container {
  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;
  text-align: left;
}

body[dir="rtl"] .admin-table {
  text-align: right;
}

.admin-table th, .admin-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.01);
}

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

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.admin-editor-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  margin-bottom: 80px;
}

.admin-form-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
}

/* --- FOOTER --- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: #080c14;
  padding: 60px 0 30px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-brand p {
  margin-top: 16px;
  max-width: 320px;
}

.footer-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

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

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
  .course-hero {
    grid-template-columns: 1fr;
  }
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .playlist-sidebar {
    height: 400px;
  }
  .checkout-wrapper {
    grid-template-columns: 1fr;
  }
  .admin-editor-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-stats {
    flex-direction: column;
    gap: 30px;
  }
  .nav-links, .nav-actions .btn {
    display: none; /* Controlled by mobile menu JS if implemented */
  }
  .menu-toggle {
    display: block;
  }
  .filter-bar {
    flex-direction: column;
  }
  .category-select {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* --- TOAST NOTIFICATION SYSTEM --- */
.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

body[dir="rtl"] .toast-container {
  right: auto;
  left: 32px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.15);
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[dir="rtl"] .toast {
  transform: translateX(-120%);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

body[dir="rtl"] .toast.hide {
  transform: translateX(-120%);
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  width: 100%;
  transform-origin: left;
  animation: toast-progress-shrink 3.5s linear forwards;
}

@keyframes toast-progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Add to cart button loading state */
.btn-cart-loading {
  pointer-events: none;
  opacity: 0.75;
}
