/* ── mouthpiececomparator.com — shared styles ── */

:root {
  --brass: #B87333;
  --brass-l: #FFF3E4;
  --brass-d: #8B5520;
  --brass-b: #E8C48A;
  --blue: #2E6DA4;
  --blue-l: #EAF2FA;
  --blue-d: #1B4A72;
  --green: #2E7D52;
  --green-l: #EAF4EE;
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --surface2: #FAF9F7;
  --border: #E4E0D6;
  --border2: #D4CFBF;
  --text: #1A1916;
  --muted: #555147;
  --faint: #EDEBE4;
  --red: #B03C3C;
  --red-l: #FDEAEA;
  --radius: 10px;
  --radius-lg: 14px;

  /*
   * Layout width — one primary column for the whole app (same as /compare main).
   * Blog stays narrower for reading. Compare tool uses --content-compare-shell for chip + panel row.
   */
  --content-max-width: 1280px;
  --content-compare-wide: 1280px; /* alias for compare templates */
  --content-compare-shell: 1260px;
  --content-compare-panels: 900px;
  --content-narrow-form: 540px; /* centered column inside wide main (e.g. photo ID) */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 15px; font-weight: 600; letter-spacing: -.4px; text-decoration: none; color: var(--text); }
.logo em { color: var(--brass); font-style: normal; }

header nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-link {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: .15s;
  text-decoration: none;
}
.nav-link:hover { background: var(--faint); color: var(--text); }
.nav-link.active { color: var(--brass); font-weight: 500; }

.nav-auth-login[hidden],
.nav-user-chip[hidden] { display: none !important; }

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--brass);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  transition: background 0.15s, box-shadow 0.15s;
}
.nav-user-chip:hover { background: var(--brass-d); color: #fff; }
.nav-user-chip.active { box-shadow: 0 0 0 2px var(--brass), 0 0 0 3px var(--surface); }
.nav-user-initial { line-height: 1; user-select: none; }

/* ── INSTRUMENT SELECTOR (header) ── */
.inst-selector {
  position: relative;
  margin-left: 10px;
  margin-right: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.inst-selector-btn {
  display: flex; align-items: center; gap: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  padding: 5px 10px 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--faint);
  color: var(--brass); cursor: pointer; transition: .15s;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.inst-selector-btn:hover { background: var(--brass-l); border-color: var(--brass-b); }
.inst-selector-btn svg { flex-shrink: 0; }
.inst-selector-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 150;
  min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px 0; max-height: 320px; overflow-y: auto;
}
.inst-selector-dropdown.open { display: flex; flex-direction: column; }
.inst-selector-item {
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 9px 16px; border: none; background: none; text-align: left;
  color: var(--text); cursor: pointer; transition: .1s;
}
.inst-selector-item:hover { background: var(--brass-l); }
.inst-selector-item.active { color: var(--brass); font-weight: 600; }

/* ── LENGTH UNIT (sliding toggle: one label — mm or in) ── */
.length-unit-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
}
.length-unit-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}
.length-unit-switch:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 14px;
}
.length-unit-switch__track {
  position: relative;
  width: 64px;
  height: 26px;
  border-radius: 13px;
  background: var(--faint);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.length-unit-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 3px);
  height: calc(100% - 4px);
  border-radius: 10px;
  background: var(--brass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: left 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}
.length-unit-switch--in .length-unit-switch__thumb {
  left: calc(50% + 1px);
}
.length-unit-switch__label {
  user-select: none;
  white-space: nowrap;
}

/* ── INSTRUMENT TABS ── */
.inst-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.inst-tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: .15s;
  white-space: nowrap;
}
.inst-tab:hover { color: var(--text); }
.inst-tab.active { color: var(--brass); border-bottom-color: var(--brass); }

/* ── PILL INSTRUMENT TABS (compare page style) ── */
.inst-pills { display: flex; gap: 6px; }
.inst-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
button.inst-pill {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  line-height: inherit;
}
a.inst-pill { text-decoration: none; display: inline-block; }
.inst-pill.active { background: var(--brass); border-color: var(--brass); color: #fff; }
.inst-pill:hover:not(.active) { background: var(--faint); color: var(--text); }

/* ── USE TAGS ── */
.use-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--faint);
  color: var(--muted);
}

