/* ============================================================
   Wiring Lab — стили
   Тёмная технологичная тема. CSS-переменные, Grid/Flexbox,
   анимации: reveal при скролле, hero-параллакс, hover-эффекты,
   плавные модальные окна, микроанимации.
   ============================================================ */

/* ============ Переменные ============ */
:root {
    /* Цвета */
    --bg: #0a0f16;
    --bg-soft: #0e1520;
    --surface: #131c29;
    --surface-2: #1a2436;
    --border: #223049;
    --border-soft: #1b2740;
    --text: #e8eef7;
    --muted: #8fa1bb;
    --accent: #ffb52e;
    --accent-strong: #ff9d1e;
    --accent-2: #37d5ff;
    --accent-ink: #1a1204;      /* текст на янтарных кнопках */
    --danger: #ff6b6b;
    --success: #4ade80;

    /* Отступы и радиусы */
    --radius: 14px;
    --radius-lg: 22px;
    --container: 1200px;
    --header-h: 76px;
    --section-pad: clamp(56px, 9vw, 110px);

    /* Тени */
    --shadow-1: 0 10px 30px rgba(2, 6, 12, 0.4);
    --shadow-2: 0 18px 50px rgba(2, 6, 12, 0.55);
    --glow-accent: 0 8px 32px rgba(255, 181, 46, 0.22);

    /* Шрифты */
    --font-head: 'Manrope', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* ============ Базовые стили ============ */
*, *::before, *::after { box-sizing: border-box; }

/* Атрибут hidden всегда важнее любых display-правил
   (иначе классы с display:flex/block перекрывают скрытие) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.no-scroll { overflow: hidden; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.text-grad {
    background: linear-gradient(92deg, var(--accent) 10%, var(--accent-2) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============ Кнопки ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease,
                background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease;
    will-change: transform;
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.25s ease; }

.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--accent-ink);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-accent);
    filter: brightness(1.05);
}
.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    background: rgba(255, 181, 46, 0.06);
}
.btn--ghost:hover svg { transform: translateX(3px); }

.btn--sm { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
.btn--lg { padding: 17px 32px; font-size: 16px; }

.btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* Спиннер внутри кнопки */
.btn__spinner {
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Шапка ============ */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(10, 15, 22, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.header.is-scrolled {
    background: rgba(10, 15, 22, 0.9);
    border-bottom-color: var(--border-soft);
}

.header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Логотип */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: none;
}
.logo__mark { width: 34px; height: 34px; transition: transform 0.3s ease; }
.logo:hover .logo__mark { transform: rotate(-6deg) scale(1.06); }
.logo__text {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.01em;
}

/* Навигация */
.nav { display: flex; align-items: center; gap: 6px; }
.nav__link {
    position: relative;
    padding: 9px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    border-radius: 10px;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.nav__link::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 5px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__link:hover::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 12px; }

/* Кнопка корзины */
.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }

.cart-btn__count {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-head);
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 10px;
}
.cart-btn__count.is-pulse { animation: pulse 0.5s ease; }
@keyframes pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Бургер */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.burger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
    position: relative;
    overflow: hidden;
    min-height: min(92vh, 860px);
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) 0 70px;
    background: var(--bg);
}

.hero__bg { position: absolute; inset: 0; pointer-events: none; }

/* Сетка-подложка */
.hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
    opacity: 0.55;
}

/* Световые пятна (анимированные) */
.hero__blob {
    position: absolute;
    width: 560px; height: 560px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.16;
    will-change: transform;
}
.hero__blob--1 {
    top: -180px; right: -120px;
    background: var(--accent);
    animation: float 14s ease-in-out infinite;
}
.hero__blob--2 {
    bottom: -240px; left: -160px;
    background: var(--accent-2);
    animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 40px) scale(1.08); }
}

/* Анимированные линии-цепи */
.hero__circuit {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0.5;
}
.circuit-line {
    stroke: var(--border);
    stroke-width: 2;
    stroke-dasharray: 6 10;
    animation: dashmove 30s linear infinite;
}
.circuit-node {
    fill: var(--accent);
    animation: nodeblink 3.2s ease-in-out infinite;
}
.circuit-node:nth-of-type(2n) { animation-delay: 1.1s; fill: var(--accent-2); }
.circuit-node:nth-of-type(3n) { animation-delay: 2.2s; }
@keyframes dashmove { to { stroke-dashoffset: -320; } }
@keyframes nodeblink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.hero__inner { position: relative; z-index: 1; }

.hero__content { max-width: 720px; }

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255, 181, 46, 0.08);
    border: 1px solid rgba(255, 181, 46, 0.25);
    border-radius: 100px;
}
.hero__eyebrow::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: nodeblink 2s ease-in-out infinite;
}

