/* ========================================
   TechShop — Основные стили
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary Colors - Dark Blue/Navy instead of purple */
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary: #475569;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;

    /* Light Theme (default) */
    --bg: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;

    /* Primary with opacity */
    --primary-10: rgba(30, 64, 175, 0.1);
    --primary-05: rgba(30, 64, 175, 0.05);
    --primary-02: rgba(30, 64, 175, 0.02);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }


.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header --- */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header__top {
    border-bottom: 1px solid var(--border);
}

.header__top-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 90px;
    padding: 6px 0;
}

.header__brand {
}

/* Логотип + подпись */
.header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    margin-right: auto;
}

.header__tagline {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 160px;
    border-left: 2px solid var(--border);
    padding-left: 14px;
}

.header__contacts {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 20px;
    flex-shrink: 0;
}

.header__contacts-location,
.header__contacts-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.header__contacts-address,
.header__contacts-phone,
.header__contacts-hours {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
}

.header__contacts-phone {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.header__contacts-map-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
}

.header__contacts-map-link:hover .header__contacts-address {
    color: var(--primary);
}

/* Страница контактов */
.contacts-block {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 32px;
    align-items: start;
    margin-top: 16px;
}

.contacts-info p {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.contacts-info a {
    color: var(--primary);
}

.contacts-map {
    border-radius: 12px;
    overflow: hidden;
}

/* Поисковая строка под навигацией */
.header__search-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.header__search-bar .search-container {
    max-width: 100%;
    margin: 0;
}

.header__search-bar .search-input {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.header__search-bar .search-input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
    transform: none;
    outline: none;
}

/* Кнопка звонка — только мобильный */
.nav__call {
    display: none;
    align-items: center;
    justify-content: center;
    color: #4ade80;
    padding: 6px 8px;
    min-height: 44px;
}

.nav__call:hover {
    color: #22c55e;
    text-decoration: none;
}

.nav__map {
    display: none;
    align-items: center;
    justify-content: center;
    color: #f97316;
    padding: 6px 8px;
    min-height: 44px;
}

.nav__map:hover {
    color: #ea580c;
    text-decoration: none;
}

/* Навигационная полоса под хедером */
.header__nav-bar {
    background: #1e293b;
    border-bottom: 1px solid #0f172a;
}

.header__nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__nav-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.header__nav-link {
    display: inline-block;
    padding: 10px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.header__nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Мобильная панель Меню + лупа (скрыта на десктопе) */
.mob-bar {
    display: none;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: space-between;
}

.mob-bar__search-inline {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0 10px;
    gap: 6px;
    min-width: 0;
}
.mob-bar__search-icon {
    flex-shrink: 0;
    opacity: 0.7;
    color: #fff;
}
.mob-bar__search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #fff !important;
    font-size: 14px;
    padding: 8px 0 !important;
    min-width: 0;
    box-shadow: none !important;
}
.mob-bar__search-input::placeholder { color: rgba(255,255,255,0.6); }
.mob-bar__search-inline .search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: -10px;
    right: -10px;
    z-index: 500;
}

.mob-bar__menu {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: color 0.15s;
}
.mob-bar__menu:hover { color: #fff; }

.mob-bar__search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.mob-bar__search:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Мобильное меню (drawer слева) ─────────────────────────── */
.mob-menu {
    position: fixed;
    top: 0; left: -100%;
    width: 80vw; max-width: 300px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    transition: left 0.28s cubic-bezier(.4,0,.2,1);
}
.mob-menu.active { left: 0; }

.mob-menu__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1999;
}
.mob-menu__overlay.active { display: block; }

.mob-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #1e293b;
}
.mob-menu__title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.mob-menu__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}
.mob-menu__close:hover { color: #fff; }

.mob-menu__nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}

.mob-menu__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
}
.mob-menu__link:hover { background: var(--primary-05); color: var(--primary); }

.mob-menu__link--catalog {
    font-weight: 600;
    color: var(--primary);
}

/* ── Мобильный поиск (всплывает сверху) ────────────────────── */
.mob-search-bar {
    position: fixed;
    top: -100%;
    left: 0; right: 0;
    background: var(--bg-card);
    z-index: 2100;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transition: top 0.25s cubic-bezier(.4,0,.2,1);
    padding: 12px 16px;
}
.mob-search-bar.active { top: 0; }

.mob-search-bar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2099;
}
.mob-search-bar__overlay.active { display: block; }

.mob-search-bar__inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mob-search-bar__close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.mob-search-bar__close:hover { color: var(--text); }


/* Статическая страница */
.static-page {
    max-width: 860px;
    margin: 40px auto;
}

.static-page__content {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
}

.static-page__content h1,
.static-page__content h2,
.static-page__content h3 {
    margin: 1.5em 0 0.5em;
    color: var(--text);
}

.static-page__content p { margin: 0 0 1em; }
.static-page__content ul,
.static-page__content ol { padding-left: 1.5em; margin: 0 0 1em; }
.static-page__content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.static-page__content table th,
.static-page__content table td { padding: 8px 12px; border: 1px solid var(--border); }
.static-page__content table th { background: var(--bg-secondary); font-weight: 600; }
.static-page__content img { max-width: 100%; height: auto; border-radius: var(--radius); }

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    border-radius: var(--radius-lg);
    background: white;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s, transform 0.2s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(71, 85, 105, 0.4);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    margin-top: 8px;
}

.search-dropdown.active {
    display: block;
}

.search-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.search-dropdown__item:last-child {
    border-bottom: none;
}

.search-dropdown__item:hover {
    background: var(--bg);
}

.search-dropdown__more {
    display: block;
    padding: 11px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    border-top: 1px solid var(--border);
    background: var(--bg);
    transition: background 0.15s;
}

.search-dropdown__more:hover {
    background: var(--bg-card);
}

.search-dropdown__image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.search-dropdown__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-dropdown__image--emoji {
    font-size: 24px;
}

.search-dropdown__info {
    flex: 1;
    min-width: 0;
}

.search-dropdown__name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-dropdown__price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    height: 100%;
}
.logo:hover { text-decoration: none; }
.logo__icon { font-size: 28px; }
.logo__img {
    height: 100%;
    width: auto;
    max-height: 78px;
    mix-blend-mode: multiply;
}


.nav {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: -20px;
}

.nav__link {
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
}
.nav__link:hover { color: var(--primary); text-decoration: none; }

.nav__cart {
    position: relative;
}

.nav__cart-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.nav__admin {
    opacity: 0.5;
}
.nav__admin:hover { opacity: 1; }

/* --- Main --- */
.main {
    flex: 1;
    padding: 24px 0;
}

/* --- Footer --- */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 0;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 14px;
}
.footer__col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer__col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.footer__col a:hover { color: var(--primary); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
    background: var(--primary);
    color: white;
}
.btn--primary:hover { background: var(--primary-hover); }

.btn--ai {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    font-weight: 600;
    white-space: nowrap;
}
.btn--ai:hover { background: linear-gradient(135deg, #6d28d9, #4338ca); }

/* AI-панель в модалке редактирования */
.ai-panel {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-panel__label {
    font-size: 13px;
    font-weight: 700;
    color: #5b21b6;
}
.ai-panel__generate {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ai-panel__parse {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-parse-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    font-size: 13px;
    background: white;
}
.ai-parse-input:focus {
    outline: none;
    border-color: #7c3aed;
}
.ai-status {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
}
.ai-status--info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ai-status--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.ai-status--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Галерея изображений товара в модалке */
.product-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    min-height: 20px;
}
.image-card {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid var(--border, #e5e7eb);
    overflow: visible;
    flex-shrink: 0;
}
.image-card--primary {
    border-color: #667eea;
}
.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    cursor: pointer;
}
.image-card__delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: background 0.15s;
}
.image-card__delete:hover {
    background: #b91c1c;
}
.image-card__badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(102, 126, 234, 0.85);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px 0;
    border-radius: 0 0 6px 6px;
    cursor: default;
}
.image-card__badge--secondary {
    background: rgba(107, 114, 128, 0.7);
    cursor: pointer;
}
.image-card__drag {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #64748b;
    color: white;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    cursor: grab;
    z-index: 10;
    border: 2px solid white;
    user-select: none;
}
.image-card__drag:active {
    cursor: grabbing;
}
.image-card.drag-over {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b55;
}
.image-card__badge--secondary:hover {
    background: rgba(102, 126, 234, 0.85);
}

/* Превью фото в таблице товаров категории */
.product-thumb-cell {
    text-align: center;
    vertical-align: middle;
    padding: 4px !important;
}
.product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border, #e5e7eb);
}
.product-thumb-empty {
    display: block;
    text-align: center;
    font-size: 22px;
    opacity: 0.35;
    line-height: 40px;
}

