/* Measurement-first shopping: shopping bar, fit badges, measurement profiles, size chart. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Shopping-for bar (listings) ---------- */
.fit-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  padding: 14px 20px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--black) 0%, var(--charcoal) 100%);
  color: var(--ivory); border: 1px solid rgba(201,162,75,0.35); border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
}
.fit-bar__who { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-width: 0; }
.fit-bar__icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(201,162,75,0.16); color: var(--gold-soft);
}
.fit-bar__eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.fit-bar__name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--white); }
.fit-bar__meta { font-size: 13px; color: var(--gold-soft); }
.fit-bar__switch select {
  padding: 7px 30px 7px 12px; border-radius: 999px; border: 1px solid rgba(201,162,75,0.45);
  background: rgba(255,255,255,0.06); color: var(--ivory); font: inherit; font-size: 13px; cursor: pointer; max-width: 100%;
}
.fit-bar__switch select option { color: var(--charcoal); }
.fit-bar__change { font-size: 13px; color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.fit-bar__change:hover { color: var(--gold); }

.fit-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ivory); white-space: nowrap; }
.fit-toggle__track {
  position: relative; width: 42px; height: 24px; border-radius: 999px; flex: 0 0 42px;
  background: rgba(255,255,255,0.18); transition: background .2s var(--ease);
}
.fit-toggle__thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ivory); transition: transform .2s var(--ease);
}
.fit-toggle.is-on .fit-toggle__track { background: var(--gold); }
.fit-toggle.is-on .fit-toggle__thumb { transform: translateX(18px); background: var(--black); }
.fit-toggle:hover .fit-toggle__track { box-shadow: 0 0 0 3px rgba(201,162,75,0.25); }

.fit-subnote { margin: -12px 0 20px; font-size: 13px; color: var(--muted); }
.fit-subnote a { color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Prompt banner (no profile yet) ---------- */
.fit-prompt {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding: 18px 52px 18px 22px; margin-bottom: 22px;
  background: var(--champagne); border: 1px solid rgba(201,162,75,0.4); border-left: 4px solid var(--gold);
  border-radius: var(--radius-m);
}
.fit-prompt__text { flex: 1 1 260px; min-width: 0; }
.fit-prompt__title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.fit-prompt__sub { font-size: 14px; color: var(--muted); }
.fit-prompt__close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); font-size: 20px; line-height: 1;
}
.fit-prompt__close:hover { background: rgba(201,162,75,0.18); color: var(--text); }

.fit-notice {
  padding: 12px 16px; margin-bottom: 18px; border-radius: var(--radius-s);
  background: rgba(63,138,91,0.1); border: 1px solid rgba(63,138,91,0.35); color: var(--success); font-size: 14px; font-weight: 600;
}

/* ---------- Fit badge on product cards ---------- */
.fit-chip {
  position: absolute; left: 12px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 24px);
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 14px rgba(20,18,15,0.18);
}
.fit-chip.is-fit { background: var(--black); color: var(--gold-soft); border: 1px solid rgba(201,162,75,0.6); }
.fit-chip.is-custom { background: rgba(250,247,241,0.95); color: var(--gold-deep); border: 1px solid var(--gold); }
.fit-chip.is-free { background: rgba(255,255,255,0.95); color: var(--charcoal); border: 1px solid var(--line); }
.fit-chip svg { flex: 0 0 auto; }

.fit-empty-tailor { margin-top: 10px; font-size: 14px; color: var(--muted); }
.fit-empty-tailor a { color: var(--gold-deep); font-weight: 700; }

/* ---------- Measurement pages ---------- */
.mm-shell { max-width: var(--container); margin: 0 auto; padding: 32px 28px 64px; }
.mm-breadcrumb { display: flex; gap: 8px; margin-bottom: 22px; font-size: 14px; color: var(--muted); }
.mm-breadcrumb a:hover { color: var(--gold); }
.mm-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.mm-eyebrow { font-size: 13px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.mm-hero h1 { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: var(--text); line-height: 1.15; margin-bottom: 6px; }
.mm-hero p { color: var(--muted); font-size: 15px; max-width: 640px; line-height: 1.6; }

.mm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-s); font-weight: 700; font-size: 14px; font-family: inherit;
  cursor: pointer; border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  text-decoration: none; white-space: nowrap;
}
.mm-btn--gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%); color: var(--black); }
.mm-btn--gold:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(201,162,75,0.35); }
.mm-btn--dark { background: var(--black); color: var(--gold-soft); }
.mm-btn--dark:hover { transform: translateY(-1px); }
.mm-btn--ghost { background: var(--surface-solid); color: var(--text); border-color: var(--line); }
.mm-btn--ghost:hover { border-color: var(--gold); background: var(--champagne); }
.mm-btn--sm { padding: 7px 13px; font-size: 12.5px; }
.mm-btn--danger { color: var(--danger); }
.mm-btn--danger:hover { border-color: var(--danger); background: rgba(196,74,63,0.07); }

