:root {
  /* Colors */
  --primary: #5451D6;
  --primary-light: #E0E0FC;
  --secondary: #FF8F6B; /* Accent orange seen in some UI elements */
  --dark: #1F2937;
  --gray: #6B7280;
  --gray-light: #F3F4F6;
  --bg-app: #F9FAFB;
  --surface: #FFFFFF;
  --success: #10B981;
  --danger: #EF4444;

  /* Typography */
  --font-main: system-ui, -apple-system, sans-serif;
  --h1: 28px;
  --h2: 22px;
  --h3: 18px;
  --body: 15px;
  --small: 13px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* UI Elements */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(84, 81, 214, 0.15);
  --shadow-lg: 0 16px 32px rgba(84, 81, 214, 0.2);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* App Container - Responsive */
#app-container {
  width: 100%;
  max-width: 1200px; /* Desktop width */
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
  padding-bottom: 80px; /* Space for bottom nav */
}

/* Typography */
h1, h2, h3, h4, p {
  margin: 0;
}

h1 { font-size: var(--h1); font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: var(--h2); font-weight: 600; }
h3 { font-size: var(--h3); font-weight: 600; }
p { font-size: var(--body); line-height: 1.5; color: var(--gray); }
.text-small { font-size: var(--small); color: var(--gray); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-decoration: none;
  font-size: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(84, 81, 214, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-light);
  color: var(--gray);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--gray-light);
  color: var(--dark);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: var(--small);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-light);
  background: var(--bg-app);
  font-size: 15px;
  transition: 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-md);
}

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.w-full { width: 100%; }
.mt-md { margin-top: var(--spacing-md); }
.mb-md { margin-bottom: var(--spacing-md); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* Header */
.header {
  padding: var(--spacing-lg) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Navigation */
.nav-bottom {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 1200px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  border-radius: 24px 24px 0 0;
  z-index: 200;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #9CA3AF;
  text-decoration: none;
  font-size: 10px;
  gap: 4px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Components Specific to E-commerce */

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--gray-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 var(--spacing-md) var(--spacing-md);
}

.search-icon {
  color: var(--gray);
  margin-right: 12px;
}

/* Categories */
.category-scroll {
  display: flex;
  overflow-x: auto;
  gap: var(--spacing-md);
  padding: 0 var(--spacing-md) var(--spacing-md);
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  text-decoration: none;
  color: var(--dark);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 24px;
  transition: 0.2s;
}

.category-item:hover .category-icon {
  background: var(--primary-light);
  color: var(--primary);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--spacing-md);
  padding: 0 var(--spacing-md) var(--spacing-md);
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.product-image-container {
  background: var(--gray-light);
  border-radius: 12px;
  aspect-ratio: 1/1;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
}

.like-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: var(--gray);
}

/* Banner */
.banner {
  margin: 0 var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.banner-content {
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.banner-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.banner-subtitle {
  opacity: 0.9;
  margin-bottom: 16px;
  font-size: 14px;
}

.banner-btn {
  background: white;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

/* Product Detail Specifics */
.detail-image-area {
  background: var(--gray-light);
  height: 350px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-content {
  background: var(--surface);
  border-radius: 32px 32px 0 0;
  margin-top: -32px;
  padding: 32px 24px 100px; /* Extra padding for bottom fixed bar */
  position: relative;
  z-index: 10;
}

.color-selector {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-dot.selected {
  border-color: var(--primary);
  padding: 2px;
  background-clip: content-box;
}

.size-selector {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.size-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--gray);
  cursor: pointer;
}

.size-badge.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.cart-img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: var(--gray-light);
  object-fit: cover;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-light);
  padding: 4px 8px;
  border-radius: 8px;
  width: fit-content;
}

.qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 4px;
  border: none;
  font-size: 16px;
  color: var(--dark);
  cursor: pointer;
}

/* Placeholders */
.placeholder-avatar {
  width: 40px;
  height: 40px;
  background: #E5E7EB;
  border-radius: 50%;
}

.placeholder-icon {
  font-style: normal;
  font-size: 20px;
}

/* Profile Menu */
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--gray-light);
  text-decoration: none;
  color: var(--dark);
}
.menu-item:last-child { border-bottom: none; }
.menu-icon-bg {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

/* Selection Cards (Checkout) */
.selection-card {
  border: 1px solid var(--gray-light);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}

.selection-card:hover {
  border-color: var(--primary);
}

.selection-card.selected {
  border-color: var(--primary);
  background: #EEF2FF;
}

.radio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.selection-card.selected .radio-circle {
  border-color: var(--primary);
}

.radio-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  display: none;
}

.selection-card.selected .radio-inner {
  display: block;
}