/* Picker характеристик со страницы */
.attrs-picker {
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    background: #faf5ff;
    margin: 10px 0;
    overflow: hidden;
    font-size: 13px;
}
.attrs-picker__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ede9fe;
    font-weight: 500;
    color: #5b21b6;
}
.attrs-picker__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #7c3aed;
    line-height: 1;
    padding: 0 4px;
}
.attrs-picker__list {
    max-height: 220px;
    overflow-y: auto;
}
.attrs-picker__row {
    display: flex;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    border-bottom: 1px solid #ede9fe;
    transition: background 0.12s;
}
.attrs-picker__row:last-child { border-bottom: none; }
.attrs-picker__row:hover { background: #ede9fe; }
.attrs-picker__name {
    color: #6b7280;
    flex: 0 0 45%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attrs-picker__value {
    color: #111827;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Строки характеристик товара с drag-and-drop */
.attr-row,
.schema-field-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.attr-row:hover { border-color: var(--border, #e5e7eb); }
.attr-row--dragging {
    opacity: 0.4;
}
.attr-row--over {
    border-color: #667eea;
    background: #f0f0ff;
}
.attr-row__handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 16px;
    padding: 0 2px;
    flex-shrink: 0;
    user-select: none;
}
.attr-row__handle:active { cursor: grabbing; }
.attr-row__label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    flex: 0 0 38%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attr-row__delete {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    line-height: 1;
}
.attr-row__delete:hover { color: #b91c1c; }

.btn--secondary {
    background: var(--secondary);
    color: white;
}
.btn--secondary:hover { opacity: 0.9; }

.btn--danger {
    background: var(--danger);
    color: white;
}
.btn--danger:hover { opacity: 0.9; }

.btn--cart {
    background: var(--success);
    color: white;
    width: 100%;
    padding: 10px;
    border-radius: 0 0 var(--radius) var(--radius);
}
.btn--cart:hover { opacity: 0.9; }

.btn--preorder {
    width: 100%;
    padding: 10px;
    border-radius: 0 0 var(--radius) var(--radius);
}

.btn--sm { padding: 4px 10px; font-size: 13px; }
.btn--lg { padding: 12px 24px; font-size: 16px; }
.btn--block { width: 100%; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.badge--available, .badge--new {
    background: #dcfce7;
    color: #166534;
}
.badge--unavailable {
    background: #fee2e2;
    color: #991b1b;
}
.badge--completed {
    background: #dbeafe;
    color: #1e40af;
}
.badge--processing {
    background: #fef3c7;
    color: #92400e;
}
.badge--new {
    background: #e0e7ff;
    color: #3730a3;
}
.badge--hit {
    background: #fff7ed;
    color: #c2410c;
}
.badge--featured {
    background: #fef9c3;
    color: #854d0e;
}
.badge--processed {
    background: #fef3c7;
    color: #92400e;
}
.badge--cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.form-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* --- Catalog --- */
.catalog__title {
    font-size: 28px;
    margin-bottom: 32px;
}

/* Categories Showcase */
.categories-showcase {
    margin-bottom: 40px;
}

.categories-showcase__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.categories-showcase__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.category-tile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    min-height: 160px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-10);
    transform: translateY(-4px);
}

.category-tile--all {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.category-tile--all:hover {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-4px);
}

.category-tile__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    transition: all 0.3s;
}

.category-tile__image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.category-tile__emoji {
    font-size: 48px;
    line-height: 1;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-tile__name {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    word-break: break-word;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-tile__count {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.category-tile--expandable {
    position: relative;
}

.category-tile__toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    transition: all 0.3s;
    z-index: 10;
}

.category-tile__toggle:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-tile__arrow {
    font-size: 14px;
    transition: transform 0.3s;
}

.category-tile__subcategories {
    flex-direction: column;
    border-top: 1px solid var(--border);
    background: var(--bg);
    width: 100%;
}

.category-tile__subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.category-tile__subitem:last-child {
    border-bottom: none;
}

.category-tile__subitem:hover {
    background: white;
    color: var(--primary);
}

.category-tile__subicon {
    font-size: 20px;
    flex-shrink: 0;
}

.category-tile__subname {
    font-size: 13px;
    font-weight: 500;
}

/* --- Catalog Layout (Menu + Slider) --- */
.catalog__layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    margin-bottom: 32px;
    align-items: start;
}

.catalog__slider-area {
    flex: 1;
    min-height: 300px;
}

/* --- Categories Menu (Vertical with hover dropdowns) --- */
.categories-menu {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: fit-content;
    max-width: 250px;
}

.categories-nav {
    display: flex;
    flex-direction: column;
    list-style: none;
}

.categories-nav__item-wrapper {
    position: relative;
}

.categories-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
}

.categories-nav__item:last-of-type {
    border-bottom: none;
}

.categories-nav__item:hover {
    background: var(--bg);
    padding-left: 18px;
}

.categories-nav__item--all {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-bottom: none;
}

.categories-nav__item--all:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding-left: 18px;
}

.categories-nav__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.categories-nav__name {
    font-weight: 500;
}

.categories-nav__arrow {
    font-size: 10px;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

/* Submenu (dropdown on hover) */
.categories-nav__item-wrapper--has-subs:hover .categories-nav__submenu {
    display: flex;
}

.categories-nav__submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    margin-left: 4px;
    overflow: hidden;
}

.categories-nav__subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    font-size: 13px;
    white-space: nowrap;
}

.categories-nav__subitem:last-child {
    border-bottom: none;
}

.categories-nav__subitem:hover {
    background: var(--bg);
    padding-left: 16px;
    color: var(--primary);
}

.categories-nav__subicon {
    font-size: 16px;
    flex-shrink: 0;
}

.categories-nav__subname {
    font-size: 13px;
    font-weight: 500;
}

.catalog__filters {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filters__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}
.filters__group label {
    font-size: 13px;
    color: var(--text-muted);
}
.filters__group input,
.filters__group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.filters__price {
    display: flex;
    gap: 8px;
}
.filters__price input {
    width: 80px;
}

.filters__group--submit {
    flex-direction: row;
    gap: 8px;
    align-items: flex-end;
}

.catalog__info {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.catalog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.catalog__empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

/* --- Product Card --- */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
}
.product-card__link:hover { text-decoration: none; }

.product-card__image {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
}
.product-card__emoji {
    font-size: 64px;
}

.product-card__info {
    padding: 12px 16px;
    flex: 1;
}
.product-card__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}
.product-card__category {
    font-size: 13px;
    color: var(--text-muted);
}

.product-card__footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.product-card__price {
    font-size: 16px;
    font-weight: 700;
}
.product-card__stock {
    font-size: 12px;
}
.product-card__stock--available { color: var(--success); }
.product-card__stock--unavailable { color: var(--danger); }

