/* ═══════════════════════════════════════════
   DOPAMİN KARGO v3 — Premium Luxury Design
   Apple minimal + E-commerce Luxury palette
   Fonts: Bodoni Moda (headings) + Jost (body)
   ═══════════════════════════════════════════ */

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

:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --text: #0C0A09;
  --text-secondary: #78716C;
  --accent: #A16207;
  --accent-hover: #854D0E;
  --accent-light: #FEF3C7;
  --green: #059669;
  --green-light: #ECFDF5;
  --border: #D6D3D1;
  --border-light: #E7E5E4;
  --nav-bg: rgba(250,250,249,0.92);
  --font-heading: 'Bodoni Moda', 'Times New Roman', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 980px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.06);
  --shadow-elevated: 0 2px 8px rgba(0,0,0,0.06), 0 8px 40px rgba(0,0,0,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: -0.01em;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

/* ── Navigation (Apple glass) ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
}
.nav-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 1.5rem;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em;
  text-transform: uppercase; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Typography ── */
h1, h2, h3, .font-heading { font-family: var(--font-heading); }
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.02em;
}
.section-title {
  font-size: 1.5rem; font-weight: 600;
  line-height: 1.2; letter-spacing: -0.01em;
}
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.85rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.5rem; font-size: 0.9rem; font-weight: 500;
  border: none; border-radius: var(--radius-pill); cursor: pointer;
  transition: all 0.2s ease; text-decoration: none;
  font-family: var(--font-body); letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(161,98,7,0.3); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text); background: var(--surface); }
.btn-lg { padding: 0.9rem 2rem; font-size: 0.95rem; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Cart badge */
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 0.3rem; }
.cart-badge {
  display: none;
  align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent); color: #fff;
  border-radius: 9px; font-size: 0.65rem; font-weight: 600;
}

/* Added-to-cart button state */
.btn-added {
  background: var(--green-light); color: var(--green);
  border: 1.5px solid var(--green);
  cursor: default;
}

/* Remove from cart button */
.btn-remove {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-light); font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0;
}
.btn-remove:hover { background: #FEE2E2; color: #DC2626; border-color: #FECACA; }

/* Product card with add button */
.product-card .add-btn { flex-shrink: 0; }
.product-card .btn-added { flex-shrink: 0; }

/* ── Hero ── */
.hero {
  text-align: center; padding: 5rem 1rem 3rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-light) 0%, transparent 60%);
  opacity: 0.5; pointer-events: none;
}
.hero > * { position: relative; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 480px; margin: 1rem auto 2rem; }

/* ── Category Grid ── */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem; margin: 2rem 0;
}
.cat-card {
  padding: 1.75rem 1rem; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  text-align: center; cursor: pointer; transition: all 0.25s ease;
  user-select: none;
}
.cat-card:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.cat-card.selected { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(161,98,7,0.15); }
.cat-emoji { font-size: 2rem; display: block; margin-bottom: 0.6rem; }
.cat-name { font-weight: 500; font-size: 0.82rem; color: var(--text); }

/* ── Product Cards (Apple-style) ── */
.products { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0; }
.product-card {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}
.product-card:hover { box-shadow: var(--shadow-card); border-color: var(--border); }
.product-img {
  width: 80px; height: 80px; background: var(--bg);
  border-radius: var(--radius); display: flex;
  align-items: center; justify-content: center;
  font-size: 2.2rem; flex-shrink: 0;
}
.product-info { flex: 1; min-width: 0; }
.product-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.15rem; }
.product-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.product-price { text-align: right; flex-shrink: 0; }
.product-price .original { text-decoration: line-through; color: #C4B5A5; font-size: 0.8rem; font-weight: 400; }
.product-price .free { font-weight: 600; color: var(--green); font-size: 0.95rem; }

/* ── Order Summary ── */
.summary {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.summary-row {
  display: flex; justify-content: space-between;
  padding: 0.55rem 0; font-size: 0.88rem;
}
.summary-row.total {
  border-top: 1px solid var(--border-light); margin-top: 0.5rem;
  padding-top: 0.75rem; font-weight: 600; font-size: 1.05rem;
}
.free-label { color: var(--green); font-weight: 500; }

/* ── Inputs ── */
.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.85rem; }
.input-group input {
  width: 100%; padding: 0.8rem 1rem; font-size: 0.9rem;
  border: 1.5px solid var(--border-light); border-radius: var(--radius);
  transition: all 0.2s; background: var(--surface);
  font-family: var(--font-body);
}
.input-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(161,98,7,0.1); }
.input-group .hint { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.35rem; }