.hero__title {
    font-size: clamp(38px, 6.4vw, 68px);
    font-weight: 800;
    margin: 0 0 24px;
}

.hero__text {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--muted);
    margin: 0 0 36px;
    max-width: 560px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }

/* Счётчики */
.hero__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 0;
    padding: 26px 0 0;
    border-top: 1px solid var(--border-soft);
    max-width: 640px;
}
.stat__value {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 4px;
}
.stat__label { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ============ Секции ============ */
.section { padding: var(--section-pad) 0; }
.section--tight { padding-top: 10px; }

.section__head { max-width: 640px; margin-bottom: 44px; }
.section__head--row {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section__title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.section__text { color: var(--muted); margin: 12px 0 0; font-size: 16.5px; }

/* ============ Преимущества ============ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature {
    padding: 30px 26px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.feature:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 181, 46, 0.4);
    box-shadow: var(--shadow-1);
}

.feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    margin-bottom: 20px;
    border-radius: 14px;
    color: var(--accent);
    background: rgba(255, 181, 46, 0.09);
    border: 1px solid rgba(255, 181, 46, 0.22);
    transition: transform 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.feature__icon svg { width: 26px; height: 26px; }
.feature:hover .feature__icon {
    transform: scale(1.08) rotate(-4deg);
    border-color: var(--accent);
}

.feature__title { font-size: 18px; margin-bottom: 10px; }
.feature__text { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ============ Категории ============ */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.cat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 181, 46, 0.4);
    box-shadow: var(--shadow-2);
}
.cat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-card:hover::after { transform: scaleX(1); }

.cat-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    margin-bottom: 20px;
    border-radius: 16px;
    color: var(--accent-2);
    background: rgba(55, 213, 255, 0.08);
    border: 1px solid rgba(55, 213, 255, 0.22);
    transition: transform 0.3s ease;
}
.cat-card__icon svg { width: 28px; height: 28px; }
.cat-card:hover .cat-card__icon { transform: scale(1.08) rotate(-4deg); color: var(--accent); }

.cat-card__title { font-size: 20px; margin-bottom: 10px; }
.cat-card__text { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; flex: 1; }
.cat-card__count {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-head);
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cat-card__badge {
    position: absolute;
    top: 16px; right: 16px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: rgba(55, 213, 255, 0.1);
    border: 1px solid rgba(55, 213, 255, 0.3);
    border-radius: 100px;
}

/* ============ Карточки товаров ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.cards-grid--catalog { grid-template-columns: repeat(3, 1fr); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-7px) scale(1.008);
    border-color: rgba(255, 181, 46, 0.45);
    box-shadow: var(--shadow-2);
}
.card.is-hidden { display: none; }

.card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-2);
}
.card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card__media img { transform: scale(1.06); }

.card__badge {
    position: absolute;
    top: 14px; left: 14px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-radius: 100px;
    box-shadow: 0 4px 14px rgba(255, 157, 30, 0.35);
}

.card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 22px 24px;
}

.card__cat {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-head);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-2);
}
.card__title { font-size: 17.5px; margin: 0 0 10px; }
.card__title a { transition: color 0.2s ease; }
.card__title a:hover { color: var(--accent); }
.card__text {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__footer { margin-bottom: 14px; }
.card__price {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 19px;
    color: var(--accent);
}

.card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s ease, gap 0.2s ease;
}
.card__link svg { width: 16px; height: 16px; }
.card__link:hover { color: var(--accent); gap: 6px; }

/* Анимация кнопки «В корзину» после добавления */
.js-add-to-cart.is-added { animation: added 0.5s ease; }
@keyframes added {
    0% { transform: scale(1); }
    40% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* ============ CTA ============ */
.cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(32px, 5vw, 56px);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.cta::before {
    content: '';
    position: absolute;
    top: -120px; right: -80px;
    width: 380px; height: 380px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(110px);
    opacity: 0.13;
    pointer-events: none;
}
.cta__body { max-width: 640px; }
.cta__title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin-bottom: 12px; }
.cta .btn { flex: none; }

/* ============ Форма обратной связи ============ */
.contact {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

.contact__list {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    gap: 18px;
}
.contact__list li { display: flex; align-items: center; gap: 14px; }
.contact__list a { color: var(--text); font-weight: 500; transition: color 0.2s ease; }
.contact__list a:hover { color: var(--accent); }
.contact__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    flex: none;
    border-radius: 12px;
    color: var(--accent);
    background: rgba(255, 181, 46, 0.08);
    border: 1px solid rgba(255, 181, 46, 0.2);
}
.contact__icon svg { width: 20px; height: 20px; }