/* --- Product Detail --- */
.product-detail__back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.breadcrumb__item {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb__item:hover {
    text-decoration: underline;
}

.breadcrumb__item--current {
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

.breadcrumb__sep {
    color: var(--text-muted);
    font-size: 12px;
}

.product-detail__title-mobile { display: none; }
.product-detail__card {
    display: grid;
    grid-template-columns: 340px 1fr 1fr;
    gap: 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    align-items: start;
}

.product-detail__card:not(:has(.product-detail__specs)) {
    grid-template-columns: 340px 1fr;
}

.product-detail__specs {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

.product-detail__specs-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.specs-table--card {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.specs-table--card .specs-table__row:nth-child(odd) {
    background: var(--bg);
}

.specs-table--card .specs-table__name,
.specs-table--card .specs-table__value {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.4;
}

.specs-table--card .specs-table__name {
    color: var(--text-muted);
    width: 48%;
    font-weight: 400;
    font-size: 12px;
}

.specs-table--card .specs-table__value {
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}

.product-detail__image {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.product-detail__emoji {
    font-size: 120px;
}

.product-detail__title {
    font-size: 24px;
    margin-bottom: 8px;
}
.product-detail__category {
    color: var(--text-muted);
    margin-bottom: 16px;
}
.product-detail__price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.product-detail__price .price-old {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: line-through;
    display: block;
    margin-bottom: 4px;
}

.product-detail__price .price-sale {
    font-size: 32px;
    color: #e53935;
    font-weight: 700;
    display: block;
}
.product-detail__price .price-hidden {
    font-size: 22px;
    color: #6b7280;
    font-style: italic;
}
.price-cash-note {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    letter-spacing: 0.01em;
}
.price-cash-wrap {
    display: inline;
}
.price-cash-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    background: rgba(31,41,55,0.9);
    color: #f9fafb;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.15s;
}
.price-cash-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(31,41,55,0.9);
}
.product-price {
    position: relative;
}
.product-item:hover .price-cash-tooltip,
.popular-card:hover .price-cash-tooltip {
    visibility: visible;
    opacity: 1;
}
.product-detail__stock {
    margin-bottom: 24px;
}

.product-variants {
    margin-bottom: 12px;
}

.product-variants__label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.product-variants__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    background: var(--bg-card);
    transition: all 0.18s;
    white-space: nowrap;
}

.variant-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.variant-btn--active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.variant-btn--active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.variant-btn--unavailable {
    opacity: 0.55;
    text-decoration: line-through;
    color: var(--text-muted);
    border-style: dashed;
    position: relative;
}
.variant-btn--unavailable::after {
    content: "Под заказ";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}
.variant-btn--unavailable:hover::after {
    opacity: 1;
}
.variant-btn--unavailable:hover {
    border-color: var(--text-muted);
    color: var(--text-muted);
    opacity: 0.8;
}

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

.product-description {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.product-description h2 {
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--text);
}

.product-description__content {
    color: var(--text);
    line-height: 1.8;
}

.product-description__content p {
    margin-bottom: 12px;
}

.product-description__content ul,
.product-description__content ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.product-description__content li {
    margin-bottom: 8px;
}

.product-specs {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.product-specs h2 {
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--text);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table__row:nth-child(odd) {
    background: var(--bg);
}

.specs-table__name,
.specs-table__value {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.specs-table__name {
    color: var(--text-muted);
    width: 40%;
    font-weight: 500;
}

.specs-table__value {
    color: var(--text);
    font-weight: 500;
}

/* ── Видео-плеер на странице товара ───────────────────────────────── */
.product-video {
    margin-top: 32px;
}
.product-video h2 {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}
.product-video__wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.product-video__player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.product-video__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.video-tab {
    padding: 8px 16px;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    color: var(--text, #333);
}
.video-tab:hover {
    border-color: var(--primary, #ff6600);
    color: var(--primary, #ff6600);
}
.video-tab--active {
    background: var(--primary, #ff6600);
    border-color: var(--primary, #ff6600);
    color: #fff;
}

@media (max-width: 768px) {
    .product-video__player {
        padding-bottom: 60%;
    }
}
/* ─────────────────────────────────────────────────────────────────── */

.related-products {
    margin-top: 32px;
}
.related-products h2 {
    margin-bottom: 16px;
}

.related-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.related-scroll::-webkit-scrollbar { height: 5px; }
.related-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.related-card {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    scroll-snap-align: start;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.related-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.related-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
    padding: 14px;
    gap: 8px;
}
.related-card__link:hover { text-decoration: none; color: inherit; }
.related-card__image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 4px;
}
.related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.related-card__emoji { font-size: 40px; }
.related-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.related-card__unavail {
    font-size: 12px;
    color: var(--danger);
}
.related-card__btn {
    margin: 0 14px 14px;
    font-size: 13px;
    padding: 8px 10px;
}
.related-card__btn--disabled {
    background: var(--text-muted);
    opacity: 0.4;
    cursor: default;
}

/* --- Quantity Selector --- */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.quantity-selector--sm {
    border-radius: var(--radius);
}
.quantity-selector__btn {
    width: 32px;
    height: 36px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quantity-selector__btn:hover { background: var(--border); }
.quantity-selector__input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
}
.quantity-selector__input--sm {
    width: 40px;
}

/* --- Cart --- */
.cart__title {
    font-size: 28px;
    margin-bottom: 24px;
}

.cart__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.cart-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.cart-item__info {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.cart-item__emoji { font-size: 40px; }
.cart-item__img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cart-item__thumb { flex-shrink: 0; display: block; }
.cart-item__thumb:hover .cart-item__img { opacity: 0.85; }
.cart-item__name-link { color: var(--text); text-decoration: none; }
.cart-item__name-link:hover { color: var(--primary); text-decoration: underline; }
.cart-item__name { font-weight: 600; }
.cart-item__price { color: var(--text-muted); font-size: 14px; }

.cart-item__controls {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cart-item__total {
    font-size: 16px;
    font-weight: 700;
}

.cart-item__warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: var(--radius);
    font-size: 13px;
    color: #92400e;
}

.cart__summary {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 180px;
}
.cart__summary h2 { margin-bottom: 16px; }
.cart__summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-muted);
}
.cart__summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.cart__delivery-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 4px 0 8px;
}
.cart__delivery-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    padding: 4px 0;
}
.cart__delivery-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.cart__delivery-option span:nth-child(2) {
    flex: 1;
}
.cart__delivery-price {
    font-size: 13px;
    color: var(--text-muted);
}

.cart__empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}
.cart__empty-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 16px;
}
.cart__empty h2 { margin-bottom: 8px; }
.cart__empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* --- Checkout --- */
.checkout__title {
    font-size: 28px;
    margin-bottom: 24px;
}

.checkout__layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.checkout__form {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.checkout__summary {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    height: fit-content;
}
.checkout__summary h2 { margin-bottom: 16px; }

.checkout__item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.checkout__item-qty { font-weight: 600; }
.checkout__item-name { flex: 1; }
.checkout__item-total { font-weight: 600; }

.checkout__summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-muted);
}
.checkout__summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s;
}
.delivery-option:has(input:checked) {
    border-color: var(--primary);
    background: #eef2ff;
}

/* --- Order Success --- */
.order-success {
    text-align: center;
    padding: 40px 0;
}
.order-success__icon {
    font-size: 80px;
    color: var(--success);
    margin-bottom: 16px;
}
.order-success__title { margin-bottom: 8px; }
.order-success__subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.order-success__card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: left;
    max-width: 600px;
    margin: 0 auto 24px;
}
.order-success__card h2 { margin-bottom: 16px; }

.order-details__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.order-items {
    margin: 16px 0;
}
.order-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.order-totals__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}
.order-totals__row--total {
    font-size: 20px;
    font-weight: 700;
    border-top: 2px solid var(--border);
    padding-top: 12px;
}

