/* =========================================================
   Vendors page
   ========================================================= */

/* ---------- Hero ---------- */
.v-hero {
  position: relative; overflow: hidden;
  padding: calc(var(--header-h) + 80px) 0 110px;
  background:
    radial-gradient(50% 70% at 80% 20%, rgba(195, 1, 1, 0.22), transparent 70%),
    var(--bg);
}
.v-hero__bg {
  position: absolute; inset: -10% -20% auto auto; width: 75%;
  display: flex; flex-direction: column; gap: 18px;
  transform: rotate(-12deg); transform-origin: top right;
  opacity: 0.22; pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
}
.v-hero__bg .logo-marquee { margin: 0; }
.v-hero__bg .logo-marquee__track { animation-duration: 70s; }
.v-hero__bg .logo-marquee--rev .logo-marquee__track { animation-direction: reverse; }
.v-hero__bg .logo-chip { filter: grayscale(1); opacity: 1; }
.v-hero__inner { position: relative; }


.v-hero__title {
  font-size: clamp(48px, 8vw, 112px); line-height: 0.95;
  letter-spacing: -0.045em; font-weight: 700;
}
.v-hero__lead { max-width: 560px; margin: 26px 0 0; font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); }

.v-stats { display: flex; gap: 44px; margin: 44px 0 40px; flex-wrap: wrap; }
.v-stats strong { display: block; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.v-stats span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.v-stats li { padding-left: 16px; border-left: 2px solid var(--red); }

/* ---------- Toolbar ---------- */
.directory { position: relative; background: var(--bg-2); padding-bottom: 100px; }
.toolbar {
  position: sticky; top: 0; z-index: 50;
  padding: 18px 0 14px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: top 0.4s var(--ease);
}
/* sit under the header when it's visible */
body:has(.header.scrolled:not(.hidden)) .toolbar { top: 70px; }
.toolbar__inner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.search {
  flex: 1 1 380px; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 18px; height: 52px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search:focus-within { border-color: rgba(195, 1, 1, 0.6); box-shadow: 0 0 0 4px rgba(195, 1, 1, 0.15); }
.search > svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--fg); font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--muted); opacity: 0.75; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: inherit; font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.search button { width: 34px; height: 34px; border-radius: 50%; color: var(--muted); display: none; }
.search button:hover { background: var(--tint); color: var(--fg); }
.search:has(input:not(:placeholder-shown)) button { display: block; }
.search:has(input:not(:placeholder-shown)) kbd { display: none; }

.toolbar__right { display: flex; align-items: center; gap: 10px; }
.result-count { font-size: 14px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; font-weight: 600;
  transition: all 0.3s var(--ease);
}
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn:hover { border-color: var(--tint-strong); }
.view-toggle { display: flex; padding: 4px; gap: 2px; border-radius: 999px; border: 1px solid var(--line); }
.view-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: all 0.3s; }
.view-btn svg { width: 16px; height: 16px; fill: currentColor; }
.view-btn.active { background: var(--invert-bg); color: var(--invert-fg); }

/* ---------- Grid & cards ---------- */
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; padding-top: 40px; }
.v-card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; outline: none;
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.4s, opacity 0.9s var(--ease);
}
.v-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(195, 1, 1, 0.2), transparent 60%);
  transition: opacity 0.3s;
}
.v-card.reveal.in:hover, .v-card.reveal.in:focus-visible { transform: translateY(-6px); }
.v-card:hover, .v-card:focus-visible { border-color: rgba(195, 1, 1, 0.5); box-shadow: 0 30px 60px -30px rgba(195, 1, 1, 0.55); }
.v-card:hover::before { opacity: 1; }
.v-card[hidden] { display: none; }
.v-card.pop { animation: cardIn 0.5s var(--ease) both; }
.v-card.flash { animation: flash 1.6s var(--ease) 0.2s 2; }
@keyframes flash { 50% { border-color: var(--red); box-shadow: 0 0 0 4px rgba(195, 1, 1, 0.25); } }

.v-card__logo {
  height: 150px; margin: 10px 10px 0; border-radius: 14px;
  display: grid; place-items: center; padding: 28px 32px;
  background: #fff; overflow: hidden; border: 1px solid var(--line);
}
.v-card__logo img { max-width: 100%; max-height: 80px; object-fit: contain; transition: transform 0.6s var(--ease); }
.v-card:hover .v-card__logo img { transform: scale(1.08); }