/* ── Tracking ── */
.track-header { text-align: center; padding: 2.5rem 0 1rem; }
.track-id {
  font-family: var(--font-heading); font-size: 1.6rem;
  font-weight: 600; letter-spacing: 0.05em;
}
.timeline { max-width: 460px; margin: 2rem auto; position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px;
  width: 1.5px; background: var(--border-light);
}
.timeline-item { position: relative; margin-bottom: 1.75rem; }
.timeline-dot {
  position: absolute; left: -2.5rem; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600; z-index: 1; transition: all 0.3s;
}
.timeline-item.done .timeline-dot { background: var(--text); border-color: var(--text); color: #fff; }
.timeline-item.current .timeline-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 5px rgba(161,98,7,0.12); }
.timeline-title { font-weight: 600; font-size: 0.9rem; }
.timeline-msg { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.1rem; }
.timeline-time { font-size: 0.72rem; color: #C4B5A5; margin-top: 0.1rem; }

/* ── Dopamine Bar ── */
.dopamine-card {
  max-width: 460px; margin: 1.5rem auto; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.dopamine-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.dopamine-header span { font-weight: 500; font-size: 0.85rem; color: var(--text-secondary); }
.dopamine-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 600; color: var(--accent); }
.dopamine-bar { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.dopamine-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── Confirmation ── */
.confirm { text-align: center; padding: 4rem 1rem; }
.confirm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--green-light); color: var(--green);
  font-size: 2rem; margin-bottom: 1.5rem;
}
.confirm h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 0.5rem; }
.confirm-id {
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600;
  letter-spacing: 0.04em; display: inline-block;
  padding: 0.5rem 1.5rem; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-pill);
  margin: 1rem 0;
}

/* ── Leaderboard ── */
.leaderboard { max-width: 460px; margin: 2rem auto; }
.lb-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border-light);
}
.lb-rank {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.8rem; flex-shrink: 0;
  background: var(--bg); color: var(--text-secondary);
}
.lb-rank.top { background: var(--accent); color: #fff; }
.lb-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.lb-score { font-weight: 600; font-size: 0.85rem; color: var(--accent); font-family: var(--font-heading); }

/* ── Confetti ── */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }
.confetti-piece {
  position: absolute;
  animation: confetti-fall 2.5s ease-out forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Spinner ── */
.spinner {
  width: 32px; height: 32px; border: 2.5px solid var(--border-light);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Race Bar ── */
.race-bar {
  max-width: 460px; margin: 1rem auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem; align-items: center;
}
.race-player {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 0.75rem; text-align: center;
}
.race-player .name { font-weight: 500; font-size: 0.85rem; }
.race-track { height: 4px; background: var(--border-light); border-radius: 2px; margin-top: 0.5rem; }
.race-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 1s ease; }
.race-vs { font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); }

/* ── Premium Teaser ── */
.teaser {
  max-width: 400px; margin: 2rem auto; text-align: center;
  padding: 1.5rem; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
}
.teaser h4 { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.teaser p { font-size: 0.82rem; color: var(--text-secondary); }
.badge {
  display: inline-block; padding: 0.25rem 0.85rem;
  background: var(--accent); color: #fff; border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; margin-top: 0.5rem;
}

/* ── Footer ── */
.footer {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-secondary); font-size: 0.78rem;
  border-top: 1px solid var(--border-light); margin-top: 3rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-card { flex-wrap: wrap; }
  .product-img { width: 56px; height: 56px; font-size: 1.5rem; }
  .product-price { width: 100%; text-align: left; margin-top: 0.5rem; display: flex; gap: 0.75rem; align-items: baseline; }
  .product-card .add-btn,
  .product-card .btn-added,
  .product-card .btn-remove { margin-left: auto; }
  .nav-links { gap: 1rem; }
}
