/* =============================================
   APIUSARTECH ACADEMY - MAIN STYLES
   ============================================= */

/* ── CSS VARIABLES ── */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --danger: #ef4444;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all .2s cubic-bezier(.4, 0, .2, 1);
  --nav-h: 70px;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text-1);
  background: var(--surface);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea {
  font-family: var(--font-body);
  outline: none;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.2; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(99,102,241,.5);
}
.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-secondary:hover { filter: brightness(1.1); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-sm {
  padding: 8px 18px;
  font-size: .85rem;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}
.btn-outline-sm:hover { background: var(--primary); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.4);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,.25); }
.btn-white {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
  font-family: var(--font-display);
}
.btn-white:hover { background: #f0f0ff; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.9); }
.btn-full { width: 100%; justify-content: center; }

/* ── NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  transition: box-shadow .3s;
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-1);
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: rgba(99,102,241,.06); }
.nav-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.cart-badge {
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
.nav-user-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  color: var(--text-2);
  position: relative;
  transition: var(--transition);
}
.nav-user-dropdown:hover { background: var(--surface-3); }
.nav-user-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  min-width: 160px;
  overflow: hidden;
  z-index: 100;
}
.nav-user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: .85rem;
  color: var(--text-2);
  transition: var(--transition);
}
.dropdown-menu a:hover { background: var(--surface-3); color: var(--primary); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 60px 0;
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}
.shape-1 { width: 500px; height: 500px; background: #6366f1; top: -100px; right: -100px; }
.shape-2 { width: 300px; height: 300px; background: #10b981; bottom: -50px; left: 10%; }
.shape-3 { width: 200px; height: 200px; background: #f59e0b; top: 40%; left: 40%; }
.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}
.hero-content { color: #fff; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  color: #fff;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, #a5b4fc, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #fff; }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.6); }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.2); }
.hero-visual { position: relative; }
.hero-card-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.floating-card {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  animation: float 6s ease-in-out infinite;
}
.floating-card:nth-child(2) { animation-delay: 1.5s; }
.floating-card:nth-child(3) { animation-delay: 3s; }
.floating-card:nth-child(4) { animation-delay: 4.5s; }
.fc-icon { font-size: 1.8rem; flex-shrink: 0; }
.fc-title { font-family: var(--font-display); font-weight: 700; font-size: .9rem; margin-bottom: 2px; }
.fc-sub { font-size: .75rem; color: rgba(255,255,255,.6); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── SECTION COMMON ── */
.section-header { margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  background: rgba(99,102,241,.1);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 12px;
}
.section-sub { font-size: 1rem; color: var(--text-2); max-width: 540px; }
.text-center { text-align: center; }
.text-center .section-sub { margin: 0 auto; }

/* ── CATEGORIES GRID ── */
.categories-section { background: var(--surface-2); }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--cat-color, var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card:hover::before { transform: scaleX(1); }
.cat-emoji { font-size: 2.5rem; }
.cat-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-1); }
.cat-desc { font-size: .85rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.cat-link { font-size: .85rem; font-weight: 600; color: var(--cat-color, var(--primary)); }

/* ── FEATURES ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.feature-item { text-align: center; }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-item h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-item p { font-size: .85rem; color: var(--text-2); line-height: 1.6; }

/* ── CTA SECTION ── */
.cta-section {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 80px 0;
}
.cta-content {
  text-align: center;
  color: #fff;
}
.cta-content h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.cta-content p { font-size: 1rem; opacity: .85; margin-bottom: 28px; }

/* ── FOOTER ── */
.footer { background: var(--text-1); color: rgba(255,255,255,.7); padding: 60px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand .nav-logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: .85rem; line-height: 1.6; }
.footer-col h4 { font-family: var(--font-display); font-weight: 700; color: #fff; margin-bottom: 16px; font-size: .9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col li, .footer-col a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; font-size: .8rem; text-align: center; }

/* ── SKELETON LOADER ── */
.skeleton-card {
  background: var(--surface-3);
  border-radius: var(--radius-lg);
  height: 200px;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { opacity: .7; }
  50% { opacity: .3; }
  100% { opacity: .7; }
}

/* ── PRODUCT CARDS ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--surface-3), var(--border));
}
.product-img-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--surface-3), #e2e8f0);
}
.product-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.product-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
}
.badge-primary { background: rgba(99,102,241,.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,.1); color: var(--secondary); }
.badge-warning { background: rgba(245,158,11,.1); color: var(--accent); }
.badge-info { background: rgba(59,130,246,.1); color: #3b82f6; }
.product-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text-1); }
.product-desc { font-size: .83rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.product-price { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.product-duration { font-size: .78rem; color: var(--text-3); }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--text-1); }
.form-input, .form-select, .form-textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text-1);
  background: var(--surface);
  transition: var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-input.error, .form-select.error, .form-textarea.error { border-color: var(--danger); }
.form-error { font-size: .78rem; color: var(--danger); display: none; }
.form-error.show { display: block; }
.form-textarea { resize: vertical; min-height: 100px; }

/* ── AUTH PAGES ── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 28px;
  justify-content: center;
  color: var(--text-1);
}
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: .85rem; color: var(--text-2); text-align: center; margin-bottom: 28px; }
.auth-link { color: var(--primary); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: .8rem; color: var(--text-3); }
.password-input-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
}

/* ── DASHBOARD ── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.sidebar {
  background: var(--text-1);
  padding: 32px 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 20px;
}
.sidebar-brand .nav-logo { color: #fff; font-size: 1rem; }
.sidebar-nav { padding: 0 12px; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 4px;
}
.sidebar-nav-item:hover, .sidebar-nav-item.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-nav-item svg { flex-shrink: 0; }
.dashboard-main { padding: 32px; background: var(--surface-2); }
.page-header { margin-bottom: 28px; }
.page-title { font-size: 1.6rem; font-weight: 800; }
.page-sub { font-size: .9rem; color: var(--text-2); margin-top: 4px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card-label { font-size: .8rem; color: var(--text-2); margin-bottom: 6px; }
.stat-card-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--text-1); }
.stat-card-icon { font-size: 1.5rem; margin-bottom: 10px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  font-size: .85rem;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── ADMIN PANEL ── */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - var(--nav-h)); }
.admin-main { padding: 32px; background: var(--surface-2); }

