/* Стили половины «покупатель» (docs/PARTS.md, часть Б). Файл принадлежит части Б.
   Цвета и размеры — только из /shared/tokens.css; общие элементы (кнопки, листы, карточки) уже в /styles.css.
   Классы — с приставкой b-. Крупные экраны вынесены в отдельные файлы: */
@import url('/buyer/css/search.css');
@import url('/buyer/css/listing.css');
@import url('/buyer/css/pages.css');

/* шесть мягких пар «фон — значок» из токенов (разделы категорий) */
.b-t-violet { --tb: var(--primary-soft); --ti: var(--primary-soft-ink); }
.b-t-amber { --tb: var(--accent-soft); --ti: var(--accent-ink); }
.b-t-green { --tb: var(--free-soft); --ti: var(--free-ink); }
.b-t-blue { --tb: var(--info-soft); --ti: var(--info); }
.b-t-rose { --tb: var(--danger-soft); --ti: var(--danger); }
.b-t-sand { --tb: var(--warn-soft); --ti: var(--warn); }
.b-t-plain { --tb: var(--surface-2); --ti: var(--ink-2); }

/* ───────── строка поиска с подсказками (шапка ПК, главная, страница поиска) ───────── */
.b-sbox { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 6px 0 14px;
  border-radius: 14px; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.b-sbox:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: var(--ring); }
.b-sbox input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; box-shadow: none; font-size: 16px; color: var(--ink); padding: 0; }
.b-sbox input::placeholder { color: var(--faint); }
.b-sbox input::-webkit-search-cancel-button { display: none; }
.b-sbox-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); flex: none; }
.b-sbox-x:hover { background: var(--surface-3); }
.b-sbox-go { display: none; }
.b-sbox.hsearch { flex: 1 1 320px; max-width: 520px; }
.b-sbox.hsearch input { font-size: 15px; }
.b-sbox.big { height: 56px; border-radius: 18px; padding: 0 7px 0 16px; background: var(--surface); border-color: var(--line-strong); box-shadow: var(--sh-2); }
.b-sbox.big:focus-within { border-color: var(--brand); box-shadow: var(--sh-2), var(--ring); }
.b-sbox.big .b-sbox-go { display: block; height: 42px; padding: 0 16px; border: 0; border-radius: 13px; background: var(--primary); color: var(--on-primary); font-weight: 650; font-size: 15px; flex: none; }
.b-sbox.big .b-sbox-go:hover { background: var(--primary-hover); }

.b-sug { position: absolute; z-index: 70; top: calc(100% + 8px); left: -1px; right: -1px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--sh-3); max-height: min(60vh, 420px); overflow: auto; animation: lv-fade .14s var(--ease); }
.b-sug-h { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px 4px; }
.b-sug-i { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 12px; color: var(--ink); font-size: 15px; cursor: pointer; }
.b-sug-i > .ic { color: var(--faint); }
.b-sug-i.on { background: var(--surface-2); }
.b-sug-sub { font-size: 12px; color: var(--muted); }
.b-sug-tag { font-size: 11px; font-weight: 650; color: var(--primary-soft-ink); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; flex: none; }
.b-sug-del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--faint); flex: none; }
.b-sug-del:hover { background: var(--surface-3); color: var(--ink); }

/* ───────── навес лавки — фирменная полоса из знака ───────── */
.b-awning { display: block; height: 26px; background: repeating-linear-gradient(90deg, var(--brand) 0 32px, var(--accent) 32px 64px);
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 100% 10px no-repeat, radial-gradient(circle at 16px 0, #000 15.4px, #0000 16px) 0 10px / 32px 16px repeat-x;
  mask: linear-gradient(#000 0 0) 0 0 / 100% 10px no-repeat, radial-gradient(circle at 16px 0, #000 15.4px, #0000 16px) 0 10px / 32px 16px repeat-x; }

/* ───────── главная ───────── */
.b-home { padding-top: env(safe-area-inset-top); }
.b-hero { max-width: 1200px; margin: 0 auto; padding: 8px 16px 0; }
.b-hero-top { align-items: center; gap: 8px; margin-bottom: 14px; }
.b-hero-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: -.02em; margin-right: auto; }
.b-hero-h { font-size: 27px; line-height: 1.08; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.b-hero-h span { color: var(--primary); display: block; }
.b-hero-search { margin-top: 14px; }
.b-hero-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.b-hero-ex a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 550; text-decoration: none !important; }
.b-hero-ex a:hover { border-color: var(--brand); color: var(--primary); }
.b-hero-sub { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--muted); min-height: 32px; }
.b-hero-sub b { color: var(--ink); font-weight: 650; }
.b-hero-map { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-soft-ink);
  font-weight: 650; font-size: 13px; text-decoration: none !important; flex: none; }
