/* ===== BearingXRef Theme Styles ===== */

:root {
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-alt: #F0F3F6;
  --border: #D2D9E1;
  --border-light: #E8ECF0;
  --text: #1C2B3A;
  --text-secondary: #4A5568;
  --text-muted: #526174;
  --navy: #0D1B2A;
  --blue: #1A6DB5;
  --blue-hover: #155A96;
  --blue-light: #E8F1FA;
  --copper: #97501D;
  --copper-light: #FDF3EA;
  --green: #1B7D4E;
  --green-light: #EAFAF1;
  --shadow-sm: 0 1px 3px rgba(13,27,42,0.06);
  --shadow-md: 0 4px 12px rgba(13,27,42,0.08);
  --shadow-lg: 0 8px 30px rgba(13,27,42,0.12);
  --radius: 6px;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── HEADER ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-text span { color: var(--blue); }

/* WordPress Nav Menu */
.main-navigation ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-navigation li a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item a {
  color: var(--blue);
  background: var(--blue-light);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  font-size: 1.5rem;
}

/* ── HERO ── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 64px;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 32px;
}

/* ── SEARCH ── */
.search-container { max-width: 600px; margin: 0 auto; position: relative; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px 6px 6px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(26,109,181,0.12);
}

.search-box input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  padding: 10px 0;
}

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

.search-btn {
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-btn:hover { background: var(--blue-hover); }

.search-hint {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-hint code {
  font-family: var(--font-mono);
  background: var(--surface-alt);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 50;
  max-height: 380px;
  overflow-y: auto;
}

.search-results.active { display: block; }

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: var(--text);
}

.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--surface-alt); }

/* ── STATS BAR ── */
.stats-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 20px 24px;
}

.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── SECTIONS ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

.section + .section { padding-top: 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.card-header .count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── BRAND GRID ── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}

/* ── SERIES GRID ── */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.series-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.series-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.series-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-light);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── TABLES ── */
.xref-table, .popular-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.xref-table th, .popular-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.xref-table td, .popular-table td {
  padding: 12px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-light);
}

.xref-table tr:last-child td, .popular-table tr:last-child td { border-bottom: none; }
.xref-table tr:hover td, .popular-table tr:hover td { background: var(--surface-alt); }

.part-number, .part-num {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--blue);
}

.match-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.match-exact { background: var(--green-light); color: var(--green); }
.match-equiv { background: var(--blue-light); color: var(--blue); }

.brand-cell { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── DIMENSIONS ── */
.dims-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.dim-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
}

.dim-item:nth-child(odd) { border-right: 1px solid var(--border-light); }
.dim-label { font-size: 0.8rem; color: var(--text-muted); }
.dim-value { font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem; }
.dim-unit { color: var(--text-muted); font-size: 0.8rem; }

/* ── LOAD BARS ── */
.load-bar-wrap { padding: 14px 20px; border-bottom: 1px solid var(--border-light); }
.load-bar-wrap:last-child { border-bottom: none; }
.load-bar-label { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 6px; }
.load-bar { height: 6px; background: var(--surface-alt); border-radius: 3px; overflow: hidden; }
.load-bar-fill { height: 100%; border-radius: 3px; background: var(--blue); }

/* ── VARIANTS ── */
.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.variant-row:last-child { border-bottom: none; }
.variant-row:hover { background: var(--surface-alt); }
.variant-name { font-family: var(--font-mono); font-weight: 500; color: var(--blue); }

/* ── BUY BOX ── */
.buy-box {
  background: var(--surface);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 8px;
}

.buy-btn-primary { background: var(--copper); color: #fff; }
.buy-btn-primary:hover { background: #A85F23; text-decoration: none; }
.buy-btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }

/* ── SIDEBAR SPECS ── */
.quick-specs .spec-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.spec-label { color: var(--text-muted); }
.spec-val { font-family: var(--font-mono); font-weight: 500; }

/* ── RELATED BEARINGS ── */
.related-grid { display: grid; grid-template-columns: 1fr 1fr; }

.related-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.related-item:nth-child(odd) { border-right: 1px solid var(--border-light); }
.related-item:hover { background: var(--surface-alt); text-decoration: none; }
.related-num { font-family: var(--font-mono); font-weight: 500; color: var(--blue); font-size: 0.88rem; display: block; }
.related-dims { font-size: 0.72rem; color: var(--text-muted); }

/* ── BREADCRUMB ── */
.breadcrumb-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 24px; }
.breadcrumb { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb .sep { color: var(--border); }

/* ── PAGE LAYOUT ── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.page-title h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-series { background: var(--blue-light); color: var(--blue); }
.badge-type { background: var(--copper-light); color: var(--copper); }
.badge-iso { background: var(--green-light); color: var(--green); }

/* ── SEO CONTENT ── */
.seo-section { background: var(--surface-alt); border-top: 1px solid var(--border); }

.seo-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px;
}

.seo-inner h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.seo-inner h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.seo-inner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 65ch;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }

.footer-col h2 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 0;
}

.footer-col a:hover { color: var(--blue); }

.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { height: 56px; }
  .main-navigation ul { display: none; }
  .menu-toggle { display: block; }
  .main-navigation.toggled ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    box-shadow: var(--shadow-md);
  }
  .hero { padding: 40px 20px 48px; }
  .hero h1 { font-size: 1.65rem; }
  .search-box { flex-direction: column; padding: 12px; gap: 10px; }
  .search-btn { width: 100%; padding: 12px; }
  .section { padding: 40px 20px; }
  .brand-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .series-grid { grid-template-columns: 1fr; }
  .page-wrap { grid-template-columns: 1fr; padding: 24px 16px 40px; }
  .dims-grid { grid-template-columns: 1fr; }
  .dim-item:nth-child(odd) { border-right: none; }
  .related-grid { grid-template-columns: 1fr; }
  .related-item:nth-child(odd) { border-right: none; }
  .footer-inner { flex-direction: column; }
}
