/* ============================================================
   BAZARIO design system
   Primary #1557D6 · Accent #FF7A00 · Surface #F5F7FA
   ============================================================ */
:root {
  --primary: #1557d6;
  --primary-dark: #1145ab;
  --primary-50: #eef4ff;
  --accent: #ff7a00;
  --accent-50: #fff4e8;
  --ink: #222222;
  --muted: #6b7280;
  --surface: #f5f7fa;
  --line: #e8ecf2;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.14);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  overscroll-behavior-y: none;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd6e0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Splash ---------------- */
.bz-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #1557d6 0%, #1145ab 55%, #0d3585 100%);
  transition: opacity .5s ease, visibility .5s ease;
}
.bz-splash.hide { opacity: 0; visibility: hidden; }
.bz-splash-inner { text-align: center; animation: bz-pop .7s cubic-bezier(.2,.9,.3,1.3); }
.bz-logo-mark {
  width: 96px; height: 96px; margin: 0 auto 20px;
  border-radius: 28px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff; backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.bz-logo-text { font-size: 40px; font-weight: 800; letter-spacing: 4px; color: #fff; }
.bz-logo-tag { color: rgba(255,255,255,.85); margin-top: 6px; font-size: 15px; letter-spacing: .5px; }
.bz-splash-bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); margin: 28px auto 0; overflow: hidden; }
.bz-splash-bar span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 4px; animation: bz-load 1.3s ease-in-out infinite; }
@keyframes bz-load { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes bz-pop { from { opacity: 0; transform: scale(.86) translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- Layout ---------------- */
.bz-main { max-width: 1200px; margin: 0 auto; padding: 12px 14px calc(84px + var(--safe-b)); }
@media (min-width: 1024px) { .bz-main { padding-bottom: 40px; } }

.bz-header { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--line); }
.bz-header-inner { max-width: 1200px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 12px; }

.bz-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b));
  display: flex;
}
@media (min-width: 1024px) { .bz-tabbar { display: none; } }
.bz-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; font-size: 10.5px; font-weight: 600; color: #8a94a6;
  border-radius: 12px; transition: .18s; position: relative;
}
.bz-tab i { font-size: 19px; }
.bz-tab.active { color: var(--primary); background: var(--primary-50); }
.bz-tab .bz-badge {
  position: absolute; top: 2px; right: 50%; transform: translateX(16px);
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* desktop top nav */
.bz-desktop-nav { display: none; }
@media (min-width: 1024px) {
  .bz-desktop-nav { display: flex; gap: 4px; }
  .bz-desktop-nav a {
    padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #4b5563;
  }
  .bz-desktop-nav a:hover { background: var(--surface); }
  .bz-desktop-nav a.active { background: var(--primary-50); color: var(--primary); }
}

/* ---------------- Components ---------------- */
.bz-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.bz-card-flat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }

.bz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-weight: 700; font-size: 14px; padding: 12px 18px;
  transition: .18s; border: 1px solid transparent; cursor: pointer; line-height: 1;
}
.bz-btn:active { transform: scale(.975); }
.bz-btn:disabled { opacity: .55; cursor: not-allowed; }
.bz-btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(21,87,214,.28); }
.bz-btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.bz-btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(255,122,0,.28); }
.bz-btn-accent:hover:not(:disabled) { background: #e56d00; }
.bz-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.bz-btn-ghost:hover:not(:disabled) { background: var(--surface); }
.bz-btn-soft { background: var(--primary-50); color: var(--primary); }
.bz-btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.bz-btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }
.bz-btn-block { width: 100%; }

