/* ═══════════════════════════════════════════════════════════
   DeskCandy Design System
   ═══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --candy-pink: #FF6B9D;
  --candy-peach: #FFA07A;
  --candy-yellow: #FFD93D;
  --candy-mint: #6BCB77;
  --candy-lilac: #C084FC;
  --dark: #1a1a2e;
  --cream: #FFF8F0;
  --text: #2D2D3F;
  --text-light: #6B6B80;
  --white: #ffffff;
  --border: rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-full: 50px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

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

/* ─── Candy Background ──────────────────────────────────── */

.candy-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.candy-bg .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.candy-bg .shape:nth-child(1) { width: 300px; height: 300px; background: var(--candy-pink); top: -50px; right: -80px; }
.candy-bg .shape:nth-child(2) { width: 200px; height: 200px; background: var(--candy-yellow); top: 30%; left: -60px; }
.candy-bg .shape:nth-child(3) { width: 250px; height: 250px; background: var(--candy-mint); bottom: 20%; right: -40px; }
.candy-bg .shape:nth-child(4) { width: 180px; height: 180px; background: var(--candy-lilac); bottom: -40px; left: 20%; }
.candy-bg .shape:nth-child(5) { width: 150px; height: 150px; background: var(--candy-peach); top: 55%; left: 50%; }

/* ─── Layout ────────────────────────────────────────────── */

.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 900px;
}

/* ─── Navigation ────────────────────────────────────────── */

.nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.logo span {
  background: linear-gradient(135deg, var(--candy-pink), var(--candy-lilac));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.cart-btn:hover {
  border-color: var(--candy-pink);
  box-shadow: var(--shadow-sm);
}

.cart-btn .cart-icon {
  font-size: 1.1rem;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--candy-pink);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
}

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

/* ─── Page Header ───────────────────────────────────────── */

.page-header {
  padding: 48px 0 32px;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -1px;
  line-height: 1.1;
}

.page-header h1 .highlight {
  background: linear-gradient(135deg, var(--candy-pink), var(--candy-lilac));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 12px;
  max-width: 500px;
}

/* ─── Category Filter ───────────────────────────────────── */

.category-filters {
  display: flex;
  gap: 8px;
  padding: 0 0 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.filter-btn:hover {
  border-color: var(--candy-pink);
  color: var(--text);
}

.filter-btn.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* ─── Product Grid ──────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

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

.product-card-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-card-image .product-emoji {
  font-size: 4rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.3s;
}

.product-card:hover .product-emoji {
  transform: scale(1.1) rotate(-3deg);
}

.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--dark);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: 'Space Grotesk', sans-serif;
}

.product-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.product-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-card-tagline {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  flex: 1;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.product-card-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

.btn-add-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--candy-pink);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-add-cart:hover {
  background: #e55a87;
  transform: scale(1.02);
}

.btn-add-cart.added {
  background: var(--candy-mint);
}

/* ─── Product Detail ────────────────────────────────────── */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 32px 0 64px;
  align-items: start;
}

.product-image-large {
  border-radius: var(--radius-lg);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image-large .product-emoji-lg {
  font-size: 8rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}

.product-image-large .product-badge-lg {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--dark);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: 'Space Grotesk', sans-serif;
}

.product-info h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.product-info .product-category-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--candy-pink);
  font-weight: 600;
  margin-bottom: 16px;
}

.product-price-lg {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}

.product-description {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 28px;
}

.product-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--white);
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

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

.qty-display {
  width: 40px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.btn-primary {
  flex: 1;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--candy-pink);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-primary:hover {
  background: #e55a87;
  transform: scale(1.01);
}

.btn-secondary {
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-secondary:hover {
  border-color: var(--candy-pink);
  color: var(--candy-pink);
}

.product-perks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-light);
}

.perk-icon {
  font-size: 1rem;
}

/* ─── Cart Page ─────────────────────────────────────────── */

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  padding-bottom: 64px;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  text-align: center;
  padding: 80px 20px;
}

.cart-empty .empty-emoji {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
}

.cart-empty h2 {
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.cart-empty p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.cart-item {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
}

.cart-item-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-image .item-emoji {
  font-size: 2rem;
}

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

.cart-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--text-light);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
}

.cart-item-qty button:hover {
  background: var(--cream);
}

.cart-item-qty .qty-val {
  width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: var(--candy-pink);
}

.cart-summary {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 24px;
}

.cart-summary h3 {
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 8px 0;
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 16px;
  font-family: 'Space Grotesk', sans-serif;
}

.btn-checkout {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--dark);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
  font-family: 'DM Sans', sans-serif;
}

.btn-checkout:hover {
  background: #2a2a4e;
  transform: scale(1.01);
}

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

.cart-note {
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 14px;
  line-height: 1.4;
}

/* ─── Success Page ──────────────────────────────────────── */

.success-container {
  text-align: center;
  padding: 100px 20px 60px;
}

.success-emoji {
  font-size: 5rem;
  margin-bottom: 24px;
  display: block;
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-container h1 {
  font-size: 2.4rem;
  color: var(--dark);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.success-container p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ─── Footer ────────────────────────────────────────────── */

.site-footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer .footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ─── Loading State ─────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--candy-pink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Toast Notification ────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ─── Breadcrumb ────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 20px 0 0;
}

.breadcrumb a {
  color: var(--text-light);
  transition: color 0.2s;
}

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

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

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px 0 48px;
  }

  .product-image-large {
    height: 280px;
  }

  .product-image-large .product-emoji-lg {
    font-size: 5rem;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }

  .nav-links {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .product-card-image {
    height: 150px;
  }

  .product-card-image .product-emoji {
    font-size: 3rem;
  }

  .product-card-body {
    padding: 14px;
  }

  .product-card-name {
    font-size: 0.92rem;
  }

  .product-card-tagline {
    font-size: 0.78rem;
  }

  .product-card-footer {
    padding: 12px 14px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .btn-add-cart {
    width: 100%;
    justify-content: center;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .product-actions {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }
}