.order-success__note {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* --- Profile / Auth --- */
.profile__title {
    font-size: 28px;
    margin-bottom: 24px;
}

.profile__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile__info,
.profile__orders {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.profile__info h2,
.profile__orders h2 {
    margin-bottom: 16px;
}

.order-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.order-card__number { font-weight: 600; font-size: 14px; }
.order-card__toggle {
    cursor: pointer;
    user-select: none;
    justify-content: space-between;
}
.order-card__toggle:hover { opacity: 0.85; }
.order-card__chevron {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s;
    display: inline-block;
}
.order-card--open .order-card__chevron { transform: rotate(180deg); }
.order-card__body {
    display: none;
    margin-top: 10px;
}
.order-card--open .order-card__body { display: block; }
.order-card__meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.order-card__items-list {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-card__item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.order-card__item-img {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary, #f1f5f9);
    position: relative;
}
.order-card__item-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.order-card__item-no-img {
    font-size: 22px;
}
.order-card__item-info {
    flex: 1;
    min-width: 0;
}
.order-card__item-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.order-card__item-name:hover { color: var(--primary); text-decoration: underline; }
.order-card__item-price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.order-card__item-qty {
    color: var(--text-muted);
}
.order-card__item-total {
    font-weight: 700;
    color: var(--text);
}
.order-card__total {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    font-size: 14px;
    text-align: right;
}

/* Auth */
.auth {
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.auth--center { text-align: center; }
.auth h2 { margin-bottom: 16px; }

.auth__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}
.auth__tab {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}
.auth__tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.auth__panel { display: none; }
.auth__panel--active { display: block; }

.auth__back {
    margin-top: 16px;
    font-size: 14px;
}

/* --- Pagination --- */
.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.btn--load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    background: var(--bg-card);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}

.btn--load-more:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}
.pagination__btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}
.pagination__info {
    color: var(--text-muted);
}

/* --- Details button on product cards --- */
.btn--details {
    flex: 1;
    text-align: center;
    font-size: 13px;
    padding: 7px 10px;
}

/* --- Review Invite Block --- */
.review-invite {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
    text-align: center;
}
.review-invite__text {
    margin: 0 0 14px;
    color: #92400e;
    font-size: 15px;
}
.review-invite__btn {
    border-color: #f97316;
    color: #f97316;
}
.review-invite__btn:hover {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-top: 8px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    animation: slideIn 0.3s ease;
}
.toast--error {
    border-left-color: var(--danger);
}
.toast__img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 700px) {
    .toast-container { bottom: 70px; right: 12px; }
}

/* ========================================
   Admin Panel Styles
   ======================================== */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #1e293b;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar__logo {
    display: block;
    padding: 0 16px 20px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    border-bottom: 1px solid #334155;
    margin-bottom: 16px;
}
.admin-sidebar__logo:hover { text-decoration: none; }

.admin-nav__link {
    display: block;
    padding: 10px 16px;
    color: #cbd5e1;
    transition: all 0.2s;
}
.admin-nav__link:hover {
    background: #334155;
    color: white;
    text-decoration: none;
}
.admin-nav__link--logout {
    color: #f87171;
    border-top: 1px solid #334155;
    margin-top: 16px;
}

.admin-main {
    margin-left: 220px;
    flex: 1;
    padding: 24px;
    background: var(--bg);
}
.admin-content {
    max-width: 100%;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.admin-page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.link-back {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 4px;
}

.link-back:hover { color: var(--primary); }

.link-muted {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.link-muted:hover { color: var(--primary); text-decoration: underline; }

.admin-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: var(--bg-secondary);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-secondary); }

.text-muted { color: var(--text-muted); font-size: 13px; }

