/* =====================================================================
   TexnoPryd — светлая «магазинная» тема.
   Подключается ПОСЛЕ style.css и переопределяет внешний вид.
   Чтобы вернуть старый дизайн — убрать <link href="theme.css"> из HTML.
   ===================================================================== */

:root {
    --bg: #f3f4f7;
    --bg-card: #ffffff;
    --bg-hover: #f1f4ff;
    --bg-soft: #f7f8fa;
    --img-bg: #ffffff;
    --text: #15181e;
    --text-muted: #626976;
    --text-faint: #9097a3;
    --border: #e4e7ec;
    --primary: #7048e8;
    --primary-hover: #5f3dc4;
    --primary-soft: #f1edff;
    --accent: #7048e8;
    --accent-hover: #5f3dc4;
    --accent-soft: #f1edff;
    --success: #12a150;
    --danger: #e5243b;
    --danger-soft: #fdecee;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 14px 36px rgba(16, 24, 40, 0.12);
    --skeleton-1: #f1f2f5;
    --skeleton-2: #e6e8ed;
    --header-h: 76px;
}

body.dark {
    --bg: #0e1014;
    --bg-card: #171a20;
    --bg-hover: #1f2430;
    --bg-soft: #1c2028;
    --img-bg: #1e222a;
    --photo-bg: #ffffff;     /* белый, как фон самих фото поставщика — поле и фото сливаются */
    --text: #eceef2;
    --text-muted: #a2a9b6;
    --text-faint: #6f7684;
    --border: #282d37;
    --primary: #9775fa;
    --primary-hover: #b197fc;
    --primary-soft: #2a2145;
    --accent: #845ef7;
    --accent-hover: #9775fa;
    --accent-soft: #2a2145;
    --danger: #ff5a6e;
    --danger-soft: #3a1a20;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.5);
    --skeleton-1: #1c2028;
    --skeleton-2: #262b35;
}

body {
    font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--text);
}
button, input, textarea, select { font-family: inherit; }

.ico {
    width: 20px; height: 20px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ==================== ШАПКА ==================== */
header {
    background: var(--bg-card) !important;
    color: var(--text);
    padding: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.04);
}

.topbar {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}
.topbar-inner {
    display: flex; gap: 24px; align-items: center;
    height: 34px;
}
.topbar-item { display: inline-flex; align-items: center; gap: 6px; }
.topbar-item .ico { width: 15px; height: 15px; }
.topbar-phone {
    margin-left: auto; color: var(--text); font-weight: 700;
    text-decoration: none;
}
.topbar-phone:hover { color: var(--primary); }

.header-inner {
    min-height: var(--header-h);
    padding-top: 12px; padding-bottom: 12px;
    gap: 24px;
}
.header-inner h1 { font-size: 22px; margin: 0; flex-shrink: 0; color: var(--text); }
.header-inner h1 a { color: var(--text) !important; text-decoration: none; }

