/* FitML — shared styles. Quiet-luxury look: near-white grey page background,
   white cards (no border, soft shadow), a charcoal/near-black header bar
   (light text) and deep-charcoal buttons, a maroon accent used sparingly for
   selection states (active swatch ring, selected size pill, recommended
   badge, active nav link) — never for price text, which stays charcoal.
   Upright Playfair Display for editorial headlines, clean sans for UI
   chrome. Reserved blue/amber stay separate for the fit-confidence box.
   Mobile-first. */

:root {
  --border: #e6ded0;
  --border-strong: #d9cbb2;
  --text: #221d18;
  --text-muted: #8a7d6a;
  --bg: #f6f6f5;
  --surface: #ffffff;
  --accent: #1c1815;
  --accent-dark: #000000;
  --accent-soft: #ece2ce;
  --maroon: #5c1a24;
  --maroon-dark: #45131b;
  --maroon-soft: #f2dde0;
  --maroon-light: #d98fa0;
  --header-bg: #1c1815;
  --header-text: #f6f0e4;
  --header-text-muted: #b7b0a4;
  --blue-bg: #e6f0fb;
  --blue-border: #bcd7ff;
  --blue-text: #1746a2;
  --amber-bg: #fff8e6;
  --amber-border: #ffe2a8;
  --amber-text: #7a5b00;
  --label-color: #8a7d6a;
  --label-size: 12px;
  --label-tracking: 0.06em;
  --label-weight: 500;
  --price-color: var(--text);
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(38, 26, 14, 0.07);
  --shadow-md: 0 2px 10px rgba(38, 26, 14, 0.09);
  --shadow-hover: 0 10px 24px rgba(38, 26, 14, 0.15);
  --gap: 16px;
  --max-width: 1200px;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--header-bg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--header-text);
}
.brand:hover { text-decoration: none; }

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.main-nav {
  display: none;
  gap: 20px;
  align-items: center;
}

.main-nav a {
  color: var(--header-text-muted);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  transition: color 0.12s ease;
}
.main-nav a:hover { color: var(--header-text); }
.nav-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--header-text-muted);
  transition: color 0.12s ease;
}
.nav-search-toggle:hover { color: var(--header-text); }