/* Dashboard */
.dashboard__title {
    font-size: 28px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card__icon { font-size: 40px; }
.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    display: block;
}
.stat-card__label {
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard__actions {
    display: flex;
    gap: 12px;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f8fafc; }
.data-table tfoot td {
    font-weight: 700;
    background: var(--bg);
}

/* Inline forms in admin inventory */
.inline-form {
    display: flex;
    gap: 4px;
    align-items: center;
}
.inline-input {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}
.inline-input--price { width: 100px; }
.inline-input--qty { width: 70px; }

/* Admin Orders Filters */
.admin-orders__filters {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

/* Order Detail */
.order-detail__header {
    margin-bottom: 24px;
}
.order-detail__back {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.order-detail__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.order-detail__info,
.order-detail__items {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.order-detail__info h2,
.order-detail__items h2 {
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    gap: 12px;
}
.info-item__label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}
.info-item__value {
    display: block;
    font-weight: 500;
}

.order-detail__stock-status {
    margin-top: 24px;
    padding: 16px;
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    border-radius: var(--radius);
}
.order-detail__stock-status h3 { margin-bottom: 12px; font-size: 14px; }

.order-detail__status {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.order-detail__status h3 { margin-bottom: 12px; }
.order-detail__status--locked {
    background: #fef8f0;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-top: none;
}
.order-detail__status--locked p {
    color: var(--text);
    margin: 0;
}
.status-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Admin Inventory Search */
.admin-inventory__search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.admin-inventory__search input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .header__inner { flex-direction: column; height: auto; padding: 12px 0; }
    .nav { margin-top: 8px; }
    .nav { gap: 12px; flex-wrap: wrap; }

    .filters__row { flex-direction: column; }
    .filters__group { width: 100%; }

    .catalog__grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

    .product-detail__card,
    .product-detail__card:not(:has(.product-detail__specs)) { grid-template-columns: 1fr; overflow: hidden; }
    .product-detail__specs { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
    .product-detail__image { height: 200px; }
    /* Мобильный: показываем дублированное название сверху, скрываем оригинальное */
    .product-detail__title-mobile { display: block; }
    .product-detail__info .product-detail__title { display: none; }
    .product-detail__price { font-size: 22px; }

    .cart__layout,
    .checkout__layout,
    .profile__layout,
    .order-detail__layout {
        grid-template-columns: 1fr;
    }

    .cart__summary { position: static; }

    .admin-sidebar {
        width: 180px;
    }
    .admin-main {
        margin-left: 180px;
    }

    .footer__inner { flex-direction: column; gap: 4px; }
}

/* --- Image Gallery --- */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-gallery__main {
    width: 100%;
    height: 400px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery__thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.product-gallery__thumb {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    background: var(--bg);
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery__thumb--active {
    border-color: var(--primary);
}

.product-gallery__thumb:hover {
    border-color: var(--secondary);
}


/* --- Image Upload Modal --- */
.image-upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.image-upload-modal.active {
    display: flex;
}

.image-upload-modal__content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.image-upload-modal__close {
    float: right;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.image-upload-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    clear: both;
}

.image-upload-modal__gallery {
    margin-bottom: 20px;
}

.image-upload-modal__image-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.image-upload-modal__image-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.image-upload-modal__image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-modal__image-info {
    flex: 1;
    font-size: 13px;
}

.image-upload-modal__image-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.image-upload-modal__image-actions {
    display: flex;
    gap: 4px;
}

.image-upload-modal__upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    background: var(--bg);
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-modal__upload-zone:hover {
    border-color: var(--primary);
}

.image-upload-modal__upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-05);
}

.image-upload-modal__upload-input {
    display: none;
}

.image-upload-modal__upload-label {
    cursor: pointer;
}

.image-upload-modal__upload-label strong {
    color: var(--primary);
}

/* --- Product Card Improvements --- */
.product-card__image--has-overlay {
    position: relative;
}

.product-card__unavailable-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 var(--radius) var(--radius);
}

.product-card__unavailable-badge span {
    color: white;
    font-weight: 600;
    font-size: 14px;
}


@media (max-width: 768px) {
    .header__search-section {
        padding: 12px 0;
    }

    .search-container {
        max-width: 100%;
    }

    .search-dropdown {
        max-height: 300px;
    }

    .search-dropdown__item {
        gap: 8px;
    }

    .search-dropdown__image {
        width: 40px;
        height: 40px;
    }

    .search-dropdown__name {
        font-size: 14px;
    }

    .search-dropdown__price {
        font-size: 12px;
    }

    .categories-showcase__grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .category-tile {
        min-height: 140px;
        padding: 12px;
        gap: 8px;
    }

    .category-tile__emoji {
        font-size: 40px;
    }

    .category-tile__image {
        width: 70px;
        height: 70px;
    }

    .category-tile__name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .catalog__grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }

    .header__search-section {
        padding: 8px 0;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .search-dropdown__image {
        width: 35px;
        height: 35px;
    }

    .search-dropdown__item {
        padding: 8px 12px;
        gap: 6px;
    }

    .categories-showcase {
        margin-bottom: 24px;
    }

    .categories-showcase__title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .categories-showcase__grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
    }

    .category-tile {
        min-height: 120px;
        padding: 8px;
        gap: 6px;
    }

    .category-tile__emoji {
        font-size: 32px;
    }

    .category-tile__image {
        width: 60px;
        height: 60px;
    }

    .category-tile__name {
        font-size: 11px;
    }

    .admin-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-body {
        flex-direction: column;
    }
}

/* ========== CATALOG PAGE - Professional E-commerce Layout ========== */

.catalog-page {
    padding: 24px 0;
    background: var(--bg);
    min-height: calc(100vh - 200px);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* Заголовок каталога + блок брендов */
.catalog-header {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.brands-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.brand-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    min-width: 120px;
    padding: 0 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.brand-chip img {
    height: 36px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

.brand-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 6px var(--primary-10);
}

.brand-chip--active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.brand-chip--active:hover {
    color: #fff;
    background: var(--primary-hover);
}

/* Main Layout: Sidebar + Main */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

/* Sidebar Styles */
.catalog-sidebar {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 180px;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

/* Category Filter (Radio buttons) */
.filter-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 14px;
    color: var(--text);
}

.filter-item input[type="radio"],
.filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.filter-item:hover {
    color: var(--primary);
}

.filter-item input:checked + span {
    font-weight: 600;
    color: var(--primary);
}

/* Price Filter */
.filter-price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.price-divider {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* Checkbox Filter */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 192px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.filter-checkboxes::-webkit-scrollbar {
    width: 4px;
}
.filter-checkboxes::-webkit-scrollbar-track {
    background: transparent;
}
.filter-checkboxes::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.filter-checkbox:hover {
    color: var(--primary);
}

.filter-checkbox--empty {
    opacity: 0.38;
    cursor: default;
}

.filter-checkbox--empty input[type="checkbox"] {
    cursor: not-allowed;
}

.filter-checkbox--empty:hover {
    color: inherit;
}

.filter-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted, #888);
}

/* In-stock filter */
.filter-group--instock {
    padding: 4px 0 2px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 2px 0;
}
.filter-instock-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    user-select: none;
}
.filter-instock-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.filter-instock-label:hover { color: var(--primary); }

/* Filter Actions */
.filter-inline-apply {
    display: inline-block;
    margin: 4px 0 4px 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.4;
    transition: background 0.15s;
}
.filter-inline-apply:hover {
    background: #dbeafe;
}

.filter-actions {
    display: flex;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.filter-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* Main Content Area */
.catalog-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Хлебные крошки каталога */
.catalog-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.4;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border);
}
.catalog-bc__item {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.catalog-bc__item:hover {
    color: var(--primary);
}
.catalog-bc__item--current {
    color: var(--text);
    font-weight: 600;
    white-space: normal;
}
.catalog-bc__sep {
    color: var(--border);
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

/* Top Bar with Sort */
.catalog-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* Subcategory tabs */
.subcategory-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 4px;
}

.subcategory-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.subcategory-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.subcategory-tab--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.subcategory-tab--active:hover {
    color: #fff;
}

.topbar-left {
    flex: 1;
}

.results-count {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-cycle-btn {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 38px;
    height: 34px;
    padding: 7px 7px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
    flex-shrink: 0;
}

.grid-cycle-btn span {
    display: block;
    flex: 1;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    opacity: 0.7;
}

.grid-cycle-btn:hover {
    border-color: var(--primary);
    background: var(--bg-hover, #1e293b);
}

.grid-cycle-btn:hover span {
    opacity: 1;
}

.sort-label {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-filters-mobile {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-filters-mobile:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.btn-categories-mobile { display: none; }
.btn-categories-mobile-home { display: none; }
.btn-categories-mobile-catalog { display: none; }

.filter-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    margin-left: 4px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.product-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: visible;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.product-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: var(--bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    padding: 8px;
}

.product-item:hover .product-image img {
    transform: scale(1.08);
}

.product-emoji {
    font-size: 80px;
    line-height: 1;
}

.product-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
}

.product-status.available {
    background: #dcfce7;
    color: #166534;
}

.product-status.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.product-status.preorder {
    background: #fef3c7;
    color: #92400e;
}


.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: var(--primary);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    margin-bottom: 12px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.price-old {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: line-through;
    display: block;
}

.price-sale {
    color: #e53935;
    font-weight: 700;
    display: block;
}

.price-hidden {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.product-qty {
    font-size: 13px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-state p {
    margin: 0;
    font-size: 18px;
    color: var(--text-muted);
}

.empty-state p:first-child {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-hint {
    font-size: 14px !important;
    margin-top: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 0 8px;
}

.pagination-pages {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-page {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.pagination-page:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.pagination-page--active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    cursor: default;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

/* ========== CATEGORIES GRID (Home Page View) ========== */
.categories-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.categories-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Плитки подкатегорий внутри каталога */
.subcat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 8px 0 24px;
}
.subcat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
    text-align: center;
    box-shadow: var(--shadow);
}
.subcat-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.subcat-tile__img {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
    padding: 8px;
    box-sizing: border-box;
}
.subcat-tile__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.subcat-tile:hover .subcat-tile__img img {
    transform: scale(1.07);
}
.subcat-tile__emoji {
    font-size: 52px;
    line-height: 1;
}
.subcat-tile__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
@media (max-width: 767px) {
    .subcat-tiles {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    .subcat-tile__img {
        width: 90px;
        height: 90px;
        padding: 6px;
    }
    .subcat-tile__emoji { font-size: 42px; }
}

.cat-tile {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.cat-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.cat-tile__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.cat-tile__image {
    width: 100%;
    aspect-ratio: 4/3;
}

.cat-tile:hover .cat-tile__link {
    color: var(--primary);
}

.cat-tile__image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    overflow: hidden;
}

.cat-tile__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.cat-tile:hover .cat-tile__image img {
    transform: scale(1.05);
}

.cat-tile__emoji {
    font-size: 64px;
    line-height: 1;
}

.cat-tile__name {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    padding: 12px 16px;
    width: 100%;
    background: var(--bg-card);
}

.cat-tile__subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--primary-02);
}

.cat-tile__subcat-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.cat-tile__subcat-link:hover {
    color: var(--primary);
}

.cat-tile__subgroup {
    width: 100%;
}

.cat-tile__subcat-link--parent {
    font-weight: 500;
    color: var(--text-secondary);
}

.cat-tile__subsubcats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding-left: 8px;
    margin-top: 2px;
}

.cat-tile__subsubcat-link {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.cat-tile__subsubcat-link:hover {
    color: var(--primary);
}

/* ========== SIDEBAR NAVIGATION (Category Menu) ========== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
}

.sidebar-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.sidebar-nav__back::before {
    content: '‹';
    font-size: 18px;
    line-height: 1;
    color: var(--primary);
}

.sidebar-nav__back:hover {
    color: var(--primary);
}

.sidebar-nav__item {
    border-bottom: 1px solid var(--border);
}

.sidebar-nav__item:first-of-type {
    border-top: 1px solid var(--border);
}

.sidebar-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 4px 11px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
    background: none;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    gap: 0;
}

.sidebar-nav__link:hover {
    color: var(--primary);
    background: none;
    border: none;
}

.sidebar-nav__item--active > .sidebar-nav__link {
    color: var(--primary);
    font-weight: 600;
    background: none;
    border: none;
}

.sidebar-nav__name {
    flex: 1;
}

/* Стрелка-индикатор раскрытия */
.sidebar-nav__arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease, color 0.15s;
    flex-shrink: 0;
}

.sidebar-nav__item--open > .sidebar-nav__link .sidebar-nav__arrow,
.sidebar-nav__item--active > .sidebar-nav__link .sidebar-nav__arrow {
    transform: rotate(90deg);
    color: var(--primary);
}

/* Аккордеон-подменю */
.sidebar-nav__submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    min-width: unset;
    padding: 0;
    z-index: auto;
    pointer-events: auto;
}

.sidebar-nav__submenu-inner {
    overflow: hidden;
}

.sidebar-nav__item--open > .sidebar-nav__submenu,
.sidebar-nav__item--active > .sidebar-nav__submenu {
    grid-template-rows: 1fr;
}

.sidebar-nav__sublink {
    display: block;
    padding: 8px 0 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid var(--border);
    margin-left: 4px;
    transition: color 0.15s, border-color 0.15s;
}

.sidebar-nav__sublink:last-child {
    margin-bottom: 10px;
}

.sidebar-nav__sublink:hover,
.sidebar-nav__sublink.active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* 3rd-level: subgroup */
.sidebar-nav__subgroup {
    display: block;
}

.sidebar-nav__sublink--parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-nav__subarrow {
    font-size: 12px;
    opacity: 0.5;
    transition: transform 0.2s;
}

.sidebar-nav__subsubmenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}

.sidebar-nav__subsubmenu-inner {
    overflow: hidden;
}

.sidebar-nav__subgroup--active > .sidebar-nav__subsubmenu,
.sidebar-nav__subgroup--open > .sidebar-nav__subsubmenu {
    grid-template-rows: 1fr;
}

.sidebar-nav__subgroup--active > .sidebar-nav__sublink--parent .sidebar-nav__subarrow,
.sidebar-nav__subgroup--open > .sidebar-nav__sublink--parent .sidebar-nav__subarrow {
    transform: rotate(90deg);
    opacity: 1;
}

.sidebar-nav__subsublink {
    display: block;
    padding: 6px 0 6px 28px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.sidebar-nav__subsublink:hover,
.sidebar-nav__subsublink.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Sidebar Filters Title */
.sidebar-filters__title {
    margin: 24px 0 16px 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    display: none;
    pointer-events: none;
    transition: background 0.3s;
}

.sidebar-overlay.active {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 220px 1fr;
        gap: 20px;
    }

    .catalog-sidebar {
        top: 180px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .contacts-block {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Скрываем десктопные nav-ссылки, показываем mob-bar */
    .header__nav-links { display: none; }
    .mob-bar { display: flex; }
    .header__search-bar { display: none; }

    /* Каталог: заголовок + бренды в колонку */
    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    /* Header */
    .header__top-inner {
        height: auto;
        padding-top: 6px;
        padding-bottom: 6px;
        flex-wrap: nowrap;
        gap: 0;
        align-items: center;
        justify-content: space-between;
    }

    .header__brand {
        gap: 8px;
        flex-shrink: 0;
        margin-right: 0;
    }

    .header__tagline {
        display: none;
    }

    .header__contacts {
        display: none;
    }

    .nav__call {
        display: flex;
    }

    .nav__map {
        display: flex;
    }

    .header__nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .logo__img {
        height: 36px;
    }

    .nav {
        gap: 2px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        margin-top: 0;
    }

    .nav__label {
        display: none;
    }

    .nav__link {
        padding: 6px 6px;
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 13px;
    }

    /* Page */
    .page-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    /* Catalog layout */
    .catalog-layout {
        display: block;
    }

    /* Sidebar → drawer */
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: 85vw;
        max-width: 320px;
        height: 100vh;
        z-index: 1100;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
        transition: left 0.3s;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .catalog-sidebar.active {
        left: 0;
    }

    .sidebar-header {
        display: flex;
    }

    .sidebar-close {
        display: block;
    }

    /* Overlay */
    .sidebar-overlay {
        display: block;
        pointer-events: none;
        z-index: 1099;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
    }

    /* В режиме фильтров — скрываем навигацию, показываем фильтры */
    .catalog-sidebar.drawer-filters .sidebar-nav { display: none; }
    .catalog-sidebar.drawer-filters .sidebar-filters { display: block; }

    /* В режиме категорий — показываем навигацию, скрываем фильтры */
    .catalog-sidebar.drawer-categories .sidebar-nav { display: flex; }
    .catalog-sidebar.drawer-categories .sidebar-filters { display: none; }

    /* По умолчанию (drawer не открыт) — скрываем оба */
    .catalog-sidebar:not(.active) .sidebar-nav { display: none; }

    /* Кнопка категорий в каталоге товаров — между заголовком и товарами */
    .btn-categories-mobile-catalog {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 12px;
        padding: 11px 16px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 14px;
        font-weight: 500;
        color: var(--text);
        cursor: pointer;
        transition: border-color 0.15s, color 0.15s;
        box-sizing: border-box;
    }

    .btn-categories-mobile-catalog:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    /* Кнопка категорий на главной (плитки) */
    .btn-categories-mobile-home {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
        padding: 10px 16px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 14px;
        font-weight: 500;
        color: var(--text);
        cursor: pointer;
        width: 100%;
        transition: border-color 0.15s, color 0.15s;
    }

    .btn-categories-mobile-home:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    /* Topbar */
    .catalog-topbar {
        position: sticky;
        top: 48px;
        z-index: 90;
        background: var(--bg-card);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        flex-direction: row;
        gap: 8px;
        align-items: center;
        padding: 8px 12px;
    }

    .topbar-left { display: none; }
    .sort-group--perpage { display: none; }
    .topbar-right {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
        overflow: hidden;
    }

    .sort-group {
        flex: 1;
        min-width: 0;
    }

    .grid-cycle-btn {
        display: none;
    }

    .btn-filters-mobile {
        display: flex;
        flex-shrink: 0;
        width: auto;
        min-height: 44px;
        padding: 0 12px;
    }

    .sort-select {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }

    /* Products grid — 2 columns on mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .product-item {
        flex-direction: column;
        border-radius: var(--radius);
        width: 100%;
    }

    .product-image {
        width: 100%;
        height: 44vw !important;
        max-height: 220px !important;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .product-info {
        padding: 8px 10px;
    }

    .product-title {
        font-size: 13px !important;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .product-category {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .product-footer {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .product-price {
        font-size: 18px;
        font-weight: 700;
    }

    .btn--cart, .btn--preorder {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
        width: 100%;
    }
    .product-actions .btn--cart, .product-actions .btn--preorder { width: auto; flex: 1; }

    /* Pagination */
    .pagination {
        gap: 6px;
        padding: 20px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        font-size: 14px;
    }

    .pagination-page {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .pagination-info {
        font-size: 13px;
        display: flex;
        align-items: center;
    }

    /* Subcategory tabs */
    .subcategory-tabs {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .subcategory-tab {
        padding: 7px 14px;
        font-size: 13px;
        min-height: 36px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }


    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cat-tile__image {
        width: 100%;
        height: auto;
    }

    .cat-tile__emoji {
        font-size: 40px;
    }

    .cat-tile__name {
        font-size: 14px;
        padding: 8px 10px;
    }

    .cat-tile__subcats {
        padding: 8px 12px;
        gap: 6px 8px;
    }

    .cat-tile__subcat-link {
        font-size: 11px;
        min-height: 28px;
        display: flex;
        align-items: center;
    }

    /* Контейнер — одинаковые отступы слева и справа */
    .container {
        padding: 0 12px;
    }

    /* На мобильном catalog-layout не grid — просто колонка */
    .catalog-layout {
        display: block;
    }
    .catalog-main {
        width: 100%;
        box-sizing: border-box;
    }
    .products-grid {
        width: 100%;
        box-sizing: border-box;
    }

    /* categories-main на всю ширину */
    .categories-main {
        width: 100%;
        gap: 12px;
    }

    /* Плитки категорий: строго 2 колонки, вписанные в экран */
    .categories-grid {
        display: grid;
        grid-template-columns: calc(50% - 5px) calc(50% - 5px);
        gap: 10px;
        width: 100%;
    }

    /* Бренды: однострочная полоса с горизонтальным скроллом */
    /* ── Тикер брендов (мобиль) ── */
    .brands-ticker-wrap {
        overflow-x: hidden; /* JS переключает на auto при ручном листании */
        overflow-y: hidden;
        width: 100%;
        position: relative;
        scrollbar-width: none;
    }
    .brands-ticker-wrap::-webkit-scrollbar { display: none; }

    .brands-bar {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: max-content;
    }
    .brands-bar.is-ticking {
        animation: brands-scroll var(--ticker-dur, 18s) linear infinite;
    }
    @keyframes brands-scroll {
        from { transform: translateX(0); }
        to   { transform: translateX(-50%); }
    }

    .brand-chip {
        flex: 0 0 auto;
        min-width: 28vw;
        max-width: 28vw;
        justify-content: center;
    }

    /* Галерея товара: ограничиваем ширину чтобы не выходила за экран */
    .product-gallery {
        min-width: 0;
        width: 100%;
    }

    .product-gallery__main {
        height: 72vw;
        max-height: 340px;
    }

    /* Миниатюры: горизонтальный скролл-слайдер, не растягивает страницу */
    .product-gallery__thumbnails {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
        width: 100%;
        min-width: 0;
    }
    .product-gallery__thumbnails::-webkit-scrollbar { display: none; }

    .product-gallery__thumb {
        flex: 0 0 68px;
        width: 68px;
        height: 68px;
    }
}

@media (max-width: 480px) {
    .logo__img {
        height: 34px;
    }

    .nav {
        gap: 6px;
    }

    .nav__link {
        font-size: 13px;
    }

    .catalog-sidebar {
        width: 92vw;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .product-image {
        height: 44vw !important;
        max-height: 200px !important;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cat-tile__emoji {
        font-size: 36px;
    }

    .cat-tile__name {
        font-size: 13px;
        padding: 8px 10px;
    }

    .cat-tile__subcats {
        padding: 8px 10px;
        gap: 4px 6px;
    }

    .cat-tile__subcat-link {
        font-size: 10px;
    }

    .product-image {
        height: 140px;
    }

    .product-info {
        padding: 8px;
    }

    .product-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .product-footer {
        padding-top: 6px;
        margin-bottom: 6px;
        gap: 4px;
    }

    .product-price {
        font-size: 14px;
    }


    .catalog-topbar {
        padding: 0;
    }

    .catalog-breadcrumbs {
        padding: 8px 10px;
        font-size: 12px;
    }

    .results-count {
        font-size: 12px;
    }

    .pagination-btn {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ========================================
   Сравнение товаров
   ======================================== */

/* Кнопка "Сравнить" на карточке */
.product-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.product-actions .btn--cart {
    flex: 1;
}
.btn--compare {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    padding: 0;
}
.btn--compare:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-card);
}
.btn--compare.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* Плавающая панель сравнения */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-card);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    flex-wrap: wrap;
}
.compare-bar__items {
    display: flex;
    gap: 12px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.compare-bar__items::-webkit-scrollbar { display: none; }
.compare-bar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    min-width: 160px;
    max-width: 200px;
    position: relative;
}
.compare-bar__item img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.compare-bar__name {
    font-size: 12px;
    color: var(--text);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}
.compare-bar__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    flex-shrink: 0;
    line-height: 1;
}
.compare-bar__remove:hover { color: var(--danger); }
.compare-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.compare-bar__count {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.compare-bar__btn {
    white-space: nowrap;
    padding: 10px 20px;
    font-size: 14px;
}
.compare-bar__clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    white-space: nowrap;
}
.compare-bar__clear:hover { color: var(--danger); }

/* Страница сравнения */
.compare-page__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.compare-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.compare-empty p { font-size: 18px; margin-bottom: 20px; }
.compare-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.compare-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.compare-toggle input { cursor: pointer; }
.compare-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.compare-table th,
.compare-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}
.compare-table th { background: var(--bg-secondary); }
.compare-table__label {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
    width: 160px;
    min-width: 140px;
    background: var(--bg-secondary) !important;
    position: sticky;
    left: 0;
    z-index: 1;
}
.compare-table__product {
    text-align: center;
    min-width: 200px;
    position: relative;
}
.compare-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.compare-remove:hover { color: var(--danger); background: #fee2e2; }
.compare-product-img {
    display: block;
    margin: 0 auto 10px;
    width: 100px;
    height: 100px;
}
.compare-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.compare-product-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 6px;
    line-height: 1.3;
}
.compare-product-name:hover { color: var(--primary); }
.compare-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}
.compare-product-status {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}
.compare-product-status.available { background: #dcfce7; color: #16a34a; }
.compare-product-status.unavailable { background: #fee2e2; color: #dc2626; }
.compare-table__val { font-size: 14px; color: var(--text); }
.compare-table__val--diff { font-weight: 600; color: var(--text); }
.compare-row--equal td { color: var(--text-muted); }
.compare-row--equal .compare-table__label { color: var(--text-muted); font-weight: 400; }

/* Мобильная адаптация панели сравнения */
@media (max-width: 640px) {
    .compare-bar {
        padding: 10px 12px;
        gap: 10px;
    }
    .compare-bar__item { min-width: 130px; }
    .compare-bar__btn { padding: 8px 14px; font-size: 13px; }
    .btn--compare { width: 36px; height: 36px; font-size: 14px; }
    .compare-page__title { font-size: 20px; }

    /* Страница сравнения: скрываем таблицу, показываем карточки */
    .compare-desktop { display: none; }
    .compare-mobile { display: block; }
}
@media (min-width: 641px) {
    .compare-desktop { display: block; }
    .compare-mobile { display: none; }
}

/* Mobile compare layout */
.compare-mobile { width: 100%; }

.cmp-mob-header {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    grid-template-columns: repeat(var(--cmp-cols, 2), 1fr);
}
.cmp-mob-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.cmp-mob-card img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.cmp-mob-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
}
.cmp-mob-remove:hover { color: var(--danger); background: #fee2e2; }
.cmp-mob-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cmp-mob-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* Блок одной характеристики */
.cmp-attr-block {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.cmp-attr-block.cmp-attr-equal { background: none; }
.cmp-attr-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.cmp-attr-vals {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(var(--cmp-cols, 2), 1fr);
}
.cmp-attr-val {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 5px 8px;
    text-align: center;
}
.cmp-attr-val--diff {
    font-weight: 600;
    color: var(--text);
    background: #eff6ff;
}

/* ═══════════════════════════════════════════════════
   TRUST BAR — компактная строка под шапкой
═══════════════════════════════════════════════════ */
.trust-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-muted);
}
.trust-bar__items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.trust-bar__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.trust-bar__sep {
    color: var(--border);
    font-size: 14px;
}
@media (max-width: 600px) {
    .trust-bar { display: none; }
    .viewed-arrow { display: none; }
}

/* ═══════════════════════════════════════════════════
   HERO СЛАЙДЕР (главная страница)
═══════════════════════════════════════════════════ */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.hero--fullscreen {
    height: 420px;
    min-height: 300px;
}
.hero__slides {
    position: absolute;
    inset: 0;
}
.hero__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.hero__slide--active {
    opacity: 1;
}
.hero__slide--gradient {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 50%, #1a2e4a 100%);
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    z-index: 1;
}
.hero__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 40px 48px;
}
.hero__text {
    max-width: 560px;
}
.hero__title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero__sub {
    font-size: 17px;
    color: rgba(255,255,255,0.88);
    margin: 0 0 24px;
}
.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero__btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.hero__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.hero__dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;
}
.hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}
.hero__dot--active {
    background: #fff;
    border-color: #fff;
}

/* ═══════════════════════════════════════════════════
   ПОПУЛЯРНЫЕ ТОВАРЫ (главная страница)
═══════════════════════════════════════════════════ */
.popular-section {
    margin-bottom: 8px;
}
.popular-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}
.popular-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.popular-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.popular-card--hidden { display: none; }
.popular-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.popular-card__img {
    position: relative;
    height: 220px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}
.popular-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    display: block;
}
.popular-card__no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
}
.popular-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px 12px 12px;
    text-decoration: none;
    color: inherit;
}
.popular-card__body:hover { text-decoration: none; }
.popular-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popular-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.popular-card__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}
.popular-card__status {
    font-size: 11px;
    color: var(--success);
    white-space: nowrap;
}
.popular-show-more {
    text-align: center;
    margin-top: 16px;
}
.popular-show-more__btn {
    display: inline-block;
    padding: 10px 32px;
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.popular-show-more__btn:hover {
    background: var(--primary);
    color: #fff;
}
@media (max-width: 900px) {
    .popular-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 500px) {
    .popular-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
@media (hover: none) and (pointer: coarse) {
    /* Мобильный: tooltip → серая подпись под ценой */
    .price-cash-tooltip {
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        transform: none !important;
        background: none !important;
        color: #9ca3af !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        display: block !important;
        margin-top: 2px !important;
        white-space: normal !important;
        z-index: auto !important;
    }
    .price-cash-tooltip::after { display: none !important; }
    .price-cash-wrap { display: block; }
    .product-price { display: flex; flex-direction: column; }
}

/* ═══════════════════════════════════════════════════
   ПРОСМОТРЕННЫЕ — горизонтальная прокрутка (главная)
═══════════════════════════════════════════════════ */
.viewed-section {
    margin-top: 24px;
    margin-bottom: 8px;
}
.viewed-section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
}
.viewed-row-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.viewed-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.viewed-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
@media (max-width: 600px) {
    .viewed-arrow { display: none !important; }
}

/* ── SEO-блок «О магазине» ── */
.seo-text-section {
    text-align: center;
    margin: 8px 0 4px;
}
.seo-details {
    display: inline-block;
    border: 2px solid var(--border);
    border-radius: 32px;
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    max-width: 560px;
    width: 100%;
}
.seo-details[open] {
    border-color: var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(30,64,175,0.08);
}
.seo-details__toggle {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}
.seo-details__toggle::-webkit-details-marker { display: none; }
.seo-details__toggle:hover { color: var(--primary); }
.seo-details__arrow {
    font-size: 16px;
    transition: transform 0.2s;
}
.seo-details[open] .seo-details__arrow {
    transform: rotate(90deg);
}
.seo-details__body {
    padding: 0 24px 20px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
}
.seo-details__body p { margin: 0 0 10px; }
.seo-details__body p:last-child { margin: 0; }
.viewed-row {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.viewed-row::-webkit-scrollbar { display: none; }
.viewed-card {
    flex: 0 0 200px;
    width: 200px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    scroll-snap-align: start;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.viewed-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}
.viewed-card__img {
    height: 220px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}
.viewed-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    display: block;
}
.viewed-card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.viewed-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.viewed-card__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════
   БРЕНДЫ — бегущая строка (главная страница)
═══════════════════════════════════════════════════ */
.brands-ticker-wrap {
    overflow: hidden;
    width: 100%;
}
.brands-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    width: max-content;
}
.brands-bar.is-ticking {
    animation: brandsTick 30s linear infinite;
}
.brands-bar.is-ticking:hover {
    animation-play-state: paused;
}
@keyframes brandsTick {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════
   БЕЙДЖИ НОВИНКА / ХИТ на карточках
═══════════════════════════════════════════════════ */
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.product-badges--card {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 4;
    flex-direction: column;
    align-items: flex-start;
}
.product-badges--card .badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ═══════════════════════════════════════════════════
   АДАПТИВ — главная страница
═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .hero--fullscreen { height: 260px; }
    .hero__content { padding: 24px 20px; }
    .hero__title { font-size: 24px; }
    .hero__sub { font-size: 14px; }
    .hero__btn { padding: 10px 20px; font-size: 14px; }
    .popular-card__img { height: 130px; }
}

