/* =====================================================================
   Base theme. Colours/fonts are all CSS variables so that once the real
   CID (corporate identity) file is supplied, re-theming the whole site
   is a matter of editing the :root block below — nothing else should
   need to change.
   ===================================================================== */

:root {
  --color-primary: #1a2b4c;
  --color-primary-contrast: #ffffff;
  --color-accent: #c8963e;
  --color-bg: #ffffff;
  --color-surface: #f4f5f7;
  --color-text: #1d1f23;
  --color-muted: #6b7280;
  --color-border: #e1e3e8;
  --color-success: #1d7a4c;
  --color-error: #b3261e;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.site-header {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
}
.header-search { display: flex; }
.header-search input {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius) 0 0 var(--radius);
  border: none;
  min-width: 160px;
}
.header-search button {
  border: none;
  background: var(--color-accent);
  color: var(--color-primary);
  padding: 0.4rem 0.7rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}
.brand__logo { height: 44px; display: block; }
.brand__wordmark { font-size: 1.4rem; font-weight: 700; color: var(--color-primary-contrast); }
.main-nav a {
  color: var(--color-primary-contrast);
  margin-left: 1.25rem;
  font-weight: 500;
}
.main-nav a:hover { color: var(--color-accent); text-decoration: none; }

main.container { padding-top: 1.5rem; padding-bottom: 3rem; min-height: 60vh; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}
.flash--error { background: #fdecea; color: var(--color-error); }
.flash--success { background: #e9f6ee; color: var(--color-success); }

.site-footer {
  background: var(--color-surface);
  color: var(--color-muted);
  padding: 1.5rem 0;
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* Forms */
form.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
}
.btn {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--color-accent); }
.btn--secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--color-bg);
}
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--color-surface); }
.product-card h3 { font-size: 1rem; margin: 0.6rem 0 0.2rem; }
.product-card .price { font-weight: 700; color: var(--color-primary); }
.product-card .manufacturer { font-size: 0.8rem; color: var(--color-muted); }
.stock-status { font-size: 0.8rem; color: var(--color-accent); font-weight: 600; margin: 0.2rem 0; }

/* Cart / checkout tables */
table.cart-table { width: 100%; border-collapse: collapse; }
table.cart-table th, table.cart-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.totals { margin-top: 1rem; text-align: right; }
.totals .grand { font-size: 1.3rem; font-weight: 700; }

.shipping-options label {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}
.shipping-options input { margin-right: 0.6rem; }
