/* ============================================================
   public/css/style.css
   PasarKu — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Syne:wght@700;800&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #0c0c0e;
  --surface:     #16161a;
  --surface2:    #1e1e24;
  --surface3:    #26262e;
  --border:      #2c2c36;
  --border2:     #38383f;

  --accent:      #f97316;
  --accent-h:    #fb923c;
  --accent-dim:  rgba(249,115,22,0.12);
  --accent-ring: rgba(249,115,22,0.35);

  --green:       #22c55e;
  --red:         #ef4444;
  --blue:        #3b82f6;
  --yellow:      #eab308;

  --text:        #f0f0f2;
  --text2:       #9898a8;
  --text3:       #52525e;

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  --shadow:    0 2px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 6px 40px rgba(0,0,0,0.55);

  --font-body:    'Plus Jakarta Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Pages (SPA routing) ────────────────────────────────── */
.page { display: none; min-height: 100vh; animation: fadeIn .2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,12,14,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}
.navbar-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.navbar-logo span { color: var(--text); }

.navbar-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.navbar-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 9px 16px 9px 42px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.navbar-search input::placeholder { color: var(--text3); }
.navbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.navbar-search .icon {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}

.navbar-spacer { flex: 1; }
.navbar-actions { display: flex; gap: 8px; align-items: center; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  border-radius: var(--r-sm); transition: all .18s; white-space: nowrap;
  padding: 9px 18px; font-size: 13px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ghost     { background: none; color: var(--text2); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface2); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-success   { background: var(--green); color: #fff; }
.btn-outline   { background: none; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 26px; font-size: 15px; }
.btn-xl  { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.form-group   { margin-bottom: 16px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label   { display: block; font-size: 11.5px; font-weight: 700; color: var(--text2);
                text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 14px; color: var(--text);
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-select  { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 88px; }
.form-hint    { font-size: 11px; color: var(--text3); margin-top: 5px; }
.form-error   { font-size: 12px; color: var(--red); margin-top: 5px; display: none; }
.form-error.show { display: block; }

/* ══════════════════════════════════════════════════════════
   CARDS / SURFACES
══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title  { font-weight: 700; font-size: 15px; }
.card-body   { padding: 20px; }

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 30px; font-size: 11.5px; font-weight: 600;
}
.badge-success { background: rgba(34,197,94,.14);  color: var(--green); }
.badge-warning { background: rgba(234,179,8,.14);   color: var(--yellow); }
.badge-danger  { background: rgba(239,68,68,.14);   color: var(--red); }
.badge-info    { background: rgba(59,130,246,.14);  color: var(--blue); }
.badge-default { background: var(--surface2); color: var(--text2); }
.badge-accent  { background: var(--accent-dim); color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface2); }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 32px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); animation: modalSlide .25s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-lg  { max-width: 600px; }
.modal-xl  { max-width: 860px; }
@keyframes modalSlide {
  from { opacity:0; transform: translateY(20px) scale(.97); }
  to   { opacity:1; transform: none; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title  { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.modal-close  {
  width: 32px; height: 32px; border: none; background: var(--surface2);
  color: var(--text2); border-radius: 50%; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-tabs {
  display: flex; gap: 4px; background: var(--surface2);
  border-radius: 10px; padding: 4px; margin-bottom: 24px;
}
.modal-tab {
  flex: 1; padding: 8px; border: none; background: none; color: var(--text2);
  border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .2s;
}
.modal-tab.active { background: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════════════ */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 18px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
  max-width: 320px; font-size: 13px; font-weight: 500;
}
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
@keyframes toastIn { from { opacity:0; transform: translateX(24px); } }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text3); }
.empty-state .es-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   PRODUCT CARD
══════════════════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  cursor: pointer; transition: all .22s;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(249,115,22,.12);
}
.product-thumb {
  width: 100%; aspect-ratio: 1;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; position: relative; overflow: hidden;
}
.product-thumb .bg-emoji {
  position: absolute; font-size: 90px; opacity: .07; transform: rotate(-15deg);
}
.product-thumb .main-emoji { position: relative; z-index: 1; }
.product-body   { padding: 13px; }
.product-store  { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.product-name   { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.product-foot   { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-price  { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--accent); }
.product-meta   { font-size: 11px; color: var(--text3); margin-top: 2px; }
.product-meta span { color: var(--yellow); }
.product-add-btn {
  width: 30px; height: 30px; background: var(--accent); border: none; color: #fff;
  border-radius: var(--r-sm); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.product-add-btn:hover { background: var(--accent-h); transform: scale(1.1); }

/* ══════════════════════════════════════════════════════════
   HERO / HOME
══════════════════════════════════════════════════════════ */
.hero {
  padding: 72px 24px 56px; text-align: center;
  max-width: 860px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border: 1px solid var(--accent-ring);
  color: var(--accent); padding: 5px 16px; border-radius: 30px;
  font-size: 12px; font-weight: 600; margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(36px, 6vw, 68px);
  font-weight: 800; letter-spacing: -2px; line-height: 1.08; margin-bottom: 18px;
}
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text2); font-size: 17px; max-width: 520px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 48px; justify-content: center;
  margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--border);
}
.hero-stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--accent); }
.hero-stat-lbl { font-size: 12px; color: var(--text3); margin-top: 2px; }