.contact__form {
    padding: clamp(26px, 4vw, 40px);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field__label { font-size: 13.5px; font-weight: 600; font-family: var(--font-head); color: var(--muted); }
.field__label span { color: var(--accent); }
.field__input {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field__input::placeholder { color: #5c6f8c; }
.field__input:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(55, 213, 255, 0.15);
    background: var(--surface-2);
}
.field__textarea { resize: vertical; min-height: 110px; }
.field__hint { font-size: 12.5px; color: #5c6f8c; margin: 12px 0 0; }

.field--search, .field--sort { margin-bottom: 0; min-width: 0; }
.field--search { position: relative; flex: 1; }
.field__icon {
    position: absolute;
    left: 15px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.field--search .field__input { padding-left: 44px; }
.field--sort { flex: none; width: 220px; }
.field--sort .field__input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }

.form-status {
    margin: 14px 0 0;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--success);
}
.form-status.is-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

/* ============ Страницы: заголовок ============ */
.page-head { padding: calc(var(--header-h) + clamp(32px, 6vw, 64px)) 0 36px; }
.page-head--product { padding-bottom: 10px; }
.page-head__title { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; margin: 14px 0 12px; }
.page-head__text { color: var(--muted); max-width: 620px; margin: 0; }

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13.5px;
    color: var(--muted);
}
.breadcrumbs svg { width: 15px; height: 15px; opacity: 0.6; }
.breadcrumbs a { transition: color 0.2s ease; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current] { color: var(--text); }

/* ============ Фильтры каталога ============ */
.catalog-filters { padding: 0 0 26px; }
.filters { display: grid; gap: 18px; }
.filters__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-head);
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.chip.is-active {
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 157, 30, 0.3);
}