/* Логотип */
.logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text) !important; text-decoration: none;
    font-weight: 800; letter-spacing: -0.02em;
}
.logo-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(140deg, #667eea, #764ba2);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(112, 72, 232, 0.3);
    flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; fill: #fff; }
.logo-text { font-size: 22px; line-height: 1; }
.logo-text span { color: var(--primary); }

.header-right {
    flex: 1; justify-content: flex-end; gap: 6px;
}

/* Поиск — крупный, на всю свободную ширину */
.desktop-header .search-wrap {
    flex: 1 1 auto !important;
    max-width: 640px !important;
    margin-right: 10px;
}
.search-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; fill: none; stroke: var(--text-faint);
    stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.header-inner input,
.mobile-search-block input {
    height: 46px;
    padding: 0 40px 0 42px !important;
    border-radius: 12px !important;
    border: 2px solid var(--primary) !important;
    background: var(--bg-card) !important;
    color: var(--text) !important;
    font-size: 15px !important;
    outline: none;
    transition: box-shadow 0.15s;
}
.mobile-search-block input { padding-left: 16px !important; }
.header-inner input::placeholder,
.mobile-search-block input::placeholder { color: var(--text-faint) !important; }
.header-inner input:focus,
.mobile-search-block input:focus { box-shadow: 0 0 0 4px rgba(112, 72, 232, 0.15); }
body.dark .header-inner input { background: var(--bg-soft) !important; }

.search-clear { width: 28px !important; height: 28px !important; background: var(--bg-soft) !important; color: var(--text) !important; }
.search-clear:hover { background: var(--primary) !important; color: #fff !important; }
.search-clear svg { width: 14px; height: 14px; }

/* Ссылки-иконки в шапке */
.header-link-btn {
    flex-direction: column; gap: 3px;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important; font-weight: 600 !important;
    min-width: 0 !important;
}
.header-link-btn .ico { width: 22px; height: 22px; }
.header-link-btn:hover { color: var(--primary) !important; background: var(--bg-hover) !important; }
.user-btn.logged-in { color: var(--primary) !important; }
#userBtnIcon { display: inline-flex; }

/* Страницы со старой шапкой (без иконок): кнопки-«таблетки» */
.header-link-btn:not(:has(.ico)) {
    flex-direction: row;
    border: 1px solid var(--border) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    padding: 9px 14px !important;
}

/* Корзина */
#cartBtn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 18px;
    background: var(--primary) !important; color: #fff !important;
    border-radius: 12px; font-size: 15px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(112, 72, 232, 0.25);
    transition: background 0.15s, transform 0.1s;
    margin-left: 6px;
}
#cartBtn:hover { background: var(--primary-hover) !important; }
#cartBtn:active { transform: scale(0.98); }
#cartBtn span {
    background: #fff !important; color: var(--primary);
    min-width: 22px; height: 22px; padding: 0 6px; margin: 0;
    border-radius: 11px; font-size: 12px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ==================== ПРИВЕТСТВЕННЫЙ БЛОК ==================== */
.hero {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
    padding-top: 22px;
}
.hero-main {
    position: relative; overflow: hidden;
    border-radius: 20px;
    padding: 34px 36px;
    color: #fff;
    background:
        radial-gradient(600px 300px at 110% -20%, rgba(255, 255, 255, 0.22), transparent 60%),
        radial-gradient(420px 280px at -10% 120%, rgba(214, 120, 255, 0.45), transparent 60%),
        linear-gradient(120deg, #5a3fd6 0%, #7048e8 50%, #8f5ce6 100%);
}
.hero-kicker {
    display: inline-block;
    font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    margin-bottom: 14px;
}
.hero-title {
    font-size: 30px; line-height: 1.18; font-weight: 800; letter-spacing: -0.02em;
    max-width: 560px; margin-bottom: 10px;
}
.hero-sub { font-size: 15px; line-height: 1.5; opacity: 0.9; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 46px; padding: 0 22px; border-radius: 12px;
    font-weight: 700; font-size: 15px; text-decoration: none;
    transition: transform 0.1s, background 0.15s;
}
.hero-btn:active { transform: scale(0.98); }
.hero-btn-primary { background: #fff; color: #5f3dc4; box-shadow: 0 6px 16px rgba(40, 20, 110, 0.25); }
.hero-btn-primary:hover { background: #f4f0ff; }
.hero-btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); }
.hero-btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }

.hero-perks {
    display: grid; grid-template-rows: repeat(2, 1fr); gap: 12px;
}
.perk {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 18px;
}
.perk-ico {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.perk-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.perk b { display: block; font-size: 15px; margin-bottom: 2px; }
.perk span { font-size: 13px; color: var(--text-muted); }

/* ==================== РАСКЛАДКА + КАТАЛОГ СЛЕВА ==================== */
.layout {
    grid-template-columns: 290px 1fr;
    gap: 20px;
    padding-top: 20px;
}
.sidebar {
    top: calc(var(--header-h) + 50px);
    max-height: calc(100vh - var(--header-h) - 70px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 16px 10px 16px 14px;
}
.sidebar-title {
    font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
    padding: 0 6px 12px; margin-bottom: 8px;
}
.category-tree { font-size: 14px; }
.cat-row { padding: 8px 10px; border-radius: 10px; font-weight: 500; }
.cat-row:hover { background: var(--bg-hover); color: var(--primary); }
.cat-row.active { background: var(--primary-soft) !important; color: var(--primary) !important; font-weight: 700; }
.cat-row.active .cat-count { color: var(--primary) !important; }
.cat-count {
    font-size: 11px; color: var(--text-faint);
    background: var(--bg-soft); border-radius: 999px; padding: 1px 7px;
}
.cat-children { border-left-color: var(--border); }

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ==================== СТАТУС-БАР ==================== */
.status {
    border: 1px solid var(--border);
    box-shadow: none;
    border-radius: var(--radius);
    padding: 10px 12px 10px 18px;
    font-size: 14px;
    color: var(--text-muted);
}
#totalInfo { font-weight: 600; color: var(--text); }
.status-actions .sort-btn {
    background: var(--bg-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    border-radius: 10px !important;
}
.status-actions .sort-btn:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
body.dark .status-actions .sort-btn { background: var(--bg-soft) !important; border-color: var(--border) !important; }
.sort-menu { border: 1px solid var(--border); border-radius: 12px; }
.sort-option.active { background: var(--primary-soft); color: var(--primary); }

#reloadBtn {
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 10px;
    min-height: 40px; padding: 0 14px; font-weight: 600;
}
#reloadBtn:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary); }

.active-category {
    background: var(--primary-soft); color: var(--primary);
    border-radius: 12px; font-weight: 600;
}

.progress-box { border: 1px solid var(--border); box-shadow: none; border-radius: var(--radius); }
/* Вместо эмодзи-часов — аккуратный круговой индикатор */
.progress-icon {
    font-size: 0; width: 30px; height: 30px; flex-shrink: 0;
    border: 3px solid var(--primary-soft); border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.progress-bar-fill { background: linear-gradient(90deg, #667eea, #764ba2); }
.progress-meta #progressPercent { color: var(--primary); }

/* ==================== КАРТОЧКИ ТОВАРОВ ==================== */
.products {
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 14px;
}
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
/* Фото на всю площадь карточки: картинка растягивается до краёв поля (с сохранением
   пропорций, без обрезки товара). Чёткость даёт размер «card» 480 px (app.js upgradeCardPhoto). */
.card-img .card-photo { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-img {
    height: 230px;
    background: var(--img-bg) !important;
    padding: 6px;
    border-bottom: 1px solid var(--border);
}
/* Светлая тема: белый фон фото сливается с белой карточкой */
.card-img img, #galleryMainImg { mix-blend-mode: multiply; }
.card-img { isolation: isolate; }

/* Тёмная тема: поле вокруг фото того же белого цвета, что и фон самих фото,
   чтобы не было серой рамки вокруг белого прямоугольника */
body.dark .card-img { background: var(--photo-bg) !important; }
body.dark .gallery-left .gallery-main,
body.dark .gallery-thumb { background: var(--photo-bg); border-color: transparent; }
.card-img:hover img { transform: scale(1.04); }
.card-img:hover::after {
    content: 'Подробнее';
    background: rgba(21, 24, 30, 0.75);
    font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px;
}

.card-body { padding: 14px 16px 16px; gap: 2px; }
.card-price {
    order: -1;
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
    color: var(--text) !important;
    margin-bottom: 0;
}
/* Цена за наличные — крупно и жирно; по карте/СБП (+18%) — мелкой строкой под ней (pay-prices.js) */
.price-cash-label { margin-left: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--success); }
.card-price-card { order: -1; margin: 1px 0 6px; font-size: 12.5px; color: var(--text-muted); }
.gallery-right-price .card-price { font-size: 30px; }
.gallery-right-price .price-cash-label { font-size: 14px; }
.gallery-right-price .card-price-card { font-size: 14px; margin-bottom: 0; }
.cart-total-card { margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.checkout-payment { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.checkout-payment-title { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.checkout-payment-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.checkout-payment-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.checkout-payment-opt input { accent-color: var(--primary); margin: 0; width: auto; }
.checkout-payment-opt span { display: flex; flex-direction: column; }
.checkout-payment-opt b { font-size: 14px; color: var(--text); }
.checkout-payment-opt small { font-size: 12px; color: var(--text-muted); }
.card-title {
    font-size: 14px; font-weight: 500; line-height: 1.38;
    color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.38em * 3);
    margin-bottom: 6px;
}
.card-sku { font-size: 11.5px; color: var(--text-faint); margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-stock {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--success);
    margin-bottom: 12px;
}
.card-stock::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.15);
}
.card-stock.out { color: var(--text-faint); }
.card-stock.out::before { box-shadow: none; }

.buy-btn {
    height: 44px; padding: 0 12px;
    background: var(--accent) !important; color: #fff;
    border-radius: 12px; font-size: 15px; font-weight: 700;
    transition: background 0.15s, transform 0.1s;
}
.buy-btn:hover { background: var(--accent-hover) !important; }
.buy-btn:active { transform: scale(0.98); }
.buy-btn:disabled,
body.dark .buy-btn:disabled {
    background: var(--bg-soft) !important; color: var(--text-faint);
    border: 1px solid var(--border);
}

/* Распродажа: красная цена + плашка вместо толстой рамки */
.card.sale {
    border: 1px solid var(--border) !important;
    box-shadow: none;
}
.card.sale:hover { box-shadow: var(--shadow-lg); }
.card.sale .card-img::before {
    content: 'Распродажа';
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: var(--danger); color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 4px 10px; border-radius: 8px;
}
.card-price.sale { color: var(--danger) !important; }
.card-price.sale::before { content: none !important; }
.card-sale-note {
    order: -1; margin: -2px 0 8px;
    font-size: 11.5px; font-style: normal; opacity: 1;
    color: var(--danger);
}

/* «Показать ещё» */
.load-more-btn {
    background: var(--bg-card); color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none; border-radius: 12px;
    padding: 13px 44px;
}
.load-more-btn:hover {
    background: var(--primary); color: #fff;
    box-shadow: 0 6px 16px rgba(112, 72, 232, 0.25);
}

/* ==================== МОДАЛКИ: КОРЗИНА, ЗАКАЗ, ГАЛЕРЕЯ ==================== */
.modal { background: rgba(15, 18, 25, 0.55); backdrop-filter: blur(3px); }
.modal-box, .gallery-box { border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-box h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 14px; }
.cart-total { font-weight: 800; }
#checkoutBtn, .btn-main-checkout {
    width: 100%;
    height: 50px;
    background: var(--accent) !important;
    border-radius: 12px; font-size: 16px; font-weight: 700;
}
#checkoutBtn:hover, .btn-main-checkout:hover { background: var(--accent-hover) !important; }

.gallery-right { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; }
.gallery-right-title { font-size: 18px; font-weight: 700; }
.gallery-right-price { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.gallery-right-stock { color: var(--success); }
.gallery-right-btn { background: var(--accent); border-radius: 12px; height: 52px; font-size: 16px; }
.gallery-right-btn:hover { background: var(--accent-hover); }
.news-strip { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.news-strip[hidden] { display: none; }
.news-strip-ico { width: 22px; height: 22px; flex: none; color: var(--primary); }
.news-strip-text { flex: 1; min-width: 0; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-strip-text b { color: var(--primary); }
.news-strip-text:hover span { text-decoration: underline; }
.news-strip-close { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.news-strip-close:hover { background: var(--bg-soft); color: var(--text); }
.news-strip-close svg { width: 16px; height: 16px; }
.gallery-share-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 10px; background: transparent; color: var(--primary); border: 1px solid var(--border); border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.gallery-share-btn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.gallery-left .gallery-main { background: var(--img-bg); border: 1px solid var(--border); border-radius: 16px; }
.gallery-arrow { background: rgba(21, 24, 30, 0.55); border-radius: 12px; }
.gallery-thumb { border-radius: 10px; background: var(--img-bg); object-fit: contain; padding: 3px; }

/* ==================== ПЛАВАЮЩИЕ КНОПКИ ==================== */
.scroll-top-btn {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-size: 20px;
}
.scroll-top-btn:hover { color: var(--primary); box-shadow: var(--shadow-lg); }
.theme-toggle,
body.dark .theme-toggle {
    width: 46px; height: 46px; bottom: 88px; right: 27px;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.theme-toggle:hover,
body.dark .theme-toggle:hover { background: var(--bg-hover); }
.theme-icon { font-size: 20px; }

/* ==================== ФУТЕР ==================== */
.site-footer,
body.dark .site-footer {
    background: #10131a;
    color: #e8eaef;
    border-top: none;
    margin-top: 56px;
}
.site-footer .logo { color: #fff !important; }
.site-footer .logo-text span { color: #b197fc; }
.footer-brand h2 { color: #fff; margin-bottom: 14px; }
.footer-brand p, .footer-col a, .footer-contact, .footer-col .footer-req { color: #a3a9b6; }
.footer-col h3 { color: #fff; }
.footer-col .footer-req b { color: #fff; }
.footer-col a:hover, .footer-contact:hover { color: #fff; }
.footer-brand .footer-delivery,
body.dark .footer-brand .footer-delivery {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(151, 117, 250, 0.16); color: #c9b8ff;
    border-radius: 999px; padding: 6px 12px;
}
.footer-bottom, body.dark .footer-bottom { border-top-color: #252a35; color: #6f7684; }

/* ==================== ИКОНКИ ВМЕСТО ЭМОДЗИ ==================== */
.footer-contact .footer-icon { display: inline-flex; width: 18px; }
.footer-icon .ico, .footer-delivery .ico { width: 16px; height: 16px; }

.support-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary) !important; background: var(--primary-soft) !important;
}
.support-card-icon .ico { width: 24px; height: 24px; }
.support-card { border: 1px solid var(--border); box-shadow: none !important; transition: border-color 0.15s, box-shadow 0.15s; }
a.support-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md) !important; }
.support-success-icon, .success-big-icon, .empty-state-icon, .cart-empty-icon, .chat-empty-icon {
    display: flex; justify-content: center; color: var(--primary);
}
.success-big-icon { margin-bottom: 15px; }
.support-success-icon .ico, .success-big-icon .ico, .empty-state-icon .ico { width: 56px; height: 56px; stroke-width: 1.5; }
.cart-empty-icon .ico, .chat-empty-icon .ico { width: 44px; height: 44px; stroke-width: 1.5; color: var(--text-faint); }
.chat-header-avatar { display: inline-flex; align-items: center; justify-content: center; }
.chat-header-avatar .ico { width: 20px; height: 20px; }
#chatSend .ico, .chat-send .ico { width: 18px; height: 18px; }
.img-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); }
.img-placeholder .ico { width: 48px; height: 48px; stroke-width: 1.4; }

/* Кнопка темы: луна / солнце рисуются маской, текст из JS скрыт */
.theme-icon { font-size: 0 !important; width: 20px; height: 20px; display: block; position: relative; }
.theme-icon::before {
    content: ''; position: absolute; inset: 0; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.dark .theme-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}

/* Кнопка «Собрать ПК с менеджером» и счётчик чата */
#chatBtn { position: relative; }
#chatBtn .chat-badge { position: absolute; top: 2px; right: 4px; }

/* ==================== ОСТАЛЬНЫЕ СТРАНИЦЫ ==================== */
/* body.has-footer — flex-колонка, из-за margin:auto контейнер сжимался по содержимому */
body.has-footer > main.container,
body.has-footer > .layout.container,
body.has-footer > .hero.container { width: 100%; }

/* support / offer / privacy / login / account / ready-pc используют старую шапку */
header .header-inner h1:not(:has(.logo)) { font-weight: 800; letter-spacing: -0.01em; }

/* ==================== АДАПТИВ ==================== */
@media (max-width: 1100px) {
    .header-link-text { display: none; }
    .hero { grid-template-columns: 1fr; }
    .hero-perks { grid-template-rows: none; grid-template-columns: repeat(2, 1fr); }
    .perk { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 900px) {
    :root { --header-h: 0px; }
    .topbar { display: none; }
    .mobile-header { padding: 10px 0 12px; }
    .mobile-logo { color: var(--text) !important; }
    .mobile-logo .logo-mark { width: 32px; height: 32px; }
    .mobile-logo .logo-text { font-size: 19px; }
    .mobile-icon-btn {
        background: var(--bg-soft) !important;
        border: 1px solid var(--border) !important;
        color: var(--text) !important;
        width: 40px !important; height: 40px !important;
        border-radius: 12px !important;
    }
    .mobile-icon-btn .ico { width: 19px; height: 19px; }
    .mobile-icon-btn.active { background: var(--primary-soft) !important; color: var(--primary) !important; }
    .mobile-nav-btn {
        background: var(--bg-soft) !important;
        border: 1px solid var(--border) !important;
        color: var(--text) !important;
        border-radius: 12px !important;
        font-size: 13px !important;
        height: 40px;
    }
    .mobile-cart-btn {
        background: var(--primary) !important;
        border-color: var(--primary) !important;
        color: #fff !important;
    }
    .mobile-cart-count { background: var(--accent) !important; }

    .hero { padding-top: 12px; }
    .hero-main { padding: 22px 20px; border-radius: 16px; }
    .hero-title { font-size: 22px; }
    .hero-sub { font-size: 14px; }
    .hero-perks { display: none; }

    .layout { grid-template-columns: 1fr; padding-top: 12px; }
    .sidebar { padding: 12px 14px; }
    .sidebar-title { font-size: 16px; padding: 0; margin: 0; }

    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card-img { height: 170px; padding: 4px; }
    .card-body { padding: 10px 12px 12px; }
    .card-price { font-size: 18px; }
    .card-title { font-size: 13px; }
    .buy-btn { height: 40px; font-size: 14px; }
}

/* Шапка внутренних страниц (у них нет отдельной мобильной версии) */
@media (max-width: 900px) {
    header .header-inner:not(.desktop-header) {
        flex-wrap: wrap !important; gap: 8px;
        min-height: 0; padding-top: 10px; padding-bottom: 10px;
    }
    .header-inner:not(.desktop-header) h1 { flex: 1 0 auto; }
    .header-inner:not(.desktop-header) h1 .logo-mark { width: 32px; height: 32px; }
    .header-inner:not(.desktop-header) h1 .logo-text { font-size: 19px; }
    .header-inner:not(.desktop-header) .header-right {
        flex-wrap: wrap !important; gap: 2px; flex: 0 1 auto;
    }
    .header-inner:not(.desktop-header) .header-link-text,
    .header-inner:not(.desktop-header) #userBtnText { display: none; }
    .header-inner:not(.desktop-header) .header-link-btn { padding: 8px !important; }
    .header-inner:not(.desktop-header) #searchInput {
        order: 10; flex: 1 0 100%; width: 100% !important; height: 42px; margin-top: 4px;
        padding-left: 14px !important;
    }
    .header-inner:not(.desktop-header) #cartBtn { height: 40px; padding: 0 12px; font-size: 14px; margin-left: 2px; }
}

/* ==================== ТЕЛЕФОН: ПРАВКИ 27.10.2026 ==================== */
/* Полоса новости — в колонке body с margin:auto она сжималась по тексту и на узком экране
   становилась шире экрана (вся страница уезжала вбок, окна товара обрезались) */
.news-strip { max-width: min(1400px, calc(100% - 24px)); }

/* «Фильтр: Распродажа (фотографии повреждений…)» — пояснение обычным шрифтом */
.active-category-note { font-weight: 400; color: var(--text-muted); }

/* Кнопка звонка в мобильной шапке (на компьютере телефон в верхней полосе) */
.mobile-phone-btn { display: none; }

@media (max-width: 900px) {
    .mobile-phone-btn { display: flex; align-items: center; justify-content: center; }

    /* Переключатель темы: появляется вместе со стрелкой «наверх», когда страницу прокрутили вниз */
    body .theme-toggle {
        display: flex !important; align-items: center; justify-content: center;
        position: fixed; right: 16px; bottom: 72px; width: 46px; height: 46px; border-radius: 50%; z-index: 9000;
        opacity: 0; transform: translateY(20px); pointer-events: none;
        transition: opacity .25s, transform .25s;
    }
    body.page-scrolled .theme-toggle { opacity: 1; transform: none; pointer-events: auto; }
    body:not(:has(#scrollTopBtn)) .theme-toggle { bottom: 16px; }

    /* Карточка: цена в одну строку, «наличными» — подписью под ней */
    .card-price { white-space: nowrap; font-size: 17px; }
    .card .price-cash-label { display: block; margin: 1px 0 0; font-size: 11px; }
    .card-price-card { font-size: 11.5px; }

    /* Сортировка с подписью — одна иконка непонятна */
    .sort-btn .sort-label { display: inline !important; font-size: 13px; }

    /* Шапка внутренних страниц: не прилипает (на телефоне занимала пятую часть экрана),
       у иконок есть подписи */
    header:has(.header-inner:not(.desktop-header)) { position: static; }
    /* Раскладка: 1-я строка — логотип, корзина, вход; 2-я — кнопки меню на всю ширину; 3-я — поиск */
    .header-inner:not(.desktop-header) .header-right { display: contents; }
    .header-inner:not(.desktop-header) #cartBtn { order: 1; }
    .header-inner:not(.desktop-header) .user-btn { order: 2; }
    /* принудительный перенос строки после входа (на страницах без корзины меню иначе вставало в 1-ю строку) */
    .header-inner:not(.desktop-header)::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
    .header-inner:not(.desktop-header) .header-link-btn:not(.user-btn) {
        order: 3; flex: 1 1 20%;
        flex-direction: column; gap: 3px; padding: 6px 2px !important; min-width: 0;
        font-size: 11px; line-height: 1.1; text-align: center;
    }
    .header-inner:not(.desktop-header) .header-link-btn:not(.user-btn) .header-link-text {
        display: block !important; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .header-inner:not(.desktop-header) .header-link-btn .ico { width: 20px; height: 20px; }
    .header-inner:not(.desktop-header) .lbl-full { display: none; }
    .header-inner:not(.desktop-header) .lbl-short { display: inline; }
}
.lbl-short { display: none; }

@media (max-width: 550px) {
    .hero-main { padding: 18px 16px; }
    .hero-kicker, .hero-sub { display: none; }
    .hero-title { font-size: 19px; margin-bottom: 0; }
    .hero-actions { margin-top: 14px; }
    .hero-actions .hero-btn { flex: 1; padding: 0 10px; height: 42px; font-size: 14px; white-space: nowrap; }
    .products { gap: 8px; }
    .card-img { height: 150px; }
    .card-price { font-size: 16px; }
    .card-sku { display: none; }
    .card.sale .card-img::before { top: 8px; left: 8px; font-size: 11px; padding: 3px 8px; }
}
