/* Root Variables and Theme */
:root {
  /* Brand Colors */
  --brand-primary: #2563EB;
  --brand-primary-foreground: #ffffff;
  --brand-secondary: #10B981;
  --brand-secondary-foreground: #ffffff;
  
  /* Base Colors */
  --background: #fafafb;
  --foreground: #111827;
  --card: #ffffff;
  --muted: #f3f4f6;
  --muted-foreground: #6b7280;
  --border: rgba(0, 0, 0, 0.08);
  
  /* Typography */
  --font-family-heading: 'Roboto Condensed', sans-serif;
  --font-family-body: 'Poppins', sans-serif;
  --font-size-base: 14px;
  
  /* Spacing */
  --container-padding: 1rem;
  --section-padding: 5rem 0;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-brand: 0 4px 20px rgb(37 99 235 / 0.15);
  --shadow-brand-lg: 0 10px 40px rgb(37 99 235 / 0.2);
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 25% 25%, rgb(37 99 235 / 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgb(16 185 129 / 0.1) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }

/* Brand Utilities */
.brand-gradient {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-pattern {
  background-image: radial-gradient(circle at 2px 2px, rgb(37 99 235 / 0.15) 1px, transparent 0);
  background-size: 20px 20px;
}

.glass-card {
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgb(255 255 255 / 0.2);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: var(--brand-primary-foreground);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover:not(:disabled) {
  background-color: #1d4ed8;
  box-shadow: var(--shadow-brand-lg);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--brand-secondary);
  color: var(--brand-secondary-foreground);
  box-shadow: 0 4px 20px rgb(16 185 129 / 0.15);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #059669;
  transform: translateY(-1px);
}

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

.btn-outline:hover:not(:disabled) {
  background-color: var(--brand-primary);
  color: var(--brand-primary-foreground);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-gradient:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: var(--shadow-brand-lg);
}

.btn-icon {
  padding: 0.75rem;
  min-width: auto;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Input Styles */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.enhanced-input {
  background: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgb(229 231 235);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1rem;
}

.enhanced-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2);
}

/* Card Styles */
.card {
  background-color: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
}

.enhanced-card {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.enhanced-card:hover {
  box-shadow: var(--shadow-brand);
  transform: translateY(-8px);
}

.card-content {
  padding: 1.5rem;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.badge-primary {
  background-color: var(--brand-primary);
  color: var(--brand-primary-foreground);
}

.badge-secondary {
  background-color: var(--brand-secondary);
  color: var(--brand-secondary-foreground);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid currentColor;
}

/* Header Styles */
.header-container {
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: white;
  text-align: center;
  padding: 0.75rem 1rem;
  position: relative;
  overflow: hidden;
}

.header-top::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgb(255 255 255 / 0.2) 1px, transparent 0);
  background-size: 20px 20px;
  opacity: 0.2;
}

.header-main {
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  position: relative;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 1rem;
  height: 1rem;
  background-color: var(--brand-secondary);
  border-radius: 50%;
  border: 2px solid white;
}

.logo-text h1 {
  font-size: 1.5rem;
  margin: 0;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo-text h1:hover {
  transform: scale(1.05);
}

.logo-tagline {
  font-size: 0.75rem;
  color: var(--brand-secondary);
  font-weight: 500;
  margin: 0;
}

.search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: rgb(249 250 251 / 0.8);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.search-input:focus {
  background: white;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border-radius: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-button {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 1.5rem;
  height: 1.5rem;
  background-color: var(--brand-secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}

.mobile-menu.active {
  display: block;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--foreground);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: rgb(37 99 235 / 0.1);
  color: var(--brand-primary);
}

/* Hero Section */
.hero-section {
  padding: 4rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(59 130 246 / 0.05) 0%, rgb(16 185 129 / 0.05) 100%);
  z-index: -1;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  space-y: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(10px);
  color: var(--brand-secondary);
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgb(37 99 235 / 0.2);
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.3s ease;
}

.hero-badge:hover {
  transform: scale(1.05);
}

.hero-title {
  font-size: 4rem;
  line-height: 1.1;
  margin: 0;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 3s infinite;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.hero-stat:hover .hero-stat-number {
  transform: scale(1.1);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-brand-lg);
  transition: transform 0.5s ease;
}

.hero-image:hover img {
  transform: scale(1.05);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.product-card:hover {
  box-shadow: var(--shadow-brand);
  transform: translateY(-8px);
}

.product-image-container {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, rgb(249 250 251) 0%, rgb(243 244 246) 100%);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image {
  transform: scale(1.1);
}

.product-badges {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  gap: 0.5rem;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.product-action-btn {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-xl);
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.product-action-btn:hover {
  background: white;
  transform: scale(1.1);
}

.product-info {
  padding: 1.5rem;
}

.product-brand {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: rgb(37 99 235 / 0.05);
  border: 1px solid rgb(37 99 235 / 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.3s ease;
}

.product-name:hover {
  color: var(--brand-primary);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rating-stars {
  display: flex;
  gap: 0.125rem;
}

.rating-star {
  width: 1rem;
  height: 1rem;
  color: rgb(209 213 219);
}

.rating-star.filled {
  color: rgb(245 158 11);
  fill: currentColor;
}

.rating-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.price-current {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-original {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: line-through;
  background: rgb(229 231 235);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.price-savings {
  font-size: 0.75rem;
  color: rgb(22 163 74);
  font-weight: 600;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.cart-overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  cursor: pointer;
}

.cart-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-sidebar:not(.hidden) .cart-content {
  transform: translateX(0);
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--muted-foreground);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.cart-item-image {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
}

.cart-item-price {
  color: var(--brand-primary);
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: var(--muted);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.cart-total {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  text-align: center;
}

.cart-checkout-btn {
  width: 100%;
}

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgb(255 255 255 / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid var(--muted);
  border-top: 4px solid var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left-color: var(--brand-secondary);
}

.toast.error {
  border-left-color: #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .search-container {
    display: none;
  }
  
  .header-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .header-actions {
    gap: 0.5rem;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .cart-content {
    max-width: 100%;
  }
}