/* On — native HTML athletic storefront
   Editorial, monochrome with a single signal accent. */

:root {
  --header-h: 64px;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #0e0e0d;
  --ink-soft: #3b3b37;
  --muted: #74736d;
  --line: #e3e1da;
  --line-strong: #cbc9c0;
  --tile: #eae9e3;
  --accent: #ff3d00;
  --radius: 2px;
  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 48px);
  --grid-gap: clamp(14px, 2.4vw, 28px);
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", "Roboto Mono", ui-monospace, "Menlo", "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: inherit; }

button { font: inherit; }

main { display: block; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.nav-toggle .bar {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.nav-toggle .bar::before,
.nav-toggle .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.nav-toggle .bar::before { top: -6px; }
.nav-toggle .bar::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    margin-left: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open { display: block; }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav a {
    padding: 15px 0;
    font-size: 20px;
    border-bottom: 1px solid var(--line);
  }

  .site-nav li:last-child a { border-bottom: 0; }
}

/* ---------- Masthead (home) ---------- */

.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) 44px;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead-title {
  margin: 0 0 24px;
  font-size: clamp(44px, 9vw, 128px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.masthead-sub {
  max-width: 46ch;
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ink-soft);
}

/* ---------- Category index (home) ---------- */

.category-index {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

.section-label {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.category-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-index a {
  font-size: clamp(28px, 4.4vw, 50px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.category-index a:hover { color: var(--accent); }

/* ---------- Page head (collection) ---------- */

.page-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) var(--gutter) 12px;
}

.page-head h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 7vw, 88px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.page-sub {
  max-width: 52ch;
  margin: 0;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-soft);
}

/* ---------- Catalog ---------- */

.catalog {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 24px;
}

.catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.catalog-head .section-label { margin-bottom: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--line);
}

.search {
  flex: 1 1 240px;
  min-width: 0;
}

.search input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.search input::placeholder { color: var(--muted); }

.search input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.sort {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sort-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sort select {
  min-width: 0;
  padding: 11px 40px 11px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sort .chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.result-count {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Product grid ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  padding: 24px 0 8px;
}

@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 470px) {
  .product-grid { grid-template-columns: 1fr; }
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.product-card[hidden] { display: none; }

.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--tile);
  border-radius: var(--radius);
  text-decoration: none;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-media:hover img { transform: scale(1.03); }

.product-media__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow: hidden;
  overflow-wrap: break-word;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.product-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.product-title a {
  text-decoration: none;
  color: var(--ink);
}

.product-title a:hover { color: var(--accent); }

.product-price {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Empty state ---------- */

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state[hidden] { display: none; }

.empty-state p {
  margin: 0 0 18px;
  font-size: 17px;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0 64px;
}

.pagination[hidden] { display: none; }

.pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.page-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.page-btn:hover { border-color: var(--line-strong); }

.page-prev,
.page-next { border-color: var(--line-strong); }

.page-num.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
  border-color: transparent;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- PDP ---------- */

.pdp {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumbs a:hover { color: var(--accent); }

.pdp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

@media (max-width: 720px) {
  .pdp-layout { grid-template-columns: 1fr; }
}

.pdp-media {
  overflow: hidden;
  background: var(--tile);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
}

@media (min-width: 721px) {
  .pdp-media {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

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

.pdp-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-top: 8px;
}

.pdp-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pdp-price {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: lowercase;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-width: 0;
}

.footer-nav a {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--accent); }

.footer-copy {
  width: 100%;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
