/* ==========================================================================
   McPeak Supply -- Site Styles
   Colors are matched to the McPeak Supply / Stupp Bridge Company logo
   (navy, steel blue, red, off-white). Customize by editing the variables
   below, or ask Claude to adjust colors, fonts, and layout for you.
   ========================================================================== */

:root {
  --color-primary: #1c3d5f;       /* navy - header, buttons, links */
  --color-primary-dark: #12283f;  /* darker navy - hover states */
  --color-accent: #bf2b2b;        /* red - highlights, taglines */
  --color-steel: #a7bcc9;         /* light steel blue - borders, subtle accents */
  --color-text: #222222;
  --color-body: #333333;           /* one gray for running text on every page */
  --color-muted: #6b7280;
  --color-bg: #f6f5f2;            /* warm off-white background */
  --color-card-bg: #ffffff;
  --color-border: #e2e2e0;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-heading); }
/* One heading size for every card type (home, about, contact, fabricated materials). */
.service-card h3, .contact-card h3, .content-block-body h2, .project-contractor { font-size: 1.15rem; line-height: 1.3; }
.site-main h1 { color: var(--color-primary); }

.site-header {
  background: #fff;
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-accent);
  box-shadow: 0 1px 6px rgba(18, 40, 63, 0.12);
}
.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
}
.site-header .brand { display: flex; align-items: center; }
.site-header .brand-logo { max-height: 130px; width: auto; display: inline-block; }
.site-header .brand-text,
.site-header .brand-text-only {
  color: var(--color-primary);
  font-size: 1.5rem;
  font-weight: 700;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
.site-header nav a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.1rem;
}
.site-header nav a:hover { color: var(--color-accent); text-decoration: none; }
.site-header nav a { border-bottom: 3px solid transparent; padding-bottom: 2px; } /* reserves the marker's space so nothing shifts */
.site-header nav a[aria-current="page"] { border-bottom-color: var(--color-accent); }
.site-header nav a.nav-cta:hover { color: #fff !important; background: var(--color-primary-dark); }
@media (max-width: 640px) {
  .site-header .brand-logo { max-height: 90px; }
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.site-footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  padding: 24px 20px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--color-primary); }

.catalog-intro { margin-bottom: 24px; }
.catalog-intro h1 { color: var(--color-primary); }
.catalog-intro .tagline { color: var(--color-accent); font-weight: 600; }
.catalog-intro .intro-copy { color: var(--color-muted); max-width: 70ch; }

