/* СтройПоиск — светлый маркетплейс: воздушный фон, белые карточки,
   синий акцент, зелёный для наличия. Шрифт Inter. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #0f1622;
  --muted: #6b7480;
  --line: #e7e9ee;
  --line-strong: #dcdfe6;
  --accent: #2563eb;
  --accent-600: #1d4ed8;
  --accent-050: #eef3ff;
  --accent-100: #e0e9ff;
  --ok: #16a34a;
  --ok-ink: #0f7a37;
  --ok-bg: #e9f7ee;
  --warn: #b45309;
  --warn-bg: #fdf1e3;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16,22,34,.06), 0 1px 3px rgba(16,22,34,.04);
  --shadow-md: 0 8px 26px rgba(16,22,34,.10);
  --wrap: 940px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
main { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 64px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #4f83ff); color: #fff; font-size: 17px;
}
.brand__text { color: var(--ink); letter-spacing: -.01em; }
.brand__text span { color: var(--accent); }
.brand__city {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 999px;
}
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 10px; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--ink); background: var(--bg); }

/* ---------- Hero + search ---------- */
.hero { padding: 44px 0 8px; }
.hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em;
  margin: 0 0 12px; font-weight: 800;
}
.hero h1 span { color: var(--accent); }
.hero__sub { margin: 0 0 24px; color: var(--muted); font-size: 1.05rem; max-width: 46ch; }

.search { margin: 0; }
.search__box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: 7px 7px 7px 16px; box-shadow: var(--shadow-md);
  transition: border-color .15s, box-shadow .15s;
}
.search__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-050), var(--shadow-md); }
.search__icon { color: var(--muted); flex-shrink: 0; }
.search input[type="search"] {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 1.06rem; color: var(--ink); padding: 12px 6px;
}
.search input[type="search"]::placeholder { color: #9aa1ab; }
.search__btn {
  flex-shrink: 0; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 12px;
  transition: background .15s;
}
.search__btn:hover { background: var(--accent-600); }

/* filters / chips */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.filters__sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font-size: .9rem; font-weight: 600;
  user-select: none; transition: background .15s, color .15s, border-color .15s;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:hover { border-color: #c7ccd6; color: var(--ink); }
.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip--toggle:has(input:checked) { background: var(--ok); border-color: var(--ok); }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-050); }

.examples { color: var(--muted); font-size: .9rem; margin: 18px 0 0; }
.examples a {
  color: var(--accent); text-decoration: none; margin-right: 4px;
  background: var(--accent-050); padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.examples a:hover { background: var(--accent-100); }

/* ---------- Results ---------- */
.results { margin-top: 30px; }
.results__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.results__count { font-weight: 800; font-size: 1.1rem; }
.results__q { color: var(--muted); font-size: .95rem; }

.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.item:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
.item--oos { opacity: .62; }
.item__main { min-width: 0; }
.item__name { font-weight: 600; font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.item__name:hover { color: var(--accent); }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.item__store {
  font-size: .8rem; font-weight: 700; color: var(--accent); text-decoration: none;
  background: var(--accent-050); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.item__store:hover { background: var(--accent-100); }
.item__cat { font-size: .8rem; color: var(--muted); }
.item__side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.price { font-size: 1.28rem; font-weight: 800; color: var(--ink); white-space: nowrap; letter-spacing: -.01em; }
.price i { font-style: normal; color: var(--muted); font-weight: 500; font-size: .72em; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge--ok { color: var(--ok-ink); background: var(--ok-bg); }
.badge--ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.badge--muted { color: var(--muted); background: #eef0f3; }
.badge--warn { color: var(--warn); background: var(--warn-bg); }

.more { text-align: center; margin: 22px 0 4px; }
.more__btn {
  display: inline-block; text-decoration: none; font-weight: 700; color: var(--accent);
  background: var(--surface); border: 1.5px solid var(--line-strong);
  padding: 11px 26px; border-radius: 999px; transition: background .15s, border-color .15s;
}
.more__btn:hover { background: var(--accent-050); border-color: var(--accent); }

.empty {
  text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 40px 24px; margin-top: 30px; box-shadow: var(--shadow-sm);
}
.empty__icon { font-size: 2.2rem; margin-bottom: 8px; opacity: .7; }
.empty__title { font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.empty__hint { color: var(--muted); margin: 0; }

/* ---------- Stores strip (home) ---------- */
.stores-strip { margin-top: 52px; }
.stores-strip h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.stores-strip h2 .count {
  color: var(--accent); background: var(--accent-050); border-radius: 999px;
  padding: 1px 9px; font-size: .78rem;
}
.stores-strip ul {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.stores-strip li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm);
}
.stores-strip li b { font-size: .98rem; }

/* ---------- Stores page ---------- */
.stores-page__head { margin: 34px 0 22px; }
.stores-page__head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.store-cards {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.store-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .15s, transform .15s;
}
.store-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.store-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.store-card__name { font-size: 1.12rem; font-weight: 700; }
.store-card__count { color: var(--muted); font-size: .88rem; }
.store-card__info { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.store-card__info div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.store-card__info dt { color: var(--muted); font-size: .84rem; }
.store-card__info dd { margin: 0; font-size: .9rem; }
.store-card__link {
  margin-top: auto; align-self: flex-start; text-decoration: none; font-weight: 700; color: var(--accent);
  font-size: .92rem;
}
.store-card__link:hover { color: var(--accent-600); }

.muted { color: var(--muted); font-size: .88rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 20px;
  color: var(--muted); font-size: .85rem;
}
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero { padding: 28px 0 4px; }
  .search__btn { padding: 12px 16px; }
  .item { flex-direction: column; gap: 12px; }
  .item__side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .store-card__info div { grid-template-columns: 64px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* htmx: subtle fade while a request is in flight */
.htmx-request #results, #results.htmx-request { opacity: .55; transition: opacity .12s; }
