/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:   #e94560;
  --dark:      #1a1a2e;
  --mid:       #16213e;
  --accent:    #0f3460;
  --light:     #f5f5f5;
  --white:     #ffffff;
  --text:      #333333;
  --muted:     #777777;
  --success:   #28a745;
  --warning:   #ffc107;
  --danger:    #dc3545;
  --radius:    8px;
  --shadow:    0 4px 20px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--light); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--dark);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.navbar .logo { color: var(--white); font-size: 1.5rem; font-weight: 700; }
.navbar .logo span { color: var(--primary); }
.navbar .nav-links { display: flex; align-items: center; gap: 24px; }
.navbar .nav-links a { color: #ccc; font-size: 0.95rem; transition: color var(--transition); }
.navbar .nav-links a:hover { color: var(--white); }
.navbar .cart-icon { position: relative; }
.navbar .cart-badge {
  position: absolute; top: -8px; right: -10px;
  background: var(--primary); color: white;
  font-size: 0.7rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.btn-nav {
  background: var(--primary); color: white;
  padding: 8px 20px; border-radius: var(--radius);
  font-size: 0.9rem; border: none; cursor: pointer;
  transition: background var(--transition);
}
.btn-nav:hover { background: #c73652; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 80px 5%;
  text-align: center;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 16px; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.15rem; color: #aaa; margin-bottom: 32px; max-width: 560px; margin-inline: auto; }
.btn-hero {
  display: inline-block;
  background: var(--primary); color: white;
  padding: 14px 36px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-hero:hover { background: #c73652; transform: translateY(-2px); }

/* ── Section ─────────────────────────────────────────────── */
.section { padding: 56px 5%; }
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.section-subtitle { color: var(--muted); margin-bottom: 36px; }

/* ── Product Grid ────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.product-card img { width: 100%; height: 200px; object-fit: cover; }
.product-card .card-body { padding: 16px; }
.product-card .category { font-size: 0.75rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.product-card h3 { font-size: 1rem; margin: 6px 0; }
.product-card .price { font-size: 1.2rem; font-weight: 700; color: var(--dark); }
.product-card .btn-add {
  display: block; width: 100%;
  background: var(--dark); color: white;
  border: none; padding: 10px; border-radius: var(--radius);
  margin-top: 12px; cursor: pointer; font-size: 0.9rem;
  transition: background var(--transition);
}
.product-card .btn-add:hover { background: var(--primary); }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 32px; align-items: center;
}
.filter-bar input, .filter-bar select {
  padding: 10px 16px; border: 1px solid #ddd;
  border-radius: var(--radius); font-size: 0.95rem;
  background: white;
}
.filter-bar input { flex: 1; min-width: 200px; }

/* ── Auth Forms ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--dark), var(--accent));
  padding: 24px;
}
.auth-card {
  background: white; border-radius: 16px;
  padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 28px; }
.auth-card .auth-logo h2 { font-size: 1.6rem; color: var(--dark); }
.auth-card .auth-logo h2 span { color: var(--primary); }
.auth-card .auth-logo p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--dark); }
.form-group input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid #e0e0e0; border-radius: var(--radius);
  font-size: 1rem; transition: border-color var(--transition);
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.btn-primary {
  width: 100%; background: var(--primary); color: white;
  border: none; padding: 14px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover { background: #c73652; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.auth-link { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--muted); }
.auth-link a { color: var(--primary); font-weight: 600; }
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.9rem; margin-bottom: 16px; display: none;
}
.alert-error   { background: #fef0f0; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #f0fef4; color: var(--success); border: 1px solid #c3e6cb; }

/* ── OTP Input ───────────────────────────────────────────── */
.otp-input {
  text-align: center; font-size: 2rem; font-weight: 700;
  letter-spacing: 12px; padding: 16px;
  border: 2px dashed var(--primary); border-radius: var(--radius);
  width: 100%; background: #fef9fa;
}

/* ── Cart ────────────────────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cart-table th { background: var(--dark); color: white; padding: 14px 20px; text-align: left; font-size: 0.9rem; }
.cart-table td { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-table img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.qty-input { width: 64px; padding: 6px; border: 1px solid #ddd; border-radius: 6px; text-align: center; }
.btn-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.2rem; }
.cart-summary { background: white; border-radius: 12px; padding: 28px; box-shadow: var(--shadow); margin-top: 24px; max-width: 400px; margin-left: auto; }
.cart-summary h3 { font-size: 1.2rem; margin-bottom: 16px; }
.cart-summary .total-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.cart-summary .total-row.grand { font-weight: 700; font-size: 1.1rem; color: var(--dark); border-bottom: none; margin-top: 8px; }

/* ── Checkout ────────────────────────────────────────────── */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; }
@media (max-width: 768px) { .checkout-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-box { background: white; border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.card-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }

/* ── Orders ──────────────────────────────────────────────── */
.order-card { background: white; border-radius: 12px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.order-card .order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
}
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-paid      { background: #d1ecf1; color: #0c5460; }
.badge-shipped   { background: #cce5ff; color: #004085; }
.badge-delivered { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--dark); padding: 24px 0; }
.admin-sidebar .sidebar-logo { color: white; font-size: 1.2rem; font-weight: 700; padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar nav a { display: block; color: #aaa; padding: 14px 24px; font-size: 0.95rem; transition: all var(--transition); }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: white; background: rgba(255,255,255,0.05); border-left: 3px solid var(--primary); }
.admin-main { padding: 32px; background: var(--light); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--dark); color: white; padding: 14px 16px; text-align: left; font-size: 0.85rem; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.btn-sm { padding: 6px 14px; border-radius: 6px; font-size: 0.82rem; cursor: pointer; border: none; font-weight: 600; }
.btn-danger { background: #fef0f0; color: var(--danger); }
.btn-success { background: #f0fef4; color: var(--success); }
select.status-select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.85rem; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: var(--dark); color: #888; text-align: center; padding: 24px; font-size: 0.9rem; margin-top: 48px; }
.footer span { color: var(--primary); }

/* ── Utility ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.empty-state { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; }
.spinner { border: 3px solid #f0f0f0; border-top: 3px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 0.8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}
