/* UniBuilder — minimal base styles.
 * Most styling lives in templates/<active>/global.css; this file only fills gaps
 * the dynamic page-layout shell expects (containers, headings, common utilities).
 */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--n800, #1F2937); /* [z1a B2] тройной body-color слит: слово за global.css (--n800); slate-значение было мёртво перекрыто */
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
/* [z1a B1] Полный сброс кнопки: статик-сборка Tailwind без preflight → без сброса каждая
 * кнопка без border-класса носила нативную UA-границу (кейс «лупы» в шапке).
 * Все кнопки темы стилизуются классами — на UA-вид не полагается ни одна (grep-факт аудита z0). */
button { font: inherit; border: 0; background: none; padding: 0; margin: 0; color: inherit; cursor: pointer; }

/* Tailwind-like container helper (Bold Modern uses 'container mx-auto px-4 sm:px-6 lg:px-8') */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px)  { .container { max-width: 640px; padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; padding-left: 2rem; padding-right: 2rem; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } }
/* [§7.5/сетка] Шапка и крошки живут в КОНТЕНТНОЙ сетке (.ct = 1200px), а не в полной Tailwind-шкале
 * (до 1536px): правый край меню (вкл. «…») больше не выходит за границу контента. */
header .container, .breadcrumb-nav .container { max-width: 1200px; }
/* [§7.5/4] пункты меню всегда однострочны: переносы ("Тест / обычная") рвали высоту шапки; тесноту решает «…» */
header nav a { white-space: nowrap; }

/* Skip link for keyboard users */
.ub-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: #0F172A; color: #fff; padding: 12px 16px; border-radius: 0 0 8px 0;
}
.ub-skip-link:focus { left: 0; }

/* Cookie banner (used inline by HTMLGenerator) — base look already inline; just refine focus */
#cookie-banner button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Form busy state — disable pointer events while submitting */
form.ub-form-busy { pointer-events: none; opacity: .85; }
form.ub-form-busy button[type="submit"] { cursor: progress; }

/* line-clamp helpers used by cart/catalog cards */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Loading spinner used by catalog placeholders */
.animate-spin { animation: ub-spin 1s linear infinite; }
@keyframes ub-spin { to { transform: rotate(360deg); } }

/* U6: CTA buttons full-width on mobile (Bold Modern uses .bm-acts / .btn classes) */
@media (max-width: 640px) {
  [class*="bm-cta-"] .bm-acts,
  [class*="bm-cta-"] .btn { width: 100%; }
  [class*="bm-cta-"] .bm-acts .btn { flex: 1 0 100%; max-width: none; }
  [class*="bm-hero-"] .bm-acts .btn { flex: 1 0 100%; max-width: none; }
  [class*="bm-hero-"] .bm-acts { flex-direction: column; gap: 10px; }
}

/* U5 (helper): mobile burger close-on-outside — handled by inline script too */
.mobile-nav.is-open { display: block; }

/* Print: hide chrome */
@media print {
  header, footer, .ub-modal-overlay, #cookie-banner, #scroll-to-top, .ub-cart, nav { display: none !important; }
}

/* Breadcrumbs — structural: inline path, no <ol> numbering.
 * Separator is a decorative <span aria-hidden> inside each <li> (not a standalone list item). */
.breadcrumb-nav {
  /* [§7.5] крошка = тонкая строка БЕЗ фоновой плашки (плашка была атрибутом старого штатного слота) */
  background: none;
  border: 0;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}
.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb-link {
  color: var(--p, #7C3AED);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-link:hover {
  color: var(--ph, #6D28D9);
  text-decoration: underline;
}
.breadcrumb-separator {
  color: var(--n500, #6B7280);
  margin: 0 0.5rem;
  user-select: none;
}
.breadcrumb-current {
  color: var(--n600, #4B5563); /* [§7.5] текущий — --n600 */
  font-weight: 500;
}

/* [T4] search keyboard-nav: активная опция — видима и в a11y-схемах (outline=currentColor переживает blanket-форс цвета) */
.ub-search-results .ub-search-active { background: #EDE9FE; outline: 3px solid currentColor !important; outline-offset: -3px !important; }

/* [z1v D1] Quality floor: единое видимое фокус-кольцо клавиатуры для ВСЕХ витринных
 * интерактивов (дизайн-код §6.1). :focus-visible — мышь не шумит, клавиатура видна. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--p, #7C3AED) 40%, transparent);
  outline-offset: 2px;
}

/* — [d1 В3-полировка] Панель фильтра: три косметики (скрин Михаила 2026-07-04) — */
/* 1. Группы атрибутов без нативных коробок: семантика fieldset/legend остаётся (a11y), вид — в ритм блока «Цена» */
.ub-catalog-filters fieldset.ub-filter-group { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.ub-catalog-filters .ub-filter-group legend:not(.sr-only) { display: block; float: none; width: 100%; padding: 0; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--n700, #374151); }
.ub-catalog-filters .ub-filter-group legend span { color: var(--n500, #6B7280); font-weight: 400; }
/* 2. Чекбоксы панели в тему (вкл. «Только в наличии») */
.ub-catalog-filters input[type="checkbox"] { accent-color: var(--p, #7C3AED); }
/* 3v2. Двухрядный низ карточки (канон): степпер строкой, «В корзину» полной шириной вторым рядом
   (в 260px степпер+кнопка одной строкой не живут ни переносом, ни nowrap); PDP-компакт скоуплен отдельно */
.ub-product-item .ub-add-to-cart { white-space: nowrap; flex-basis: 100%; }
