*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── DESIGN TOKENS ─────────────────────────────── */
:root {
  --bg:           #2C2C2C;
  --bg-card:      #383838;
  --ink:          #ffffff;
  --ink-mid:      rgba(255,255,255,0.65);
  --ink-muted:    rgba(255,255,255,0.35);
  --accent:       #FFFF6B;
  --border:       rgba(255,255,255,0.12);
  --progress-bg:  #222222;

  /* 12-col grid: 220px margin, 20px gutter */
  --margin:       220px;
  --gutter:       20px;
  --cols:         12;

  /* col unit = (100vw - 2*margin - 11*gutter) / 12 */
  --col: calc((100vw - 2 * var(--margin) - 11 * var(--gutter)) / 12);

  /* Font stacks */
  --f-heading: 'Noto Sans JP', sans-serif;   /* ExtraBold 800 / Black 900 */
  --f-field:   'Ubuntu', 'Noto Sans JP', sans-serif;
  --f-body:    'Open Sans', sans-serif;
}

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* ─── HEADER ─────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  /* 48px at 1920px = 2.5vw, scales down with viewport */
  padding-top: clamp(20px, 2.5vw, 48px);
  padding-bottom: clamp(20px, 2.5vw, 48px);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  padding-right: calc(3 * var(--col) + 2 * var(--gutter) + var(--margin));
  flex-shrink: 0;
}

.header-inner {
  margin-left: var(--margin);
  display: flex;
  align-items: center;
}

.logo-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 32px;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.logo-btn em { font-style: italic; font-weight: 700; }

.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

/* ─── PAGE SYSTEM ────────────────────────────────── */
html, body { height: 100%; }
body { display: flex; flex-direction: column; }

.page { display: none; flex: 1; }
.page.active { display: flex; flex-direction: column; }

/* Landing fills all remaining space below the header — no scroll */
#landing-section.active {
  overflow: hidden;
}

/* Mobile brands — hidden on desktop, shown on mobile */
.mobile-brands { display: none; }

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer {
  /* 48px at 1920px = 2.5vw, scales down with viewport */
  padding: clamp(20px, 2.5vw, 48px) var(--margin);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-copy {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 400;
}

/* ─── BRAND SIDEBAR ──────────────────────────────── */
.brand-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: calc(3 * var(--col) + 2 * var(--gutter) + var(--margin));
  height: 100vh;
  padding-top: clamp(80px, 8.33vw, 160px);
  padding-bottom: clamp(60px, 6.25vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 1.67vw, 32px);
  padding-left: clamp(24px, 2.08vw, 40px);
  z-index: 50;
  pointer-events: none;
  /* When viewport height is short, allow internal scroll so brands don't clip */
  overflow-y: auto;
  /* Hide scrollbar visually */
  scrollbar-width: none;
}
.brand-sidebar::-webkit-scrollbar { display: none; }

