/* core/public/css/site.css — site-wide layout + components for Phase 1A catalog.
 * Consumes brand custom properties from /css/brand/theme.css.
 * No build step; plain CSS.
 */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink, #1a1a1a);
  background: var(--color-neutral, #fff);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary-dark, var(--color-primary, #06c)); text-underline-offset: 0.15em; }
a:hover { color: var(--color-primary, #06c); }

/* === Typography === */
h1, h2, h3, h4 {
  font-family: var(--font-heading, var(--font-body, serif));
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-ink, #1a1a1a);
}
h1 { font-size: 2.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.text-muted { color: var(--color-muted, #666); }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius, 8px);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease;
  font-family: inherit;
  font-size: 1rem;
}
.btn-primary {
  background: var(--color-primary, #06c);
  color: var(--color-neutral, #fff);
  border-color: var(--color-primary, #06c);
}
.btn-primary:hover { opacity: 0.9; color: var(--color-neutral, #fff); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary-dark, var(--color-primary, #06c));
  border-color: var(--color-primary-dark, var(--color-primary, #06c));
}
.btn-secondary:hover { background: var(--color-primary-dark, var(--color-primary, #06c)); color: var(--color-neutral, #fff); }
.btn-disabled, .btn:disabled {
  background: var(--color-muted, #999);
  color: var(--color-neutral, #fff);
  border-color: var(--color-muted, #999);
  cursor: not-allowed;
  opacity: 0.65;
}

/* === Cards === */
.card {
  background: #fff;
  border-radius: var(--radius, 8px);
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08); }
.card-image { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius, 8px); margin: -1.25rem -1.25rem 1rem; background: var(--color-neutral, #f4f4f4); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 1.125rem; margin: 0 0 0.25rem; }
.card-meta { font-size: 0.875rem; color: var(--color-muted, #666); margin: 0 0 0.5rem; }
.card-price { margin-top: auto; padding-top: 0.75rem; font-weight: 600; color: var(--color-primary-dark, var(--color-primary, #06c)); }

/* === Header / Footer (overrides Phase 0 placeholder vibe) === */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--color-neutral, #fff);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  max-width: 1200px;
  margin: 0 auto;
}
.brand-logo img { max-height: 48px; width: auto; }
.site-header nav { display: flex; gap: 1.5rem; }
.nav-link { color: var(--color-ink, #1a1a1a); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--color-primary, #06c); }
.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted, #666);
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 4rem;
}

/* === Breadcrumbs === */
.breadcrumbs { font-size: 0.875rem; color: var(--color-muted, #666); margin: 1.5rem 0; }
.breadcrumbs a { color: inherit; }
.breadcrumbs > * + *::before { content: "›"; margin: 0 0.5rem; }

/* === Hero / category banner === */
.hero-banner {
  padding: 3rem 0;
  text-align: center;
}
.hero-banner h1 { margin-bottom: 0.5rem; }
.hero-banner .lede { font-size: 1.125rem; max-width: 60ch; margin: 0 auto; color: var(--color-muted, #666); }

/* === Tier table === */
.tier-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
  border-radius: var(--radius, 8px);
  overflow: hidden;
}
.tier-table th, .tier-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.tier-table th { background: var(--color-neutral, #f8f8f8); font-weight: 600; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted, #666); }
.tier-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tier-table tr:last-child td { border-bottom: 0; }
.tier-table .tier-default { background: rgba(0,0,0,0.02); font-weight: 600; }

/* === Product detail === */
.product-detail { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.product-image { aspect-ratio: 1 / 1; background: var(--color-neutral, #f4f4f4); border-radius: var(--radius, 8px); overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-summary p.lede { font-size: 1.125rem; color: var(--color-muted, #666); }
.product-cta { margin-top: 1.5rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.product-cta input[type="number"] {
  width: 100px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: var(--radius, 8px);
  font-family: inherit;
}
.cta-note { font-size: 0.875rem; color: var(--color-muted, #666); margin-top: 0.5rem; flex-basis: 100%; }

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--color-muted, #666);
}

/* === Error pages === */
.error-page { padding: 4rem 0; text-align: center; }
.error-page h1 { font-size: 2.5rem; }
.error-page .error-detail { color: var(--color-muted, #666); margin-bottom: 2rem; }
.error-trace { background: rgba(0,0,0,0.04); padding: 1rem; border-radius: var(--radius, 8px); text-align: left; font-size: 0.875rem; overflow-x: auto; }

/* === Responsive === */
@media (min-width: 768px) {
  h1 { font-size: 3rem; }
  .product-detail { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .product-image { aspect-ratio: 4 / 5; }
}
