/* Jupiter Garden - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
  /* Light mode (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b7280;
  --accent: #84cc16;
  --accent-hover: #65a30d;
  --accent-glow: rgba(132, 204, 22, 0.3);
  --accent-glow-strong: rgba(132, 204, 22, 0.5);
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);

  /* Fonts */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;

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

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

/* Dark mode */
[data-theme="dark"] {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f26;
  --bg-tertiary: #242b33;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #242b33;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-md);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.nav {
  display: none;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.nav a {
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav a:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: background-color var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--text-primary);
}

/* Cart Button */
.cart-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: background-color var(--transition-fast);
}

.cart-btn:hover {
  background: var(--bg-tertiary);
}

.cart-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  fill: none;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}

/* Hero Section */
.hero {
  padding: var(--space-3xl) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero h1 {
  margin-bottom: var(--space-lg);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px var(--accent-glow-strong);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

/* Section */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--text-muted);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Product Card */
.product-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-lg);
}

.product-card-image {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

.product-card-content {
  padding: var(--space-md);
}

.product-card-vendor {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.product-card-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.product-card-stock {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.product-card-stock.out-of-stock {
  color: #ef4444;
}

/* Pill Buttons (Product Attributes) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all var(--transition-fast);
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.1);
}

.pill-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Vendor Grid */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .vendor-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .vendor-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vendor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.vendor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.vendor-card-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin-bottom: var(--space-md);
}

.vendor-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vendor-card-name {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Footer */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h4 {
  font-family: var(--font-display);
  margin-bottom: var(--space-md);
}

.footer-section p,
.footer-section a {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.footer-section a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Cart Sidebar */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  z-index: 200;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: -4px 0 24px var(--shadow-lg);
  transform: translateX(100%);
  z-index: 201;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  transform: translateX(0);
}

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

.cart-header h3 {
  margin: 0;
}

.cart-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}

.cart-close:hover {
  background: var(--bg-tertiary);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.cart-item-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.cart-item-price {
  color: var(--accent);
  font-weight: 600;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.qty-btn:hover {
  background: var(--border);
}

.cart-item-remove {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-sm);
}

.cart-item-remove:hover {
  color: #ef4444;
}

.cart-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.cart-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: 1.125rem;
}

.cart-subtotal-value {
  font-weight: 700;
  color: var(--accent);
}

.cart-shipping-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

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

/* Product Page */
.product-page {
  padding: var(--space-xl) 0 var(--space-3xl);
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .product-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.product-gallery {
  position: relative;
}

.product-main-image {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
}

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

.product-info h1 {
  margin-bottom: var(--space-sm);
}

.product-vendor {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.product-vendor a {
  color: var(--accent);
}

.product-vendor a:hover {
  text-decoration: underline;
}

.product-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

.product-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.product-attributes {
  margin-bottom: var(--space-xl);
}

.product-attributes h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.product-stock {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-weight: 500;
}

.stock-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.stock-indicator.in-stock {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.stock-indicator.low-stock {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.stock-indicator.out-of-stock {
  background: #ef4444;
}

.product-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}

.quantity-selector button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.quantity-selector button:hover {
  background: var(--border);
}

.quantity-selector input {
  width: 50px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.add-to-cart-btn {
  flex: 1;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-separator {
  color: var(--border);
}

/* Checkout Page */
.checkout-page {
  padding: var(--space-2xl) 0;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .checkout-layout {
    grid-template-columns: 1fr 400px;
  }
}

.checkout-form {
  background: var(--bg-secondary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
}

.checkout-section {
  margin-bottom: var(--space-xl);
}

.checkout-section:last-child {
  margin-bottom: 0;
}

.checkout-section h3 {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

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

.form-group input,
.form-group select {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Shipping Options */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.shipping-vendor {
  background: var(--bg-primary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.shipping-vendor h4 {
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.shipping-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.shipping-option:last-child {
  margin-bottom: 0;
}

.shipping-option:hover,
.shipping-option.selected {
  border-color: var(--accent);
}

.shipping-option.selected {
  background: rgba(132, 204, 22, 0.1);
}

.shipping-option input {
  display: none;
}

.shipping-option-name {
  font-weight: 500;
}

.shipping-option-price {
  color: var(--accent);
  font-weight: 600;
}

/* Payment Methods */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.payment-method:hover {
  border-color: var(--text-muted);
}

.payment-method.selected {
  border-color: var(--accent);
  background: rgba(132, 204, 22, 0.1);
}

.payment-method input {
  display: none;
}

.payment-method-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-sm);
}

.payment-method-name {
  font-weight: 600;
  text-align: center;
}

/* Order Summary */
.order-summary {
  background: var(--bg-secondary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  position: sticky;
  top: calc(72px + var(--space-lg));
}

.order-summary h3 {
  margin-bottom: var(--space-lg);
}

.order-items {
  margin-bottom: var(--space-lg);
}

.order-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

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

.order-item-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-details {
  flex: 1;
}

.order-item-name {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.order-item-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.order-item-price {
  font-weight: 600;
}

.order-totals {
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.order-total-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.order-total-row.total .value {
  color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.5s ease forwards;
}

/* Print Styles */
@media print {
  .header,
  .cart-btn,
  .theme-toggle,
  .cart-sidebar,
  .cart-overlay,
  .footer {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
