/* ===========================================================
   Mashura / CUBEX / Zimbis — Parts Ordering Mockup
   Shared design system
   =========================================================== */

@font-face {
  font-family: "Scto Grotesk A";
  src: url("../fonts/ScotoGroteskA-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Scto Grotesk A";
  src: url("../fonts/ScotoGroteskA-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "Scto Grotesk A";
  src: url("../fonts/ScotoGroteskA-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Shinka Mono";
  src: url("../fonts/ShinkaMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Shinka Mono";
  src: url("../fonts/ShinkaMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "Shinka Mono";
  src: url("../fonts/ShinkaMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --blue: #529CFF;
  --blue-dark: #2E7BE6;
  --blue-tint: #EAF2FF;
  --ink: #14181F;
  --ink-soft: #4B5563;
  --line: #DCE3EC;
  --line-soft: #EDF1F6;
  --bg: #F7F9FC;
  --white: #FFFFFF;
  --green: #1E8E5A;
  --green-tint: #E7F6EE;
  --amber: #B4790A;
  --amber-tint: #FDF3E1;
  --red: #C4362B;
  --red-tint: #FBE9E7;
  --gray-tint: #EEF1F5;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20,24,31,0.06), 0 1px 8px rgba(20,24,31,0.04);
  --font: "Scto Grotesk A", Arial, Helvetica, sans-serif;
  --font-mono: "Shinka Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--ink); }
em, i, .no-italic { font-style: normal !important; }
u { text-decoration: none !important; }

h1, h2, h3, h4 {
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.2;
}
p { margin: 0 0 10px 0; line-height: 1.5; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--ink);
}
.brand-lockup svg { width: 30px; height: 30px; color: var(--ink); }
.brand-name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 4px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--blue-dark); }
.search-form {
  flex: 1;
  display: flex;
  max-width: 480px;
}
.search-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
}
.search-form input:focus { outline: none; border-color: var(--blue); }
.search-form button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 500;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  flex-shrink: 0;
}
.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
}
.cart-badge {
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.signin-box {
  font-size: 13px;
  line-height: 1.3;
  text-align: right;
}
.signin-box .signin-top { color: var(--ink-soft); font-size: 11px; }
.signin-box .signin-name { font-weight: 700; }
.btn-signin {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
}
.subnav {
  background: var(--ink);
  color: var(--white);
}
.subnav .container { display: flex; gap: 22px; height: 40px; align-items: center; overflow-x: auto; }
.subnav a { color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; white-space: nowrap; }
.subnav a:hover, .subnav a.active { color: var(--white); }
.subnav .tag {
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }
.btn-primary:disabled { background: #A9C8F5; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #000; color: var(--white); }
.btn-outline { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-text { background: none; border: none; color: var(--blue-dark); padding: 6px 4px; }
.btn-danger { background: var(--white); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-tint); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Layout helpers ---------- */
.page { padding: 28px 0 60px; }
.page-title { font-size: 24px; margin-bottom: 4px; }
.page-subtitle { color: var(--ink-soft); font-size: 14px; margin-bottom: 22px; }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

/* ---------- Filter sidebar ---------- */
.filters { }
.filter-group { margin-bottom: 20px; }
.filter-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 10px; font-weight: 700; }
.filter-group select, .filter-group input[type=text] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  background: var(--white);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
}
.chip.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ---------- Grid / tiles ---------- */
.results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-count { font-size: 13px; color: var(--ink-soft); }
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.part-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.part-tile .tile-img {
  aspect-ratio: 1 / 1;
  background: var(--gray-tint);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.part-tile .tile-img img { width: 60%; height: 60%; object-fit: contain; }
.part-id-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--gray-tint);
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  width: fit-content;
}
.tile-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tile-name-alt { font-size: 12px; color: var(--ink-soft); }
.tile-cabinets { font-size: 11px; color: var(--ink-soft); }
.tile-cabinets .cab-chip {
  display: inline-block;
  background: var(--blue-tint);
  color: var(--blue-dark);
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  margin: 2px 4px 0 0;
}
.tile-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.qty-selector { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qty-selector button {
  background: var(--gray-tint);
  border: none;
  width: 30px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font);
}
.qty-selector input {
  width: 42px;
  border: none;
  text-align: center;
  font-family: var(--font);
  font-size: 14px;
  height: 32px;
}
.qty-row { display: flex; align-items: center; gap: 8px; }
.availability { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.availability.in-stock { background: var(--green-tint); color: var(--green); }
.availability.limited { background: var(--amber-tint); color: var(--amber); }
.availability.internal-only { background: var(--gray-tint); color: var(--ink-soft); }

/* ---------- Part details ---------- */
.detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: 32px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-img { background: var(--gray-tint); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; aspect-ratio: 1/1; }
.detail-img img { width: 55%; height: 55%; object-fit: contain; }
.detail-flags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.flag { font-size: 12px; font-weight: 500; padding: 6px 11px; border-radius: var(--radius); display: flex; align-items: center; gap: 6px; }
.flag.yes { background: var(--amber-tint); color: var(--amber); }
.flag.no { background: var(--green-tint); color: var(--green); }
.kv-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.kv-table th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 500; padding: 8px 0; width: 200px; vertical-align: top; }
.kv-table td { padding: 8px 0; font-size: 14px; vertical-align: top; }
.kv-table tr + tr th, .kv-table tr + tr td { border-top: 1px solid var(--line-soft); }

/* ---------- Cart ---------- */
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.cart-item:last-child { border-bottom: none; }
.cart-item .item-img { width: 72px; height: 72px; background: var(--gray-tint); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.cart-item .item-img img { width: 60%; height: 60%; object-fit: contain; }
.cart-item .item-name { font-weight: 700; font-size: 14px; }
.cart-item .item-meta { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.cart-item .item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.summary-row.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .field.span-2 { grid-column: span 1; } }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.field .hint { font-size: 11px; color: var(--ink-soft); }
.radio-card-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}
.radio-card.selected { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-dark); }
.radio-card.locked { opacity: 0.6; cursor: not-allowed; }

