/* Общие стили сайта БАЛДЁЖ-ТЕХ (подключаются в base.html). Стили отдельных страниц — в их шаблонах, блок extra_head. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0a0a;
  --bg-2:         #0f0f0f;
  --surface:      #181818;
  --surface-2:    #202020;
  --accent:       #9333ea;
  --accent-dim:   rgba(147, 51, 234, 0.12);
  --accent-glow:  rgba(147, 51, 234, 0.25);
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(147, 51, 234, 0.35);
  --text:         #f0f0f0;
  --text-2:       #8a8a8a;   /* контраст ≥ 4.5:1 на фоне карточек (WCAG AA) */
  --radius:       14px;
  --tr:           0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
main { flex: 1; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  height: 64px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.nav-logo em { color: var(--accent); font-style: normal; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  flex: 1;
}
.nav-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--tr);
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: auto;
  transition: background var(--tr), color var(--tr);
}
.nav-cta:hover { background: var(--accent); color: #fff; }

/* ── Mobile nav burger / drawer ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--tr), opacity var(--tr);
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--tr);
  z-index: 150;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.nav-drawer.is-open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.nav-drawer-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.nav-drawer-close:hover { color: var(--text); }

.nav-drawer-links { list-style: none; display: flex; flex-direction: column; }
.nav-drawer-links li { border-bottom: 1px solid var(--border); }
.nav-drawer-links a {
  display: block;
  padding: 16px 4px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: color var(--tr);
}
.nav-drawer-links a:hover { color: var(--accent); }

.nav-drawer-cta { margin-top: 24px; text-align: center; }

body.nav-open { overflow: hidden; }

/* ── Container ── */
.container { max-width: 1120px; margin: 0 auto; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: 0.8rem;
  color: var(--text-2);
}
.breadcrumb a { color: var(--text-2); transition: color var(--tr); }
.breadcrumb a:hover { color: var(--text); }
.bc-sep { color: rgba(255,255,255,0.2); }
.bc-cur { color: var(--text); }

/* ── Section ── */
.section { padding: 96px 24px; scroll-margin-top: 64px; }
.section-alt { background: var(--bg-2); }

.section-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 52px;
}
.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 14px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-hover);
  padding: 13px 36px;
}
.btn-outline:hover {
  background: var(--accent-dim);
  box-shadow: none;
}
.btn-sm { padding: 9px 22px; font-size: 0.875rem; }

/* ── Plastic badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-pla     { background: rgba(34,197,94,.12);   color: #4ade80; }
.badge-petg    { background: rgba(59,130,246,.12);  color: #60a5fa; }
.badge-abs     { background: rgba(249,115,22,.12);  color: #fb923c; }
.badge-tpu     { background: rgba(234,179,8,.12);   color: #facc15; }
.badge-asa     { background: rgba(147,51,234,.15);  color: #c084fc; }
.badge-petg-cf { background: rgba(99,102,241,.15);  color: #818cf8; }
.badge-pla-cf  { background: rgba(16,185,129,.12);  color: #34d399; }

/* ── Доступность ── */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 3000;
  padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600;
  transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .product-card:hover, .cat-card:hover, .subcat-card:hover { transform: none !important; }
}

/* ── Значок «3D» на карточках товаров ── */
.product-card { position: relative; }
.card-3d {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 100px;
  background: rgba(10,10,12,0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(147,51,234,0.5); color: #d8b4fe;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
}

/* ── Footer ── */
.footer {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-links a { color: var(--text-2); transition: color var(--tr); font-size: 0.875rem; }
.footer-links a:hover { color: var(--text); }
.footer-legal { gap: 8px 24px; margin-bottom: 14px; }
.footer-legal a { font-size: 0.8rem; }
.footer-seller { font-size: 0.78rem; line-height: 1.6; color: rgba(255,255,255,0.55); margin-bottom: 10px; }
.footer-seller a { color: inherit; }
.footer-seller a:hover { color: var(--text); }

/* ── Mobile ── */
@media (max-width: 640px) {
  .nav { padding: 0 20px; gap: 16px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
  .section { padding: 64px 16px; }
}
