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

/* =================== CSS Variables =================== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: rgba(99, 102, 241, 0.2);
  --border-hover: rgba(99, 102, 241, 0.5);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --gradient-card: linear-gradient(145deg, rgba(30,41,59,0.9), rgba(15,23,42,0.9));

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

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary); }

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

/* =================== Navbar =================== */
.navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary) !important;
  background: var(--bg-glass);
}

.navbar-toggler { border-color: var(--border); }
.navbar-toggler-icon { filter: invert(1); }

.cart-badge {
  background: var(--gradient-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 50px;
  position: absolute;
  top: 0;
  right: -6px;
}

/* =================== Buttons =================== */
.btn-primary-custom {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99,102,241,0.5);
  color: white;
}

.btn-outline-custom {
  background: transparent;
  color: var(--primary-light);
  border: 1px solid var(--border);
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline-custom:hover {
  background: var(--bg-glass);
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-2px);
}

.btn-danger-custom {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger-custom:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.4); }

/* =================== Cards & Glass =================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

/* =================== Product Card =================== */
.product-card {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  height: 100%;
}

.product-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), var(--shadow-glow);
  transform: translateY(-8px) scale(1.02);
}

.product-card .img-wrapper {
  position: relative;
  padding-top: 75%;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-card .img-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .img-wrapper img { transform: scale(1.08); }

.product-card .img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: var(--text-muted);
  font-size: 3rem;
}

.product-card .card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(99,102,241,0.15);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.product-card:hover .card-overlay { opacity: 1; }

.overlay-btn {
  background: white;
  color: var(--secondary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  transform: translateY(10px);
}

.product-card:hover .overlay-btn { transform: translateY(0); }
.overlay-btn:hover { background: var(--primary); color: white; }

.product-card .card-body { padding: 1.25rem; }

.badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 2;
}

.badge-featured {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 2;
}

.product-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.product-compare-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

/* =================== Hero Section =================== */
.hero {
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 6s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 8s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.2);
  border: 1px solid rgba(99,102,241,0.4);
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 540px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.stat-item { text-align: center; }
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* =================== Section =================== */
.section { padding: 5rem 0; }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.section-subtitle { color: var(--text-secondary); margin-bottom: 3rem; }
.title-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =================== Category Cards =================== */
.category-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: block;
  position: relative;
}

.category-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.category-card .cat-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.category-card .cat-icon {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
}

.category-card .cat-body {
  padding: 1.25rem;
  text-align: center;
}

.category-card .cat-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.category-card .cat-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =================== Form Styles =================== */
.form-control {
  background: rgba(30, 41, 59, 0.7) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.75rem 1rem !important;
  transition: var(--transition) !important;
  font-size: 0.9rem !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  outline: none !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.form-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

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

/* =================== Cart =================== */
.cart-table { width: 100%; border-collapse: separate; border-spacing: 0 0.75rem; }
.cart-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 1rem 0.5rem;
  font-weight: 600;
}
.cart-row {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.cart-row:hover { border-color: var(--border-hover); }
.cart-row td { padding: 1rem; vertical-align: middle; }
.cart-row td:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.cart-row td:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.qty-input {
  background: var(--bg-secondary)!important;
  border: 1px solid var(--border)!important;
  color: var(--text-primary)!important;
  width: 70px!important;
  text-align: center!important;
  border-radius: var(--radius-sm)!important;
  padding: 0.4rem!important;
}

.cart-summary {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

/* =================== Order Badge =================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pending { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.status-processing { background: rgba(59,130,246,0.15); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.status-shipped { background: rgba(139,92,246,0.15); color: #8b5cf6; border: 1px solid rgba(139,92,246,0.3); }
.status-delivered { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.status-cancelled { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.status-paid { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }

/* =================== Rating Stars =================== */
.stars { color: #f59e0b; font-size: 1rem; letter-spacing: 2px; }
.star-input { display: flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 1.8rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f59e0b; }

/* =================== Alerts & Messages =================== */
.alert {
  border-radius: var(--radius-md);
  border: none;
  padding: 0.85rem 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.alert-success { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.alert-error, .alert-danger { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.alert-info { background: rgba(99,102,241,0.15); color: var(--primary-light); border: 1px solid var(--border); }

/* =================== Toast Notifications =================== */
#toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast-notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
}
.toast-notification.success { border-color: rgba(16,185,129,0.4); }
.toast-notification.error { border-color: rgba(239,68,68,0.4); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeInDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =================== Breadcrumb =================== */
.breadcrumb { background: none; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-secondary); font-size: 0.875rem; }
.breadcrumb-item.active { color: var(--text-muted); font-size: 0.875rem; }

/* =================== Search Bar =================== */
.search-bar {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.search-bar input {
  background: none!important;
  border: none!important;
  color: var(--text-primary)!important;
  padding: 0.7rem 1rem!important;
  flex: 1;
}
.search-bar input:focus { box-shadow: none!important; }
.search-bar button {
  background: var(--gradient-primary);
  border: none;
  color: white;
  padding: 0 1.25rem;
  cursor: pointer;
}

/* =================== Filter Sidebar =================== */
.filter-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.filter-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.filter-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: var(--transition);
}
.filter-link:hover, .filter-link.active {
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
}

/* =================== Empty State =================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.5rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.empty-state p { max-width: 380px; margin: 0 auto 2rem; }

/* =================== Footer =================== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-brand { font-size: 1.4rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-desc { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.5rem; }
.footer-heading { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 1rem; }
.footer-link { display: block; color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem; transition: var(--transition); }
.footer-link:hover { color: var(--primary-light); padding-left: 4px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; color: var(--text-muted); font-size: 0.8rem; }

/* =================== Scrollbar =================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =================== Utilities =================== */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.text-gradient { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary-light); margin-bottom: 0.5rem; }

/* =================== Go To Top =================== */
#go-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 999;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border: none;
}
#go-to-top.show { opacity: 1; visibility: visible; }
#go-to-top:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* =================== Animations =================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* =================== Responsive =================== */
@media (max-width: 992px) {
  .hero { padding: 4rem 0; }
  .hero-stats { gap: 1.5rem; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2.4rem; }
  .hero-stats { justify-content: center; }
  .section { padding: 3rem 0; }
}
