/* ===== APEX SIM — dark racing theme ===== */
/* Плавный кросс-фейд между страницами (Chrome/Edge) вместо резкой перерисовки */
@view-transition { navigation: auto; }

:root {
  --bg: #0b0d10;
  --bg2: #12151a;
  --panel: #171b21;
  --panel2: #1e232b;
  --line: #262c35;
  --text: #eef1f5;
  --muted: #9aa4b2;
  --accent: #ff4d2e;
  --accent2: #ff8a00;
  --grad: linear-gradient(90deg, #ff4d2e, #ff8a00);
  --green: #3ddc84;
  --radius: 14px;
}
/* ===== светлая тема ===== */
[data-theme="light"] {
  --bg: #f4f5f7;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #eceef2;
  --line: #dde1e8;
  --text: #171a20;
  --muted: #5c6570;
}
[data-theme="light"] header.site { background: rgba(255,255,255,.88); }
[data-theme="light"] .hero::after { opacity: .04; }
[data-theme="light"] .card:hover { border-color: #c3cad4; }
[data-theme="light"] .badge { background: #e6e9ef; color: var(--text); }
[data-theme="light"] .badge.hit, [data-theme="light"] .badge.sale { color: #14060a; }
[data-theme="light"] .badge.hit { background: var(--grad); }

.theme-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 17px;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,.logo { font-family: "Unbounded", "Manrope", sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(26px, 4vw, 44px); }
h2 { font-size: clamp(20px, 3vw, 30px); margin-bottom: 22px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
section { padding: 44px 0; }
.muted { color: var(--muted); }
.accent-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,16,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.lg-mark { flex-shrink: 0; }
.lg-text {
  font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 20px;
  font-style: italic; letter-spacing: .03em; text-transform: lowercase; line-height: 1;
}
.lg-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo:hover .lg-text { text-shadow: 0 0 22px rgba(255, 77, 46, .35); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 15px; transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav .cta { margin-left: 8px; }
.burger { display: none; margin-left: auto; background: none; border: 0; color: var(--text); font-size: 26px; cursor: pointer; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s;
  font-family: "Manrope", sans-serif;
}
.btn:hover { transform: translateY(-1px); background: var(--panel2); }
.btn-accent { background: var(--grad); border: 0; color: #14060a; }
.btn-accent:hover { box-shadow: 0 6px 24px rgba(255, 77, 46, .35); background: var(--grad); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* hero */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 90px;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(255,77,46,.18), transparent 60%),
    radial-gradient(600px 300px at 10% 110%, rgba(255,138,0,.10), transparent 60%),
    var(--bg2);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background: repeating-linear-gradient(-55deg, transparent 0 26px, #fff 26px 28px);
}
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); margin-bottom: 18px;
}
.hero .kicker::before { content: ""; width: 34px; height: 2px; background: var(--grad); }
.hero h1 { max-width: 720px; margin-bottom: 18px; }
.hero p { max-width: 560px; color: var(--muted); font-size: 18px; margin-bottom: 30px; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* grids & cards */
.grid { display: grid; gap: 18px; }
.grid.cats { grid-template-columns: repeat(4, 1fr); }
.grid.products { grid-template-columns: repeat(4, 1fr); }
.grid.news-grid { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative; transition: transform .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: #3a4250; }
.cat-card { min-height: 120px; padding: 22px; justify-content: flex-end; }
.cat-card::before {
  content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  background: var(--grad); opacity: .10; border-radius: 50%; transition: opacity .2s, transform .2s;
}
.cat-card:hover::before { opacity: .22; transform: scale(1.25); }
.cat-card h3 { font-size: 16px; margin-bottom: 4px; }
.cat-card .muted { font-size: 13px; }

.p-card .thumb { aspect-ratio: 4/3; background: var(--panel2); position: relative; overflow: hidden; }
.p-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.p-card:hover .thumb img { transform: scale(1.04); }
.p-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-card .brand { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.p-card h3 { font-size: 15px; font-family: "Manrope"; font-weight: 700; }
.p-card .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 10px; }
.price { font-family: "Unbounded"; font-size: 17px; font-weight: 700; }
.price.sale { color: var(--accent); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.badge {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 9px; border-radius: 6px; background: #222834; color: var(--text);
}
.badge.hit { background: var(--grad); color: #14060a; }
.badge.new { background: var(--green); color: #06220f; }
.badge.sale { background: #ffd60a; color: #221a00; }
.stock { font-size: 13px; font-weight: 600; }
.stock.in { color: var(--green); }
.stock.pre { color: var(--accent2); }
.stock.out { color: var(--muted); }

/* brand strip */
.brands-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.brand-chip {
  padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); font-weight: 700; font-size: 14px; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.brand-chip:hover { color: var(--text); border-color: var(--accent); }

/* features */
.features { grid-template-columns: repeat(4, 1fr); }
.feature { padding: 20px; }
.feature .ico { font-size: 24px; margin-bottom: 10px; }
.feature h3 { font-size: 15px; font-family: "Manrope"; margin-bottom: 6px; }
.feature p { font-size: 14px; color: var(--muted); }

/* section head */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.sec-head h2 { margin: 0; }
.sec-head a { color: var(--accent2); font-weight: 700; font-size: 14px; }

/* category banner */
.cat-banner { border-radius: var(--radius); overflow: hidden; margin: 14px 0 22px; border: 1px solid var(--line); }
.cat-banner img { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.news-banner { border-radius: var(--radius); overflow: hidden; margin: 0 0 22px; border: 1px solid var(--line); }
.news-banner img { width: 100%; max-height: 380px; object-fit: cover; display: block; }

/* category page */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
/* без стрелок в числовых фильтрах */
.toolbar input[type=number]::-webkit-outer-spin-button,
.toolbar input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.toolbar input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.toolbar select, .toolbar input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font-family: inherit; font-size: 14px;
}
.toolbar label { font-size: 13px; color: var(--muted); font-weight: 600; }
.crumbs { font-size: 13px; color: var(--muted); margin: 22px 0 10px; }
.crumbs a:hover { color: var(--text); }

/* product page */
.product-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.gallery .main {
  aspect-ratio: 4/3; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.gallery .main img, .gallery .main iframe, .gallery .main video { width: 100%; height: 100%; object-fit: contain; border: 0; }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery .thumbs button {
  width: 76px; height: 58px; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel); padding: 0; position: relative;
}
.gallery .thumbs button.active { border-color: var(--accent); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs .vid::after {
  content: "▶"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; background: rgba(0,0,0,.45); font-size: 18px;
}
.p-info h1 { font-size: clamp(22px, 3vw, 32px); margin: 6px 0 14px; }
.brand-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .1em;
  transition: color .15s;
}
.brand-link:hover { color: var(--accent2); }
.brand-link img { height: 22px; max-width: 90px; object-fit: contain; }
.brand-link .brand-mark {
  width: 24px; height: 24px; border-radius: 7px; background: var(--grad);
  color: #14060a; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; letter-spacing: 0;
}
.brand-link .arrow { font-size: 14px; transition: transform .15s; }
.brand-link:hover .arrow { transform: translateX(3px); }
.p-info .price { font-size: 30px; }
.p-info .old-price { font-size: 17px; }
.p-info .buy-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.spec-table td { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-table td:first-child { color: var(--muted); width: 45%; }
.desc { margin-top: 30px; max-width: 800px; }
.desc p { margin-bottom: 12px; color: #c7cdd6; }

/* news */
.news-card .thumb { aspect-ratio: 16/9; background: var(--panel2); overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: 18px; }
.news-card time { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.news-card h3 { font-size: 17px; font-family: "Manrope"; margin: 8px 0; }
.article { max-width: 780px; }
.article .cover { border-radius: var(--radius); overflow: hidden; margin: 24px 0; }
.article-body { color: #c7cdd6; white-space: pre-line; }

/* contacts */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.contact-card { padding: 26px; }
.contact-card h3 { margin-bottom: 12px; }
.contact-card .row { display: flex; gap: 10px; padding: 8px 0; align-items: center; }

/* footer */
footer.site { border-top: 1px solid var(--line); background: var(--bg2); padding: 40px 0 30px; margin-top: 40px; }
.foot { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.foot h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.foot a { display: block; padding: 4px 0; color: var(--muted); font-size: 14px; }
.foot a:hover { color: var(--text); }
.copy { margin-top: 30px; font-size: 13px; color: var(--muted); }

/* ===== анимации ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero .kicker, .hero h1, .hero p, .hero .actions { animation: fadeUp .7s cubic-bezier(.2,.7,.2,1) backwards; }
.hero h1 { animation-delay: .08s; }
.hero p { animation-delay: .16s; }
.hero .actions { animation-delay: .24s; }
@keyframes stripesMove { to { background-position: 720px 0; } }
.hero::after { animation: stripesMove 40s linear infinite; }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hero .kicker, .hero h1, .hero p, .hero .actions, .hero::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* лайтбокс (увеличение фото товара) */
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(5, 6, 8, .9); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 20px 80px rgba(0,0,0,.6);
  transform: scale(.96); transition: transform .2s ease;
}
.lightbox.open img { transform: scale(1); }
.lb-btn {
  position: absolute; z-index: 2; cursor: pointer;
  background: rgba(23, 27, 33, .72); color: #eef1f5;
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  width: 46px; height: 46px; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
}
.lb-btn:hover { background: rgba(255, 77, 46, .85); transform: scale(1.06); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #cfd5dd; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  background: rgba(23,27,33,.72); padding: 6px 14px; border-radius: 999px;
}
.gallery .main img { cursor: zoom-in; }

/* misc */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.skeleton { background: linear-gradient(100deg, var(--panel) 40%, var(--panel2) 50%, var(--panel) 60%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 220px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1000px) {
  .grid.cats, .grid.products, .features { grid-template-columns: repeat(2, 1fr); }
  .grid.news-grid { grid-template-columns: 1fr 1fr; }
  .product-layout, .contact-grid { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 16px 20px; gap: 14px;
  }
  .nav-links.open { display: flex; }
  .burger { display: block; }
  .nav .cta { display: none; }
  .grid.products { grid-template-columns: 1fr 1fr; }
  .grid.news-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
