/* ═══════════════════════════════════════════════════════
   KiN Snacks — Shared Design System (Mobile-First)
   Brand: Forest Green + Warm Cream
   ═══════════════════════════════════════════════════════ */

/* ─── TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand colors — extracted from KiN logo */
  --primary:      #4A6F38;  /* KiN forest green */
  --primary-dark: #354F28;  /* darker forest green */
  --primary-xdark:#263A1C;  /* deepest green (navbar bg etc) */
  --accent:       #D4A843;  /* warm peanut gold */
  --accent-dark:  #B08928;  /* deeper gold */
  --accent-light: #F0CC6A;  /* light gold */
  --surface:      #FAFDF7;  /* near-white with a hint of green */
  --surface-alt:  #EDF3E8;  /* soft sage mist */
  --text-main:    #1C2B14;  /* very dark green (replaces near-black) */
  --text-muted:   #5A7048;  /* muted forest text */
  --border:       #CDDBC4;  /* green-tinted border */
  --success:      #2D7A4F;
  --error:        #C0392B;
  --shadow-sm:    0 1px 4px rgba(74,111,56,0.10);
  --shadow-md:    0 4px 20px rgba(74,111,56,0.14);
  --shadow-lg:    0 12px 48px rgba(74,111,56,0.18);
  --radius:       14px;
  --radius-sm:    8px;
  --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
  --nav-h:        64px;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: 'DM Sans', sans-serif; }
input, select, textarea { font-family: 'DM Sans', sans-serif; }

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
.serif { font-family: 'DM Sans', sans-serif; }
.mono  { font-family: 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }

/* ─── LAYOUT ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 16px; /* Mobile Default */
}
.container-sm {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 16px; /* Mobile Default */
}
.page-body {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  
  /* Mobile Default */
  font-size: 15px;
  min-height: 52px; 
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,168,67,0.40); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,111,56,0.35); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--surface-alt); color: var(--primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 40px; } /* Mobile Default */
.btn-lg { padding: 16px 28px; font-size: 16px; } /* Mobile Default */
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── FORM ELEMENTS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-label .req { color: var(--error); margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  appearance: none;
  
  /* Mobile Default */
  padding: 13px 14px; 
  font-size: 16px; 
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,111,56,0.15);
  background: #fff;
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; } /* Mobile Default */

/* ─── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; /* Mobile Default */
}
.card-sm { padding: 16px; }
.card-lg { padding: 20px; } /* Mobile Default */

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.3px;
}
.badge-accent  { background: rgba(212,168,67,0.14); color: var(--accent-dark); border: 1px solid rgba(212,168,67,0.3); }
.badge-success { background: rgba(74,111,56,0.12);  color: var(--primary); border: 1px solid rgba(74,111,56,0.25); }
.badge-error   { background: rgba(192,57,43,0.10);  color: var(--error); border: 1px solid rgba(192,57,43,0.2); }
.badge-muted   { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-dark    { background: var(--primary); color: #fff; }

/* ─── DIVIDER ────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── SECTION TAG ────────────────────────────────────── */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(74,111,56,0.10);
  border: 1px solid rgba(74,111,56,0.22);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

/* ─── PROGRESS BAR ───────────────────────────────────── */
.progress-bar-wrap {
  background: var(--surface-alt);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6B9A52);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* ─── TOAST ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  
  /* Mobile Default */
  bottom: 72px;
  left: 16px;
  right: 16px;
  transform: none;
  width: auto;
  max-width: 100%;
}
.toast {
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease both;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
  
  /* Mobile Default */
  font-size: 13px; 
  padding: 12px 16px; 
  border-radius: 12px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }
.toast.accent  { background: var(--accent); color: #fff; }
.toast.out     { animation: toastOut 0.3s ease both; }
@keyframes toastIn  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0); }   to { opacity:0; transform:translateY(-10px); } }

/* ─── NAVBAR ─────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 999;
  background: rgba(38,58,28,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.topnav-logo {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  
  /* Mobile Default */
  font-size: 16px;
}
.topnav-logo .logo-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.topnav-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.topnav-back:hover { border-color: var(--accent); color: var(--accent); }
.topnav-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex: 1;
}
.topnav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topnav-cart-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  transition: var(--transition);
}
.topnav-cart-btn:hover { border-color: var(--accent); background: rgba(212,168,67,0.18); }
.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: 'DM Sans', sans-serif; font-variant-numeric: tabular-nums;
}

/* ─── STEP INDICATOR ─────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  padding: 4px 0;
}
.step-indicator::-webkit-scrollbar { display: none; }
.step-ind-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.step-ind-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: var(--transition);
  
  /* Mobile Default */
  width: 24px; height: 24px; font-size: 11px;
}
.step-ind-circle.done   { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-ind-circle.active { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.step-ind-label { font-weight: 500; color: var(--text-muted); font-size: 11px; } /* Mobile Default */
.step-ind-label.active { color: var(--primary); font-weight: 600; }
.step-ind-line {
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
  
  /* Mobile Default */
  width: 24px; 
}
.step-ind-line.done { background: var(--success); }

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-family: 'DM Sans', sans-serif; font-size: 22px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; max-width: 320px; margin-inline: auto; }

/* ─── SKELETON ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, #ece8e0 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── ANIMATIONS ─────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* ─── RESPONSIVE HELPERS (MOBILE-FIRST) ──────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
  .hide-desktop { display: none !important; }
  
  /* Container Desktop */
  .container, .container-sm { padding-inline: 20px; }
  
  /* Buttons Desktop */
  .btn { min-height: 48px; font-size: 14px; }
  .btn-sm { min-height: 36px; padding: 8px 16px; font-size: 13px; }
  .btn-lg { padding: 16px 36px; font-size: 16px; }
  
  /* Form Desktop */
  .form-input, .form-select, .form-textarea { padding: 11px 14px; font-size: 14px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  
  /* Card Desktop */
  .card { padding: 24px; }
  .card-lg { padding: 32px; }
  
  /* Step Indicator Desktop */
  .step-ind-circle { width: 28px; height: 28px; font-size: 12px; }
  .step-ind-label { font-size: 12px; }
  .step-ind-line { width: 40px; }
  
  /* Toast Desktop */
  #toast-container {
    bottom: 80px; left: 50%; right: auto; 
    transform: translateX(-50%); width: max-content;
  }
  .toast { font-size: 14px; padding: 12px 20px; }
  
  /* Topnav Desktop */
  .topnav-logo { font-size: 18px; }
}