/* ── CART PAGE ── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.cart-item-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}
.cart-item-title { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.cart-item-price { color: var(--primary); font-weight: 700; }
.cart-item-remove {
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background .2s;
}
.cart-item-remove:hover { background: rgba(239,68,68,.1); }
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
.cart-summary h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 10px; color: var(--text-2); }
.summary-total { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; font-weight: 700; color: var(--text-1); font-size: 1rem; }

/* ── CHECKOUT MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.modal-close { color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; transition: background .2s; }
.modal-close:hover { background: var(--surface-3); color: var(--text-1); }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--text-1);
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  max-width: 320px;
  pointer-events: auto;
}
.toast.success { background: #065f46; }
.toast.error { background: #7f1d1d; }
.toast.warning { background: #78350f; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(100%); opacity: 0; } }

/* ── LOADING SPINNER ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-dark {
  border-color: rgba(99,102,241,.2);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { font-size: .9rem; color: var(--text-2); margin-bottom: 20px; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-3);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-2); transition: color .2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-3); }

/* ── CATEGORY PAGE ── */
.category-page { padding: 40px 0 80px; }
.category-header {
  padding: 48px 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.category-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.category-desc { font-size: 1rem; color: var(--text-2); max-width: 520px; }

/* ── STATUS BADGE ── */
.status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
}
.status-pending { background: rgba(245,158,11,.1); color: #b45309; }
.status-approved { background: rgba(16,185,129,.1); color: #059669; }
.status-rejected { background: rgba(239,68,68,.1); color: #dc2626; }

/* ── PAGINATION (simple) ── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}
.filter-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.filter-chip:hover, .filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── ANIMATIONS ── */
.animate-fade-up { animation: fadeUp .6s ease both; }
.animate-fade-in { animation: fadeIn .8s ease .2s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── CARD SECTION HEADERS ── */
.section-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

/* ── ORDER STATUS SELECT ── */
.status-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .78rem;
  cursor: pointer;
  background: var(--surface);
}

/* ── QUANTITY CONTROL ── */
.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-value { font-weight: 700; min-width: 24px; text-align: center; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-info { background: rgba(99,102,241,.08); color: var(--primary); border: 1px solid rgba(99,102,241,.2); }
.alert-success { background: rgba(16,185,129,.08); color: #059669; border: 1px solid rgba(16,185,129,.2); }
.alert-danger { background: rgba(239,68,68,.08); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }

/* ── SEARCH INPUT ── */
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-input { padding-left: 38px; }

/* ── IMAGE UPLOAD ── */
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-3);
  font-size: .85rem;
}
.img-upload-area:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.03); }

/* ── PAGE LOADER ── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-container { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    transition: transform .3s ease;
    gap: 4px;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: flex; padding: 12px 14px; }
  .nav-user-dropdown { padding: 12px 14px; }
  .nav-user-dropdown .dropdown-menu { position: static; box-shadow: none; border: none; background: var(--surface-2); }
  .hamburger { display: flex; }

  .hero { padding: 40px 0; min-height: auto; }
  .hero-card-stack { grid-template-columns: 1fr 1fr; gap: 12px; }
  .floating-card { padding: 14px; }
  .hero-stats { gap: 14px; }

  .dashboard-layout, .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }

  .section { padding: 50px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 6px; }
}

@media (max-width: 480px) {
  .hero-card-stack { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .hero-actions { flex-direction: column; }
  .products-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .modal { padding: 24px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
