/* Shared primitives reused across every page: nav bar, buttons, badges,
   cards, form fields, toasts. Page-specific layout stays in each page's
   own <style> block — this file is only for things more than one page
   needs, so changing a button style here changes it everywhere at once. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--route-teal); text-decoration: none; }
a:hover { color: var(--route-teal-hover); }

::placeholder { color: var(--text-muted); }

button { font-family: inherit; }

/* -- layout -- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* -- nav bar -- */

.navbar {
  background: var(--steel-900);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-inverse) !important;
}
.navbar-mark {
  width: 34px;
  height: 34px;
  background: var(--cargo-red);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-stencil);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.navbar-word {
  font-family: var(--font-stencil);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.05em;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
}
.navbar-link {
  color: var(--text-inverse-muted) !important;
  font-size: 15px;
  font-weight: 500;
}
.navbar-link:hover { color: var(--text-inverse) !important; }
.navbar-link-active { color: var(--text-inverse) !important; font-weight: 700; }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar-account {
  color: var(--text-inverse-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
@media (max-width: 720px) {
  .navbar-links { display: none; }
}

/* -- buttons -- */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--route-teal); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--cargo-red); color: var(--text-inverse); }
.btn-primary:hover:not(:disabled) { background: var(--cargo-red-hover); }

.btn-teal { background: var(--route-teal); color: var(--text-inverse); }
.btn-teal:hover:not(:disabled) { background: var(--route-teal-hover); }

.btn-outline {
  background: transparent;
  color: var(--steel-900);
  border: 1.5px solid var(--steel-900);
}
.btn-outline:hover:not(:disabled) { background: var(--steel-900); color: var(--text-inverse); }

.btn-outline-light {
  background: transparent;
  color: var(--text-inverse);
  border: 1.5px solid var(--steel-700);
}
.btn-outline-light:hover:not(:disabled) { border-color: var(--text-inverse-muted); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* -- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
}
.badge-pending { background: var(--hazard-amber-tint); color: var(--hazard-amber-hover); }
.badge-verified { background: var(--route-teal-tint); color: var(--route-teal-hover); }
.badge-rejected { background: #f2e2df; color: var(--cargo-red-hover); }
.badge-neutral { background: var(--border-light); color: var(--text-secondary); }

/* -- cards -- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

/* -- form fields -- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 11px 14px;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--route-teal);
  outline-offset: -1px;
}
.field textarea { resize: vertical; min-height: 80px; }
.field-error { font-size: 12px; color: var(--cargo-red); min-height: 16px; }

/* -- listing card (marketplace grid, featured row, storefront's product
      list — shared by any page that shows a grid of listings) -- */

.listing-card { background: var(--card-bg); border: 1px solid var(--border); display: flex; flex-direction: column; }
.listing-image { position: relative; height: 170px; background: var(--route-teal-tint); color: var(--route-teal); display: flex; align-items: center; justify-content: center; }
.listing-body { padding: 18px; display: flex; flex-direction: column; gap: 9px; }
.listing-category { font-family: var(--font-mono); font-size: 11px; color: var(--route-teal); text-transform: uppercase; letter-spacing: 0.06em; }
.listing-title { font-weight: 700; font-size: 15px; line-height: 1.3; min-height: 2.6em; }
.listing-meta-row { display: flex; align-items: center; justify-content: space-between; }
.listing-price { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.listing-seller { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary); }
.seller-avatar {
  width: 20px; height: 20px; border-radius: 50%; background: var(--steel-900); color: var(--text-inverse);
  font-size: 9px; font-weight: 700; font-family: var(--font-mono); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.request-quote-btn {
  appearance: none; border: none; background: none; cursor: pointer; text-align: left; padding: 0; margin-top: 4px;
  font-size: 13px; font-weight: 700; color: var(--route-teal); font-family: var(--font-body);
}
.request-quote-btn:hover { color: var(--route-teal-hover); }
.featured-badge {
  position: absolute; top: 10px; left: 10px; background: var(--hazard-amber); color: var(--steel-900);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; display: flex; align-items: center; gap: 4px;
}

/* -- modal (RFQ request, used on marketplace and listing detail) -- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,24,27,0.5); display: none; align-items: center; justify-content: center;
  padding: 24px; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--card-bg); width: 100%; max-width: 440px; padding: 32px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.modal-close { appearance: none; border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 20px; line-height: 1; padding: 0; }

/* -- empty state -- */

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* -- toast -- */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--steel-900);
  color: var(--text-inverse);
  padding: 14px 20px;
  font-size: 14px;
  max-width: 320px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--cargo-red); }
.toast-success { background: var(--route-teal); }

/* -- misc -- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hazard-amber);
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