.mm-alert { padding: 14px 18px; border-radius: var(--radius-s); margin-bottom: 20px; font-size: 14px; }
.mm-alert--info { background: var(--champagne); border: 1px solid rgba(201,162,75,0.4); color: var(--text); }
.mm-alert--error { background: rgba(196,74,63,0.08); border: 1px solid rgba(196,74,63,0.35); color: var(--danger); }
.mm-alert ul { margin: 6px 0 0 18px; list-style: disc; }

.mm-guest {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; margin-bottom: 26px; border-radius: var(--radius-m);
  background: var(--surface-solid); border: 1px dashed rgba(201,162,75,0.6);
}
.mm-guest strong { font-family: var(--font-display); font-size: 17px; }
.mm-guest p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 36px; }
.mm-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 22px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft); transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.mm-card:hover { border-color: rgba(201,162,75,0.5); }
.mm-card.is-active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-soft); }
.mm-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mm-card__name { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); word-break: break-word; }
.mm-card__meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mm-size {
  flex: 0 0 auto; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 50%;
  display: grid; place-items: center; background: var(--black); color: var(--gold-soft);
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.mm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-tag { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--champagne); color: var(--gold-deep); }
.mm-tag--dark { background: var(--black); color: var(--gold-soft); }
.mm-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mm-value { padding: 8px 10px; border-radius: var(--radius-s); background: var(--bg); border: 1px solid var(--line); }
.mm-value span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mm-value strong { font-size: 15px; color: var(--text); }
.mm-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.mm-card__actions form { display: inline; }
.mm-card--add {
  align-items: center; justify-content: center; text-align: center; min-height: 220px;
  border-style: dashed; border-color: rgba(201,162,75,0.55); background: var(--champagne); box-shadow: none; color: var(--gold-deep);
}
.mm-card--add:hover { transform: translateY(-2px); }
.mm-card--add .plus { font-size: 34px; line-height: 1; font-family: var(--font-display); }

/* Form */
.mm-form-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.mm-panel { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; box-shadow: var(--shadow-soft); min-width: 0; }
.mm-section + .mm-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.mm-section__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mm-step { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--gold-soft); font-family: var(--font-body); font-size: 12px; font-weight: 700; }
.mm-section__hint { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.mm-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.mm-label small { font-weight: 500; color: var(--muted); }
.mm-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.mm-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,0.18); }
.mm-input.is-invalid { border-color: var(--danger); }
.mm-error { display: block; color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.mm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mm-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mm-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-seg label { position: relative; flex: 1 1 0; min-width: 88px; cursor: pointer; }
.mm-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mm-seg span {
  display: block; text-align: center; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 600; color: var(--text);
  transition: all .15s var(--ease);
}
.mm-seg span small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.mm-seg input:checked + span { background: var(--black); border-color: var(--black); color: var(--gold-soft); }
.mm-seg input:checked + span small { color: var(--gold-soft); opacity: .85; }
.mm-seg input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.mm-quick { padding: 16px; border-radius: var(--radius-s); background: var(--champagne); border: 1px dashed rgba(201,162,75,0.55); }
.mm-quick__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.mm-quick__head strong { font-size: 14px; }
.mm-approx { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
.mm-quick__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-quick__btns button {
  min-width: 58px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--gold); background: var(--surface-solid);
  color: var(--text); font-weight: 700; font-size: 13px;
}
.mm-quick__btns button small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.mm-quick__btns button:hover, .mm-quick__btns button.is-picked { background: var(--black); color: var(--gold-soft); border-color: var(--black); }
.mm-quick__note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.mm-unit { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.mm-unit label { cursor: pointer; }
.mm-unit input { position: absolute; opacity: 0; pointer-events: none; }
.mm-unit span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mm-unit input:checked + span { background: var(--black); color: var(--gold-soft); }
.mm-unit input:focus-visible + span { outline: 2px solid var(--gold-deep); }
.mm-measure-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }

.mm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mm-field__wrap { position: relative; }
.mm-field__wrap .mm-input { padding-right: 46px; }
.mm-field__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); pointer-events: none; }
.mm-num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%;
  background: var(--gold); color: var(--black); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.mm-field.is-focus .mm-num { background: var(--black); color: var(--gold-soft); }

