/* ── Подсказка автосохранения настроек ──────────────────────────────── */
.settings-autosave-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #64748b;
    padding: 4px 2px;
}
.settings-autosave-hint .fa-circle-check { color: #16a34a; }
.settings-autosave-hint .fa-triangle-exclamation { color: #dc2626; }

/* ── PJAX-переход вики (мягкое затухание во время загрузки) ──────────── */
.wiki-content-wrapper { transition: opacity 0.12s ease; }
.wiki-content-wrapper.wiki-pjax-loading { opacity: 0.45; pointer-events: none; }

/* ── PJAX-переключение вкладок админки каталога ──────────────────────── */
.cat-admin-page, .char-admin-page, .models-admin-page, .dict-page { transition: opacity 0.12s ease; }
.admin-pjax-loading { opacity: 0.5; pointer-events: none; }

/* ── Прогрессивная загрузка изображений ──────────────────────────────── */
.app-img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.app-img--loaded { opacity: 1; }

/* Skeleton-мерцание в контейнерах фото каталога */
.eq-card-photo,
.model-image,
.search-model-photo,
.compare-chip {
    position: relative;
    overflow: hidden;
}
/* Мерцание показываем только пока есть незагруженное фото */
.eq-card-photo:has(img:not(.app-img--loaded))::before,
.model-image:has(img:not(.app-img--loaded))::before,
.search-model-photo:has(img:not(.app-img--loaded))::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        rgba(0, 0, 0, 0.04) 30%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 70%);
    background-size: 200% 100%;
    animation: app-shimmer 1.3s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.eq-card-photo img,
.model-image img,
.search-model-photo img { position: relative; z-index: 1; }

@keyframes app-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Плавающая панель сравнения ──────────────────────────────────────── */
.compare-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1200;
    transform: translateY(120%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}
.compare-bar.open { transform: translateY(0); }
.compare-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
}
.compare-bar-label {
    font-weight: 600;
    color: var(--clr-primary, #2563eb);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.compare-bar-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    padding: 4px 0;
}
.compare-chip {
    position: relative;
    width: 52px; height: 52px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    flex: 0 0 auto;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
}
.compare-chip img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.compare-chip-noimg { color: #cbd5e1; font-size: 1.2rem; }
.compare-chip-remove {
    position: absolute;
    top: 0; right: 0;
    width: 18px; height: 18px;
    border-radius: 0 8px 0 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s ease;
}
.compare-chip-remove:hover { color: #1e293b; }
.compare-bar-actions { display: flex; gap: 8px; white-space: nowrap; }
.compare-bar-go {
    background: var(--clr-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    cursor: pointer;
}
.compare-bar-go:hover { background: var(--clr-primary-hover, var(--clr-primary)); }
.compare-bar-clear {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 14px;
    color: #64748b;
    cursor: pointer;
}
.compare-bar-hide {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 15px;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}
.compare-bar-hide:hover { color: #1e293b; background: #f1f5f9; }

/* ── Массовый выбор карточек ──────────────────────────────────────────── */
.bulk-enabled { position: relative; }
.bulk-check {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 5;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.bulk-enabled:hover .bulk-check,
.bulk-check input:checked ~ .bulk-check-box,
.bulk-selected .bulk-check { opacity: 1; }
.bulk-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.bulk-check-box {
    width: 24px; height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 12px;
}
.bulk-check-box i { opacity: 0; }
.bulk-check input:checked + .bulk-check-box {
    background: var(--clr-primary, #2563eb);
    border-color: var(--clr-primary, #2563eb);
}
.bulk-check input:checked + .bulk-check-box i { opacity: 1; }
.bulk-selected { outline: 2px solid var(--clr-primary, #2563eb); outline-offset: -2px; border-radius: 10px; }

.bulk-bar {
    position: fixed;
    left: 50%; bottom: 20px;
    transform: translate(-50%, 160%);
    z-index: 1250;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.bulk-bar.open { transform: translate(-50%, 0); }
.bulk-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.bulk-bar-count { font-weight: 600; white-space: nowrap; }
.bulk-bar-set {
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 7px 10px;
    max-width: 220px;
}
.bulk-bar-add {
    background: var(--clr-primary, #2563eb);
    color: #fff; border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.bulk-bar-cancel {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s ease;
}
.bulk-bar-cancel:hover { color: #fff; }

/* ── Автодополнение поиска ────────────────────────────────────────────── */
.search-ac {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    z-index: 1300;
    max-height: 380px;
    overflow-y: auto;
    display: none;
    padding: 4px 0;
}
.search-ac.open { display: block; }
.search-ac-head {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    padding: 8px 14px 4px;
    font-weight: 600;
}
.search-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}
.search-ac-item i { color: #94a3b8; width: 16px; text-align: center; }
.search-ac-item:hover,
.search-ac-item.active { background: var(--clr-primary-light, var(--clr-primary-light)); color: var(--clr-primary, #2563eb); }
.search-ac-item.active i,
.search-ac-item:hover i { color: var(--clr-primary, #2563eb); }
.search-ac-history .search-ac-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-ac-del {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 17px;
    line-height: 1;
    width: 22px; height: 22px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s ease;
}
.search-ac-del:hover { background: transparent; color: #0f172a; }
/* Перебиваем .catalog-topbar-search button (синий фон поиска) — крестик нейтральный */
.search-ac button.search-ac-del { background: transparent; color: #94a3b8; }
.search-ac button.search-ac-del:hover { background: transparent; color: #0f172a; }
/* Строки истории — нейтральная серая подсветка вместо синей */
.search-ac-history:hover,
.search-ac-history.active { background: #f1f5f9; color: #1e293b; }
.search-ac-history:hover i,
.search-ac-history.active i { color: #94a3b8; }

/* ===== Избранное (звёздочка на модели) ===== */
.btn-favorite {
    background: var(--clr-primary-light);
    color: var(--clr-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.btn-favorite:hover { background: var(--clr-primary); color: #fff; }
.btn-favorite.is-favorite { color: #f59e0b; }
.btn-favorite.is-favorite:hover { background: var(--clr-primary-light); }

/* ===== Реакции на комментарии ===== */
.comment-react-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 2px 10px;
    margin-top: 4px;
    cursor: pointer;
    font-size: .82rem;
    color: #64748b;
    transition: background .15s, border-color .15s;
}
.comment-react-btn:hover { background: var(--clr-primary-light); }
.comment-react-btn.is-liked {
    border-color: var(--clr-primary);
    background: var(--clr-primary-light);
    color: var(--clr-primary);
}
.comment-react-count { font-weight: 600; }

/* ===== Вложения вики ===== */
.wiki-attachments { margin-top: 18px; }
.wiki-attachments-title { font-weight: 600; margin-bottom: 8px; }
.wiki-attachment-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 8px;
}
.wiki-attachment-item:hover { background: var(--clr-primary-light); }
.wiki-attachment-item a { text-decoration: none; color: var(--clr-primary); }
.wiki-attachment-size { color: #94a3b8; font-size: .8rem; }
.wiki-attachment-del button { background: none; border: none; color: #94a3b8; cursor: pointer; }
.wiki-attachment-del button:hover { color: #dc2626; }
.wiki-attachments-form { margin-top: 10px; display: flex; gap: 8px; align-items: center; }

/* ===== Сортировка каталога ===== */
.cat-sort-row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.cat-sort-row label { font-size: .85rem; color: #64748b; }

/* ===== «Вы недавно смотрели» + карточки-миниатюры вне model.css ===== */
.recent-views-section { margin: 28px 0; }
.recent-views-section h2 { margin-bottom: 12px; }
.model-cards-row { display: flex; gap: 14px; overflow-x: auto; padding: 6px 0; }
.model-related-card {
    min-width: 180px; max-width: 210px; flex: 0 0 auto;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    text-decoration: none; color: inherit; overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.model-related-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.model-related-photo { height: 120px; display: flex; align-items: center; justify-content: center; background: #f8fafc; }
.model-related-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.model-related-photo i { color: #cbd5e1; font-size: 1.6rem; }
.model-related-body { padding: 10px 12px; }
.model-related-name { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.model-related-mfr { font-size: .75rem; color: #94a3b8; margin-top: 2px; }
.model-related-price { font-size: .85rem; font-weight: 700; color: var(--clr-primary); margin-top: 6px; }

/* ===== Импорт: режим обновления ===== */
.ir-update-mode { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-size: .85rem; color: #475569; cursor: pointer; }

/* Кликабельные бейджи категории/производителя на странице модели */
a.model-badge { text-decoration: none; cursor: pointer; transition: filter .15s, box-shadow .15s; }
a.model-badge:hover { filter: brightness(0.93); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