.v-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.v-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.v-card__cat {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--red-2);
}
.v-card__star { font-size: 11px; font-weight: 600; color: var(--star); white-space: nowrap; }
.v-card h3 { font-size: 21px; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 8px; }
.v-card p {
  color: var(--muted); font-size: 14.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 18px;
}
.v-card__actions { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.v-card__more { font-size: 14px; font-weight: 600; color: var(--fg); }
.v-card__more::after { content: " →"; color: var(--red-2); display: inline-block; transition: transform 0.3s var(--ease); }
.v-card:hover .v-card__more::after { transform: translateX(4px); }
.v-card__site {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--muted);
  max-width: 55%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: color 0.2s;
}
.v-card__site svg { width: 14px; height: 14px; flex-shrink: 0; }
.v-card__site:hover { color: var(--fg); }

/* list view */
.v-grid.is-list { grid-template-columns: 1fr; gap: 12px; }
.v-grid.is-list .v-card { flex-direction: row; align-items: stretch; }
.v-grid.is-list .v-card__logo { width: 220px; height: auto; min-height: 120px; margin: 10px; flex-shrink: 0; padding: 20px; }
.v-grid.is-list .v-card__body { padding: 20px 26px 20px 10px; }
.v-grid.is-list .v-card p { -webkit-line-clamp: 2; }
.v-grid.is-list .v-card__actions { border-top: 0; padding-top: 0; justify-content: flex-start; gap: 28px; }
.v-grid.is-list .v-card.reveal.in:hover { transform: translateX(6px); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 80px 20px; max-width: 520px; margin-inline: auto; }
.empty__icon {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; font-weight: 700;
  background: rgba(195, 1, 1, 0.12); color: var(--red-2);
}
.empty h3 { font-size: 24px; margin-bottom: 10px; word-break: break-word; }
.empty p { color: var(--muted); }
.empty__actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ---------- CTA ---------- */
.v-cta-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; }
.v-cta-grid .partner { margin-top: 0; }
.v-cta {
  padding: clamp(36px, 5vw, 60px); border-radius: 32px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.v-cta h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.03em; }
.v-cta p { color: var(--muted); margin-bottom: 10px; }

/* ---------- Vendor modal ---------- */
.vm { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: all 0.4s var(--ease); }
.vm.open { opacity: 1; visibility: visible; }
.vm__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(8px); }
.vm__box {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  display: grid; grid-template-columns: 300px 1fr;
  border-radius: 28px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 50px 100px -30px var(--shadow);
  transform: translateY(24px) scale(0.97); transition: transform 0.45s var(--ease);
}
.vm.open .vm__box { transform: none; }
.vm__logo { background: #fff; display: grid; place-items: center; padding: 40px; min-height: 240px; }
.vm__logo img { max-height: 120px; object-fit: contain; }
.vm__body { padding: 40px 40px 36px; }
.vm__body h2 { font-size: 34px; letter-spacing: -0.03em; margin: 8px 0 14px; }
.vm__body > p { color: var(--soft); line-height: 1.75; }
.vm__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.vm__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 15px;
  transition: background 0.3s, transform 0.3s var(--ease);
}
.vm__close:hover { background: var(--red); transform: rotate(90deg); }
.vm__rel-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.vm__related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vm-rel {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 8px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; transition: all 0.25s;
}
.vm-rel img { width: 56px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; flex-shrink: 0; }
.vm-rel:hover { border-color: rgba(195, 1, 1, 0.5); background: rgba(195, 1, 1, 0.08); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .v-cta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .v-hero { padding: calc(var(--header-h) + 48px) 0 80px; }
  .v-hero__bg { width: 140%; opacity: 0.14; }
  .v-stats { gap: 24px; }
  .v-stats strong { font-size: 30px; }
  /* compact sticky toolbar: search + sort on one row, chips below */
  .toolbar { padding: 10px 0 8px; }
  .toolbar__inner { flex-wrap: nowrap; gap: 8px; }
  .search { flex: 1 1 0; max-width: none; height: 44px; padding-left: 14px; }
  .search input { font-size: 16px; } /* 16px stops iOS zooming in on focus */
  .search kbd, .result-count, .view-toggle { display: none; }
  .tool-btn { height: 44px; width: 44px; padding: 0; justify-content: center; flex-shrink: 0; }
  .tool-btn span { display: none; }
  .toolbar .chips { margin-top: 8px; }
  .v-grid.is-list .v-card { flex-direction: column; }
  .v-grid.is-list .v-card__logo { width: auto; height: 120px; }
  .v-grid.is-list .v-card__body { padding: 18px 22px 22px; }
  .vm__box { grid-template-columns: 1fr; }
  .vm__logo { min-height: 160px; padding: 30px; }
  .vm__body { padding: 28px 24px; }
  .vm__body h2 { font-size: 28px; }
  .vm__related { grid-template-columns: 1fr; }
}