@media (min-width: 900px) {
  .b-hero { padding: 26px 32px 0; }
  .b-hero-h { font-size: 44px; max-width: 760px; }
  .b-hero-h span { display: inline; }
  .b-hero-sub { font-size: 15px; margin-top: 14px; }
  .b-hero-map { margin-left: 12px; }
}

.b-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; margin-top: 18px; }
.b-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 2px; border-radius: 16px; color: var(--ink); text-decoration: none !important; text-align: center; }
.b-cat-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 20px; background: var(--tb, var(--surface-2)); color: var(--ti, var(--ink-2)); flex: none;
  transition: transform var(--t) var(--ease); }
.b-cat:hover .b-cat-ic { transform: translateY(-2px); }
.b-cat:active .b-cat-ic { transform: scale(.94); }
.b-cat-n { font-size: 11.5px; letter-spacing: -.01em; font-weight: 600; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-cat-c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -3px; }
@media (min-width: 620px) { .b-cats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .b-cats { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 2px; margin-top: 26px; } .b-cat-n { font-size: 12.5px; } }

.b-nearask { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.b-nearask-ic, .b-ask-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--info-soft); color: var(--info); flex: none; }
.b-quiet { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 20px; background: var(--surface); }
.b-more { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; }

.b-promise { display: grid; gap: 12px; margin-top: 40px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.b-promise-i { display: flex; gap: 12px; align-items: flex-start; }
.b-promise-i b { font-size: 15px; }
.b-promise-i p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.b-promise-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--primary-soft); color: var(--primary-soft-ink); flex: none; }
.b-promise-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; min-height: 36px; }
@media (min-width: 900px) { .b-promise { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 24px; } .b-promise-more { grid-column: 1 / -1; } }

/* лента-карусель */
.b-rail-wrap { position: relative; }
.b-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: -16px; padding: 4px 16px 12px; scroll-padding-inline: 16px; }
.b-rail::-webkit-scrollbar { display: none; }
.b-rail-i { flex: 0 0 158px; min-width: 0; scroll-snap-align: start; display: flex; }
.b-rail-i > * { flex: 1; min-width: 0; }
.b-rail-i.wide { flex-basis: 272px; }
.b-rail-btn { display: none; }
@media (min-width: 900px) {
  .b-rail { gap: 18px; margin-inline: -4px; padding: 4px 4px 14px; scroll-padding-inline: 4px; }
  .b-rail-i { flex-basis: 204px; }
  .b-rail-i.wide { flex-basis: 320px; }
  .b-rail-btn { display: grid; place-items: center; position: absolute; top: calc(50% - 30px); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); z-index: 3; }
  .b-rail-btn.l { left: -18px; } .b-rail-btn.r { right: -18px; }
  .b-rail-btn:hover { background: var(--surface-2); }
}

/* все категории */
.b-tree { columns: 1; column-gap: 16px; margin-top: 6px; }
.b-tree-sec { break-inside: avoid; display: flex; flex-direction: column; gap: 10px; padding: 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.b-tree-sec h2 { font-size: 18px; }
.b-tree-sec h2 a { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; }
.b-tree-sec .b-cat-ic { width: 44px; height: 44px; border-radius: 15px; }
.b-tree-sec ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.b-tree-sec li a { display: flex; align-items: center; min-height: 40px; color: var(--ink-2); font-size: 14px; line-height: 1.25; padding: 4px 0; }
@media (min-width: 620px) { .b-tree { columns: 2; } }
@media (min-width: 1000px) { .b-tree { columns: 3; } .b-tree-sec ul { grid-template-columns: 1fr; } .b-tree-sec li a { min-height: 34px; } }

/* плитка магазина */
.b-shop { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  color: var(--ink); text-decoration: none !important; box-shadow: var(--sh-1); transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
@media (hover: hover) { .b-shop:hover { box-shadow: var(--sh-2); transform: translateY(-2px); } }
.b-shop-cover { display: block; height: 54px; background: linear-gradient(120deg, var(--primary-soft), var(--accent-soft)); }
.b-shop-cover img { width: 100%; height: 100%; object-fit: cover; }
.b-shop-logo { position: absolute; top: 24px; left: 14px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface); line-height: 0; }
.b-shop-b { display: flex; flex-direction: column; gap: 3px; padding: 28px 14px 14px; min-width: 0; }
.b-shop-n { display: flex; align-items: center; gap: 6px; font-size: 16px; min-width: 0; }
.b-shop-m { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.b-shop-a { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-shop-c { font-size: 12px; font-weight: 650; color: var(--primary); margin-top: 4px; }

/* общее для экранов покупателя */
.b-h { display: flex; align-items: center; gap: 8px; font-size: 18px; letter-spacing: -.01em; }
.b-fhint { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.b-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.b-narrow { max-width: 860px; }