/* ── Плавающая кнопка Telegram ── */
.tg-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #229ED9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(34,158,217,0.45);
    text-decoration: none;
    animation: tgPulse 2.5s ease-in-out infinite;
}
.tg-float:hover {
    background: #1a8bbf;
    text-decoration: none;
    color: #fff;
    animation: none;
    transform: scale(1.08);
    transition: transform 0.2s;
}
@keyframes tgPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(34,158,217,0.45); }
    50%       { box-shadow: 0 4px 28px rgba(34,158,217,0.75), 0 0 0 8px rgba(34,158,217,0.12); }
}

/* ── Кнопка избранного ── */
@keyframes wlPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.btn--wishlist {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    padding: 0;
    line-height: 1;
}
.btn--wishlist:hover {
    border-color: #e11d48;
    color: #e11d48;
    background: var(--bg-card);
}
.btn--wishlist.btn-wishlist--active {
    border-color: #e11d48;
    background: #e11d48;
    color: #fff;
}
.btn--wishlist.wl-pop {
    animation: wlPop 0.35s ease;
}
.btn--wishlist.btn--lg {
    width: 46px;
    height: 46px;
    font-size: 22px;
}

/* ── Мобильная нижняя навигация ── */

/* На мобильном скрываем избранное из шапки — оно есть в нижнем навбаре */
@media (max-width: 700px) {
    .nav__wishlist { display: none !important; }
    html, body { overflow-x: hidden; max-width: 100vw; }
    .header__top-inner { overflow: hidden; max-width: 100%; }
    .nav { flex-shrink: 1 !important; min-width: 0; }
    .nav__link { padding: 4px 4px !important; }
    .nav__admin { font-size: 16px; }
}

