/* ============================================================
   Metal Table Legs -- catalog site
   Plain CSS, no build step, safe to edit directly on the server.
   ============================================================ */

:root {
  --ink: #1b1b1c;
  --steel: #3a3d42;
  --steel-light: #6b6f76;
  --line: #dcdcdc;
  --paper: #ffffff;
  --paper-alt: #f4f4f2;
  --accent: #c05621; /* warm rust/copper accent, reads "metal fabrication" */
  --max-width: 1180px;
  --gap: clamp(24px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header__nav {
  min-height: 1px; /* reserved for the menu you'll add later */
}

/* ---------- Hero (kept empty on purpose) ---------- */
.hero {
  height: clamp(160px, 28vh, 320px);
  background: var(--paper-alt);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

/* ---------- Catalog ---------- */
.catalog {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.catalog__empty {
  padding: 80px 0;
  text-align: center;
  color: var(--steel-light);
}

.product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--gap);
  align-items: start;
  padding: clamp(48px, 8vw, 96px) 0;
  border-bottom: 1px solid var(--line);
}

.product:last-child { border-bottom: none; }

/* Alternate media/text sides on larger screens for visual rhythm */
.product:nth-of-type(even) .product__media { order: 1; }
.product:nth-of-type(even) .product__text { order: 2; }

/* ---------- Media column ---------- */
.product__media {
  position: sticky;
  top: 88px;
}

.product__main-photo {
  aspect-ratio: 4 / 3;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  overflow: hidden;
}

.product__main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.product__thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--line);
  background: var(--paper-alt);
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  transition: border-color 0.15s ease;
}

.product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__thumb:hover,
.product__thumb:focus-visible {
  border-color: var(--steel-light);
}

.product__thumb.is-active {
  border-color: var(--accent);
}

/* ---------- Text column ---------- */
.product__name {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  letter-spacing: 0.01em;
}

.product__description {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--steel);
}

.product__details {
  margin: 0 0 24px;
  color: var(--steel);
}

.product__specs {
  margin: 0;
  border-top: 1px solid var(--line);
}

.product__spec-row {
  display: grid;
  grid-template-columns: 40% 60%;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.product__spec-row dt {
  color: var(--steel-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
  font-weight: 600;
  padding-top: 2px;
}

.product__spec-row dd {
  margin: 0;
  color: var(--ink);
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  color: var(--steel-light);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .product {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product:nth-of-type(even) .product__media,
  .product:nth-of-type(even) .product__text {
    order: initial;
  }
  .product__media {
    position: static;
  }
}
