/* ============================================================
   NEONRIG — дизайн-система
   Концепция: «взгляд внутрь работающего корпуса».
   Глубокий фиолетовый туннель, светящееся стекло,
   энергопотоки, реагирующие на скролл.
   Палитра задана брифом.
   ============================================================ */

:root {
    --black:      #000000;
    --ink-900:    #0C0032; /* самый тёмный фиолетовый — фон-глубина */
    --ink-800:    #190061;
    --ink-700:    #240090;
    --violet:     #3500D3; /* основной неон-акцент */
    --grey-900:   #282828; /* нейтральная карточка */
    --grey-700:   #3a3a3a;

    --text:       #EDEAFF;
    --text-dim:   #9b97c4;
    --line:       rgba(255,255,255,.08);

    --glow:       0 0 40px rgba(53,0,211,.45);
    --glow-soft:  0 0 24px rgba(53,0,211,.25);

    --maxw:       1200px;
    --radius:     18px;

    --font-display: 'Unbounded', system-ui, sans-serif;
    --font-body:    'Manrope', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--black);
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Фон-туннель: радиальные пятна фиолетового на чёрном.
   Фиксирован — создаёт глубину при скролле. */
.bg-tunnel {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1100px 700px at 50% -10%, var(--ink-700) 0%, transparent 55%),
        radial-gradient(900px 600px at 85% 20%, rgba(53,0,211,.35) 0%, transparent 50%),
        radial-gradient(800px 800px at 10% 80%, var(--ink-800) 0%, transparent 55%),
        var(--black);
}

/* Тонкая сетка-«плата» поверх фона */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    opacity: .5;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }

/* ── Header ─────────────────────────────────────────────── */
.header {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(8,4,24,.62);
    border-bottom: 1px solid var(--line);
}
.nav {
    display: flex; align-items: center; gap: 6px;
    height: 72px;
}
.logo {
    font-family: var(--font-display); font-weight: 800; font-size: 22px;
    letter-spacing: -.04em; margin-right: 28px; white-space: nowrap;
}
.logo b { color: var(--violet); text-shadow: var(--glow-soft); }

.nav-link {
    padding: 10px 14px; border-radius: 10px; font-size: 15px; color: var(--text-dim);
    transition: color .2s, background .2s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-spacer { flex: 1; }

/* выпадающее меню каталога */
.has-drop { position: relative; }
.drop {
    position: absolute; top: calc(100% + 10px); left: 0;
    min-width: 280px; padding: 10px;
    background: rgba(16,8,40,.96); backdrop-filter: blur(18px);
    border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: .22s ease;
}
.has-drop:hover .drop, .has-drop:focus-within .drop { opacity: 1; visibility: visible; transform: translateY(0); }
.drop a { display: block; padding: 11px 13px; border-radius: 10px; color: var(--text-dim); font-size: 14px; }
.drop a:hover { background: rgba(53,0,211,.18); color: var(--text); }
.drop a b { display: block; color: var(--text); font-size: 15px; margin-bottom: 1px; }

/* значки-вкладки (корзина/кабинет) — меньше остальных */
.nav-icons { display: flex; gap: 4px; align-items: center; }
.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 10px; color: var(--text-dim);
    transition: .2s; position: relative;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count {
    position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 9px; background: var(--violet);
    font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff;
}

.burger { display: none; width: 40px; height: 40px; border: 0; background: transparent; color: var(--text); cursor: pointer; }

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 14px 26px; border-radius: 12px; border: 0;
    font-family: var(--font-body); font-weight: 700; font-size: 15px;
    cursor: pointer; transition: transform .15s, box-shadow .25s, background .2s;
    line-height: 1; text-align: center;
}
.btn-primary { background: var(--violet); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 56px rgba(53,0,211,.7); }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; padding: 130px 0 90px; overflow: hidden; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-dim); margin-bottom: 22px;
    padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
    background: rgba(255,255,255,.03);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #43e07f; box-shadow: 0 0 10px #43e07f; }