.main-nav a.active {
  color: var(--header-text-muted);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.nav-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: none;
  color: var(--header-text);
  border-radius: var(--radius);
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.nav-search-wrap {
  display: inline-flex;
  align-items: center;
}
.nav-search-inline {
  display: none;
  align-items: center;
  gap: 6px;
}
.nav-search-wrap.open .nav-search-toggle { display: none; }
.nav-search-wrap.open .nav-search-inline { display: flex; }
.nav-search-inline input {
  width: 140px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  padding: 4px 2px;
  background: none;
  color: var(--header-text);
}
.nav-search-inline input::placeholder { color: var(--header-text-muted); }
.nav-search-inline input:focus { outline: none; border-bottom-color: var(--header-text); }
.nav-search-inline .search-close {
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--header-text-muted);
  padding: 4px;
}
.nav-search-inline .search-close:hover { color: var(--header-text); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 8px 16px 16px;
}
.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 10px 0;
  color: var(--header-text-muted);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.active { color: var(--header-text-muted); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 768px) {
  .main-nav { display: flex; align-items: center; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-bottom: 28px;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-col h4 {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  margin: 0 0 12px;
}
.footer-col a {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 8px;
}
.footer-col p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

main { flex: 1; }

/* ------------------------------------------------------------------ card */

.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

/* ---------------------------------------------------------------- button */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover {
  border-color: var(--text-muted);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------------------------------------------------ hero */

.hero {
  text-align: center;
  padding: 56px 16px 44px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.hero p.tagline {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 26px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .hero h1 { font-size: 50px; }
}

/* ------------------------------------------------------------ feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 4px 0 48px;
}

@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

.feature-card {
  text-align: left;
  padding: 16px;
}
.feature-card .icon {
  color: var(--accent);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.feature-card .icon svg { width: 24px; height: 24px; display: block; }
.feature-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.feature-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }


/* --------------------------------------------------------------- sections */

.section {
  padding: 16px 0 32px;
}
.section h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.section p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.section-list {
  margin: 10px 0 0;
  padding-left: 20px;
}
.section-list li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 5px;
}
.section + .section {
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------- about bands */

.about-band { background: var(--bg); }
.about-band-alt { background: var(--surface); }
.about-band .section { padding: 40px 0; }
.about-band .section + .section { border-top: none; }

.pull-stat {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.pull-stat-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--maroon);
  line-height: 1;
}
.pull-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
}
@media (min-width: 768px) {
  .pull-stat-num { font-size: 30px; }
}

/* ----------------------------------------------------------------- forms */

.profile-section {
  max-width: 720px;
  margin: 0 auto;
}
.profile-section h2 { font-size: 18px; margin-bottom: 6px; }
.profile-section > p { font-size: 12.5px; margin: 0 0 16px; }
.profile-section .field label { font-size: 12px; }
.profile-section .field input,
.profile-section .field select { font-size: 13px; min-height: 44px; }
.profile-section .hint { font-size: 11.5px; }
.profile-section .btn { font-size: 13px; padding: 8px 16px; min-height: 44px; }
.profile-section .consent-note { font-size: 11.5px; }

.form-section {
  border: none;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
.form-section legend {
  display: block;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  width: 100%;
  padding-bottom: 5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

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

.field {
  margin-bottom: 10px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.field .hint {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.field-row.two-col { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) {
  .field-row { gap: 14px; }
  .field-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
}

.toggle-group {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 12px;
}
.toggle-group button {
  border: none;
  background: var(--surface);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  color: var(--text-muted);
}
.toggle-group button.active {
  background: var(--accent);
  color: #fff;
}

.unit-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  margin-left: 8px;
  vertical-align: middle;
}
.unit-toggle button {
  border: none;
  background: var(--surface);
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.unit-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.photo-upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.photo-upload-actions .btn { flex: 1 1 auto; min-width: 140px; }
.file-drop input[type="file"] { display: none; }

.checkbox-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.checkbox-row input { margin: 0; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
.checkbox-row label { display: inline; font-size: 13px; font-weight: 400; margin: 0; }

.file-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  background: var(--bg);
}
.file-drop img.preview {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius);
  margin-top: 12px;
}

.error-text {
  color: #b42318;
  font-size: 13px;
  margin-top: 8px;
}
.success-text {
  color: #067647;
  font-size: 13px;
  margin-top: 8px;
}

.consent-note {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 10px;
}

.accordion-section + .checkbox-row,
.accordion-section + .consent-note {
  margin-top: 12px;
}

/* --------------------------------------------------------------- catalog */

.catalog-layout {
  padding: 20px 0 48px;
}

.category-tabs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 11px;
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--label-color);
  cursor: pointer;
  flex-shrink: 0;
}
.category-tab.active {
  color: var(--text);
  font-weight: 700;
  border-bottom: 2px solid var(--text);
}

.catalog-gender-nav {
  display: flex;
  gap: 18px;
  padding: 12px 16px;
}
.gender-tab {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  cursor: pointer;
}
.gender-tab.active { color: var(--text); }

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.filter-order-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  text-decoration: underline;
}
.item-count {
  font-size: 12px;
  color: var(--text-muted);
}

.density-toggle {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 3px;
}
.density-btn {
  border: none;
  background: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}
.density-btn svg { width: 15px; height: 15px; }
.density-btn:hover { background: var(--bg); }
.density-btn.active { background: var(--accent-soft); color: var(--accent); }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1280px) {
  .catalog-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (min-width: 640px) {
  .catalog-grid.density-1 { grid-template-columns: repeat(1, 1fr) !important; }
  .catalog-grid.density-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .catalog-grid.density-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .catalog-grid.density-1 .item-card { max-width: 420px; margin: 0 auto; width: 100%; }
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.item-card .thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;
}
.item-card .thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  box-sizing: border-box;
}
.item-card .thumb-wrap.showing-cutout .thumb {
  padding: 6%;
  background: transparent;
}
.wishlist-heart {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.wishlist-heart.active { color: #c0392b; }
.item-card .item-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.item-card .brand-name {
  font-size: 11px;
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
}
.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.item-card .product-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) {
  .item-card .product-name { -webkit-line-clamp: 1; }
}
.item-card .fabric-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.item-card .price {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--price-color);
}
.item-card .price-was {
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
  margin-right: 6px;
}
.expand-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.expand-btn:hover { background: var(--bg); }

.details-panel {
  border-top: 1px solid var(--border);
  padding: 4px 12px 12px;
}
.item-info .details-panel { margin-top: 24px; padding: 4px 0 12px; }
.details-fixed { padding: 10px 2px 4px; }
.details-fixed h4 {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  margin: 0 0 8px;
}
.details-panel .accordion-panel-inner p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 8px;
}
.details-panel .accordion-panel-inner p:last-child { margin-bottom: 0; }

.size-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.size-chart-table th, .size-chart-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.size-chart-table th {
  color: var(--label-color);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: var(--label-tracking);
}
.item-card .size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}
.chip {
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text-muted);
}
/* Item-page "Sizes" chips are buttons that select the size (kept in sync
   with the main pill row) */