.category-heading {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-steel);
  padding-bottom: 6px;
  margin: 28px 0 14px;
  font-size: 1.2rem;
}
.category-heading:first-of-type { margin-top: 0; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.item-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.item-card.out-of-stock { opacity: 0.6; }

.item-image {
  aspect-ratio: 1 / 1;
  background: #eef2f4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-image img { width: 90%; height: 90%; object-fit: contain; }
.no-image-placeholder {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.item-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-body h3 { margin: 0; font-size: 1.05rem; color: var(--color-primary); }
.item-body .sku { color: var(--color-muted); font-size: 0.8rem; margin: 0; }
.item-body .desc { font-size: 0.9rem; margin: 0; color: #444; }
.item-body .unit { font-size: 0.85rem; margin: 0; color: var(--color-muted); }
.item-body .stock-status { color: var(--color-accent); font-weight: 600; font-size: 0.9rem; }

.qty-row { display: flex; align-items: center; gap: 8px; margin-top: auto; }

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { text-decoration: none; background: #f0f0ee; }
.btn-link { background: none; color: var(--color-primary); }
.link-btn {
  background: none; border: none; color: var(--color-primary); cursor: pointer;
  text-decoration: underline; padding: 0; font-size: 0.9rem;
}

.empty-state { color: var(--color-muted); }

table { width: 100%; border-collapse: collapse; }
.cart-table, .admin-table { margin-bottom: 20px; }
.cart-table th, .cart-table td, .admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.9rem;
}
.cart-table thead th, .admin-table thead th { color: var(--color-muted); font-weight: 600; }

.cart-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.checkout-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; }
.checkout-form label, .item-form label {
  display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600;
}
.checkout-form input, .checkout-form textarea,
.item-form input[type=text], .item-form input[type=url], .item-form input[type=email],
.item-form textarea, .item-form select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px;
  border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.95rem; font-family: inherit;
}
.item-form label input[type=checkbox] { width: auto; display: inline; margin-right: 6px; }

.order-summary { background: var(--color-card-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; height: fit-content; }
.order-summary ul { list-style: none; padding: 0; margin: 0 0 12px; }
.order-summary li { padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.summary-total { font-size: 1.1rem; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info { background: #fef9c3; color: #713f12; }
.alert ul { margin: 0; padding-left: 18px; }

.note { color: var(--color-muted); font-size: 0.85rem; }

/* Admin */
.admin-body { background: #f3f4f6; }
.admin-header { background: #111827; border-bottom: 3px solid var(--color-accent); }
.admin-main { max-width: 1200px; }
.admin-login-box {
  max-width: 380px; margin: 80px auto; background: #fff; padding: 30px;
  border-radius: var(--radius); border: 1px solid var(--color-border);
}
.admin-login-box input { display: block; width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--color-border); border-radius: 6px; }
.admin-login-box label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.9rem; }

.stat-cards { display: flex; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 18px 24px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card strong { font-size: 1.8rem; color: var(--color-primary); }
.stat-card span { color: var(--color-muted); font-size: 0.85rem; }

.status { padding: 3px 10px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; }
.status-new { background: #dbeafe; color: #1e40af; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-fulfilled { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.filter-row { margin-bottom: 18px; display: flex; gap: 16px; flex-wrap: wrap; }
.filter-row a { color: var(--color-muted); }
.filter-row a.active { color: var(--color-primary); font-weight: 700; }

.inline-form { display: inline; }

/* Content pages: home, about, fabrication, projects, contact */
.hero { margin-bottom: 10px; }
.hero-home { text-align: left; }
.hero-logo { max-height: 150px; width: auto; display: block; margin-bottom: 18px; }
.hero h1 { color: var(--color-primary); margin-bottom: 4px; }
.hero .tagline { color: var(--color-accent); font-weight: 600; margin: 0 0 12px; }
.hero-lead { font-size: 1.1rem; font-weight: 500; margin: 0 0 10px; max-width: 63.6ch; color: var(--color-body); } /* 63.6ch at 1.1rem = the 70ch paragraph width below it */
.intro-copy { color: var(--color-body); max-width: 70ch; }

.page-copy { max-width: 70ch; color: var(--color-body); }
.page-copy br + br { display: block; content: ""; margin-top: 10px; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 10px;
}
.service-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card-image { aspect-ratio: 16 / 10; background: #eef2f4; overflow: hidden; }
.service-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-card h3, .service-card p { padding-left: 18px; padding-right: 18px; }
.service-card h3 { margin: 14px 0 8px; color: var(--color-primary); }
.service-card p { margin: 0 0 8px; font-size: 0.92rem; color: var(--color-body); }
.service-card p:last-child { margin-bottom: 18px; }

.photo-credit { font-size: 0.75rem; color: var(--color-muted); font-style: italic; }

/* Generic editable content blocks (About, Fabrication, Contact extras) */
.content-blocks { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }
.content-block {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.content-block-image { aspect-ratio: 4 / 3; background: #eef2f4; overflow: hidden; }
.content-block-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.content-block-body { padding: 16px 18px 16px 0; }
.content-block:not(:has(.content-block-image)) { grid-template-columns: 1fr; }
.content-block:not(:has(.content-block-image)) .content-block-body { padding-left: 18px; }
/* Text-only blocks (the two locations on About) sit side by side instead of one narrow column. */
.content-blocks:not(:has(.content-block-image)) { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.content-block-body p { color: var(--color-body); }
.content-block-body h2 { margin: 0 0 8px; color: var(--color-primary); font-size: 1.15rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-image {
  aspect-ratio: 16 / 10;
  background: #eef2f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  overflow: hidden;
}
.project-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body { padding: 14px; }
.project-contractor { font-weight: 700; color: var(--color-primary); margin: 0 0 6px; font-family: var(--font-heading); }
.project-location { color: var(--color-accent); font-size: 0.85rem; margin: 0 0 8px; }
.project-desc { font-size: 0.9rem; color: var(--color-body); margin: 0; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.contact-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
}
.contact-card h3 { margin: 0 0 8px; color: var(--color-primary); }
.contact-card p { color: var(--color-body); }
.contact-card .contact-line { margin: 0 0 6px; }

@media (max-width: 800px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .content-block { grid-template-columns: 1fr; }
}

/* ---- Added by BITS: replaces inline styles (blocked by the Content-Security-Policy) ---- */
.qty-input { width: 70px; }
.thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.thumb-lg { width: 120px; border-radius: 4px; }
.inline-label { display: inline-block; margin-left: 10px; }
.nav-cta { background: var(--color-accent); color: #fff !important; padding: 6px 12px; border-radius: var(--radius); }
.nav-signout { color: inherit; font: inherit; opacity: .85; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-box { margin: 12px 0; min-height: 70px; }
.audit-note { color: var(--color-muted); font-size: .9em; }
