/* ── Suppliers page styles ── */

/* Prevent horizontal page overflow */
html, body { overflow-x: hidden; }
.suppliers-layout, .sup-main, .sup-card, .sup-inner { max-width: 100%; }

.nav-active {
  color: var(--sage) !important;
  font-weight: 700 !important;
}

/* ── Hero ── */
.suppliers-hero { padding: 4rem 2rem 3.5rem; }
.suppliers-hero h1 { max-width: 560px; }

/* ── Layout ── */
.suppliers-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── Sidebar ── */
.sup-sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  padding-left: 4px;
}

.filter-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-btn {
  text-align: left;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--warm-white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--sage); color: var(--sage); background: var(--sage-pale); }
.filter-btn.active {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.rank-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-link:hover { background: var(--sage-light); color: var(--sage); }
.rank-link .rn { font-size: 0.68rem; font-weight: 800; color: var(--text-muted); min-width: 18px; }

/* ── Main ── */
.sup-main { min-width: 0; }

.results-bar {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
  padding-left: 2px;
}

/* ── Supplier Card ── */
.sup-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  scroll-margin-top: 88px;
}
.sup-card:hover { box-shadow: var(--shadow-md); }

/* #1 card — featured */
.sup-card.rank-1 {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(62,94,53,0.10), var(--shadow-md);
}

/* Card inner */
.sup-inner {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
}

/* Rank column */
.sup-rank-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 0 20px 18px;
  gap: 6px;
}

.rank-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-mid);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sup-card.rank-1 .rank-badge {
  background: linear-gradient(135deg, #BF9B30, #E8C84A);
  border-color: #BF9B30;
  color: white;
  font-size: 1rem;
  width: 44px;
  height: 44px;
}
.sup-card.rank-2 .rank-badge { background: #E8E8E8; border-color: #C0C0C0; color: #555; }
.sup-card.rank-3 .rank-badge { background: #F5E6D4; border-color: #CD7F32; color: #7A4A1A; }

/* Body column */
.sup-body {
  padding: 18px 16px 16px;
  min-width: 0;
}

/* Top banner for #1 */
.sup-card.rank-1 .sup-body::before {
  content: '🏆 Editor\'s Pick — #1 Ranked Supplier';
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage);
  background: var(--sage-light);
  margin: -18px -16px 14px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--sage-pale);
}

.sup-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.sup-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
}

.sup-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.sup-badge.model-pmr  { background: var(--sage-light); color: var(--sage); }
.sup-badge.model-barf { background: #EEF7EE; color: #4A9A48; }
.sup-badge.model-both { background: var(--cream); color: var(--text-mid); }
.sup-badge.type-badge { background: var(--cream); color: var(--text-mid); border: 1px solid var(--cream-border); }
.sup-badge.hpp-badge  { background: #EEF4FF; color: #3B6FCC; }

.sup-notes {
  font-size: 0.86rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.sup-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sup-ships {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sup-ships::before { content: '🚚'; font-size: 0.78rem; }

/* CTA column */
.sup-cta-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 18px 18px 8px;
  gap: 8px;
  min-width: 110px;
  border-left: 1px solid var(--cream-border);
  background: var(--warm-white);
}

.sup-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.score-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--sage);
  letter-spacing: -0.04em;
  line-height: 1;
}
.score-max {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sup-stars {
  display: flex;
  gap: 1px;
  font-size: 0.7rem;
  color: #E8C84A;
  margin: 2px 0;
}

.btn-visit {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s;
}
.btn-visit:hover { background: var(--orange-dark); }

.sup-card.rank-1 .btn-visit {
  background: var(--sage);
}
.sup-card.rank-1 .btn-visit:hover {
  background: var(--sage-mid);
}

.btn-visit-ghost {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}
.btn-visit-ghost:hover { border-color: var(--sage); color: var(--sage); }

/* Hidden */
.sup-card.hidden-card { display: none; }

/* ── Mobile filter bar (replaces hidden sidebar on small screens) ── */
.mobile-filters {
  display: none;
}

@media (max-width: 700px) {

  /* Show mobile filter bar */
  .mobile-filters {
    display: block;
    padding: 0 0 1rem;
  }
  .mobile-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .mobile-filter-scroll::-webkit-scrollbar { display: none; }
  .mobile-filter-scroll .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  /* Layout */
  .suppliers-layout {
    grid-template-columns: 1fr;
    padding: 1.25rem 0.75rem 4rem;
  }
  .sup-sidebar { display: none; }

  /* Supplier card */
  .sup-inner {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .sup-rank-col {
    padding: 16px 0 0 12px;
    justify-content: flex-start;
  }
  .rank-badge { width: 34px; height: 34px; font-size: 0.78rem; }
  .sup-card.rank-1 .rank-badge { width: 38px; height: 38px; font-size: 0.88rem; }

  .sup-body {
    padding: 14px 12px 10px 10px;
    grid-column: 2;
  }
  .sup-card.rank-1 .sup-body::before {
    margin: -14px -12px 12px;
    font-size: 0.62rem;
    padding: 6px 12px;
  }

  .sup-name { font-size: 0.95rem; }
  .sup-notes { font-size: 0.82rem; }

  /* CTA bar — full width at bottom */
  .sup-cta-col {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-left: none;
    border-top: 1px solid var(--cream-border);
    padding: 11px 14px;
    min-width: unset;
    background: var(--warm-white);
    gap: 12px;
  }
  .sup-score { flex-direction: row; align-items: baseline; gap: 4px; }
  .score-val { font-size: 1.3rem; }
  .score-max { font-size: 0.65rem; }
  .sup-stars { font-size: 0.65rem; }

  .btn-visit       { padding: 9px 18px; font-size: 0.8rem; }
  .btn-visit-ghost { display: none; } /* hide secondary link on mobile */

  /* Suppliers hero */
  .suppliers-hero { padding: 2.5rem 1.25rem 2rem; }
}