button.size-chip { cursor: pointer; font-family: inherit; padding: 4px 10px; }
button.size-chip:hover { border-color: var(--text-muted); }
button.size-chip.active {
  background: var(--maroon-soft);
  border-color: var(--maroon);
  color: var(--maroon);
}
.item-card .btn { margin-top: 8px; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

/* ------------------------------------------------------------ swatch dots */

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.swatch-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--swatch-color, #ccc);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.swatch-dot.active { box-shadow: 0 0 0 2px var(--maroon); }

/* ------------------------------------------------------- filter drawer */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
  display: none;
}
.drawer-overlay.open { display: block; }

.filters-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 400px;
  background: var(--surface);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.15);
}
.filters-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.drawer-header .drawer-close {
  border: none;
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 20px;
}

.drawer-footer {
  flex-shrink: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.drawer-footer .clear-filters-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 12px 0 0;
}

.accordion-section {
  border-bottom: 1px solid var(--border);
}
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 14px 0;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  cursor: pointer;
}
.accordion-header .chev { color: var(--text-muted); transition: transform 0.2s ease; font-size: 11px; }
.accordion-section.open .accordion-header .chev { transform: rotate(180deg); }

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.accordion-section.open .accordion-panel { max-height: 600px; }
.accordion-panel-inner { padding: 2px 0 16px; }

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 5px 0;
  cursor: pointer;
}
.radio-line input { accent-color: var(--accent); }

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.pill.active {
  background: var(--maroon-soft);
  border-color: var(--maroon);
  color: var(--maroon);
}

.drawer-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: none;
  text-align: left;
}
.color-option:hover { background: var(--bg); }
.color-option.selected {
  background: var(--maroon-soft);
  border-color: var(--maroon);
  color: var(--maroon);
}
.color-option .swatch-box {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--swatch-color, #ccc);
  box-shadow: 0 0 0 1px var(--border-strong);
  flex-shrink: 0;
}

.price-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.price-range-inputs input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}

/* ------------------------------------------------------------- utilities */

.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.loading { color: var(--text-muted); padding: 32px; text-align: center; }

/* -------------------------------------------------------------- item detail */

.item-detail { padding: 20px 0 56px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
}
.back-link:hover { border-color: var(--border-strong); background: var(--accent-soft); }
.item-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 900px) {
  .item-detail-grid { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
}

.item-hero-wrap {
  position: relative;
  background: #ffffff;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.item-hero-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6%;
  box-sizing: border-box;
}
.item-hero-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 251, 250, 0.85);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.item-swatch-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.item-info .brand-name {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
}
.item-info h1 { font-size: 21px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -0.01em; }
.item-info .price { font-size: 17px; font-weight: 700; color: var(--price-color); margin-bottom: 12px; }
.item-info .meta-line { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.item-info .description { font-size: 13.5px; line-height: 1.6; margin: 14px 0; color: var(--text); }

.size-select-label {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  margin: 16px 0 8px;
  display: block;
}
.size-pill-row { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.size-pill { position: relative; }
.size-pill.recommended::after {
  content: "Recommended";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.confidence-box {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.55;
}
.confidence-box.blue { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue-text); }
.confidence-box.amber { background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber-text); }
.confidence-box strong { font-weight: 700; }

.advice-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.advice-block h3 {
  font-size: var(--label-size);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
  font-weight: var(--label-weight);
  margin: 0 0 10px;
}
.advice-block p { font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }

.no-profile-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}
.no-profile-note a { font-weight: 600; }

.item-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.item-actions .btn { flex: 1 1 auto; min-width: 160px; }

/* ------------------------------------------------------------------ history */

.history-layout { padding: 20px 0 56px; }
.history-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.history-subtitle { font-size: 13.5px; margin: 0 0 18px; }
.history-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .history-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .history-grid { grid-template-columns: repeat(3, 1fr); } }

.history-card { display: flex; gap: 14px; padding: 14px; }
.history-card img {
  width: 84px;
  height: 104px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
  flex-shrink: 0;
}
.history-card .history-body { flex: 1; min-width: 0; }
.history-card .history-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: var(--label-color);
}
.history-card .history-name { font-size: 13.5px; font-weight: 600; margin: 2px 0 4px; line-height: 1.3; }
.history-card .history-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.history-card .history-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.history-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.history-badge.blue { background: var(--blue-bg); color: var(--blue-text); }
.history-badge.amber { background: var(--amber-bg); color: var(--amber-text); }
.history-card .history-actions { margin-top: 8px; }
.history-card .history-actions a { font-size: 12px; font-weight: 600; }
