/* =========================================================================================
   Trade Supply Co. — design tokens
   Subject: industrial parts distributor (hydraulics, fasteners, power transmission) serving
   contractors and trade accounts. Palette and type are chosen to read like a warehouse /
   spec-sheet, not a generic SaaS landing page.
========================================================================================= */
:root {
  /* Color */
  --ink:        #1A2229;   /* steel charcoal — header, footer, primary text on light */
  --ink-soft:   #2B2F33;   /* body text */
  --concrete:   #ECE8E0;   /* warm light grey-beige page background */
  --concrete-2: #DCD6C9;   /* slightly deeper panel background */
  --paper:      #FFFFFF;
  --amber:      #E8A33D;   /* signal amber — primary CTA / accent */
  --amber-dark: #C7822A;
  --blue:       #2F5D8A;   /* hydraulic blue — links, secondary accent */
  --blue-dark:  #22456A;
  --green:      #3F7D52;   /* in-stock */
  --red:        #A6402F;   /* out of stock / errors */
  --line:       #C9C2B2;   /* hairline borders on concrete */
  --line-dark:  #3A4550;   /* hairline borders on ink */

  /* Brand purple — sampled from the Cochrane Distribution logo wordmark (#D19DF3) */
  --purple:       #D19DF3;   /* bright orchid — brand mark text, accents on dark backgrounds */
  --purple-soft:  #E7D3F9;   /* light tint — hover states on dark backgrounds */
  --purple-deep:  #241A33;   /* near-black purple — dark background base */
  --purple-deep-2:#2E2247;   /* dark background gradient stop */
  --bg-purple: linear-gradient(160deg, var(--purple-deep-2) 0%, var(--purple-deep) 45%, var(--ink) 100%);

  /* Type */
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Roboto Mono', monospace;

  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-soft);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink);
  margin: 0 0 0.4em 0;
  text-transform: uppercase;
}
p { line-height: 1.55; margin: 0 0 1em 0; }
a { color: var(--blue); }
.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- Signature element: perforated "packing-slip" divider ---- */
.perf {
  height: 1px;
  border: none;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
  margin: 48px 0;
}
.perf.on-dark {
  background-image: repeating-linear-gradient(90deg, var(--line-dark) 0 8px, transparent 8px 16px);
}

/* ---- Rubber-stamp badge ---- */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(-2deg);
}
.stamp.in-stock { color: var(--green); }
.stamp.out-of-stock { color: var(--red); }
.stamp.trade { color: var(--blue); }

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--amber); border-color: var(--amber-dark); color: var(--ink); }
.btn.primary:hover { background: var(--amber-dark); }
.btn.on-dark { border-color: var(--concrete); color: var(--concrete); }
.btn.on-dark:hover { background: rgba(236,232,224,0.08); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ---- Forms (shared by account/portal pages) ---- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 14.5px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink-soft);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.field { margin-bottom: 16px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ---- Product detail modal (shared: public catalog + signed-in portal) ---- */
.pd-overlay {
  position: fixed; inset: 0; background: rgba(26,34,41,0.55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: pd-fade 0.12s ease;
}
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
.pd-panel {
  background: var(--paper); border-radius: var(--radius); max-width: 780px; width: 100%;
  max-height: 88vh; overflow-y: auto; position: relative; box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}
.pd-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font-size: 18px;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.pd-close:hover { border-color: var(--ink); }
.pd-body { display: grid; grid-template-columns: 300px 1fr; gap: 0; }
.pd-photo { background: var(--concrete-2); display: flex; align-items: center; justify-content: center; min-height: 260px; }
.pd-photo img { width: 100%; height: 100%; object-fit: contain; display: block; max-height: 420px; }
.pd-photo .placeholder { color: var(--line); font-size: 64px; }
.pd-info { padding: 30px 32px; }
.pd-pn { font-family: var(--font-mono); font-size: 13px; color: #8a8f7a; margin-bottom: 6px; }
.pd-desc { font-size: 22px; margin: 0 0 10px; text-transform: none; letter-spacing: 0; }
.pd-cat { font-size: 13px; color: #5B6470; margin-bottom: 18px; }
.pd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-bottom: 22px; }
.pd-fact label { margin-bottom: 2px; }
.pd-fact span { font-size: 14.5px; color: var(--ink-soft); }
.pd-fact .mono { font-size: 13.5px; }
.pd-price-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1.5px solid var(--line); }
.pd-price { font-family: var(--font-mono); font-weight: 700; font-size: 24px; color: var(--ink); }
.pd-details { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1.5px solid var(--line); }
.pd-details p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 0; }
@media (max-width: 640px) {
  .pd-body { grid-template-columns: 1fr; }
  .pd-photo { min-height: 200px; }
  .pd-info { padding: 22px 20px; }
}
