/* Northeastern Distributors Inc — public site styles. Mobile-first, dependency-free. */

:root {
  --herrs-red: #d8232a;
  --herrs-red-dark: #a5151b;
  --herrs-yellow: #ffc72c;
  --herrs-yellow-dark: #e0a800;
  --ink: #1f1a17;
  --muted: #6b625c;
  --bg: #fffdf7;
  --card: #ffffff;
  --line: #ece4d8;
  --ok: #1c7a3a;
  --err: #b00020;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 26, 23, 0.08);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }

a { color: var(--herrs-red); }
a:hover { color: var(--herrs-red-dark); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 3px solid var(--herrs-yellow);
  box-shadow: var(--shadow);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 6px;
}
.brand-row .logo { height: 44px; width: auto; object-fit: contain; }
.brand-name { line-height: 1.2; }
.brand-name strong { display: block; font-size: 1.02rem; }
.brand-name small { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.02em; }

.site-nav { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 8px; }
.site-nav a {
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}
.site-nav a:hover { background: #f7ecd2; }
.site-nav a.active { background: var(--herrs-red); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--herrs-red) 0%, var(--herrs-red-dark) 100%);
  color: #fff;
  padding: 34px 0 40px;
  text-align: center;
}
.hero .logos { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.hero .logos img { height: 64px; background: #fff; border-radius: 10px; padding: 6px; }
.hero h1 { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.25; }
.hero p.lede { margin: 0 auto; max-width: 34em; font-size: 1.05rem; opacity: 0.96; }
.hero .cta-row { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--herrs-red);
  color: #fff;
  text-align: center;
}
.btn:hover { background: var(--herrs-red-dark); color: #fff; }
.btn-yellow { background: var(--herrs-yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--herrs-yellow-dark); color: var(--ink); }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 14px; margin: 26px 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 1.12rem; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card p { margin: 0 0 12px; color: var(--muted); }

.section { margin: 30px 0; }
.section h2 { font-size: 1.3rem; margin: 0 0 12px; border-left: 5px solid var(--herrs-yellow); padding-left: 10px; }

.states { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.states li {
  background: #fff4d6;
  border: 1px solid #ecd28a;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.92rem;
}

.contact-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.contact-box p { margin: 6px 0; }

/* ---------- Catalog ---------- */
.search-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.search-bar input[type="search"],
.search-bar select {
  flex: 1 1 140px;
  min-width: 0;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.search-bar button { flex: 0 0 auto; }

.result-count { color: var(--muted); font-size: 0.92rem; margin: 4px 0 14px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}
.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.p-img {
  aspect-ratio: 1 / 1;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Show product photos at their natural size, fully visible and never
   upscaled or cropped, so small catalog images stay as sharp as possible. */
.p-img img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #f3ede2, #f3ede2 12px, #ece2cf 12px, #ece2cf 24px);
}
.img-ph span {
  background: #fff;
  border: 2px dashed var(--muted);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
}
.p-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.p-name { font-weight: 700; font-size: 0.95rem; line-height: 1.3; margin: 0 0 4px; }
.p-sku { font-size: 0.8rem; color: var(--muted); margin: 0 0 4px; }
.p-pack { font-size: 0.82rem; color: var(--muted); margin: 0 0 auto; }
.p-price { margin-top: 8px; font-weight: 800; font-size: 1.05rem; color: var(--herrs-red-dark); }
.p-price small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- Tax exemption box (signup) ---------- */
.tax-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; background: #faf8f3; }
.tax-box legend { font-weight: 700; padding: 0 6px; }
.tax-box .check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin-bottom: 12px; }
.tax-box .check input { width: 18px; height: 18px; accent-color: var(--herrs-red); }

/* ---------- Forms ---------- */
form .field { margin-bottom: 14px; }
form label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.95rem; }
form label .req { color: var(--herrs-red); }
form input[type="text"],
form input[type="tel"],
form input[type="email"],
form input[type="number"],
form input[type="search"],
form select,
form textarea {
  width: 100%;
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--herrs-yellow);
  border-color: var(--herrs-yellow-dark);
}
form textarea { min-height: 110px; resize: vertical; }
.grid-2 { display: grid; gap: 0 12px; }

.banner { border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; font-weight: 600; }
.banner-error { background: #fdeceb; border: 1px solid #f5b5b0; color: var(--err); }
.banner-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: var(--ok); }
.banner-info { background: #eef4fb; border: 1px solid #b9d2ec; color: #1d4e89; }
.banner-info a { color: #1d4e89; text-decoration: underline; }

/* Customer auth */
.auth-wrap { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.auth-card h2 { margin-top: 0; }
.auth-sub { color: var(--muted); margin-top: -8px; }
.auth-alt { text-align: center; margin-bottom: 0; }

/* Gated price on public catalog */
.p-price.gated { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.p-price.gated a { color: var(--herrs-red); }

/* Account links in the public nav */
.nav-account { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-hello { padding: 8px 6px; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.nav-signup { background: var(--herrs-red); color: #fff !important; border-radius: 8px; }
.nav-signup:hover { background: var(--herrs-red-dark) !important; }

/* Order product picker */
.picker-controls { position: sticky; top: 118px; z-index: 20; background: var(--bg); padding: 10px 0; }
.tally {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.tally strong { color: var(--herrs-yellow); font-size: 1.1rem; }
.order-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.order-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.order-row .thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #0a0a0a; display: flex; align-items: center; justify-content: center; }
.order-row .thumb img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.order-row .thumb .img-ph { border-radius: 8px; }
.order-row .thumb .img-ph span { padding: 4px 6px; font-size: 0.7rem; }
.order-row .info { min-width: 0; }
.order-row .info .n { font-weight: 700; font-size: 0.92rem; line-height: 1.3; }
.order-row .info .s { font-size: 0.8rem; color: var(--muted); }
.order-row .info .pr { font-size: 0.85rem; font-weight: 600; color: var(--herrs-red-dark); }
.qty { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 88px; }
.qty label { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin: 0; }
.qty input { width: 100%; padding: 10px 6px; text-align: center; font-size: 1.05rem; }

/* Confirmation */
.confirm-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 20px 0; }
.confirm-box h1 { margin-top: 0; }
.order-meta { list-style: none; padding: 0; margin: 0 0 16px; }
.order-meta li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
table.lines { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.92rem; }
table.lines th, table.lines td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.lines th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.lines td.num, table.lines th.num { text-align: right; white-space: nowrap; }
.total-row { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 800; padding: 10px 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #e9e2d8;
  margin-top: 40px;
  padding: 28px 0 34px;
  font-size: 0.95rem;
}
.site-footer a { color: var(--herrs-yellow); }
.site-footer p { margin: 6px 0; }
.site-footer .fine { margin-top: 14px; font-size: 0.82rem; color: #a89e90; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .brand-row .logo { height: 54px; }
}

@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