.catalog-count { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.catalog-empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ============ Страница товара ============ */
.product {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.product__gallery { position: sticky; top: calc(var(--header-h) + 24px); }

.product__media {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
}
.product__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

.product__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.product__thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__thumb:hover { transform: translateY(-2px); border-color: var(--border); }
.product__thumb.is-active { border-color: var(--accent); }

.product__info .card__cat { margin-bottom: 10px; }
.product__title { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; margin-bottom: 16px; }
.product__short { color: var(--muted); font-size: 16.5px; margin: 0 0 28px; }

.product__actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 24px;
    margin-bottom: 28px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}
.product__price strong {
    font-family: var(--font-head);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}
.product__dev { margin: 0; color: var(--muted); font-size: 15px; }

.product__features {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    display: grid;
    gap: 12px;
}
.product__features li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.product__features svg {
    width: 18px; height: 18px;
    flex: none;
    margin-top: 3px;
    color: var(--success);
}

.product__specs-title { font-size: 20px; margin-bottom: 16px; }

/* Кнопка скачивания инструкции */
/* Блок документов: один или несколько PDF */
.product__manuals {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
}
.product__manual {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.product__manual:hover {
    transform: translateY(-3px);
    border-color: rgba(55, 213, 255, 0.45);
    box-shadow: var(--shadow-1);
}
.product__manual-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    flex: none;
    border-radius: 12px;
    color: var(--accent-2);
    background: rgba(55, 213, 255, 0.08);
    border: 1px solid rgba(55, 213, 255, 0.22);
    transition: transform 0.25s ease;
}
.product__manual-icon svg { width: 24px; height: 24px; }
.product__manual:hover .product__manual-icon {
    transform: scale(1.06);
    color: var(--accent);
    background: rgba(255, 181, 46, 0.1);
    border-color: rgba(255, 181, 46, 0.4);
}
/* Стрелка скачивания: мягкий сдвиг вниз при наведении */
.manual-arrow {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.product__manual:hover .manual-arrow { transform: translateY(2px); }
.product__manual strong { display: block; font-family: var(--font-head); font-size: 15px; color: var(--text); }
.product__manual em { font-style: normal; font-size: 13px; color: var(--muted); }
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}
.specs-table th, .specs-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.specs-table tr:first-child th, .specs-table tr:first-child td { border-top: 1px solid var(--border-soft); }
.specs-table th { color: var(--muted); font-weight: 500; width: 42%; }
.specs-table td { color: var(--text); font-weight: 500; }
.specs-table tr { transition: background-color 0.2s ease; }
.specs-table tr:hover { background-color: rgba(255, 181, 46, 0.04); }

.product__desc-body { max-width: 820px; color: var(--muted); font-size: 16.5px; }
.product__desc-body p { margin: 0 0 18px; }
.product__desc-body strong { color: var(--text); }

/* ============ Модальные окна ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 14, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.modal__card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__card { opacity: 1; transform: none; }

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal__title { font-size: 24px; font-weight: 800; margin: 0; }
.modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { color: var(--text); border-color: var(--accent); transform: rotate(90deg); }

/* Товары в корзине */
.cart__items { display: grid; gap: 12px; margin-bottom: 20px; }

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    animation: cartitem 0.3s ease;
}
@keyframes cartitem {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.cart-item__name { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; font-family: var(--font-head); }
.cart-item__price { margin: 0; font-size: 13px; color: var(--muted); }
.cart-item__sum { font-size: 14.5px; font-weight: 700; font-family: var(--font-head); color: var(--accent); white-space: nowrap; }

.cart-item__qty {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}
.qty-btn {
    width: 30px; height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.qty-btn:hover { color: var(--accent); background: rgba(255, 181, 46, 0.1); }
.qty-num { min-width: 26px; text-align: center; font-weight: 600; font-size: 14.5px; }

.cart-item__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.cart-item__remove svg { width: 15px; height: 15px; }
.cart-item__remove:hover { color: var(--danger); background: rgba(255, 107, 107, 0.1); }

.cart__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    margin-bottom: 18px;
    font-size: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.cart__total strong { font-family: var(--font-head); font-size: 21px; font-weight: 800; color: var(--accent); }

.cart__success, .cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 32px 12px;
    animation: cartitem 0.35s ease;
}
.cart__success-icon, .cart__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px; height: 72px;
    border-radius: 50%;
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.cart__empty-icon { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.cart__success-icon svg, .cart__empty-icon svg { width: 34px; height: 34px; }
.cart__success-title { font-size: 22px; margin: 0; }
.cart__success-text { margin: 0; color: var(--muted); }
.cart__empty p { margin: 0; color: var(--muted); }

.cart__checkout .btn--lg { width: 100%; justify-content: center; }

/* ============ Всплывающие уведомления ============ */
.toasts {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: grid;
    gap: 10px;
    justify-items: center;
    pointer-events: none;
}
.toast {
    padding: 12px 22px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    box-shadow: var(--shadow-1);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.is-visible { opacity: 1; transform: none; }

/* ============ Подвал ============ */
.footer {
    border-top: 1px solid var(--border-soft);
    background: var(--bg-soft);
    padding: 56px 0 0;
}
.footer__inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer__text { color: var(--muted); font-size: 14.5px; margin: 16px 0 0; max-width: 300px; }
.footer__head {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 16px;
}
.footer__nav, .footer__contacts { display: grid; gap: 10px; align-content: start; }
.footer__nav a, .footer__contacts a, .footer__contacts span { color: var(--muted); font-size: 14.5px; transition: color 0.2s ease; }
.footer__nav a:hover, .footer__contacts a:hover { color: var(--accent); }
.footer__bottom {
    padding: 20px 20px;
    border-top: 1px solid var(--border-soft);
    color: #5c6f8c;
    font-size: 13.5px;
}

/* ============ Анимация появления при скролле ============ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ Адаптивность (mobile-first корректировки) ============ */
@media (max-width: 1080px) {
    .cards-grid, .features-grid { grid-template-columns: repeat(2, 1fr); }
    .cards-grid--catalog { grid-template-columns: repeat(2, 1fr); }
    .cats-grid { grid-template-columns: 1fr; }
    .hero__stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    /* Бургер-меню */
    .burger { display: flex; }
    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 16px 20px 24px;
        background: rgba(10, 15, 22, 0.97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;
        transition: opacity 0.28s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
    .nav__link { padding: 14px; font-size: 16px; border-radius: 12px; background: var(--surface); }
    .nav__link::after { display: none; }

    .contact { grid-template-columns: 1fr; }
    .product { grid-template-columns: 1fr; }
    .product__gallery { position: static; }
    .cta { flex-direction: column; align-items: flex-start; }
    .section__head--row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .cards-grid, .cards-grid--catalog, .features-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero { min-height: auto; }
    .hero__actions .btn { width: 100%; justify-content: center; }
    .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .cart-item { grid-template-columns: 1fr auto; grid-template-areas: "info remove" "qty sum"; }
    .cart-item__info { grid-area: info; }
    .cart-item__qty { grid-area: qty; justify-self: start; }
    .cart-item__sum { grid-area: sum; justify-self: end; }
    .cart-item__remove { grid-area: remove; justify-self: end; }
    .filters__row { flex-direction: column; align-items: stretch; }
    .field--sort { width: 100%; }
    .modal__card { padding: 22px 18px; }
}

/* ============ Уважение к prefers-reduced-motion ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