/* ---------- Checkout steps ---------- */
.steps-bar { display: flex; gap: 4px; margin-bottom: 26px; flex-wrap: wrap; }
.step-pill {
  flex: 1;
  min-width: 90px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  padding: 9px 6px;
  background: var(--gray-tint);
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
}
.step-pill.active { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-tint); font-weight: 700; }
.step-pill.done { color: var(--green); }
.step-actions { display: flex; justify-content: space-between; margin-top: 24px; }

/* ---------- Order summary text block ---------- */
.order-doc {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--ink);
  color: #E7F1FF;
  border-radius: var(--radius-lg);
  padding: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}
.order-doc .lbl { color: #8FB9F2; }

/* ---------- Status badges ---------- */
.status-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; display: inline-block; }
.status-badge.pending-approval { background: var(--amber-tint); color: var(--amber); }
.status-badge.approved { background: var(--green-tint); color: var(--green); }
.status-badge.rejected { background: var(--red-tint); color: var(--red); }
.status-badge.more-info { background: #EDE7FB; color: #6A4FC7; }
.status-badge.pending-processing { background: var(--amber-tint); color: var(--amber); }
.status-badge.processed { background: var(--blue-tint); color: var(--blue-dark); }
.status-badge.shipped { background: #E3F1FE; color: #1C6FB0; }
.status-badge.delivered { background: var(--green-tint); color: var(--green); }
.status-badge.cancelled { background: var(--gray-tint); color: var(--ink-soft); }

/* ---------- Tables (admin) ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table tr:hover td { background: var(--blue-tint); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.table-wrap .data-table { min-width: 1100px; }

/* ---------- Admin layout ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 72px); }
.admin-sidebar { background: var(--white); border-right: 1px solid var(--line); padding: 20px 0; }
.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.admin-sidebar a.active, .admin-sidebar a:hover { color: var(--blue-dark); background: var(--blue-tint); }
.admin-main { padding: 24px 28px 60px; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--blue-dark); border-color: var(--blue); font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search-mini { flex: 1; min-width: 200px; }
.toolbar .search-mini input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font); font-size: 13px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,24,31,0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto; z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  max-width: 640px; width: 100%; padding: 24px;
  box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--white); padding: 12px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; z-index: 200; box-shadow: var(--shadow);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 40px; color: var(--ink-soft); font-size: 12px; }

/* ---------- Misc ---------- */
.pill-note { background: var(--blue-tint); color: var(--blue-dark); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }
.mono { font-family: var(--font-mono); }
.text-soft { color: var(--ink-soft); }
.badge-domain { font-size: 11px; background: var(--gray-tint); padding: 3px 8px; border-radius: 999px; color: var(--ink-soft); font-weight: 500; }
select, input, textarea, button { font-style: normal !important; text-decoration: none !important; }

/* ---------------- customer support popup ---------------- */
.support-block { margin-top: 16px; }
.support-block:first-of-type { margin-top: 6px; }
.support-title { font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.support-email { margin-bottom: 8px; }
.support-nums { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.support-num { font-size: 13px; white-space: nowrap; }
.support-num strong { color: var(--blue-dark); margin-right: 2px; }

/* ---------------- order approval notification banner ---------------- */
.alert-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 20px; z-index: 1200; width: min(560px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px;
}
.alert-line {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: 10px; padding: 12px 14px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(20,40,80,.14);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.alert-line.ok { border-left-color: #1E9E5A; }
.alert-line.bad { border-left-color: var(--red); }
.alert-line.warn { border-left-color: #C98A12; }
.alert-dismiss {
  margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; font-family: var(--font); font-size: 12px;
  cursor: pointer; color: var(--ink);
}
.alert-dismiss:hover { border-color: var(--blue); color: var(--blue-dark); }