/* ── BUTTONS ── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: .15s;
  text-decoration: none;
}
a.btn { display: inline-block; text-align: center; }
.btn:hover { background: var(--faint); }
.btn-primary { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn-primary:hover { background: var(--brass-d); }
.btn-outline { border-color: var(--brass); color: var(--brass); background: transparent; }
.btn-outline:hover { background: var(--brass-l); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── INPUTS / SELECTS ── */
.form-input, .form-select {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--faint);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus { border-color: var(--brass); }
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7567' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

/* ── LOADING SPINNER ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--faint);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MONO FONT ── */
.mono { font-family: 'DM Mono', monospace; }

/* ── MOBILE HAMBURGER ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
}
.nav-hamburger svg { display: block; }

@media (max-width: 700px) {
  .nav-right { display: none; position: fixed; top: 56px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px 24px 16px; gap: 4px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
  .nav-right.open { display: flex; }
  .nav-link { padding: 10px 0; font-size: 15px; }
  .nav-hamburger { display: block; }
  .inst-selector { margin-left: 6px; gap: 6px; }
  .inst-selector-btn { font-size: 11px; padding: 4px 8px 4px 10px; }
  .length-unit-toggle { font-size: 11px; }
}

/* ── SITE FOOTER ── */
.site-footer {
  text-align: center;
  padding: 28px 24px 32px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer p { margin: 0 0 12px; line-height: 1.5; }
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
}
.site-footer-nav a { color: var(--muted); text-decoration: none; transition: color .15s; }
.site-footer-nav a:hover { color: var(--brass); }
.sf-sep { opacity: 0.45; user-select: none; }

/* ── MOUTHPIECE DNA CARD ── */
.dna-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-size: 12px; }
.dna-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--faint); }
.dna-name { font-size: 15px; font-weight: 600; letter-spacing: -.3px; }
.dna-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dna-specs { padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; border-bottom: 1px solid var(--faint); }
.dna-spec { display: flex; flex-direction: column; gap: 3px; }
.dna-spec-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 500; }
.dna-spec-val { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; }
.dna-bar { height: 3px; background: var(--faint); border-radius: 2px; overflow: hidden; }
.dna-bar-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.dna-radar-mini { padding: 10px 16px; display: flex; flex-direction: column; gap: 5px; border-bottom: 1px solid var(--faint); }
.dna-score-row { display: flex; align-items: center; gap: 6px; }
.dna-score-label { font-size: 10px; width: 60px; flex-shrink: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.dna-score-bar { flex: 1; height: 4px; background: var(--faint); border-radius: 2px; overflow: hidden; }
.dna-score-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.dna-score-val { font-family: 'DM Mono', monospace; font-size: 10px; width: 18px; text-align: right; color: var(--muted); }
.dna-actions { padding: 10px 16px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── SKIP-TO-CONTENT ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 999;
  padding: 8px 16px;
  background: var(--brass);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 12px;
  width: auto;
  height: auto;
  overflow: visible;
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(90deg, var(--faint) 25%, var(--border) 50%, var(--faint) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── EMPTY STATE (standardized) ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state-icon { font-size: 36px; margin-bottom: 12px; opacity: .35; }
.empty-state h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; line-height: 1.5; max-width: 320px; margin: 0 auto; }

/* ── BUTTON FEEDBACK ANIMATION ── */
.add-btn.just-added,
.card-add.just-added {
  animation: pop-check .35s cubic-bezier(.17,.67,.35,1.5);
}
@keyframes pop-check {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── NAV TOOLS DROPDOWN ── */
.nav-tools-wrap { position: relative; }
.nav-tools-btn {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: .15s;
  text-decoration: none;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-tools-btn:hover { background: var(--faint); color: var(--text); }
.nav-tools-btn.has-active { color: var(--brass); font-weight: 500; }
.nav-tools-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 150;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px 0;
}
.nav-tools-dropdown.open { display: flex; flex-direction: column; }
.nav-tools-dropdown .nav-link { padding: 8px 16px; border-radius: 0; }
.nav-tools-dropdown .nav-link:hover { background: var(--brass-l); }

@media (max-width: 700px) {
  .nav-tools-dropdown { position: static; box-shadow: none; border: none; padding: 0; display: flex !important; flex-direction: column; min-width: auto; }
  .nav-tools-btn { display: none; }
}