.section { padding: 40px 24px; max-width: 1240px; margin: 0 auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; }

.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 14px; text-align: center; cursor: pointer; transition: all .2s;
}
.cat-card:hover, .cat-card.active {
  border-color: var(--accent); background: var(--surface2); transform: translateY(-2px);
}
.cat-card .icon { font-size: 26px; margin-bottom: 7px; }
.cat-card .name { font-size: 12px; font-weight: 600; color: var(--text2); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD SELLER
══════════════════════════════════════════════════════════ */
.dash-layout {
  display: grid; grid-template-columns: 226px 1fr;
  min-height: calc(100vh - 62px);
}
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 14px; position: sticky; top: 62px;
  height: calc(100vh - 62px); overflow-y: auto;
}
.sidebar-store {
  background: var(--surface2); border-radius: var(--r-md);
  padding: 16px; text-align: center; margin-bottom: 22px;
}
.sidebar-logo {
  width: 50px; height: 50px; border-radius: 50%; background: var(--accent);
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 9px;
}
.sidebar-name   { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.sidebar-status { font-size: 11px; color: var(--green); }
.sidebar-divider { height: 1px; background: var(--border); margin: 10px 0; }
.sidebar-menu    { list-style: none; }
.sidebar-menu li { margin-bottom: 2px; }
.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .18s;
}
.sidebar-item:hover  { background: var(--surface2); color: var(--text); }
.sidebar-item.active { background: var(--accent-dim); color: var(--accent); }
.sidebar-item .icon  { font-size: 16px; }

.dash-main    { padding: 28px; }
.dash-section { display: none; }
.dash-section.active { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; }
.stat-icon  { font-size: 26px; margin-bottom: 10px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.stat-sub   { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════
   CART
══════════════════════════════════════════════════════════ */
.cart-layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 24px; max-width: 1100px; margin: 0 auto; padding: 32px 24px;
}
.cart-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px; margin-bottom: 12px;
}
.cart-img {
  width: 72px; height: 72px; background: var(--surface2);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 32px; flex-shrink: 0;
}
.cart-info   { flex: 1; }
.cart-name   { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.cart-store  { font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.cart-price  { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--accent); }
.qty-ctrl    { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; color: var(--text); font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-num { font-weight: 700; min-width: 26px; text-align: center; }

.cart-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 24px;
  position: sticky; top: 80px; height: fit-content;
}
.summary-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 11px; font-size: 13px; color: var(--text2); }
.summary-row.total {
  border-top: 1px solid var(--border); padding-top: 13px;
  margin-top: 4px; font-weight: 700; color: var(--text); font-size: 15px;
}
.summary-row.total span:last-child { color: var(--accent); font-family: var(--font-display); font-size: 18px; }

/* ══════════════════════════════════════════════════════════
   REGISTER STORE STEPS
══════════════════════════════════════════════════════════ */
.steps-bar    { display: flex; gap: 6px; margin-bottom: 32px; }
.step         { flex: 1; text-align: center; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  color: var(--text3); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px; transition: all .3s;
}
.step-dot.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-dot.done   { background: var(--green);  border-color: var(--green);  color: #fff; }
.step-lbl  { font-size: 11px; color: var(--text3); }
.step-line { flex: 1; height: 2px; background: var(--border); margin-top: 15px; }
.step-pane { display: none; }
.step-pane.active { display: block; }

/* ══════════════════════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════════════════════ */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .cart-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 14px; }
  .navbar-search { display: none; }
  .hero { padding: 48px 16px 36px; }
  .hero h1 { letter-spacing: -1px; }
  .hero-stats { gap: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 24px; }
  .dash-main { padding: 20px 16px; }
}