.mob-nav {
    display: none;
}
@media (max-width: 700px) {
    .mob-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1200;
        background: #fff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
        height: 58px;
        align-items: stretch;
        justify-content: space-around;
    }
    .mob-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 2px;
        color: #64748b;
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        position: relative;
        padding: 4px 0;
        transition: color 0.15s;
    }
    .mob-nav__item:active {
        color: #1e40af;
        background: #f1f5f9;
    }
    .mob-nav__item svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    .mob-nav__item span.mob-nav__label {
        font-size: 10px;
        line-height: 1;
    }
    .mob-nav__badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        background: #dc2626;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        padding: 0 3px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    /* Telegram кнопка — поднять над навбаром */
    .tg-float {
        bottom: 70px;
    }
    /* Отступ снизу для body чтобы контент не прятался */
    body {
        padding-bottom: 58px;
    }
}

/* ── Мобильная sticky кнопка корзины (на странице товара) ── */
.mob-sticky-cart {
    display: none;
}
@media (max-width: 700px) {
    .mob-sticky-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1201;
        background: #fff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
        padding: 8px 16px;
        display: none;
        align-items: center;
        gap: 10px;
        height: 58px;
    }
    .mob-sticky-cart.visible {
        display: flex;
    }
    .mob-sticky-cart__btn {
        flex: 1;
        height: 42px;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    .mob-sticky-cart__btn--primary {
        background: #1e40af;
        color: #fff;
    }
    .mob-sticky-cart__btn--preorder {
        background: #d97706;
        color: #fff;
    }
}

/* ── Сетка товаров 2 колонки на мобильном ── */
@media (max-width: 700px) {
    .price-cash-tooltip { display: none !important; }
    .products-grid { gap: 8px !important; grid-template-columns: 1fr 1fr !important; }
    .product-item { min-width: 0; width: 100%; box-sizing: border-box; }
    .product-image { height: 52vw !important; max-height: 260px !important; }
    .product-title { font-size: 12px !important; line-height: 1.3; }
    .product-price { font-size: 13px !important; font-weight: 700 !important; }
    .product-footer { margin-bottom: 4px; }
    .product-info { padding: 8px 6px !important; }
    .product-status { font-size: 10px !important; padding: 2px 6px !important; }
    .product-actions { gap: 4px; flex-wrap: nowrap; }
    .btn--details { font-size: 12px !important; padding: 7px 4px !important; flex: 1; min-width: 0; }
    .btn--compare, .btn--wishlist { width: 32px !important; height: 32px !important; font-size: 15px !important; flex-shrink: 0; }
}
