/* ==========================================================================
   FAEZ STORE — Minimalist Zinc Design System (Shared & Storefront)
   ========================================================================== */

:root {
  --bg: #09090b;
  --surface: #121215;
  --surface-hover: #18181c;
  --surface-raised: #1c1c21;
  --border: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #71717a;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg: #f8f8fa;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;
  --surface-raised: #efeff1;
  --border: #e4e4e7;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-focus: #a1a1aa;
  --text: #09090b;
  --muted: #52525b;
  --dim: #71717a;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.1);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

/* Layout Container */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

/* Header / Topbar */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Bento Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.metric-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-foot {
  font-size: 12px;
  color: var(--dim);
  margin-top: 4px;
}

/* Segmented Navigation Tabs */
.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.nav-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* Panels & Split Layouts */
.split {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 920px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Filter & Search Bar */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cat-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.cat-btn.active {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.cat-count {
  font-size: 11px;
  opacity: 0.7;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Product Bento Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.product-card:hover {
  border-color: var(--border-focus);
}

.product-card.out-of-stock {
  opacity: 0.68;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-code {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 5px;
}

.card-desc {
  font-size: 12px;
  color: var(--muted);
  min-height: 36px;
  line-height: 1.45;
}

.card-foot {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-label {
  font-size: 11px;
  color: var(--dim);
  display: block;
}

.price-val {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Forms & Inputs */
.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.search-box {
  position: relative;
  width: 240px;
  max-width: 100%;
}

.search-box i, .search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
}

.search-box input {
  padding-left: 32px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
}

/* Buttons */
.btn {
  background: var(--text);
  color: var(--bg);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  opacity: 0.88;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-hover);
  opacity: 1;
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid transparent;
}

.btn-success {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid transparent;
}

.btn-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
}

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.pill-neutral {
  background: var(--border-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}

.pill-green {
  background: var(--green-soft);
  color: var(--green);
}

.pill-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill-red {
  background: var(--red-soft);
  color: var(--red);
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--dim);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--border-subtle);
}

/* Modals */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  overflow-y: auto;
}

.modal-bg.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
}

/* Checkout Specific Components */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  color: var(--text);
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.qty-btn:disabled {
  color: var(--dim);
  cursor: not-allowed;
}

.qty-val {
  min-width: 40px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.summary-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.qris-frame {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.qris-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.account-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 10px 0;
}

/* Star Rating Selector */
.star-picker {
  display: inline-flex;
  gap: 6px;
}

.star-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.star-btn:hover, .star-btn.active {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

/* Voucher & Review Grid */
.voucher-grid, .review-grid, .guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 920px) {
  .voucher-grid, .review-grid, .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .voucher-grid, .review-grid, .guide-grid {
    grid-template-columns: 1fr;
  }
}

.progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

/* Footer */
footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--dim);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: 0.2s ease;
  z-index: 200;
  pointer-events: none;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}