.mm-check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.mm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Guide */
.mm-guide { position: sticky; top: 100px; }
.mm-guide h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mm-guide__sub { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.mm-figure { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 14px; color: var(--text); }
.mm-figure .body { fill: var(--champagne); stroke: var(--gold-deep); stroke-width: 1.5; }
.mm-figure .tape { stroke: var(--gold-deep); stroke-width: 1.6; stroke-dasharray: 4 3; fill: none; }
.mm-figure .pt circle { fill: var(--gold); stroke: var(--black); stroke-width: 1; transition: fill .15s; }
.mm-figure .pt text { font: 700 10px var(--font-body); fill: var(--black); text-anchor: middle; dominant-baseline: central; }
.mm-figure .pt.is-on circle { fill: var(--black); }
.mm-figure .pt.is-on text { fill: var(--gold-soft); }
.mm-guide__list { display: grid; gap: 10px; }
.mm-guide__item { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-s); font-size: 13.5px; line-height: 1.5; color: var(--muted); transition: background .15s; }
.mm-guide__item strong { color: var(--text); display: block; }
.mm-guide__item.is-on { background: var(--champagne); }
.mm-guide__tips { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mm-guide__tips ul { margin: 6px 0 0 18px; list-style: disc; }

/* ---------- Product page: fit + size chart ---------- */
.pd-fit { margin-bottom: 1.75rem; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); }
.pd-fit__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pd-fit__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text); }
.pd-fit__for { font-size: 13px; color: var(--muted); }
.pd-fit__for a { color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pd-callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.pd-callout strong { display: block; font-size: 15px; }
.pd-callout--fit { background: var(--black); color: var(--gold-soft); }
.pd-callout--fit strong { color: var(--white); }
.pd-callout--warn { background: var(--champagne); color: var(--text); border: 1px solid rgba(201,162,75,0.45); }
.pd-callout--muted { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pd-callout a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.pd-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.pd-size { position: relative; cursor: pointer; }
.pd-size input { position: absolute; opacity: 0; pointer-events: none; }
.pd-size span {
  display: grid; place-items: center; min-width: 54px; height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-solid); font-weight: 700; font-size: 14px; color: var(--text);
  transition: all .15s var(--ease);
}
.pd-size.is-rec span { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.pd-size.is-rec::after {
  content: 'Your fit'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 999px; background: var(--gold); color: var(--black); font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.pd-size.is-nofit span { color: var(--muted); background: var(--bg); }
.pd-size.is-oos span { text-decoration: line-through; opacity: .5; cursor: not-allowed; }
.pd-size input:checked + span { background: var(--black); border-color: var(--black); color: var(--gold-soft); }
.pd-size input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.pd-size-note { font-size: 13px; color: var(--muted); min-height: 1.2em; margin-bottom: 14px; }

.pd-chart-wrap { margin-top: 6px; }
.pd-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pd-chart-head h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
.pd-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.pd-chart { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 420px; }
.pd-chart th, .pd-chart td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pd-chart th { background: var(--bg); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.pd-chart td:first-child, .pd-chart th:first-child { text-align: left; font-weight: 700; color: var(--text); }
.pd-chart tr:last-child td { border-bottom: 0; }
.pd-chart tr.is-rec td { background: rgba(201,162,75,0.14); }
.pd-chart tr.is-nofit td { color: var(--muted); }
.pd-chart .pd-chart__fit { text-align: left; white-space: normal; min-width: 150px; font-size: 12.5px; }
.pd-chart .ok { color: var(--success); font-weight: 700; }
.pd-chart .no { color: var(--danger); }

.pd-tailor {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-top: 14px; border-radius: 10px; background: var(--champagne); border: 1px dashed var(--gold);
}
.pd-tailor strong { font-family: var(--font-display); font-size: 16px; color: var(--text); }
.pd-tailor p { font-size: 13px; color: var(--muted); }

.pd-tryon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 1rem 1.25rem;
  border-radius: 8px; border: 2px solid var(--black); color: var(--black); background: transparent; font-weight: 600; white-space: nowrap;
}
.pd-tryon:hover { background: var(--black); color: var(--gold-soft); }
body[data-theme="dark"] .pd-tryon { border-color: var(--gold); color: var(--gold-soft); }

/* Listing hero (products/category): let grid children shrink on phones. */
.category-hero > *, .hero-search-mini input { min-width: 0; }
.product-card .product-price { flex-wrap: wrap; row-gap: 2px; }
.product-card { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .mm-form-layout { grid-template-columns: 1fr; }
  .mm-guide { position: static; }
}
@media (max-width: 600px) {
  .mm-shell { padding: 20px 16px 48px; }
  .mm-hero h1 { font-size: 28px; }
  .mm-panel { padding: 18px; }
  .mm-row, .mm-row--3, .mm-fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mm-row--3 > :first-child { grid-column: 1 / -1; }
  .fit-bar { padding: 14px 16px; }
  .fit-toggle { white-space: normal; }
  .fit-chip { font-size: 10.5px; padding: 4px 9px; left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
}
@media (max-width: 380px) {
  .mm-fields { grid-template-columns: 1fr; }
}