.hero h1 { font-size: clamp(40px, 7vw, 84px); max-width: 14ch; }
.hero h1 .accent { color: var(--violet); text-shadow: var(--glow); }
.hero p { margin: 26px 0 36px; font-size: clamp(16px,2vw,19px); color: var(--text-dim); max-width: 52ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* энергопоток — сигнатурный элемент */
.energy { position: absolute; right: -80px; top: 50%; transform: translateY(-50%); width: 620px; max-width: 55vw; opacity: .9; pointer-events: none; }

.hero-stats { display: flex; gap: 40px; margin-top: 64px; flex-wrap: wrap; }
.hero-stats .stat b { font-family: var(--font-display); font-size: 30px; display: block; color: var(--text); }
.hero-stats .stat span { color: var(--text-dim); font-size: 14px; }

/* ── Секции ─────────────────────────────────────────────── */
.section { padding: 90px 0; position: relative; }
.section-head { margin-bottom: 46px; max-width: 60ch; }
.section-head .kicker { color: var(--violet); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(28px, 4vw, 46px); margin-top: 12px; }
.section-head p { color: var(--text-dim); margin-top: 14px; font-size: 17px; }

/* ── Карточки сборок ────────────────────────────────────── */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.card {
    background: linear-gradient(160deg, rgba(40,40,40,.55), rgba(12,0,50,.55));
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .3s, border-color .3s, box-shadow .3s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); border-color: rgba(53,0,211,.55); box-shadow: var(--glow-soft); }
.card-media {
    aspect-ratio: 4/3; position: relative;
    background:
        radial-gradient(120% 120% at 70% 20%, rgba(53,0,211,.45), transparent 60%),
        linear-gradient(160deg, #190061, #0C0032);
    display: grid; place-items: center;
}
.card-media .rig-svg { width: 64%; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
.badge {
    position: absolute; top: 12px; left: 12px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 6px 11px; border-radius: 8px; background: var(--violet); color: #fff;
}
.badge.sale { left: auto; right: 12px; background: #e0144c; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 21px; }
.card-body .sub { color: var(--text-dim); font-size: 13.5px; margin: 6px 0 14px; min-height: 38px; }
.spec-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.spec-list li { font-size: 13.5px; color: var(--text-dim); display: flex; gap: 9px; align-items: center; }
.spec-list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); flex: none; box-shadow: 0 0 8px var(--violet); }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 10px; }
.price { font-family: var(--font-display); font-size: 24px; }
.price-old { color: var(--text-dim); text-decoration: line-through; font-size: 15px; }
.installment { font-size: 12.5px; color: var(--text-dim); margin: 4px 0 16px; }
.card-actions { display: flex; gap: 10px; }
.card-actions .btn { padding: 12px 16px; font-size: 14px; flex: 1; }

