:root {
  /* Colors */
  --primary: #2563EB; /* Trust Blue */
  --primary-dark: #1E40AF;
  --accent: #F97316; /* Action Orange - High visibility for CTAs */
  --accent-hover: #EA580C;
  --bg-body: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #111827;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;

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

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;

  /* Layout */
  --header-height: 60px;
  --bottom-nav-height: 64px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: var(--bottom-nav-height); /* Space for bottom nav */
}

a {
  text-decoration: none;
  color: inherit;
}

/* Utilities */
.container {
  max-width: 480px; /* Mobile-focused max width */
  margin: 0 auto;
  background: var(--bg-body);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.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-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.p-md { padding: var(--space-md); }

/* Header */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.brand-logo {
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--primary);
  letter-spacing: -0.5px;
}

.cart-icon-wrapper {
  position: relative;
  padding: 8px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--error);
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Product Listing Grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm);
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.product-image-container {
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  position: relative;
  background: #f0f0f0;
}

.product-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #E2E8F0;
  color: #94A3B8;
}

.product-info {
  padding: var(--space-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: var(--text-sm);
  font-weight: 500;
  margin: 0 0 var(--space-xs) 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-block {
  margin-top: auto;
}

.current-price {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-main);
}

.original-price {
  font-size: var(--text-xs);
  text-decoration: line-through;
  color: var(--text-muted);
  margin-left: var(--space-xs);
}

.discount-tag {
  font-size: 10px;
  color: var(--success);
  font-weight: 700;
  background: #ECFDF5;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: var(--space-xs);
}

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

.btn-primary {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

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

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-sm);
}

/* Product Detail Page */
.pdp-hero {
  background: white;
}

.pdp-image {
  width: 100%;
  height: 350px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  position: relative;
}

.pdp-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.pdp-content {
  padding: var(--space-md);
  background: white;
  margin-bottom: var(--space-sm);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  background: var(--success);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  gap: 2px;
}

.selection-group {
  margin-top: var(--space-md);
}

.selection-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.chip-container {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: var(--text-sm);
  background: white;
  cursor: pointer;
}

.chip.selected {
  border-color: var(--primary);
  background: #EFF6FF;
  color: var(--primary);
  font-weight: 600;
}

.chip.disabled {
  opacity: 0.5;
  background: #F3F4F6;
  text-decoration: line-through;
  pointer-events: none;
}

/* Sticky Bottom Bar */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: var(--space-md);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  display: flex;
  gap: var(--space-sm);
  z-index: 100;
  max-width: 480px; /* Match container */
  margin: 0 auto;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: var(--space-lg) var(--space-md);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Cart Specifics */
.cart-item {
  background: white;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

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

.cart-thumb {
  width: 80px;
  height: 80px;
  background: #f0f0f0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  font-weight: bold;
}

.price-summary {
  background: white;
  padding: var(--space-md);
  margin-top: var(--space-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
}

.summary-row.total {
  border-top: 1px dashed var(--border);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
  font-weight: 700;
  font-size: var(--text-lg);
}

/* Icons (Placeholders) */
.icon-box {
  width: 24px;
  height: 24px;
  display: block;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px; /* Match container */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  height: var(--bottom-nav-height);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 90;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  gap: 4px;
}

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

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  stroke: currentColor;
}
.nav-item.active .nav-icon {
  stroke: var(--primary);
  stroke-width: 2.5px;
}

/* Delivery Banner */
.delivery-banner {
  background: #EFF6FF;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary-dark);
  font-size: var(--text-xs);
  font-weight: 500;
}

.sale-banner {
  background: linear-gradient(90deg, #2563EB 0%, #1E40AF 100%);
  padding: 16px;
  color: white;
  margin-bottom: 8px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  padding: var(--space-lg);
  text-align: center;
}

.empty-img {
  width: 160px;
  height: 120px;
  background: #f0f0f0;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
}
