/* Импорт шрифта Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-sidebar: #fafbfc;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --code-bg: #f1f5f9;
    --search-highlight: #fef08a;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-sidebar: #1e1e1e;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --code-bg: #2d2d2d;
    --search-highlight: #854d0e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Шапка */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header h1,
.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 600px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.theme-toggle {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent-hover);
}

/* Основной контейнер */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Боковая панель СЛЕВА */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

/* Заголовок оглавления */
.toc-nav h3 {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 24px;
    letter-spacing: -0.196px;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding: 0;
}

.content-area table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.content-area thead {
    background-color: var(--accent);
    color: white;
}

.content-area thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.content-area tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.content-area tbody tr:hover {
    background-color: var(--bg-secondary);
}

.content-area tbody tr:last-child {
    border-bottom: none;
}

.content-area tbody td {
    padding: 1rem;
    vertical-align: top;
    color: var(--text-secondary);
    line-height: 1.6;
}

.content-area tbody td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    width: 30%;
}

.content-area tbody td:last-child {
    width: 70%;
}

/* Адаптивность для таблиц */
@media (max-width: 768px) {
    .content-area table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .content-area thead th,
    .content-area tbody td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Контейнер главы */
.toc-chapter-container {
    margin-bottom: 0.5rem;
    position: relative;
}

/* Базовый стиль для элементов оглавления */
.toc-item {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 24px;
    letter-spacing: -0.196px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
    background-color: transparent;
}

/* Активный элемент */
.toc-item.active {
    padding-left: 1rem;
    background-color: var(--bg-secondary);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    animation: highlightToc 3s ease;
}

@keyframes highlightToc {
    0% {
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
    10% {
        box-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
    }
    100% {
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
}

.toc-item:hover {
    padding-left: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Иконка раскрытия/скрытия */
.toc-toggle {
    width: 16px;
    height: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px; /* Увеличить область вокруг иконки */
    user-select: none;
    font-size: 10px; /* сохраните размер иконки, padding увеличит область */
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.toc-toggle > * {
  pointer-events: none;
}

.toc-toggle.collapsed {
    transform: rotate(-90deg);
}

/* Уровни вложенности */
.toc-item.level-1 {
    font-weight: 600;
    padding-left: 0.75rem;
}

.toc-item.level-2 {
    font-size: 0.9rem;
    padding-left: 2.5rem;
}

.toc-item.level-3 {
    font-size: 0.85rem;
    padding-left: 3.5rem;
}

.toc-item.level-4 {
    font-size: 0.8rem;
    padding-left: 4.5rem;
}

/* Контейнер дочерних элементов с ЕДИНОЙ вертикальной линией */
.toc-children {
    position: relative;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    padding-left: 0;
    margin-left: 0.75rem;
    z-index: 59;
}

.toc-children:not(.collapsed) {
  max-height: auto;
  opacity: 1;
}

.toc-children.collapsed {
    max-height: 0;
    opacity: 0;
}


/* ЕДИНАЯ вертикальная линия для всех дочерних элементов */
.toc-children::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border);
    z-index: 0;
}

/* Индивидуальная вертикальная линия для каждого элемента (поверх основной) */
.toc-item.level-2::after,
.toc-item.level-3::after,
.toc-item.level-4::after {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.2s ease;
    z-index: 1;
}

/* Активная вертикальная линия только для активного элемента */
.toc-item.active.level-2::after,
.toc-item.active.level-3::after,
.toc-item.active.level-4::after {
    background: var(--accent);
}

/* Горизонтальные линии-соединители */
.toc-item.level-2::before,
.toc-item.level-3::before,
.toc-item.level-4::before {
    content: '';
    position: absolute;
    top: 50%;
    height: 2px;
    background: var(--border);
    transition: background 0.2s ease;
    z-index: 2;
    transform: translateY(-50%);
}

.toc-item.active.level-2::before,
.toc-item.active.level-3::before,
.toc-item.active.level-4::before {
    background: var(--accent);
}

.toc-item.level-2::before {
    left: -0.75rem;
    width: calc(2.5rem - 0.75rem - 6px); /* padding-left - margin-left - отступ */
}

.toc-item.level-3::before {
    left: -0.75rem;
    width: calc(3.5rem - 0.75rem - 6px);
}

.toc-item.level-4::before {
    left: -0.75rem;
    width: calc(3.5rem - 0.75rem - 6px);
}

/* Контент СПРАВА */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 900px;
}

.content-area {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-area h1,
.content-area h2,
.content-area h3,
.content-area h4 {
    scroll-margin-top: 100px;
}

.content-area h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-area h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-area h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.content-area h4 {
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.content-area p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Стиль для элемента с hover картинкой */
.hover-image {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--accent);
    font-style: italic;
}

/* Для десктопа */
@media (hover: hover) {
    .hover-image:hover::after {
        content: '';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 400px;
        height: 600px;
        background-image: url('mem.png');
        background-size: cover;
        background-position: center;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        z-index: 9999;
        animation: popupFade 0.3s ease;
        pointer-events: none;
    }
}

/* Для мобильных (активный класс) */
.hover-image.active::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 400px;
    height: 60vh;
    max-height: 600px;
    background-image: url('mem.png');
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: popupFade 0.3s ease;
    pointer-events: none;
}

@keyframes popupFade {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.content-area ul,
.content-area ol {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.content-area li {
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.content-area code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.content-area pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.content-area pre code {
    background: none;
    padding: 0;
}

.menu-toggle {
    display: none;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: white;
}

.menu-toggle:hover {
    background: var(--accent-hover);
}

.menu-icon {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
}

/* Оверлей для закрытия меню */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.next-chapter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin: 3rem auto 2rem auto;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.next-chapter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.next-chapter-btn:active {
    transform: translateY(0);
}

.next-chapter-btn.hidden {
    display: none;
}

.next-chapter-text {
    flex: 1;
    text-align: left;
}

#next-chapter-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.next-chapter-icon {
    font-size: 1.5rem;
    margin-left: 1rem;
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

/* Скрываем кнопку на мобильных (там будет свайп) */
@media (max-width: 1024px) {
    .next-chapter-btn {
        display: none !important;
    }
}

/* Индикатор свайпа для мобильных */
.swipe-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.swipe-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 1025px) {
    .swipe-indicator {
        display: none;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1024px) {
    /* Показываем кнопку меню */
    .menu-toggle {
        display: flex;
    }
    
    /* Скрываем sidebar по умолчанию */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        height: calc(100vh - 80px);
        z-index: 99;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }
    
    /* Открытое состояние sidebar */
    .sidebar.open {
        left: 0;
    }
    
    .content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
        align-items: center;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .header-controls {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }
}

/* Адаптивные таблицы для мобильных */
@media (max-width: 768px) {
    /* Таблица совместимости - вертикальные карточки */
    .compat-table {
        display: block;
        overflow-x: visible;
    }
    
    .compat-table thead {
        display: none; /* Скрываем заголовки */
    }
    
    .compat-table tbody {
        display: block;
    }
    
    .compat-table tr {
        display: block;
        margin-bottom: 1rem;
        padding: 1rem;
        background: var(--bg-secondary);
        border-radius: 8px;
        box-shadow: 0 2px 4px var(--shadow);
    }
    
    .compat-table td {
        display: block;
        text-align: left !important;
        padding: 0.5rem 0;
        border: none;
    }
    
    /* Добавляем подписи к данным */
    .compat-table td:before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 0.25rem;
        color: var(--accent);
        font-size: 0.85rem;
    }
    
    /* Бейджи */
    .type-badge {
        display: inline-block;
        margin-top: 0.25rem;
    }
}


@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* Результаты поиска */
.search-results {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid var(--accent);
}

.search-results.hidden {
    display: none;
}

.search-results h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result {
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--shadow);
}

.result-chapter {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-preview {
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-preview mark {
    background-color: var(--search-highlight);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

.no-results {
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    padding: 2rem;
    text-align: center;
}

.search-highlight {
    background-color: var(--search-highlight);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    animation: highlight-pulse 0.5s ease-in;
    transition: background-color 0.5s ease-out, opacity 0.5s ease-out;
}

.search-highlight.fade-out {
    background-color: transparent;
    opacity: 0.5;
}

@keyframes highlight-pulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: var(--search-highlight);
        transform: scale(1.05);
    }
    100% {
        background-color: var(--search-highlight);
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        height: calc(100vh - 80px);
        z-index: 99;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-controls {
        width: 100%;
        max-width: none;
    }
}

/* === Страница совместимости === */
.compatibility-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Фильтр производителей в сайдбаре */
.manufacturer-filter {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.manufacturer-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.manufacturer-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.manufacturer-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
}

/* Секция производителя */
.manufacturer-section {
    margin-bottom: 3rem;
}

.manufacturer-title {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
}

/* Карточка совместимости */
.compat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.compat-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
}

/* Заголовок карточки */
.compat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.compat-card-header:hover {
    background: var(--bg-hover);
}

.compat-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.compat-title-section h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.compat-type-badge {
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.compat-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.compat-card.collapsed .compat-toggle-btn {
    transform: rotate(0deg);
}

.compat-card:not(.collapsed) .compat-toggle-btn {
    transform: rotate(180deg);
}

/* Тело карточки */
.compat-card-body {
    padding: 1.5rem;
    max-height: 2000px;
    opacity: 1;
    transition: all 0.3s ease;
    overflow: hidden;
}

.compat-card-body.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 1.5rem;
}

/* Таблица совместимости */
.compat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.compat-table thead {
    background: var(--accent);
    color: white;
}

.compat-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.compat-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.compat-table tbody tr:hover {
    background: var(--bg-hover);
}

.compat-table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Изображения в таблице */
.compat-img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    border-radius: 6px;
}

.compat-img-small {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
    margin: 0 4px;
}

/* Сообщения */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error-message {
    color: #dc2626;
    padding: 2rem;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
}

#content-area {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .compat-table {
        font-size: 0.85rem;
    }
    
    .compat-table th,
    .compat-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .compat-img {
        max-width: 80px;
        max-height: 80px;
    }
    
    .compat-img-small {
        max-width: 50px;
        max-height: 50px;
    }
}

@media (max-width: 768px) {
    .compatibility-page {
        padding: 1rem 0.5rem;
    }
    
    .manufacturer-title {
        font-size: 1.5rem;
    }
    
    .compat-card-header {
        padding: 1rem;
    }
    
    .compat-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .compat-table {
        display: block;
        overflow-x: auto;
    }
    
    .compat-img,
    .compat-img-small {
        max-width: 60px;
        max-height: 60px;
    }
}