/* Cap brand item font so it never clips — scales down with viewport height */
.brand-item {
  font-family: var(--f-heading);
  font-weight: 800;
  /* 24px at 1920px = 1.25vw. Also cap by vh so tall lists don't overflow */
  font-size: clamp(12px, min(1.25vw, 2.2vh), 24px);
  line-height: 1.4;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Landing scrollable when viewport height is short (< 600px) */
@media (max-height: 600px) and (min-width: 769px) {
  #landing-section.active { overflow: visible; height: auto; }
  .brand-sidebar { position: absolute; }
}

/* ─── LANDING ────────────────────────────────────── */
.landing-body {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  /* Right padding reserves space for the fixed brand sidebar */
  padding-right: calc(3 * var(--col) + 2 * var(--gutter) + var(--margin));
}

.landing-content {
  margin-left: var(--margin);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-title {
  font-family: var(--f-heading);
  font-weight: 800;
  /* 150px at 1920px viewport = 7.8125vw */
  font-size: clamp(40px, 7.8125vw, 150px);
  /* 147px line-height at 1920px = 7.65625vw */
  line-height: clamp(39px, 7.65625vw, 147px);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.btn-take-quiz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 20px clamp(24px, 2.08vw, 40px);
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(13px, 0.833vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  margin-top: clamp(28px, 2.5vw, 48px);
  align-self: flex-start;
  min-width: 288px;
}
.btn-take-quiz:hover { background: #E8E85C; }

/* ─── QUIZ ───────────────────────────────────────── */
/*
  Desktop: flex row.
  Left col (4): title, independent height.
  Right col (6): progress bar (40px gap) then options then nav.
  quiz-progress-col sits at the top of the right column via flex column inside quiz-right-wrap.
  On mobile: order 1=progress, 2=title, 3=options+nav.
*/
.quiz-layout {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding-top: 32px;
  padding-bottom: 32px;
  min-height: 0;
}

/* Left margin via ::before */
.quiz-layout::before {
  content: '';
  width: var(--margin);
  flex-shrink: 0;
  display: block;
}

/* Title — 4 cols wide */
.quiz-left {
  width: calc(4 * var(--col) + 3 * var(--gutter));
  flex-shrink: 0;
  padding: 0 0 32px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: flex-start;
}

/* 1-col spacer */
.quiz-spacer {
  width: calc(var(--col) + var(--gutter));
  flex-shrink: 0;
}

/* Right col — 6 cols, flex column: progress → options → nav */
.quiz-right {
  width: calc(6 * var(--col) + 5 * var(--gutter));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  min-width: 0;
}

/* Progress col — first child of right col, always visible */
.quiz-progress-col {
  width: 100%;
  margin-bottom: 40px;
  display: block;
}

/* Progress bar — no rounded corners */
.progress-bar {
  height: 10px;
  background: var(--progress-bg);
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Question title: 74px / 86px at 1920px — fluid */
.quiz-question-title {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(28px, 3.854vw, 74px);
  line-height: clamp(32px, 4.479vw, 86px);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Hint: white, 24px below title on desktop, only on multi-select */
.quiz-question-hint {
  font-family: var(--f-body);
  font-size: 14px;
  color: #ffffff;
  margin-top: 24px;
  line-height: 1.5;
}

/* Option rows — 32px gap between cards, card bg, 8px radius */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-shrink: 0;
}

.option-row {
  display: flex;
  align-items: flex-start;
  padding: 20px 32px;
  border: 1px solid #d2d2d2;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: #222222;
  width: 100%;
  text-align: left;
  position: relative;
  transition: border-color 0.12s;
}

.option-row:focus { outline: none; }

.option-row.selected {
  background: #222222;
  border-color: #FFFF6B;
}

/* No left accent bar — border alone indicates selection */

.option-row.no-desc { align-items: center; }
.option-row-text { display: flex; flex-direction: column; }

/* Option title: Ubuntu Mono regular (not bold), 20px / 30px, white */
.option-label {
  font-family: 'Ubuntu Mono', 'Ubuntu', monospace;
  font-size: 20px;
  font-weight: 400;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 30px;
}

/* Selected: label turns yellow */
.option-row.selected .option-label { color: #FFFF6B; }

/* Sub text: 4px margin above, Open Sans 16px / 24px */
.option-desc {
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 24px;
  margin-top: 4px;
}

.option-row.selected .option-desc { color: rgba(255,255,107,0.7); }

/* Quiz nav — Restart far left, BACK+NEXT grouped right with 32px gap between them */
.quiz-nav {
  margin-top: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Desktop: nav-right always pushed to the right */
.quiz-nav-right { display: flex; align-items: center; gap: 32px; order: 2; margin-left: auto; }
.btn-restart-nav { order: 1; margin-left: 0; }

/* NEXT — grey filled rect when inactive, yellow when active, 365px desktop */
.btn-next {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(13px, 0.833vw, 16px);
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: default;
  pointer-events: none;
  padding: 20px 40px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  border-radius: 4px;
  width: clamp(160px, 19.01vw, 365px);
  text-align: center;
}

.btn-next.active {
  background: var(--accent);
  color: #1a1a1a;
  cursor: pointer;
  pointer-events: all;
}
.btn-next.active:hover { background: #E8E85C; }

/* BACK — always visible, plain uppercase text */
.btn-back-nav {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(13px, 0.833vw, 16px);
  letter-spacing: 0.1em;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px 0;
  text-transform: uppercase;
  transition: color 0.15s;
  visibility: visible !important;
}
.btn-back-nav:hover { color: var(--ink-mid); }

/* Restart — white, underlined, left side */
.btn-restart-nav {
  font-family: var(--f-body);
  font-size: 13px;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}
.btn-restart-nav:hover { color: var(--ink-mid); }

/* ─── RESULTS ────────────────────────────────────── */
.results-header {
  padding: 32px var(--margin) 0;
}

.results-title {
  font-family: var(--f-heading);
  font-weight: 800;
  /*
    Font must fit the content column: 100vw - 2*margin.
    At 1920px / 220px margins → 1480px content.
    "RECOMMENDATIONS" is the longest word.
    Use font-size relative to content width, not viewport width.
    Content width = 100vw - 2*var(--margin).
    We use a CSS custom property to compute a safe size.
    Approximation: 1 char ≈ 0.6em wide at this weight/tracking.
    "RECOMMENDATIONS" = 15 chars → font ≈ content-width / (15 * 0.58).
    At 1920px: 1480 / 8.7 ≈ 170px → clamp to 140px max.
    Drive via vw minus fixed margin offset.
  */
  font-size: clamp(20px, calc((100vw - 2 * var(--margin)) * 0.092), 140px);
  line-height: 1.05;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  /* Never overflow the content column */
  max-width: 100%;
  overflow: hidden;
}

.results-sub {
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--ink-muted);
  margin-top: 20px;
}

/* Shoe grid — uses margin */
.shoes-grid {
  padding: 56px var(--margin) 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Shoe card */
.shoe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.4s ease both;
  transition: border-color 0.2s, transform 0.2s;
}
.shoe-card:hover { border-color: rgba(255,255,107,0.3); transform: translateY(-3px); }

.shoe-img-area {
  height: 240px;
  background: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shoe-svg-render {
  width: 76%;
  max-width: 260px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}
.shoe-card:hover .shoe-svg-render { transform: translateY(-4px) scale(1.04); }

.shoe-img-real {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.shoe-card:hover .shoe-img-real { transform: scale(1.04); }

.shoe-detail-svg .shoe-img-real {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  border-radius: 2px;
}

.shoe-body { padding: 32px; display: flex; flex-direction: column; gap: 0; flex: 1; }

.shoe-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.shoe-brand {
  font-family: var(--f-body);
  font-size: clamp(14px, 1.25vw, 24px);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: clamp(16px, 1.35vw, 26px);
  margin-bottom: 4px;
}

.shoe-name {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(26px, 2.5vw, 48px);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 16px;
}

.shoe-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }

.shoe-tag {
  font-family: var(--f-body);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid;
  text-transform: uppercase;
}

.shoe-tag.indoor     { background: rgba(143,209,148,0.15); border-color: #4a9e50; color: #8fd694; }
.shoe-tag.sport      { background: rgba(255,100,80,0.15);  border-color: #cc4444; color: #ff8877; }
.shoe-tag.trad       { background: rgba(255,60,160,0.15);  border-color: #cc1a80; color: #ff50b8; }
.shoe-tag.boulder    { background: rgba(255,200,80,0.15);  border-color: #aa8020; color: #ffcc50; }
.shoe-tag.comp       { background: rgba(180,130,230,0.15); border-color: #8844bb; color: #cc99ff; }
.shoe-tag.multipitch { background: rgba(80,180,220,0.15);  border-color: #2277aa; color: #66bbee; }

.shoe-divider { height: 1px; background: #ffffff; margin: 24px 0; }

.shoe-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }

.spec-label {
  font-family: var(--f-field);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.spec-value {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.shoe-desc {
  font-family: var(--f-body);
  font-size: 13px;
  color: #ffffff;
  line-height: 1.6;
  margin-top: 24px;
}

.match-wrap { margin-top: auto; padding-top: 32px; }

.match-row { display: flex; justify-content: space-between; margin-bottom: 6px; }

.match-label-text {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #FFFF6B;
  text-transform: uppercase;
}

.match-pct {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.match-track { height: 6px; background: var(--progress-bg); border-radius: 0; overflow: hidden; }
.match-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
  width: 0;
  transition: width 1s cubic-bezier(0.4,0,0.2,1) 0.3s;
}

.results-footer {
  padding: 0 var(--margin) 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn-show-more {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(12px, 0.833vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 20px 40px;
  cursor: pointer;
  border-radius: 4px;
  min-width: 288px;
  text-align: center;
  transition: background 0.15s;
}
.btn-show-more:hover { background: #E8E85C; }
.btn-show-more[style*="display: none"],
.btn-show-more[style*="display:none"] { display: none !important; }

.btn-retake {
  font-family: var(--f-body);
  font-size: 13px;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}
.btn-retake:hover { color: var(--ink-mid); }

/* ─── TOP MATCH ──────────────────────────────────── */
.shoe-card.top-match {
  border-color: #FFFF6B;
}

.top-match-badge {
  display: inline-block;
  flex-shrink: 0;
  background: #FFFF6B;
  color: #1a1a1a;
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1400px) {
  :root { --margin: 80px; }
}
@media (max-width: 1100px) {
  :root { --margin: 40px; }
  .quiz-left { width: calc(var(--margin) + 4 * var(--col) + 3 * var(--gutter) + 40px); padding: 48px 40px; }
}

/* ── TABLET / MOBILE — 768px ── */
@media (max-width: 768px) {
  :root { --margin: 24px; }

  /* Header — centred logo, no right padding */
  header {
    padding-right: 0;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .header-inner { margin-left: 0; }

  /* Brand sidebar hidden — shown inline below button on mobile */
  .brand-sidebar { display: none !important; }

  /* Landing fills full viewport height on mobile — footer pinned to bottom */
  #landing-section.active {
    height: 100dvh;
    overflow: hidden;
  }

  .landing-body {
    flex-direction: column;
    padding-right: 0;
    padding: 24px var(--margin) 0;
    align-items: flex-start;
    flex: 1;
  }

  .landing-content {
    margin-left: 0;
    width: 100%;
  }

  .btn-take-quiz {
    min-width: 0;
    width: 100%;
    font-size: 16px;
  }

  /* Mobile brands — horizontal wrap below button, centred, 24px above footer divider */
  .mobile-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 40px;
    margin-bottom: 24px;
    justify-content: center;
    width: 100%;
  }

  .mobile-brands .brand-item {
    font-size: 16px;
    line-height: 24px;
    color: rgba(255,255,255,0.5);
  }

  /* H1 scales fluidly with viewport on mobile/tablet — fills the content column */
  .landing-title {
    font-size: clamp(40px, 16vw, 150px);
    line-height: clamp(38px, 15.5vw, 147px);
  }

  /* Quiz — flat flex column: progress(1) → title(2) → options+nav(3) */
  .quiz-layout {
    display: flex;
    flex-direction: column;
    padding: 0;
    align-items: stretch;
  }
  .quiz-layout::before { display: none; }
  .quiz-spacer { display: none; }

  /* quiz-right becomes transparent to layout — children are ordered directly */
  .quiz-right {
    display: contents;
  }

  /* 1: progress bar */
  .quiz-progress-col {
    order: 1;
    width: 100%;
    padding: 24px var(--margin) 0;
    margin-bottom: 0;
  }
  .progress-bar { margin-bottom: 0; }

  /* 2: title + hint — 40px below progress */
  .quiz-left {
    order: 2;
    width: 100%;
    flex-shrink: unset;
    align-self: unset;
    padding: 40px var(--margin) 4px;
    justify-content: flex-start;
  }
  .quiz-question-hint { margin-top: 16px; }

  /* 3: options list — 40px below title */
  .options-list {
    order: 3;
    gap: 16px;
    padding: 40px var(--margin) 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* 4: nav */
  .quiz-nav {
    order: 4;
    padding: 0 var(--margin) 32px;
    width: 100%;
    box-sizing: border-box;
  }

  .option-row {
    padding: 16px 20px;
    width: 100%;
    box-sizing: border-box;
  }
  .option-label { font-size: 16px; line-height: 24px; }
  .option-desc { font-size: 14px; line-height: 20px; }

  /* Nav full-width on mobile */
  .btn-show-more { width: 100%; min-width: 0; }

  /* Title scales fluidly on mobile */
  .quiz-question-title {
    font-size: clamp(28px, 8.5vw, 74px);
    line-height: clamp(32px, 9.5vw, 86px);
  }

  /* Nav: stacked on mobile — NEXT full width, BACK centred 16px below, Restart centred 40px below */
  .quiz-nav {
    flex-direction: column;
    align-items: center;
    margin-top: 32px;
    gap: 0;
  }
  /* quiz-nav-right: column with NEXT first via order */
  .quiz-nav-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    order: 1;
    margin-left: 0;
  }
  /* NEXT: full width, shown first */
  .btn-next {
    width: 100%;
    padding: 18px 20px;
    font-size: 14px;
    order: 1;
  }
  /* BACK: centred, 16px below NEXT */
  .btn-back-nav {
    font-size: 14px;
    padding: 16px 0 0 0;
    text-align: center;
    width: 100%;
    order: 2;
  }
  /* Restart: centred, 40px below BACK */
  #btn-restart {
    order: 2;
    margin-top: 40px;
    text-align: center;
    padding: 0;
    margin-left: 0;
  }

  /* Results */
  .results-header { padding: 16px var(--margin) 0; }
  /* results-title uses fluid clamp — no override needed on mobile */
  .shoes-grid { padding: 40px var(--margin) 48px; grid-template-columns: 1fr; gap: 16px; }
  .results-footer { padding: 0 var(--margin) 40px; }

  /* Footer centred on mobile — with divider and fluid 16px padding */
  .site-footer {
    justify-content: center;
    padding-left: var(--margin);
    padding-right: var(--margin);
    padding-top: clamp(16px, 3.125vw, 24px);
    padding-bottom: clamp(16px, 3.125vw, 24px);
    border-top: 1px solid #373737;
  }
}

/* ─── BRAND LINKS ─────────────────────────────────── */
.brand-link {
  cursor: pointer;
  pointer-events: all;
  transition: color 0.15s;
  text-decoration: none;
}
.brand-link:hover { color: #FFFF6B !important; }

/* ─── SHOE CARD CLICKABLE ────────────────────────── */
.shoe-card[role="button"] { cursor: pointer; }

/* ─── BRAND PAGE ─────────────────────────────────── */
.brand-page-header { padding-bottom: 8px; }

/* ── Brand breadcrumb ── */
.brand-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 40px;
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-muted);
}

/* ── Brand switcher panel — wider to fit brand names ── */
.brand-switcher-panel {
  min-width: 200px;
  left: 0;
  right: auto;
}

.brand-page-header .brand-subline {
  font-family: var(--f-body);
  font-size: 24px;
  line-height: 32px;
  color: #fff;
  margin-top: 24px;
  /* 10 col width on desktop */
  max-width: calc(10 * var(--col) + 9 * var(--gutter));
}

/* ── BRAND PAGE GRID — no extra top padding (sort bar handles spacing) ── */
#brand-section .shoes-grid {
  padding-top: 0;
}

/* ── BRAND CONTROL BAR (sort + filter) ── */
.brand-sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--margin);
  margin-top: 56px;
  margin-bottom: 24px;
}

/* ── Shared button style ── */
.bsb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: transparent;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  position: relative;
}
.bsb-btn:hover { border-color: #999; }

.bsb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--f-body);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

/* ── Filter wrap + panel ── */
.bsb-filter-wrap,
.bsb-sort-wrap {
  position: relative;
}

.filter-panel,
.sort-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 20px;
  z-index: 100;
  min-width: 260px;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.filter-panel.open,
.sort-panel.open { display: block; }

/* ── Filter sections ── */
.filter-section {
  margin-bottom: 18px;
}
.filter-section:last-of-type { margin-bottom: 12px; }

.filter-section-label {
  font-family: var(--f-field);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.filter-section .filter-chip:first-of-type { margin-top: 0; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  background: transparent;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  margin: 0 6px 8px 0;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.filter-chip:hover { border-color: #888; color: #fff; }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
}

.filter-clear {
  font-family: var(--f-body);
  font-size: 12px;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0 0;
  text-decoration: underline;
  transition: color 0.12s;
}
.filter-clear:hover { color: #ccc; }

/* ── Sort options ── */
.sort-option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 400;
  color: #ccc;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.sort-option:hover { background: #2a2a2a; color: #fff; }
.sort-option.active { color: var(--accent); font-weight: 600; }

/* ── No results message ── */
.brand-no-results {
  padding: 40px;
  color: var(--ink-muted);
  font-family: var(--f-body);
  font-size: 15px;
}

@media (max-width: 768px) {
  .brand-sort-bar {
    margin-top: 32px;
    gap: 8px;
  }
  .bsb-btn {
    font-size: 14px;
    padding: 9px 14px;
  }
  .filter-panel,
  .sort-panel {
    min-width: 220px;
  }
  .brand-page-header .brand-subline {
    font-size: clamp(13px, 3.5vw, 16px);
    line-height: clamp(20px, 5vw, 24px);
  }
}

@media (max-width: 1100px) {
  .brand-page-header .brand-subline {
    font-size: clamp(14px, 2vw, 20px);
    line-height: clamp(22px, 2.8vw, 28px);
  }
}

/* ─── SHOE DETAIL PAGE ───────────────────────────── */
.shoe-detail-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shoe-detail-layout {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--margin) 80px;
  flex: 1;
}

.shoe-detail-back {
  padding: 32px 0 24px;
}

.btn-detail-back {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-muted);
  transition: color 0.15s;
  padding: 0;
  letter-spacing: 0.04em;
}
.btn-detail-back:hover { color: var(--ink); }

.shoe-detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 40px 0 60px;
  border-bottom: 1px solid var(--border);
}

.shoe-detail-hero.no-image {
  grid-template-columns: 1fr;
}

.shoe-detail-svg {
  background: #444;
  border-radius: 4px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shoe-detail-hero.has-image .shoe-detail-svg {
  background: none;
  padding: 0;
  border-radius: 0;
}

.shoe-detail-svg .shoe-svg-render {
  width: 100%;
  max-width: 340px;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.5));
}

.shoe-detail-brand {
  font-family: var(--f-body);
  font-size: clamp(14px, 1.25vw, 24px);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: clamp(16px, 1.35vw, 26px);
  margin-bottom: 4px;
}

.shoe-detail-name {
  font-family: var(--f-heading);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 88px);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 20px;
}

.shoe-detail-desc {
  font-family: var(--f-body);
  font-size: 16px;
  color: #ffffff;
  line-height: 1.7;
  margin-top: 20px;
  margin-bottom: 24px;
}

.shoe-detail-price {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.shoe-detail-specs-section {
  padding: 48px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding-bottom: 48px;
}

.shoe-detail-section-title {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: clamp(12px, 0.833vw, 16px);
  letter-spacing: 0.12em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.shoe-detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 40px;
}

.shoe-detail-spec-item .spec-label {
  font-size: 9px;
  margin-bottom: 6px;
  color: var(--ink-muted);
}

.shoe-detail-spec-item .spec-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

/* Responsive shoe detail */
@media (max-width: 768px) {
  .shoe-detail-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0 40px;
  }
  .shoe-detail-svg { padding: 24px; }
  .shoe-detail-specs-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .shoe-detail-layout { padding: 0 var(--margin) 60px; }
}

@media (max-width: 480px) {
  .shoe-detail-specs-grid { grid-template-columns: 1fr; }
}

/* ─── BRAND PAGE OVERRIDES ───────────────────────────────────────────────────── */

/* Back to top — fixed sticky button, bottom-right */
.btn-back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFF6B;
  color: #1a1a1a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.btn-back-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.btn-back-top:hover { background: #E8E85C; }


/* ═══════════════════════════════════════════════════════════════════════════
   SHOE DETAIL v2  —  matches Figma layout (breadcrumb / perf-bars / fit / pc)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout wrapper ─────────────────────────────────────────────────────── */
.sd2-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 0;
  overflow: visible;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.sd2-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 32px 0 0;
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-muted);
}
.sd2-bread-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-muted);
  padding: 0;
  transition: color 0.15s;
}
.sd2-bread-btn:hover { color: var(--ink); }
.sd2-bread-sep { color: var(--ink-muted); opacity: 0.5; }
.sd2-bread-current { color: var(--ink-muted); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.sd2-hero {
  padding: 56px 0 40px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.sd2-hero-text { flex: 1; }
.sd2-hero-img  { flex: 0 0 auto; }
.sd2-hero-img img {
  width: clamp(160px, 30vw, 280px);
  object-fit: contain;
  display: block;
}

.sd2-hero-brand {
  font-family: var(--f-body);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.8);
  margin-bottom: 4px;
}
.sd2-hero-name {
  font-family: var(--f-heading);
  font-weight: 900;
  font-size: clamp(36px, 6vw, 72px);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin-bottom: 20px;
}
.sd2-hero-tags { margin-bottom: 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.sd2-hero-desc {
  font-family: var(--f-body);
  font-size: 15px;
  color: #ffffff;
  line-height: 1.65;
  margin-bottom: 20px;
}
.sd2-hero-price {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ── Performance row (perf card + best-for) ─────────────────────────────── */
.sd2-perf-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  margin-bottom: 0;
}

/* Perf card */
.sd2-perf-card {
  background: #333333;
  border-radius: 0;
  padding: 40px;
}

/* Tabs */
.sd2-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
}
.sd2-tab {
  background: #1D1D1D;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 9px 22px;
  margin-right: 10px;
  transition: background 0.15s, color 0.15s;
}
.sd2-tab:hover { color: var(--ink); }
.sd2-tab.active {
  background: var(--accent);
  color: #1a1a1a;
}

/* Tab panels */
.sd2-tab-panel { display: block; }
.sd2-hidden    { display: none !important; }

/* Rating bars — label + value on one row, full-width bar below */
.sd2-rating-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}
.sd2-rating-row:last-child { margin-bottom: 0; }
.sd2-rating-label {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 16px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--accent);
  flex-shrink: 0;
}
.sd2-rating-right {
  display: flex;
  align-items: center;
  gap: 0;
}
.sd2-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.sd2-rating-track {
  width: 100%;
  height: 6px;
  background: #222222;
  border-radius: 0;
  overflow: hidden;
}
.sd2-rating-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
  transition: width 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}
.sd2-rating-value {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 16px;
  line-height: 16px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  flex-shrink: 0;
}

/* Tech specs inside tab */
.sd2-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.sd2-spec-item .spec-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.sd2-spec-item .spec-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* Best For card */
.sd2-bestfor-card {
  background: #222222;
  border-radius: 0;
  padding: 40px;
}
.sd2-bestfor-title {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 24px;
}
.sd2-bestfor-list {
  list-style: disc;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sd2-bestfor-list li {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 22px;
  color: var(--ink);
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.sd2-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0 0;
}

/* ── Generic section ────────────────────────────────────────────────────── */
.sd2-section {
  padding: 56px 0 0;
}
.sd2-section-title {
  font-family: var(--f-heading);
  font-size: 24px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 24px;
}

/* ── Fit section ─────────────────────────────────────────────────────────── */
.sd2-fit-advice {
  font-family: var(--f-body);
  font-size: 14px;
  color: #ffffff;
  line-height: 1.65;
  margin-bottom: 28px;
}
.sd2-fit-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.sd2-fit-stat-range {
  font-family: var(--f-heading);
  font-size: 20px;
  line-height: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.sd2-fit-stat-label {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 18px;
  color: var(--accent);
  margin-bottom: 10px;
}
.sd2-fit-stat-note {
  font-family: var(--f-body);
  font-size: 14px;
  color: #ffffff;
  line-height: 1.6;
}

.sd2-fit-disclaimer {
  margin-top: 24px;
  font-family: var(--f-body);
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  font-style: italic;
}

/* ── Pros & Cons ─────────────────────────────────────────────────────────── */
.sd2-pc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sd2-pc-card {
  background: #222222;
  border-radius: 0;
  padding: 40px;
}
.sd2-pc-title {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
}
.sd2-pc-list {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sd2-pc-list li {
  font-family: var(--f-body);
  font-size: 14px;
  color: #ffffff;
  line-height: 1.55;
}

/* ── Alternatives ────────────────────────────────────────────────────────── */
.sd2-alt-section {
  margin-top: 56px;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #222222;
  padding: 56px calc((100vw - 760px) / 2 + 24px);
  box-sizing: border-box;
}
.sd2-alt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sd2-alt-card {
  background: transparent;
  border-radius: 4px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.18s ease;
  border: 1px solid #676767;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sd2-alt-card:hover {
  border-color: var(--accent);
}
.sd2-alt-brand {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.sd2-alt-name {
  font-family: var(--f-heading);
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 12px;
}
.sd2-alt-tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .sd2-layout { padding: 0 20px 0; }
  .sd2-perf-row { grid-template-columns: 1fr; gap: 0; }
  .sd2-hero { flex-direction: column-reverse; gap: 24px; }
  .sd2-hero-img img { width: 100%; max-width: 320px; }
  .sd2-hero-brand { font-size: 18px; }
  .sd2-alt-section { padding: 40px 20px; }
  .sd2-alt-grid { grid-template-columns: 1fr 1fr; }
  .sd2-pc-row { grid-template-columns: 1fr; }
  .sd2-fit-stats { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .sd2-hero-name { font-size: clamp(30px, 10vw, 52px); }
  .sd2-hero-brand { font-size: 15px; }
  .sd2-specs-grid { grid-template-columns: 1fr; }
  .sd2-alt-grid { grid-template-columns: 1fr; }
}