/* ── «Почему мы» ────────────────────────────────────────── */
.reasons { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.reason {
    padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
    background: rgba(255,255,255,.02); transition: .3s;
}
.reason:hover { background: rgba(53,0,211,.1); border-color: rgba(53,0,211,.4); }
.reason .num { font-family: var(--font-display); color: var(--violet); font-size: 14px; }
.reason h3 { font-size: 19px; margin: 14px 0 10px; }
.reason p { color: var(--text-dim); font-size: 14.5px; }

/* ── Отзывы ─────────────────────────────────────────────── */
.reviews { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.review {
    padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(40,40,40,.4), rgba(12,0,50,.4));
}
.review .stars { color: #ffce3b; margin-bottom: 14px; letter-spacing: 2px; }
.review p { font-size: 15px; }
.review .who { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.review .who .av { width: 40px; height: 40px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; font-weight: 700; }
.review .who b { display: block; font-size: 14px; }
.review .who span { color: var(--text-dim); font-size: 12.5px; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { max-width: 820px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; background: transparent; border: 0; color: var(--text);
    font-family: var(--font-body); font-weight: 600; font-size: 18px; padding: 22px 0; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q .pm { color: var(--violet); font-size: 26px; transition: transform .25s; flex: none; }
.faq-item.open .faq-q .pm { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; color: var(--text-dim); }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding-bottom: 22px; font-size: 15.5px; }

/* ── Формы ──────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--text-dim); margin-bottom: 8px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 14px 16px; border-radius: 12px;
    background: rgba(255,255,255,.04); border: 1px solid var(--line);
    color: var(--text); font-family: var(--font-body); font-size: 15px; transition: border-color .2s, background .2s;
}
/* Кастомный вид select: убираем системную стрелку и рисуем свою,
   чтобы выпадающий список и контрол совпадали со стилем сайта. */
.field select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 42px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%239b97c4' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    /* Цвет фона самого контрола в закрытом виде */
    background-color: #14082e;
}
/* Пункты выпадающего списка. Многие браузеры (особенно на Windows)
   красят их системным белым — задаём тёмный фон и светлый текст явно. */
.field select option {
    background-color: #14082e;
    color: var(--text);
}
.field select option:checked,
.field select option:hover {
    background-color: var(--violet);
    color: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); background-color: rgba(53,0,211,.12); }
.field textarea { resize: vertical; min-height: 110px; }
.field .err { color: #ff6b8a; font-size: 13px; margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Кастомный чекбокс в стиле сайта */
.checkbox { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-dim); cursor: pointer; user-select: none; }
.checkbox input[type="checkbox"] {
    -webkit-appearance: none; appearance: none; margin: 0;
    width: 20px; height: 20px; flex: none; margin-top: 1px;
    border: 1px solid var(--line); border-radius: 6px;
    background: rgba(255,255,255,.04); cursor: pointer;
    display: grid; place-content: center;
    transition: background .15s, border-color .15s;
}
.checkbox input[type="checkbox"]::before {
    content: ""; width: 11px; height: 11px;
    transform: scale(0); transition: transform .15s ease;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.checkbox input[type="checkbox"]:checked {
    background: var(--violet); border-color: var(--violet);
    box-shadow: var(--glow-soft);
}
.checkbox input[type="checkbox"]:checked::before { transform: scale(1); }
.checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.checkbox a { color: var(--violet); }

.auth-wrap { max-width: 460px; margin: 60px auto; padding: 38px;
    border: 1px solid var(--line); border-radius: 22px; background: rgba(16,8,40,.7); backdrop-filter: blur(14px); }
.auth-wrap h1 { font-size: 30px; margin-bottom: 8px; }
.auth-wrap .lead { color: var(--text-dim); margin-bottom: 28px; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--text-dim); font-size: 14px; }
.auth-alt a { color: var(--violet); font-weight: 600; }

/* ── Flash / алерты ─────────────────────────────────────── */
.flash { padding: 16px 20px; border-radius: 12px; margin-bottom: 22px; font-size: 15px;
    background: rgba(67,224,127,.12); border: 1px solid rgba(67,224,127,.4); color: #b8ffd2; }
.flash.error { background: rgba(255,107,138,.12); border-color: rgba(255,107,138,.4); color: #ffd0da; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 60px 0 40px; margin-top: 40px; background: rgba(0,0,0,.4); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.footer h4 { font-family: var(--font-body); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 16px; }
.footer a { display: block; color: var(--text-dim); padding: 5px 0; font-size: 14.5px; transition: color .2s; }
.footer a:hover { color: var(--text); }
.footer .logo { font-size: 24px; margin: 0 0 12px; }
.footer .about { color: var(--text-dim); font-size: 14px; max-width: 36ch; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--text-dim); font-size: 13px; }
.pay-badges { display: flex; gap: 10px; align-items: center; }
.pay-badges span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }

/* ── Scroll-reveal ──────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── Страница товара ────────────────────────────────────── */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; padding: 50px 0; }
.product-media { border-radius: 22px; aspect-ratio: 4/3; position: relative; overflow: hidden;
    background: radial-gradient(120% 120% at 60% 20%, rgba(53,0,211,.5), transparent 60%), linear-gradient(160deg,#190061,#0C0032);
    display: grid; place-items: center; border: 1px solid var(--line); }
.product-media .rig-svg { width: 60%; }
.product h1 { font-size: clamp(30px, 4vw, 46px); }
.product .sub { color: var(--text-dim); font-size: 18px; margin: 10px 0 24px; }
.product .price-block { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.product .price-block .price { font-size: 38px; }
.spec-table { width: 100%; border-collapse: collapse; margin: 26px 0; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table td { padding: 13px 0; font-size: 15px; }
.spec-table td:first-child { color: var(--text-dim); width: 42%; }
.spec-table td:last-child { font-weight: 600; }

/* ── Утилиты ────────────────────────────────────────────── */
.center { text-align: center; }
.mt-40 { margin-top: 40px; }
.muted { color: var(--text-dim); }
.pill { display:inline-block; padding:5px 12px; border:1px solid var(--line); border-radius:999px; font-size:13px; color:var(--text-dim); }
/* Кнопки-фильтры каталога */
button.pill { cursor:pointer; background:transparent; font-family:var(--font-body); transition:border-color .2s, color .2s, background .2s; }
button.pill:hover { color:var(--text); border-color:rgba(53,0,211,.5); }
.pill[data-active] { border-color:var(--violet); color:var(--text); background:rgba(53,0,211,.15); }
/* Затухание сетки при загрузке нового фильтра */
[data-catalog-grid] { transition:opacity .2s; }
[data-catalog-grid].is-loading { opacity:.4; pointer-events:none; }

/* ── Адаптив ────────────────────────────────────────────── */
@media (max-width: 980px) {
    .grid, .reasons, .reviews { grid-template-columns: repeat(2,1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .product { grid-template-columns: 1fr; }
    .energy { display: none; }
}
@media (max-width: 760px) {
    .nav-desktop { display: none; }
    .burger { display: grid; place-items: center; }
    .nav-mobile-open .nav-desktop {
        display: flex; position: absolute; top: 72px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px; padding: 16px;
        background: rgba(10,5,28,.98); border-bottom: 1px solid var(--line);
    }
    .nav-mobile-open .has-drop .drop { position: static; opacity:1; visibility:visible; transform:none; box-shadow:none; background:transparent; border:0; padding-left: 12px; }
    .grid, .reasons, .reviews, .footer-grid, .field-row { grid-template-columns: 1fr; }
    .hero { padding: 70px 0 60px; }
    .hero-stats { gap: 26px; }
    .section { padding: 60px 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ── Тосты (AJAX-уведомления) ────────────────────────────── */
.toast-host {
    position: fixed; right: 20px; bottom: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
    background: rgba(16,8,40,.97); backdrop-filter: blur(14px);
    border: 1px solid rgba(53,0,211,.5); border-left: 3px solid var(--violet);
    color: var(--text); padding: 14px 18px; border-radius: 12px;
    font-size: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
    opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s;
}
.toast.in { opacity: 1; transform: none; }
.toast-error { border-color: rgba(255,107,138,.5); border-left-color: #ff6b8a; }
@media (max-width: 600px) {
    .toast-host { left: 16px; right: 16px; max-width: none; }
}
