        :root {
    /* Палитра бренда — канон openspec/specs/ui/tokens, предметное описание docs/brand/DESIGN.md §3 */
    --brand-primary:#084C84; --brand-accent:#00A99D;
    --blue-900:#04263F; --blue-800:#063A63; --blue-700:#084C84;
    --blue-600:#0B5FA5; --blue-500:#1272BF; --blue-300:#7FB6E4;
    --blue-200:#BBD9F2; --blue-100:#E1EEF9; --blue-50:#F2F8FD;
    --teal-700:#00695F; --teal-600:#008578; --teal-500:#00A99D;
    --teal-400:#2FC3B6; --teal-300:#6FD9CE; --teal-200:#AEEDE5;
    --teal-100:#DAF7F3; --teal-50:#F0FCFA;
    --success:#0F7A4A; --success-bg:#E6F5ED;
    --warning:#9A5B00; --warning-bg:#FDF1E0;
    --danger:#B01B33;  --danger-bg:#FCE9EC;
    --info:#0B5FA5;    --info-bg:#E1EEF9;
    --ink:#0F2233; --slate-700:#33475B; --slate-500:#5A6B7C;
    --slate-400:#8A9BAB; --slate-300:#C6D2DE; --slate-200:#E3EAF1;
    --slate-100:#F4F7FA; --paper:#FAF8F5; --white:#FFFFFF;
    /* Радиусы — канон openspec/specs/ui/controls */
    --radius: 7px;
    --radius-inner: 3px;
    --radius-overlay: 18px;
    --radius-pill: 999px;
}
        * { margin: 0; padding: 0; box-sizing: border-box; }
        /* Владелец 27.10.2026 (канон openspec/specs/ui/controls): текст на кнопках не выделяется */
        button, summary, a.filter-btn, a.filters-reset, .category-tree a { -webkit-user-select: none; user-select: none; }
        body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(180deg, #FFFFFF 0%, #F4F7FA 100%); background-attachment: fixed; color: #0F2233; }
        .product-price, .product-detail-price, .cart-summary-row, .qty-value, .card-qty-value, .price { font-variant-numeric: tabular-nums; }

        /* Header */
        .header { background: linear-gradient(90deg, #FFFFFF 0%, var(--blue-50) 100%); color: #0F2233; padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(8,76,132,0.08); border-bottom: 1px solid #E3EAF1; }
        .header-content { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 2rem; }
        .logo { cursor: pointer; display: flex; align-items: center; text-decoration: none; }
        .header-menu { display: contents; }   /* на широком экране поиск и иконки — прямые дети шапки */
        .menu-toggle { display: none; }       /* гамбургер только на узком экране */
        .logo:hover { opacity: 0.9; }
        .logo-img { height: 56px; width: auto; max-width: 100%; object-fit: contain; display: block; }
        /* Логотип на страницах с панелью каталога центрирован по этой панели:
           панель .category-tree шириной 280px, логотип встаёт по её середине (владелец 17.11.2026).
           С 907px хватает места на шапку в одну строку; ниже логотип сжимается и стоит по левому краю. */
        @media (min-width: 907px) {
            body:has(.category-tree) .logo { width: 280px; flex: 0 0 280px; justify-content: center; }
        }
        .search-box { flex: 1; max-width: 500px; position: relative; display: flex; gap: 0.25rem; background: #fff; border-radius: var(--radius); padding: 0.25rem; box-shadow: 0 1px 3px rgba(8,76,132,0.10); }
        .search-box input { flex: 1; padding: 0.75rem 1rem; border: none; border-radius: var(--radius); font-size: 1rem; background: transparent; }
        .search-box button { padding: 0.75rem 1.5rem; background: var(--brand-primary); color: white; border: none; border-radius: var(--radius-inner); cursor: pointer; font-size: 1rem; }
        .search-box button:hover { background: var(--blue-600); }
        .search-results { position: absolute; top: 100%; left: 0; right: 0; background: white; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.15); max-height: 400px; overflow-y: auto; display: none; z-index: 101; }
        .search-results.active { display: block; }
        .search-item { padding: 0.75rem 1rem; border-bottom: 1px solid #E3EAF1; cursor: pointer; display: flex; gap: 0.75rem; align-items: center; transition: background 0.15s; color: #0F2233; }
        .search-item:hover { background: #F4F7FA; }
        .search-item.active { background: #F2F8FD; border-left: 3px solid var(--brand-primary); padding-left: 0.5rem; }
        .search-item.active div { color: var(--brand-primary); }
        .search-item img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
        .header-stats { font-size: 0.875rem; opacity: 0.9; white-space: nowrap; }

        /* Header actions (icons) — белая подложка СОХРАНЯЕТСЯ */
        .header-actions { display: flex; align-items: center; gap: 0.25rem; background: #fff; border-radius: var(--radius); padding: 0.25rem; box-shadow: 0 1px 3px rgba(8,76,132,0.10); }
        .header-icon { cursor: pointer; padding: 0.5rem; display: flex; align-items: center; justify-content: center; color: #33475B; transition: all 0.2s; border-radius: var(--radius); }
        .header-icon:hover { color: var(--brand-primary); background: var(--blue-50); transition-duration: 0.1s; }
        .header-icon svg { width: 24px; height: 24px; }
        /* трубка — сплошная, красным из логотипа (#084C84); hover — общий для иконок шапки (как у кабинета и корзины) */
        .header-icon-call { color: #084C84; }
        /* обводка тем же цветом — глиф толще и читается в 24px */
        .header-icon-call svg { stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }

        /* Category header (search results page) */
        /* Владелец 27.10.2026: заголовок, «Фильтр» и счётчик товаров — в одной строке, чтобы не терять высоту */
        .category-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 0.75rem;
            margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid #C6D2DE; }
        .category-header h1 { font-size: 1.25rem; line-height: 1.3; margin: 0; }
        .category-header h1 .product-count { font-size: 0.85rem; font-weight: 400; color: #5A6B7C; white-space: nowrap; }
        .category-header .product-description-html { flex-basis: 100%; margin: 0; }
        /* «Фильтр» — ниже полосы заголовка, у левого края (владелец 06.11.2026) */
        .filters-inline { margin: 0 0 1rem; }

        /* Подкатегории текущей категории — в выпадающем меню пункта хлебных крошек (владелец 17.11.2026) */
        /* на узком экране заголовок на своей строке */
        @media (max-width: 900px) {
            .category-header { gap: 12px 0; }
            .category-header h1 { flex-basis: 100%; }
        }

        /* Индекс каталога: карточка категории горизонтальная — строка названия и счётчиков,
           ниже полоска фото товаров ветки. Дизайн-язык карточки товара, компоновка другая. */
        /* Карточки категорий шире товарных: полоска фото должна читаться */
        .products-grid.cats-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
        .products-grid.cats-grid > .product-card-link { min-width: 0; }  /* иначе полоска задаёт min-content и карточка вылезает на телефоне */
        .cat-card-strip { display: flex; gap: 6px; height: 120px; padding: 0 1rem 1rem; }
        .cat-card-strip img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: contain;
            background: #fff; border-radius: 6px; }
        /* Название категории — как ссылка-подкатегория: акцентный цвет + подчёркивание,
           чтобы карточку категории не путали с карточкой товара */
        .cat-name { -webkit-line-clamp: 3; color: var(--brand-primary); text-decoration: underline;
            text-underline-offset: 3px; text-decoration-color: rgba(8,76,132, 0.45); }
        .cat-counts { font-size: 0.875rem; color: #5A6B7C; }
        /* Empty state */
        .empty-state { text-align: center; padding: 4rem 2rem; background: white; border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
        .empty-icon { font-size: 4rem; margin-bottom: 1rem; }
        .empty-state h3 { font-size: 1.25rem; color: #0F2233; margin-bottom: 0.5rem; }
        .empty-state p { color: #5A6B7C; }

        /* Product grid (search results) */
        .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
        .product-sticker { position: absolute; top: 12px; left: 12px; padding: 0.375rem 0.75rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; z-index: 2; }

        /* Layout */
        .container { max-width: 1400px; margin: 0 auto; display: flex; gap: 2rem; padding: 2rem; }
        .sidebar { width: 280px; flex-shrink: 0; }
        .main-content { flex: 1; min-width: 0; }

        /* Category Tree */
        /* overscroll-behavior: contain — колесо над панелью не уезжает в страницу, когда панель докручена до края */
        .category-tree { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; }
        .category-tree::-webkit-scrollbar { width: 6px; }
        .category-tree::-webkit-scrollbar-track { background: #F4F7FA; border-radius: var(--radius); }
        .category-tree::-webkit-scrollbar-thumb { background: #E3EAF1; border-radius: var(--radius); }
        .category-tree::-webkit-scrollbar-thumb:hover { background: #5A6B7C; }
        .category-tree h3 { font-size: 1.125rem; margin-bottom: 1rem; color: #0F2233; }
        .tree-item { margin-bottom: 0.25rem; }
        .tree-parent { padding: 0; cursor: pointer; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; font-weight: 500; transition: all 0.2s; }
        .tree-parent:hover { border: 1px solid var(--brand-primary); transition-duration: 0.1s; }
        .tree-parent { border: 1px solid transparent; }
        .tree-parent.active { background: var(--blue-50); color: var(--brand-primary); }
        .tree-children { margin-left: 1rem; margin-top: 0.25rem; display: none; }
        .tree-children.open { display: block; }
        .tree-child { padding: 0; cursor: pointer; border-radius: var(--radius); transition: all 0.2s; }
        .tree-child:hover { border: 1px solid var(--brand-primary); transition-duration: 0.1s; }
        .tree-child { border: 1px solid transparent; }
        .tree-child.active { background: #F2F8FD; color: var(--brand-primary); }
        /* пункт целиком — ссылка: padding на <a>, а не на обёртке (было кликабельно только слово) */
        .tree-parent > a, .tree-child > a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius); }
        .tree-parent > a { flex: 1; }
        .arrow { transition: transform 0.2s; transform: rotate(-90deg); display: inline-block; }
        .arrow.open { transform: rotate(0deg); }

        /* Breadcrumbs */
        .crumbs-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 10px; }
        .crumbs-row > .breadcrumbs { margin-bottom: 0; min-width: 0; }
        .tree-hamburger { display: none; }
        .tree-overlay { display: none; }
        .breadcrumbs { margin-bottom: 1.5rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
        .breadcrumb { color: #5A6B7C; text-decoration: none; font-size: 0.875rem; }
        .breadcrumb:hover { color: var(--blue-600); }
        .breadcrumb.active { color: var(--brand-primary); font-weight: 500; }
        .breadcrumb-sep { color: #5A6B7C; }
        /* Попап подкатегорий в крошках: наведение или фокус на пункт — дети одной строкой каждый.
           Список берётся из того же дерева категорий, что и левая панель (канон «как в проводнике»). */
        .crumb-item { position: relative; display: inline-flex; align-items: center; }
        .crumb-pop { display: none; position: absolute; top: 100%; left: 0; z-index: 60;
            width: max-content; max-width: min(420px, 80vw); max-height: 60vh; overflow-y: auto; overflow-x: hidden;
            padding: 0.375rem 0; background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius);
            box-shadow: 0 8px 24px rgba(8,76,132,0.14); }
        .crumb-item:hover > .crumb-pop, .crumb-item:focus-within > .crumb-pop { display: block; }
        .crumb-pop-item { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
            padding: 0.375rem 0.75rem; font-size: 0.8125rem;
            color: var(--slate-700); text-decoration: none; }
        .crumb-pop-item:hover { background: var(--slate-100); color: var(--blue-600); }
        .crumb-pop-count { color: var(--slate-500); font-size: 0.75rem; }

        /* Product Grid */
        .products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
        .products-header h2 { font-size: 1.5rem; color: #0F2233; }
        .product-count { color: #5A6B7C; font-size: 0.875rem; }
        .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

        /* Product Card */
        .product-card { background: white; border: 1px solid #E3EAF1; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 12px rgba(8,76,132,0.08); transition: all 0.3s; cursor: pointer; position: relative; }
        .product-card:hover { transform: translateY(-4px); box-shadow: 0 4px 24px rgba(8,76,132,0.45); transition-duration: 0.1s; }
        .product-image { width: 100%; height: 250px; object-fit: contain; background: #fff; padding: 1rem; }
        /* Товар без фото: коробка того же размера, вместо картинки — надпись, сетка не сдвигается */
        .no-photo { display: flex; align-items: center; justify-content: center; background: #fff; color: #8A9BAB;
            font-size: 1.25rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
        .product-detail-image .main-image.no-photo { width: 100%; height: 20rem; max-height: none; }
        .product-info { padding: 1.25rem; }
        .product-name { font-size: 1rem; font-weight: 500; margin-bottom: 0.75rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .product-price { font-size: 1.25rem; font-weight: 700; color: #0F2233; margin-bottom: 0.5rem; }
        .product-old-price { font-size: 0.875rem; color: #5A6B7C; text-decoration: line-through; margin-left: 0.5rem; }
        .product-registration { font-size: 0.75rem; color: #00695F; margin-top: 0.5rem; background: var(--blue-50); border: 1px solid #AEEDE5; border-radius: var(--radius); padding: 0.35rem 0.6rem; display: inline-block; }
        /* Индикатор «Кварцевание включено» — пульсирующий УФ-свет */
        .uv-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--blue-600); box-shadow: 0 0 12px rgba(8,76,132,0.8); animation: uv-glow 2s ease-in-out infinite; display: inline-block; margin-right: 6px; vertical-align: middle; }
        @keyframes uv-glow { 0%, 100% { box-shadow: 0 0 10px rgba(8,76,132,0.5); } 50% { box-shadow: 0 0 20px rgba(8,76,132,1); } }

        /* Stickers */
        .sticker { position: absolute; top: 12px; left: 12px; padding: 0.375rem 0.75rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; z-index: 2; }
        .sticker-hit { background: #9A5B00; color: #fff; }
        .sticker-new { background: #0B5FA5; color: #fff; }
        .sticker-sale { background: #B01B33; color: #fff; }

        /* Product Detail Page */
        .product-detail { background: white; border-radius: var(--radius); padding: 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
        
        /* Верхний блок: фото + инфо */
        /* Владелец 27.10.2026: фото не выходит за свой блок, галерея — горизонтальная лента-разделитель
           между шапкой карточки и характеристиками (на мобильном — между фото и информацией). */
        /* Фото не фиксируем жёстко: при узком main колонка 400px выдавливала информацию и давала прокрутку */
        .product-detail-top { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 10px 3rem; margin-bottom: 0; }
        .product-detail-media { grid-column: 1; grid-row: 1; min-width: 0; }
        .product-detail-info { grid-column: 2; grid-row: 1; min-width: 0; }
        .product-detail-image { position: relative; display: flex; align-items: center; justify-content: center;
            width: 100%; max-height: 500px; overflow: hidden; background: #fff; border-radius: var(--radius); padding: 2rem; }
        .product-detail-image .main-image { max-width: 100%; max-height: 100%; width: auto; height: auto;
            object-fit: contain; border-radius: var(--radius); display: block; }
        .img-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
            display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
            border: 1px solid #E3EAF1; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--brand-primary); }
        .img-nav.prev { left: 0.5rem; }
        .img-nav.next { right: 0.5rem; }
        .img-nav svg { width: 18px; height: 18px; }
        .product-gallery { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 0.5rem; min-width: 0;
            padding: 0.75rem 0; }
        .product-gallery-track { display: flex; gap: 0.5rem; flex: 1 1 auto; min-width: 0; overflow-x: auto;
            scrollbar-width: none; }
        .product-gallery-track::-webkit-scrollbar { display: none; }
        .gallery-thumb { flex: 0 0 auto; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius);
            cursor: pointer; border: 2px solid transparent; opacity: 0.7; }
        .gallery-thumb.active, .gallery-thumb:hover { border-color: var(--brand-primary); opacity: 1; }
        .gal-nav { flex: 0 0 auto; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
            padding: 0; cursor: pointer; border: 1px solid #E3EAF1; background: #fff; color: var(--brand-primary); border-radius: var(--radius); }
        .gal-nav svg { width: 14px; height: 14px; }
        .gal-nav[hidden] { display: none; }
        /* Полноэкранный просмотр фото */
        .photo-lightbox { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
            padding: 1rem; background: rgba(0, 0, 0, 0.88); }
        .photo-lightbox[hidden] { display: none; }
        .lightbox-img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: var(--radius); }
        .lightbox-btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
            padding: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35);
            border-radius: 50%; }
        .lightbox-btn svg { width: 20px; height: 20px; }
        .lightbox-btn.close { top: 1rem; right: 1rem; }
        .lightbox-btn.prev { left: 1rem; top: 50%; transform: translateY(-50%); }
        .lightbox-btn.next { right: 1rem; top: 50%; transform: translateY(-50%); }
        .lightbox-btn[hidden] { display: none; }
        .variant-btn { padding: 0.5rem 1rem; border: 2px solid #E3EAF1; border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 0.875rem; color: #0F2233; transition: all 0.15s; }
        .variant-btn:hover { border-color: var(--brand-primary); transition-duration: 0.1s; }
        .variant-btn.active { border-color: var(--brand-primary); background: var(--brand-primary); color: #fff; }
        .product-detail-info h1 { font-size: 1.2rem; margin: 0 0 0.75rem; color: #0F2233; line-height: 1.3; }
        .product-detail h2 { font-size: 1.2rem; margin: 1.75rem 0 0.75rem; color: #0F2233; }
        .head-fact-value a { color: inherit; }
        .product-detail-image .main-image { cursor: zoom-in; }
        /* Шапка карточки: набор свойств задаётся флагами show_in_header из CRM.
           Владелец 05.11.2026: свойства идут столбиком и не прилипают к блоку выше. */
        .product-head-facts { list-style: none; margin: 1rem 0 1.25rem; padding: 0; display: flex;
            flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 0.35rem; }
        .product-head-facts li, .product-head-facts .head-fact { font-size: 0.95rem; color: #0F2233; }
        .product-head-facts .head-fact-label { color: #5A6B7C; margin-right: 0.35rem; }
        .product-head-facts .head-fact-value { font-weight: 600; }
        .product-detail-price { font-size: 2rem; font-weight: 700; color: #0F2233; }
        /* Цена слева, счётчик и «В корзину» справа — одной строкой */
        .product-buy-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.5rem; }
        .product-buy-row .product-detail-price { font-size: 1.5rem; }
        .product-buy-row .qty-counter { gap: 0.5rem; }
        .product-buy-row .qty-btn { width: 34px; height: 34px; }
        .product-buy-row .qty-value { font-size: 1.1rem; min-width: 24px; }
        .product-buy-row .btn-add-cart-inline { padding: 0.6rem 0.9rem; font-size: 0.95rem; gap: 0.4rem; }
        .product-buy-row .btn-add-cart-inline svg { width: 18px; height: 18px; }
        
        /* HTML описание на всю ширину */
        .product-description-html { margin-bottom: 2rem; padding: 1.5rem 0; border-top: 1px solid #C6D2DE; white-space: pre-wrap; }
        .product-description-html img { max-width: 100%; height: auto; }
        .product-description-html table { width: 100%; border-collapse: collapse; margin: 1rem 0; white-space: normal; }
        .product-description-html td, .product-description-html th { border: 1px solid #E3EAF1; padding: 0.5rem; white-space: normal; }
        
        /* Короткое описание */
        .product-detail-description { color: #33475B; line-height: 1.6; margin-bottom: 1.5rem; }
        .product-attributes { margin-bottom: 2rem; }
        /* Характеристики и описание — рядом: слева характеристики, справа описание.
           Владелец 16.11.2026: друг под другом эти блоки оставляли справа пустое поле шириной в полэкрана.
           До 1100px колонки складываются в столбик — иначе описанию остаётся слишком узкая полоса.
           Верхняя граница блока — та самая разделительная линия после фотографий: блок прижат к ней (отступ сверху 0). */
        .product-detail-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2.5rem; align-items: start;
            padding-top: 1.25rem; border-top: 1px solid #E3EAF1; }
        .product-detail-bottom h2 { margin-top: 0; }
        @media (min-width: 1100px) {
            .product-detail-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
        }
        .product-detail-bottom .product-attributes { margin-bottom: 0; }
        .product-detail-bottom .product-description-html { padding-top: 0; margin-bottom: 0; border-top: 0; }
        .product-attributes h3 { font-size: 1.125rem; margin-bottom: 1rem; color: #0F2233; }
        .attribute-row { display: flex; padding: 0.75rem 0; border-bottom: 1px solid #C6D2DE; }
        .attribute-key { width: 200px; color: #5A6B7C; }
        .attribute-value { flex: 1; color: #0F2233; font-weight: 500; }
        .btn-primary { background: var(--brand-primary); color: white; padding: 1rem 2rem; border: none; border-radius: var(--radius); font-size: 1.125rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 2px 16px rgba(8,76,132,0.3); transition-duration: 0.1s; }
        .btn-secondary { background: #F4F7FA; color: #0F2233; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius); font-size: 1rem; cursor: pointer; margin-left: 1rem; transition: all 0.2s; }
        .btn-secondary:hover { background: #C6D2DE; transition-duration: 0.1s; }

        /* Related Products */
        .related-products { margin-top: 3rem; }
        .related-products h3 { font-size: 1.25rem; margin-bottom: 1.5rem; color: #0F2233; }

        /* Loading */
        .loading { text-align: center; padding: 3rem; color: #5A6B7C; }
        .spinner { border: 3px solid #C6D2DE; border-top: 3px solid var(--brand-primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* Filter Button */
        .filter-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; background: white; border: 2px solid #E3EAF1; border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; font-weight: 500; color: #0F2233; transition: all 0.2s; }
        .filter-btn:hover { background: var(--blue-50); transition-duration: 0.1s; }
        .filter-btn.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
        .filter-btn svg { width: 18px; height: 18px; }
        .filter-count { background: var(--brand-primary); color: white; border-radius: var(--radius); padding: 0.1rem 0.5rem; font-size: 0.75rem; }
        .filter-btn.active .filter-count { background: white; color: var(--brand-primary); }

        /* Filter Panel Overlay */
        .filter-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; opacity: 0; transition: opacity 0.3s; }
        .filter-overlay.active { display: block; opacity: 1; }

        /* Filter Panel */
        .filter-panel { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: white; z-index: 201; box-shadow: -4px 0 20px rgba(0,0,0,0.15); transition: right 0.3s ease; display: flex; flex-direction: column; }
        .filter-panel.active { right: 0; }
        .filter-panel-header { padding: 1.5rem; border-bottom: 1px solid #C6D2DE; display: flex; justify-content: space-between; align-items: center; }
        .filter-panel-header h3 { font-size: 1.25rem; color: #0F2233; }
        .filter-close { width: 32px; height: 32px; border: none; background: #F4F7FA; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
        .filter-close:hover { background: #C6D2DE; transition-duration: 0.1s; }
        .filter-panel-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
        .filter-panel-footer { padding: 1rem 1.5rem; border-top: 1px solid #C6D2DE; display: flex; gap: 0.75rem; }
        .filter-apply-btn { flex: 1; padding: 0.75rem; background: var(--brand-primary); color: white; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
        .filter-apply-btn:hover { background: var(--blue-600); transition-duration: 0.1s; }
        .filter-reset-btn { flex: 1; padding: 0.75rem; background: #F4F7FA; color: #0F2233; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
        .filter-reset-btn:hover { background: #C6D2DE; }

        /* Filter Group */
        .filter-group { margin-bottom: 1.5rem; }
        .filter-group-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 0.5rem 0; }
        .filter-group-header h4 { font-size: 1rem; color: #0F2233; }
        .filter-group-toggle { font-size: 0.8rem; color: #5A6B7C; }
        .filter-group-body { padding-left: 0.75rem; }

        /* Filter Input Fields */
        .filter-property { margin-bottom: 1rem; }
        .filter-property label { display: block; font-size: 0.85rem; font-weight: 500; color: #33475B; margin-bottom: 0.35rem; }
        .filter-property input[type="number"],
        .filter-property input[type="text"],
        .filter-property select {
            width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #E3EAF1; border-radius: var(--radius);
            font-size: 0.9rem; color: #0F2233; background: white; transition: border-color 0.2s;
        }
        .filter-property input:focus,
        .filter-property select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
        .filter-range-row { display: flex; gap: 0.5rem; align-items: center; }
        .filter-range-row .filter-range-separator { color: #5A6B7C; font-size: 0.85rem; }
        /* Единица измерения: видна у заполненного поля, скрыта во время ввода (контракт §8.3) */
        .filter-range-row .facet-unit { display: none; color: #5A6B7C; font-size: 0.8rem; white-space: nowrap; }
        .filter-range-row input:not(:placeholder-shown) + .facet-unit { display: inline; }
        .filter-range-row input:focus + .facet-unit { display: none; }
        .filter-unit { display: inline-block; font-size: 0.75rem; color: #5A6B7C; margin-top: 0.25rem; }
        .filter-no-options { font-size: 0.8rem; color: #5A6B7C; font-style: italic; }
        .filter-select-multi label { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; cursor: pointer; font-size: 0.85rem; }
        .filter-select-multi input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-primary); }
        .filter-range-row input { flex: 1; }
        .filter-select-multi { border: 1px solid #E3EAF1; border-radius: var(--radius); padding: 0.25rem; }
        .filter-select-multi label { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem; border-radius: var(--radius); cursor: pointer; font-weight: 400; font-size: 0.85rem; }
        .filter-select-multi label:hover { background: #F4F7FA; }
        .filter-select-multi input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--brand-primary); }
        .active-filter-tag { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.6rem; background: #F2F8FD; border-radius: var(--radius); font-size: 0.8rem; color: var(--blue-600); }
        .active-filter-tag .remove { cursor: pointer; font-weight: bold; margin-left: 0.25rem; }

        /* Cart Icon in Header */
        .cart-icon { cursor: pointer; position: relative; padding: 0.5rem; display: flex; align-items: center; justify-content: center; min-width: 44px; gap: 0.5rem; color: #33475B; transition: all 0.2s; border-radius: var(--radius); }
        .cart-icon:hover { color: var(--brand-primary); background: var(--blue-50); transition-duration: 0.1s; }
        .cart-icon svg { width: 28px; height: 28px; margin-left: -3px; }
        /* Наполненная корзина — подложка бирюзовым из логотипа (владелец 27.11.2026) */
        .cart-icon.has-items { background: var(--brand-accent); color: #fff; }
        .cart-icon.has-items:hover { background: var(--teal-700); color: #fff; }
        .cart-badge { position: absolute; top: -6px; right: -6px; background: #B01B33; color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; font-size: 0.7rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; }
        .cart-badge.empty { display: none; }

        /* Всплывающая подсказка над элементом (data-tip) */
        .tip { position: relative; }
        .tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: #04263F; color: #fff; font-size: 0.75rem; font-weight: 500; line-height: 1.2; padding: 6px 10px; border-radius: var(--radius-inner); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 12; box-shadow: 0 4px 14px rgba(4,38,63,0.28); }
        .tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

        /* Бейдж количества товара в корзине на кнопке корзины */
        .cart-qty-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #B01B33; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; pointer-events: none; }
        .cart-qty-badge[hidden] { display: none; }

        /* Cart Modal */
        .cart-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 300; display: none; opacity: 0; transition: opacity 0.3s; }
        .cart-overlay.active { display: block; opacity: 1; }
        .cart-modal { position: fixed; top: 0; right: -640px; width: 620px; max-width: 100vw; height: 100vh; background: white; z-index: 301; box-shadow: -4px 0 20px rgba(0,0,0,0.15); transition: right 0.3s ease; display: flex; flex-direction: column; }
        .cart-modal.active { right: 0; }
        .cart-header { padding: 1.5rem; border-bottom: 1px solid #C6D2DE; display: flex; justify-content: space-between; align-items: center; }
        .cart-header h3 { font-size: 1.25rem; color: #0F2233; }
        .cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
        .cart-footer { padding: 1.5rem; border-top: 1px solid #C6D2DE; background: #F4F7FA; }
        .cart-empty { text-align: center; padding: 3rem 1rem; color: #5A6B7C; }
        .cart-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
        .cart-item { display: flex; gap: 0.75rem; padding: 1rem 0; border-bottom: 1px solid #F4F7FA; align-items: flex-start; }
        .cart-item-img-wrap { flex-shrink: 0; cursor: pointer; }
        .cart-item-img-wrap:hover .cart-item-img { outline: 2px solid #F2F8FD; }
        .cart-item-img { width: 70px; height: 70px; object-fit: contain; border-radius: var(--radius); background: #fff; transition: outline 0.2s; }
        .cart-item-name-wrap { flex: 1; min-width: 0; cursor: pointer; }
        .cart-item-name-wrap:hover .cart-item-name { color: var(--brand-primary); }
        .cart-item-name { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.25rem; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; transition: color 0.2s; line-height: 1.4; }
        .cart-item-right { flex-shrink: 0; width: 150px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
        .cart-item-price { font-size: 0.85rem; color: #5A6B7C; white-space: nowrap; }
        .cart-item-qty { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
        .cart-item-qty button { width: 28px; height: 28px; border: 1px solid #E3EAF1; border-radius: var(--radius); background: white; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
        .cart-item-qty button:hover { background: #F4F7FA; }
        .cart-item-qty span { min-width: 24px; text-align: center; font-weight: 600; }
        .cart-item-remove { color: #B01B33; cursor: pointer; font-size: 0.85rem; margin-top: 0.5rem; }
        .cart-item-remove:hover { text-decoration: underline; }
        .cart-summary-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.9rem; }
        .cart-summary-row.total { font-size: 1.1rem; font-weight: 700; color: #0F2233; border-top: 2px solid #C6D2DE; margin-top: 0.5rem; padding-top: 0.75rem; }
        .cart-summary-row .label { color: #5A6B7C; }
        .cart-action-btn { width: 100%; padding: 0.875rem; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 0.75rem; transition: all 0.2s; }
        .cart-action-btn:disabled { opacity: 0.6; cursor: default; }
        .cart-action-btn.invoice { background: var(--brand-primary); color: white; }
        .cart-action-btn.invoice:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
        .cart-action-btn.quote { background: #F4F7FA; color: #0F2233; }
        .cart-action-btn.quote:hover { background: #C6D2DE; }
        .cart-close { width: 32px; height: 32px; border: none; background: #F4F7FA; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
        .cart-close:hover { background: #C6D2DE; }

        /* Cart button area - absolutely positioned at bottom-right of card */
        .card-cart-area { position: absolute; bottom: 12px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 0.5rem; }
        /* Кнопка корзины — «тихая» до добавления (ТЗ 4.7b) */
        .btn-add-cart-icon { position: relative; width: 44px; height: 44px; border: 1px solid #E3EAF1; background: #F2F8FD; color: #5A6B7C; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: none; flex-shrink: 0; }
        .btn-add-cart-icon:hover { transform: translateY(-2px); background: var(--teal-50); color: var(--brand-primary); border-color: var(--blue-500); transition-duration: 0.1s; }
        /* При наведении на карточку — корзина и цена становятся акцентными */
        .product-card:hover .btn-add-cart-icon:not(.card-added) { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); box-shadow: 0 2px 12px rgba(8,76,132,0.35); }
        .product-card:hover .product-price { color: var(--brand-primary); }
        /* Добавлен в корзину — яркая УФ-заливка со свечением */
        .btn-add-cart-icon.card-added { border: none; background: var(--brand-accent); color: #fff; box-shadow: 0 2px 12px rgba(0,169,157,0.35); }
        .btn-add-cart-icon.card-added:hover { background: var(--teal-700); }
        .btn-add-cart-icon svg { width: 22px; height: 22px; margin-left: -3px; }

        /* Card quantity counter (shown after adding to cart) */
        .card-qty-counter { display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem; background: #F4F7FA; border-radius: var(--radius); }
        .card-qty-btn { width: 32px; height: 32px; border: 2px solid #E3EAF1; border-radius: var(--radius); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
        .card-qty-btn:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
        .card-qty-btn:hover svg { stroke: white; }
        .card-qty-btn svg { width: 16px; height: 16px; stroke: #0F2233; stroke-width: 3; fill: none; }
        .card-qty-value { font-size: 1.1rem; font-weight: 700; min-width: 24px; text-align: center; color: #0F2233; }
        .card-cart-icon-btn { margin-left: auto; width: 36px; height: 36px; border: none; background: var(--brand-primary); color: white; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; flex-shrink: 0; }
        .card-cart-icon-btn:hover { background: var(--blue-600); }
        .card-cart-icon-btn svg { width: 18px; height: 18px; }

        /* Breadcrumb back arrow */
        .breadcrumb-back { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 4px; border-radius: var(--radius); transition: background 0.2s; }
        .breadcrumb-back:hover { background: #F4F7FA; }
        .breadcrumb-back svg { width: 20px; height: 20px; }

        /* Quantity Counter */
        /* Кнопка «В корзину» переносится, а не вылезает за карточку, когда правая колонка узкая */
        .qty-counter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-left: auto; }
        /* Пока товара нет в корзине — только кнопка «В корзину»; «−», «0» и «+» появляются с первой штукой */
        .qty-counter.is-zero .qty-btn, .qty-counter.is-zero .qty-value { display: none; }
        .qty-btn { width: 40px; height: 40px; border: 2px solid #E3EAF1; border-radius: var(--radius); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
        .qty-btn:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
        .qty-btn:hover svg { stroke: white; }
        .qty-btn svg { width: 20px; height: 20px; stroke: #0F2233; stroke-width: 3; fill: none; }
        .qty-value { font-size: 1.25rem; font-weight: 700; min-width: 40px; text-align: center; color: #0F2233; }
        .btn-add-cart-inline { position: relative; padding: 0.75rem 1.5rem; background: var(--brand-primary); color: white; border: none; border-radius: var(--radius); cursor: pointer; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; transition: background 0.2s; }
        .btn-add-cart-inline:hover { background: var(--blue-600); }
        .btn-add-cart-inline.in-cart { background: var(--brand-accent); box-shadow: 0 2px 12px rgba(0,169,157,0.35); }
        .btn-add-cart-inline.in-cart:hover { background: var(--teal-700); }
        .btn-add-cart-inline svg { width: 20px; height: 20px; }

        /* Properties Table in Product Detail */
        .properties-table-section { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid #C6D2DE; }
        .properties-table-section h3 { font-size: 1.25rem; color: #0F2233; margin-bottom: 1.5rem; }
        .properties-group { margin-bottom: 1.5rem; }
        .properties-group h4 { font-size: 1rem; color: #0F2233; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #C6D2DE; }
        .properties-group h4 .group-icon { margin-right: 0.5rem; }
        .properties-group.dimensions-product h4 { color: #5A6B7C; }  /* зелёный — габариты изделия */
        .properties-group.dimensions-package h4 { color: #5A6B7C; }  /* оранжевый — габариты упаковки */
        .properties-table { width: 100%; border-collapse: collapse; }
        .properties-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #F4F7FA; }
        .properties-table tr:last-child td { border-bottom: none; }
        .properties-table td:first-child { color: #5A6B7C; width: 45%; }
        .properties-table td:last-child { color: #0F2233; font-weight: 500; }
        
        /* Discovered properties indicator */
        .properties-table tr.discovered-row { background: #FDF1E0; }
        .properties-table tr.discovered-row td:last-child { position: relative; }
        .discovered-badge { display: inline-block; font-size: 0.65rem; background: #9A5B00; color: white; padding: 1px 6px; border-radius: var(--radius); margin-left: 0.5rem; vertical-align: middle; font-weight: 600; letter-spacing: 0.02em; }

        /* Широкий экран (≥1025px): полезная площадь шире, шапка компактнее */
        @media (min-width: 1025px) {
            .header { height: 82px; padding: 0; display: flex; align-items: center; }
            .header-content { max-width: 1672px; width: 100%; height: 100%; }
            .container { max-width: 1672px; }
        }

        /* Responsive */
        @media (max-width: 1024px) {
            /* панель каталога остаётся колонкой: карточки встают в один столбик рядом с ней */
            .product-detail-grid { grid-template-columns: 1fr; }
            .filter-panel { width: 100%; right: -100%; }
        }

        @media (max-width: 768px) {
            /* Шапка в одну строку: логотип, поиск, гамбургер; в гамбургере — только иконки действий */
            .header { padding: 0.5rem 1rem; }
            .header-content { flex-wrap: wrap; align-items: center; gap: 0.5rem; position: relative; padding: 0; }
            .logo { order: 1; }
            .logo-img { height: 40px; }
            .menu-toggle { order: 3; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
                width: 44px; height: 44px; border: 1px solid #E3EAF1; background: #fff; color: var(--brand-primary);
                border-radius: var(--radius); font-size: 1.25rem; line-height: 1; cursor: pointer; }
            .header-menu { display: contents; }
            .header-menu .search-box { order: 2; flex: 1 1 0; min-width: 0; width: auto; max-width: none; }
            .header-menu .header-actions { order: 4; display: none; position: absolute; top: calc(100% + 0.5rem); right: 0;
                z-index: 120; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #fff; border: 1px solid #E3EAF1;
                border-radius: var(--radius); box-shadow: 0 8px 24px rgba(8,76,132, 0.18); }
            .header-menu.open .header-actions { display: flex; }
            .search-box input { padding: 0.6rem 0.5rem; font-size: 0.95rem; min-width: 0; }
            .search-box button { flex: 0 0 auto; padding: 0.6rem 0.75rem; }
            .header-stats { font-size: 0.75rem; text-align: center; }

            /* Container: single column, less padding */
            .container { padding: 1rem; gap: 1rem; }

            /* Панель каталога: гамбургер слева от крошек, дерево выезжает поверх страницы */
            .container { flex-direction: column; gap: 0.75rem; }
            .sidebar { display: contents; }
            .tree-hamburger { display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
                width: 38px; height: 38px; border: 1px solid #E3EAF1; background: #fff; color: var(--brand-primary);
                border-radius: var(--radius); font-size: 1.1rem; line-height: 1; cursor: pointer; }
            .tree-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 290; }
            .tree-overlay.active { display: block; }
            body.tree-open { overflow: hidden; }
            .category-tree { position: fixed; top: 0; bottom: 0; left: calc(-100% - 2rem); width: min(85vw, 340px); z-index: 300;
                max-height: 100vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 0; padding: 1rem; }
            .category-tree.expanded { left: 0; }

            /* Product grid: 2 columns on mobile */
            .products-grid, .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
            .product-image { height: 180px; padding: 0.5rem; }
            .product-info { padding: 0.75rem; }
            .product-name { font-size: 0.85rem; -webkit-line-clamp: 3; }
            .product-price { font-size: 1rem; }
            .product-old-price { font-size: 0.75rem; }


            /* Attributes: flexible key width */
            .attribute-key { width: auto; flex: 0 0 120px; font-size: 0.85rem; }
            .attribute-value { font-size: 0.85rem; }

            /* Buttons: full width on mobile */
            .btn-primary, .btn-secondary { display: block; width: 100%; margin: 0.5rem 0; text-align: center; }
            .btn-secondary { margin-left: 0; }

            /* Breadcrumbs: smaller; попап подкатегорий на телефоне не раскрывается (там дерево-гамбургер) */
            .breadcrumbs { font-size: 0.8rem; }
            .crumb-pop { display: none !important; }

            /* Products header: строка «Всего: N товаров» + кнопка «Каталог» переносится, а не вылезает */
            .products-header { flex-wrap: wrap; gap: 0.5rem; }
            .products-header > div { flex-wrap: wrap; }
            .products-header h2 { font-size: 1.15rem; }

            /* Filter panel: full screen on mobile */
            .filter-panel { width: 100%; right: -100%; }
            .filter-panel-body { padding: 1rem; }

            /* Properties table: simpler on mobile */
            .properties-table td { display: block; width: 100%; padding: 0.3rem 0; }
            .properties-table td:first-child { font-size: 0.75rem; color: #5A6B7C; text-transform: uppercase; }
            .properties-table td:last-child { font-size: 0.95rem; }

            /* Search results */
            .search-results { max-height: 250px; }
            .search-item img { width: 32px; height: 32px; }
        }

        /* Карточка товара: до 906px одна колонка (фото → галерея → информация), с 907px — две.
   Владелец 28.10.2026: скачок заголовка вправо должен совпадать с перестройкой остального интерфейса. */
@media (max-width: 906px) {
    .product-detail { padding: 1rem; }
    .product-detail-top { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 0; }
    .product-detail-media, .product-detail-info, .product-gallery { grid-column: 1; grid-row: auto; }
    .product-detail-image { max-height: 40vh; padding: 0.5rem; }
    .product-detail-price { font-size: 1.5rem; }
}

@media (max-width: 480px) {
            /* Ultra compact: 1 column grid for very small screens */
            .products-grid, .product-grid { grid-template-columns: 1fr; }
            .product-image { height: 200px; }
            .product-name { font-size: 0.95rem; }
            .product-price { font-size: 1.15rem; }

            /* Header even more compact */
            .header { padding: 0.5rem 1rem; }
            .logo-img { height: 35px; }
        }

/* 907–1081px: две равные колонки (фото — половина блока по ширине). Правило без привязки к ориентации:
   при колонке фото 400px правая часть уже не вмещала кнопку «В корзину» и давала горизонтальную прокрутку. */
@media (min-width: 907px) and (max-width: 1081px) {
    .product-detail-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 1rem; }
    .product-detail-media { grid-column: 1; grid-row: 1; }
    .product-detail-info { grid-column: 2; grid-row: 1; }
    .product-gallery { grid-column: 1 / -1; grid-row: 2; }
    .product-detail-image { max-height: none; }
}

/* ─── Доставка в корзине и модалка заявки ─── */
.cart-delivery { margin: 0.5rem 0 0.25rem; }
.cart-delivery-title { font-size: 0.9rem; font-weight: 600; color: #0F2233; margin-bottom: 0.4rem; }
.cart-field { width: 100%; padding: 0.55rem 0.75rem; border: 1px solid #E3EAF1; border-radius: var(--radius);
    font-family: inherit; font-size: 0.9rem; color: #0F2233; background: #fff; margin-bottom: 0.5rem; }
.cart-field:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(8,76,132, 0.15); }
.cart-field.invalid { border-color: #B01B33; box-shadow: 0 0 0 2px rgba(176,27,51,.12); }

.lead-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 500; display: none; opacity: 0; transition: opacity 0.3s; }
.lead-overlay.active { display: block; opacity: 1; }
.lead-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 560px; max-width: calc(100vw - 2rem);
    max-height: 90vh; overflow-y: auto; background: #fff; border-radius: var(--radius); z-index: 501;
    box-shadow: 0 12px 40px rgba(4,38,63, 0.28); display: none; }
.lead-modal.active { display: block; }
.lead-modal [hidden] { display: none !important; }
.lead-modal .cart-header { position: sticky; top: 0; z-index: 2; background: #fff; }
.lead-body { padding: 1rem 1.5rem 1.5rem; }
.lead-field { margin-bottom: 0.75rem; }
/* Поле-приманка для ботов (change lead-antispam): обычный input, вынесенный за экран.
   Не display:none и не type="hidden" — это первое, что проверяют спам-боты; человеку поле недоступно
   (за экраном, tabindex="-1", aria-hidden на обёртке). */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.lead-label { display: block; font-size: 0.85rem; font-weight: 500; color: #33475B; margin-bottom: 0.25rem; }
.lead-field input, .lead-field textarea { width: 100%; padding: 0.55rem 0.75rem; border: 1px solid #E3EAF1;
    border-radius: var(--radius); font-family: inherit; font-size: 0.95rem; color: #0F2233; background: #fff; }
.lead-field textarea { resize: vertical; min-height: 56px; }
.lead-field input:focus, .lead-field textarea:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(8,76,132, 0.15); }
.lead-field input.invalid { border-color: #B01B33; box-shadow: 0 0 0 2px rgba(176,27,51,.12); }
.lead-consent { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.75rem 0; font-size: 0.85rem; line-height: 1.35; color: #33475B; cursor: pointer; }
.lead-consent input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--brand-primary); flex: 0 0 auto; }
.lead-consent input.invalid { outline: 2px solid #B01B33; outline-offset: 2px; }
.lead-consent a { color: var(--brand-primary); }
.lead-error { background: #FCE9EC; border: 1px solid rgba(176,27,51,.35); color: #B01B33; border-radius: var(--radius);
    padding: 0.6rem 0.75rem; font-size: 0.9rem; margin-bottom: 0.75rem; }
.lead-actions { display: flex; gap: 0.75rem; align-items: stretch; margin-top: 0.5rem;
    position: sticky; bottom: -1.5rem; background: #fff; padding: 0.75rem 0 0.25rem; }
.lead-submit { flex: 1; padding: 0.75rem 1rem; background: var(--brand-primary); color: #fff; border: 0;
    border-radius: var(--radius); font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.lead-submit:hover { background: var(--blue-600); }
.lead-submit:disabled, .lead-max-btn:disabled { opacity: 0.6; cursor: default; }
.lead-max-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    padding: 0.6rem 1rem; border: 1px solid var(--brand-primary); border-radius: var(--radius); background: #fff;
    color: var(--brand-primary); font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.lead-max-note { font-size: 0.75rem; font-weight: 400; color: #5A6B7C; }
.lead-qr { background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius); padding: 1rem; margin-top: 1rem; text-align: center; }
.lead-qr svg { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }
.lead-max-code { margin-top: 0.5rem; font-size: 0.85rem; color: #5A6B7C; text-align: center; }
.lead-success { text-align: center; padding: 1.5rem 0 0.5rem; }
.lead-success-icon { width: 48px; height: 48px; margin: 0 auto 0.75rem; border-radius: 50%; background: var(--brand-primary);
    color: #fff; font-size: 1.5rem; line-height: 48px; }
.lead-success-text { font-size: 1rem; line-height: 1.5; color: #0F2233; margin-bottom: 0.5rem; }
.lead-success-no { font-size: 0.95rem; font-weight: 600; color: var(--brand-primary); margin-bottom: 1rem; }
.lead-success .lead-max-btn { max-width: 320px; margin: 0 auto; }

/* Запрос звонка из шапки: та же карточка-форма, но затемнение синее и уже окно */
.call-overlay { background: var(--brand-primary); }
.call-overlay.active { opacity: 0.42; }
.call-modal { width: 420px; }
.lead-optional { font-weight: 400; color: #5A6B7C; }

@media (max-width: 560px) {
    /* Полоска фото на карточке категории — ниже и с меньшими отступами; карточки в одну колонку */
    .cat-card-strip { height: 90px; padding: 0 0.5rem 0.5rem; gap: 4px; }
    .products-grid.cats-grid { grid-template-columns: 1fr; }
    .lead-modal { top: 0; left: 0; transform: none; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    /* короткая форма звонка остаётся карточкой по центру и на телефоне */
    .call-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100vw - 2rem); height: auto; max-height: 90vh; border-radius: var(--radius); }
    .lead-body { padding: 1rem; }
    .lead-actions { flex-direction: column; }
}

/* ─── Вход и личный кабинет ─── */
.auth-wrap { max-width: 560px; }
.auth-title { font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.35rem; }
.auth-sub { color: #5A6B7C; margin: 0 0 1.25rem; }
.auth-card { background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius); padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(8,76,132,0.06); }
.auth-card [hidden], .orders-table [hidden] { display: none !important; }
.auth-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; background: #F4F7FA; border-radius: var(--radius);
    padding: 0.25rem; margin-bottom: 1rem; }
.auth-tab { flex: 1 1 auto; padding: 0.55rem 0.75rem; border: 0; border-radius: var(--radius-inner);
    background: transparent; font-family: inherit; font-size: 0.9rem; font-weight: 600; color: #33475B;
    cursor: pointer; white-space: nowrap; }
.auth-tab:hover { color: var(--brand-primary); }
.auth-tab.active { background: #fff; color: var(--brand-primary); box-shadow: 0 1px 3px rgba(8,76,132,0.12); }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-field { display: block; }
.auth-field > span { display: block; font-size: 0.85rem; font-weight: 500; color: #33475B; margin-bottom: 0.25rem; }
.auth-field input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #E3EAF1; border-radius: var(--radius);
    font-family: inherit; font-size: 0.95rem; color: #0F2233; background: #fff; }
.auth-field input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(8,76,132,0.15); }
.auth-error, .auth-success { border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.9rem; margin-bottom: 0.9rem; }
.auth-error { background: #FCE9EC; border: 1px solid rgba(176,27,51,.35); color: #B01B33; }
.auth-success { background: #E6F5ED; border: 1px solid rgba(15,122,74,.35); color: #0F7A4A; }
.auth-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 1rem;
    background: var(--brand-primary); color: #fff; border: 0; border-radius: var(--radius); font-family: inherit;
    font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.auth-btn:hover { background: var(--blue-600); }
.auth-btn:disabled { opacity: 0.6; cursor: default; }
.auth-btn-alt { background: #F4F7FA; color: #0F2233; }
.auth-btn-alt:hover { background: #C6D2DE; }
.auth-link { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--brand-primary);
    font-family: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-privacy { margin: 1rem 0 0; font-size: 0.85rem; color: #5A6B7C; }
.auth-privacy a { color: var(--brand-primary); }
.header-link { display: flex; align-items: center; padding: 0 0.6rem; color: #33475B; text-decoration: none;
    font-size: 0.9rem; font-weight: 600; white-space: nowrap; border-radius: var(--radius); }
.header-link:hover { color: var(--brand-primary); background: var(--blue-50); }

.account-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.5rem 1rem; margin-bottom: 0.5rem; }
.account-head h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; }
.account-greet { color: #33475B; margin-bottom: 1.25rem; }
.account-title { font-size: 1.15rem; margin: 0 0 0.75rem; }
.account-card { background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius); padding: 0.25rem 1.25rem;
    margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(8,76,132,0.06); }
.account-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.75rem 0; border-bottom: 1px solid #F2F8FD; }
.account-row:last-child { border-bottom: 0; }
.account-label { flex: 0 0 120px; color: #5A6B7C; }
.account-confirmed { display: inline-block; margin-left: 0.35rem; padding: 0 0.5rem; border-radius: 999px;
    background: #E6F5ED; border: 1px solid rgba(15,122,74,.35); color: #0F7A4A; font-size: 0.75rem; font-weight: 600; }
.account-logout { padding: 0.5rem 1rem; background: #fff; color: var(--brand-primary); border: 1px solid var(--brand-primary);
    border-radius: var(--radius); font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.account-logout:hover { background: var(--blue-50); }
.account-logout:disabled { opacity: 0.6; cursor: default; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

.orders-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #E3EAF1;
    border-radius: var(--radius); overflow: hidden; }
.orders-table th, .orders-table td { padding: 0.7rem 0.75rem; text-align: left; vertical-align: top;
    border-bottom: 1px solid #F2F8FD; font-size: 0.9rem; }
.orders-table th { background: #F4F7FA; color: #5A6B7C; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.03em; }
.orders-table tr:last-child td { border-bottom: 0; }
/* место под плавающий виджет чата, иначе он закрывает колонку статуса */
@media (min-width: 900px) {
    .orders-table th:last-child, .orders-table td:last-child { padding-right: 92px; }
}
.orders-table .order-uid { font-weight: 600; white-space: nowrap; }
.order-status { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.8rem;
    font-weight: 600; white-space: nowrap; }
.order-status.sent { background: #E6F5ED; color: #0F7A4A; }
.order-status.pending { background: #FDF1E0; color: #9A5B00; }
.orders-empty { background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius); padding: 1.5rem; color: #5A6B7C; }

@media (max-width: 700px) {
    .orders-table, .orders-table tbody, .orders-table tr, .orders-table td { display: block; width: 100%; }
    .orders-table { border: 0; background: transparent; }
    .orders-table thead { display: none; }
    .orders-table tr { background: #fff; border: 1px solid #E3EAF1; border-radius: var(--radius);
        padding: 0.6rem 0.9rem; margin-bottom: 0.75rem; box-shadow: 0 2px 8px rgba(8,76,132,0.06); }
    .orders-table td { display: flex; gap: 0.75rem; border: 0; padding: 0.35rem 0; font-size: 0.9rem; }
    .orders-table td::before { content: attr(data-label); flex: 0 0 110px; color: #5A6B7C; font-size: 0.8rem; }
    .auth-tab { padding: 0.5rem 0.4rem; font-size: 0.85rem; }
    .account-label { flex-basis: auto; }
}