.bz-input, .bz-select, .bz-textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; background: #fff; transition: .18s; font-family: inherit;
}
.bz-input:focus, .bz-select:focus, .bz-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,87,214,.12);
}
.bz-label { display: block; font-size: 12.5px; font-weight: 700; color: #4b5563; margin-bottom: 6px; }

.bz-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #fff;
  border: 1px solid var(--line); color: #4b5563; white-space: nowrap; transition: .15s; cursor: pointer;
}
.bz-chip:hover { border-color: #c9d3e2; }
.bz-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.bz-badge-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.bz-st-pending { background: #fff7ed; color: #c2410c; }
.bz-st-confirmed { background: #eff6ff; color: #1d4ed8; }
.bz-st-processing { background: #f0f9ff; color: #0369a1; }
.bz-st-packed { background: #f5f3ff; color: #6d28d9; }
.bz-st-shipped { background: #eef2ff; color: #4338ca; }
.bz-st-delivered, .bz-st-paid, .bz-st-approved, .bz-st-active { background: #f0fdf4; color: #15803d; }
.bz-st-cancelled, .bz-st-rejected, .bz-st-failed, .bz-st-suspended, .bz-st-blocked { background: #fef2f2; color: #b91c1c; }
.bz-st-out_for_delivery, .bz-st-ready_for_pickup { background: #ecfeff; color: #0e7490; }
.bz-st-refunded, .bz-st-returned, .bz-st-returned_ { background: #fdf4ff; color: #a21caf; }

/* product grid */
.bz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .bz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1024px) { .bz-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.bz-prod { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: .2s; position: relative; display: flex; flex-direction: column; }
.bz-prod:hover { box-shadow: var(--shadow-pop); transform: translateY(-3px); border-color: #dbe3ef; }
.bz-prod-img { position: relative; aspect-ratio: 1/1; background: var(--surface); overflow: hidden; }
.bz-prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.bz-prod:hover .bz-prod-img img { transform: scale(1.06); }
.bz-prod-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.bz-prod-name { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.bz-prod-price { font-size: 15.5px; font-weight: 800; color: var(--primary); }
.bz-prod-old { font-size: 11.5px; color: #9aa3b2; text-decoration: line-through; }
.bz-disc { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(255,122,0,.4); }
.bz-wish { position: absolute; top: 7px; right: 7px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.94); display: flex; align-items: center; justify-content: center; color: #94a3b8; box-shadow: 0 2px 8px rgba(0,0,0,.1); transition: .18s; }
.bz-wish:hover { color: var(--danger); }
.bz-wish.on { color: var(--danger); }
.bz-add-btn { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 11px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(21,87,214,.35); transition: .18s; }
.bz-add-btn:hover { background: var(--primary-dark); }

/* banner carousel */
.bz-carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.bz-carousel::-webkit-scrollbar { display: none; }
.bz-slide { flex: 0 0 86%; scroll-snap-align: center; border-radius: var(--radius-lg); overflow: hidden; position: relative; min-height: 152px; background: var(--primary); }
@media (min-width: 768px) { .bz-slide { flex: 0 0 46%; min-height: 210px; } }
@media (min-width: 1200px) { .bz-slide { flex: 0 0 32%; } }
.bz-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bz-slide-ov { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,40,95,.92) 0%, rgba(13,40,95,.55) 55%, rgba(13,40,95,.1) 100%); }
.bz-slide-txt { position: relative; padding: 20px; color: #fff; max-width: 78%; }
.bz-slide-txt h3 { font-size: 19px; font-weight: 800; line-height: 1.25; }
.bz-slide-txt p { font-size: 12.5px; opacity: .92; margin-top: 5px; }

.bz-hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.bz-hscroll::-webkit-scrollbar { display: none; }

.bz-cat-pill { flex: 0 0 auto; width: 82px; text-align: center; }
.bz-cat-pill .ic { width: 62px; height: 62px; margin: 0 auto 7px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; box-shadow: var(--shadow); }
.bz-cat-pill span { font-size: 11px; font-weight: 600; line-height: 1.25; display: block; color: #4b5563; }

.bz-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.bz-sec-head h2 { font-size: 17px; font-weight: 800; }
.bz-sec-head a { font-size: 12.5px; font-weight: 700; color: var(--primary); }

.bz-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: #b45309; }
.bz-rating i { font-size: 10.5px; color: #f59e0b; }

/* toast */
.bz-toast-root { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(92vw, 420px); }
.bz-toast { background: #1f2937; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 10px; animation: bz-slide-down .25s ease; }
.bz-toast.ok { background: #15803d; }
.bz-toast.err { background: #b91c1c; }
.bz-toast.info { background: var(--primary); }
@keyframes bz-slide-down { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* modal / sheet */
.bz-modal-root { position: fixed; inset: 0; z-index: 9000; }
.bz-modal-bg { position: absolute; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); animation: bz-fade .2s; }
@keyframes bz-fade { from { opacity: 0; } to { opacity: 1; } }
.bz-sheet { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 18px calc(22px + var(--safe-b)); max-height: 92vh; overflow-y: auto; animation: bz-up .28s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 768px) { .bz-sheet { left: 50%; transform: translateX(-50%); bottom: auto; top: 50%; margin-top: -0px; translate: 0 -50%; width: 560px; border-radius: 20px; animation: bz-pop .25s; } }
@keyframes bz-up { from { transform: translateY(100%); } to { transform: none; } }
.bz-sheet-grip { width: 42px; height: 4px; border-radius: 4px; background: #d7dde7; margin: 6px auto 14px; }

/* stepper */
.bz-stepper { display: flex; align-items: center; gap: 4px; }
.bz-step { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #9aa3b2; }
.bz-step.done { color: var(--success); }
.bz-step.cur { color: var(--primary); }
.bz-step-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 11px; border: 2px solid var(--line); }
.bz-step.done .bz-step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.bz-step.cur .bz-step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }

/* order tracker */
.bz-track { position: relative; padding-left: 26px; }
.bz-track::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.bz-track-item { position: relative; padding-bottom: 20px; }
.bz-track-item::before { content: ''; position: absolute; left: -24px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.bz-track-item.on::before { border-color: var(--success); background: var(--success); }
.bz-track-item.cur::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px rgba(21,87,214,.15); }

/* skeleton */
.bz-sk { background: linear-gradient(90deg, #eef1f5 25%, #e3e8ef 50%, #eef1f5 75%); background-size: 200% 100%; animation: bz-shim 1.3s infinite; border-radius: 10px; }
@keyframes bz-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* desktop sidebar (seller/admin) */
.bz-shell { display: flex; min-height: 100vh; }
.bz-side { width: 250px; flex: 0 0 250px; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.bz-side-link { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #4b5563; transition: .16s; margin-bottom: 3px; }
.bz-side-link i { width: 20px; text-align: center; font-size: 15px; }
.bz-side-link:hover { background: var(--surface); }
.bz-side-link.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(21,87,214,.28); }
.bz-content { flex: 1; min-width: 0; padding: 18px; }
@media (max-width: 1023px) {
  .bz-side { position: fixed; z-index: 8000; left: 0; top: 0; transform: translateX(-102%); transition: .25s; box-shadow: var(--shadow-pop); }
  .bz-side.open { transform: none; }
}

.bz-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.bz-kpi .lbl { font-size: 12px; font-weight: 700; color: #8a94a6; text-transform: uppercase; letter-spacing: .4px; }
.bz-kpi .val { font-size: 24px; font-weight: 800; margin-top: 6px; }
.bz-kpi .sub { font-size: 11.5px; color: #8a94a6; margin-top: 3px; }

table.bz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bz-table th { text-align: left; padding: 11px 12px; background: var(--surface); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; font-weight: 700; white-space: nowrap; }
table.bz-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.bz-table tr:hover td { background: #fafbfd; }

.bz-bar { height: 8px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.bz-bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

.hide { display: none !important; }
.no-scroll { overflow: hidden; }
