/* ============================================================
   SWAPZONE — СТИЛИ ОТДЕЛЬНЫХ СТРАНИЦ
   Уникальные элементы: каталог, карточка движка, гид по свапу,
   страницы статей, секции каталога, AJAX-пагинация.
   ============================================================ */


/* ============================================================
   1. ШАПКА КАТАЛОГА (engines/catalog.html)
   Тёмно-градиентный блок с заголовком и счётчиком двигателей.
   ============================================================ */
.catalog-header {
    background: linear-gradient(135deg, #2c2c2c 0%, #3a3a3a 50%, #4a4a4a 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.catalog-header h1 {
    color: white;
}

.catalog-header .lead {
    color: rgba(255, 255, 255, 0.8);
}


/* ============================================================
   2. БЛОК ПОИСКА + ФИЛЬТРЫ В ШАПКЕ КАТАЛОГА (КОМПАКТНЫЙ)
   Две строки: строка поиска и ряд фильтров под ней.
   Стеклянный эффект на тёмном фоне.
   ============================================================ */
.header-search-box {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 20px;
}

/* --- Строка поиска (ряд 1) --- */
.header-search-box .form-control {
    border: none;
    padding: 10px 16px;
    font-size: 0.95rem;
    border-radius: 8px 0 0 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    height: 44px;
}

.header-search-box .form-control::placeholder {
    color: #6c757d;
}

.header-search-box .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
    background: #fff;
    color: #333;
}

.header-search-box .btn-warning {
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0 22px;
    border: none;
    background: #ffc107;
    color: #212529;
    transition: all 0.3s;
    height: 44px;
}

.header-search-box .btn-warning:hover {
    background: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* --- Ряд фильтров (ряд 2) --- */
.filter-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.5fr auto;
    gap: 10px;
    align-items: end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-label {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    font-size: 0.85rem;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

.filter-input:focus {
    outline: none;
    background: #fff;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

.filter-input::placeholder {
    color: #adb5bd;
}

/* --- Поле мощности (от — до) --- */
.filter-field-power .power-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-field-power .filter-input {
    flex: 1;
    min-width: 0;
}

.filter-field-power .power-sep {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    flex-shrink: 0;
}

/* --- Кнопки «Применить» / «Сбросить» --- */
.filter-field-actions {
    align-self: end;
}

.filter-actions {
    display: flex;
    gap: 6px;
}

.btn-apply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffc107;
    color: #212529;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 16px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-apply:hover {
    background: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* --- Кнопка «Сбросить» рядом с «Применить» --- */
.btn-reset,
.btn-reset:hover,
.btn-reset:focus,
.btn-reset:active,
.btn-reset:visited {
    text-decoration: none !important;
    color: #ffffff !important;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 16px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    text-decoration: none !important;
}

.btn-reset:active {
    transform: translateY(0);
}

.btn-reset:focus {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
    text-decoration: none !important;
}

/* Иконка и текст — принудительно белые */
.btn-reset i,
.btn-reset .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    color: #ffffff !important;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

/* --- Подсказка под формой поиска --- */
.header-search-box .search-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.8rem;
}

.header-search-box .search-hint .badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 6px;
    margin-right: 2px;
}


/* ============================================================
   3. ИНФО О РЕЗУЛЬТАТАХ ПОИСКА
   ============================================================ */
.search-results-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #eef0f2 100%);
    border: 1px solid #e0e3e7;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

.search-results-info .info-text {
    color: #495057;
    font-size: 0.95rem;
}

.search-results-info .info-text strong {
    color: #495057;
}

.search-results-info .info-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.search-results-info .info-stats .stat-item {
    font-size: 0.85rem;
    color: #6c757d;
}

.search-results-info .info-stats .stat-item .count {
    font-weight: 700;
    color: #1a1a2e;
    margin-right: 3px;
}


/* ============================================================
   4. ЗАГОЛОВКИ СЕКЦИЙ РЕЗУЛЬТАТОВ ПОИСКА
   ============================================================ */
.search-section {
    margin-bottom: 35px;
}

.search-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.search-section-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-section-header h4 i {
    color: #6c757d;
}

.search-section-header .section-count {
    background: linear-gradient(135deg, #4a4a4a 0%, #2c2c2c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}


/* ============================================================
   5. КАРТОЧКИ СТАТЕЙ И ГИДОВ (в результатах поиска)
   ============================================================ */
.article-card,
.guide-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    height: 100%;
    background: #fff;
}

.article-card:hover,
.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.article-card .card-img-top,
.guide-card .card-img-top {
    height: 160px;
    object-fit: cover;
    background: #f8f9fa;
}

.article-card .card-body,
.guide-card .card-body {
    padding: 18px;
}

.article-card .card-title,
.guide-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-card .card-title a,
.guide-card .card-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке, чтобы работало с .stretched-link */
.article-card:hover .card-title a,
.guide-card:hover .card-title a {
    color: #6c757d;
}

.article-card .excerpt,
.guide-card .excerpt {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 12px;
}

.article-card .card-footer,
.guide-card .card-footer {
    background: transparent;
    border-top: 1px solid #f0f0f0;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.article-card .badge,
.guide-card .badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    font-weight: 500;
}


/* ============================================================
   6. ПУСТОЕ СОСТОЯНИЕ ПОИСКА
   ============================================================ */
.empty-search-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.empty-search-state i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.empty-search-state h5 {
    color: #495057;
    margin-bottom: 8px;
}

.empty-search-state p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
}


/* ============================================================
   7. КАРТОЧКА ДВИГАТЕЛЯ В КАТАЛОГЕ
   ============================================================ */
.engine-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.engine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.engine-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.engine-card .badge-top {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.engine-card .badge-bottom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.engine-card .engine-specs {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 10px;
}

.engine-card .engine-specs .spec-item {
    text-align: center;
}

.engine-card .engine-specs .spec-item .value {
    font-weight: 700;
    color: #6c757d;
}

.engine-card .engine-specs .spec-item .label {
    font-size: 0.7rem;
    color: #6c757d;
}

.engine-card .card-body {
    padding: 1.25rem;
}

.engine-card .card-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.engine-card .card-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке, чтобы работало с .stretched-link */
.engine-card:hover .card-title a {
    color: #6c757d;
}

.engine-card .description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
}

.engine-card .card-footer {
    background: transparent;
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
}

.engine-tags .badge {
    font-size: 0.7rem;
    font-weight: 500;
}


/* ============================================================
   8. РЕКОМЕНДУЕМЫЕ СТАТЬИ — ГОРИЗОНТАЛЬНАЯ КАРУСЕЛЬ
   ============================================================ */
.featured-carousel-wrapper {
    position: relative;
    padding: 0 45px;
}

.featured-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 0 24px 0;
    -webkit-overflow-scrolling: touch;
}

.featured-carousel::-webkit-scrollbar {
    display: none;
}

.featured-carousel .featured-article-card {
    flex: 0 0 calc((100% - 40px) / 3);
    scroll-snap-align: start;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    background: #fff;
    display: flex;
    flex-direction: column;
}

.featured-carousel .featured-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.featured-carousel .featured-article-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background: #f8f9fa;
}

.featured-carousel .featured-article-card .card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.featured-carousel .featured-article-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.featured-carousel .featured-article-card .card-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке */
.featured-carousel .featured-article-card:hover .card-title a {
    color: #6c757d;
}

.featured-carousel .featured-article-card .card-text {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 12px;
    flex: 1;
}

.featured-carousel .featured-article-card .badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    font-weight: 500;
    align-self: flex-start;
}

/* --- Стрелки навигации карусели --- */
.featured-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s;
    opacity: 1;
    pointer-events: auto;
}

.featured-carousel-arrow:hover {
    background: #ffc107;
    color: #212529;
    transform: translateY(-50%) scale(1.1);
}

.featured-carousel-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8f9fa;
}

.featured-carousel-arrow:disabled:hover {
    transform: translateY(-50%) scale(1);
    background: #f8f9fa;
    color: #333;
}

.featured-carousel-arrow.prev { left: 0; }
.featured-carousel-arrow.next { right: 0; }

/* --- Точки-индикаторы карусели --- */
.featured-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.featured-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ced4da;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s;
}

.featured-carousel-dot:hover {
    background: #adb5bd;
}

.featured-carousel-dot.active {
    background: #ffc107;
    width: 24px;
    border-radius: 6px;
}


/* ============================================================
   9. КАРТОЧКА ДВИГАТЕЛЯ (engine_detail.html)
   ============================================================ */
.engine-header-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.engine-header-card .card-body {
    padding: 30px;
}

.engine-header-card .engine-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.engine-header-card .engine-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.engine-header-card .engine-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.engine-header-card .engine-meta i {
    margin-right: 5px;
}

.engine-header-card .engine-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.engine-header-card .engine-badges .badge {
    font-size: 0.85rem;
    padding: 6px 14px;
}

/* --- Модификации двигателя --- */
.modification-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.modification-card .mod-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.modification-card .mod-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
}

.modification-card .mod-code {
    color: #6c757d;
    font-size: 0.9rem;
}

.modification-card .mod-specs {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.modification-card .mod-specs .spec-item {
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 6px;
}

/* Описание модификации — обычный текст без фона и рамки */
.modification-card .mod-specs .mod-description {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.6;
    width: 100%;
    background: transparent;
    padding: 0;
    border-radius: 0;
}


/* ============================================================
   10. ГИД ПО СВАПУ (swap_guide_detail.html)
   ============================================================ */
.guide-header-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.guide-header-card .card-body {
    padding: 30px;
}

.guide-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.guide-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.guide-meta i {
    margin-right: 5px;
}

.guide-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.guide-badges .badge {
    font-size: 0.85rem;
    padding: 6px 14px;
}

/* --- Этапы работы (шаги гида) --- */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-item {
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
}

/* Тело шага */
.step-body {
    min-width: 0;
}

/* Заголовок шага — в стиле h5 портала */
.step-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* Содержимое шага */
.step-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.step-content p {
    margin-bottom: 0.5rem;
}

.step-content p:last-child {
    margin-bottom: 0;
}

.step-content ul {
    margin: 0.8rem 0 0 1.5rem;
    padding-left: 0.5rem;
    list-style-type: disc;
}

.step-content li {
    margin-bottom: 0.3rem;
    line-height: 1.7;
}

.step-content strong {
    color: #2c3e50;
    font-weight: 700;
}


/* ============================================================
   11. ЗАПЧАСТИ И ИНСТРУМЕНТЫ В ГИДЕ
   Оформление как у списков «Преимущества/Недостатки»
   в карточке двигателя: стандартные чёрные маркеры,
   без hover-эффектов и подсветки.
   ============================================================ */
.parts-list,
.tools-list {
    margin: 0.8rem 0 0 1.5rem;
    padding-left: 0.5rem;
    list-style-type: disc;
}

.parts-list li,
.tools-list li {
    margin-bottom: 0.3rem;
    line-height: 1.8;
    color: #333;
}

/* --- Цветные полосы для блоков советов и ошибок --- */
.tips-card { border-left: 4px solid #28a745; }
.mistakes-card { border-left: 4px solid #dc3545; }


/* ============================================================
   12. СЕКЦИИ КАТАЛОГА («Описание двигателей», «Гиды по свапу»)
   ============================================================ */
.catalog-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.catalog-section:last-child {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 0;
}

/* --- Пагинация внутри секции каталога --- */
.catalog-pagination {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* --- Карточка гида в секции каталога --- */
.catalog-guide-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.catalog-guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.catalog-guide-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.catalog-guide-card .guide-difficulty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 600;
}

.catalog-guide-card .card-body {
    padding: 1.25rem;
}

.catalog-guide-card .card-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.catalog-guide-card .card-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке, чтобы работало с .stretched-link */
.catalog-guide-card:hover .card-title a {
    color: #6c757d;
}

.catalog-guide-card .description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.catalog-guide-card .guide-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    margin-top: 10px;
}

.catalog-guide-card .guide-specs .spec-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 6px;
}

.catalog-guide-card .guide-specs .spec-item i {
    color: #ffc107;
}

.catalog-guide-card .card-footer {
    background: transparent;
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
}


/* ============================================================
   13. AJAX-ПАГИНАЦИЯ СЕКЦИЙ КАТАЛОГА
   ============================================================ */
#engines-grid,
#guides-grid {
    transition: opacity 0.2s ease;
}

.catalog-pagination .page-link {
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    border-color: #dee2e6;
}

/* Активная страница — жёлтая */
.catalog-pagination .page-item.active .page-link {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
    font-weight: 600;
}

/* Ховер неактивной страницы */
.catalog-pagination .page-link:hover:not(.active) {
    background: #fff8e1;
    border-color: #ffc107;
    color: #212529;
}

/* Во время загрузки — блёклый вид */
.catalog-pagination[style*="pointer-events: none"] .page-link {
    opacity: 0.6;
    cursor: wait;
}


/* ============================================================
   14. ПРАВАЯ ПАНЕЛЬ КАРТОЧКИ ДВИГАТЕЛЯ (engine_detail.html)
   ============================================================ */
#right-column > .card {
    margin-bottom: 24px;
}

#engine-image-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

#engine-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* --- Список похожих двигателей --- */
.similar-engines-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.similar-engine-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.similar-engine-item:hover {
    background: #fff;
    border-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Жёстко фиксируем размер картинок в похожих двигателях */
.similar-engine-img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: cover !important;
    border-radius: 8px;
    background: #f8f9fa;
    flex-shrink: 0;
    display: block;
}

.similar-engine-info {
    flex: 1;
    min-width: 0;
}

.similar-engine-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.similar-engine-specs {
    font-size: 0.75rem;
    color: #6c757d;
}

/* --- Краткая информация — разделители строк --- */
#right-column .card-body ul.list-unstyled li {
    font-size: 0.9rem;
    padding-bottom: 4px;
    border-bottom: 1px solid #f5f5f5;
}

#right-column .card-body ul.list-unstyled li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#right-column .card-body ul.list-unstyled li strong {
    color: #495057;
    font-weight: 600;
}

/* --- Кнопки в правой колонке --- */
#right-column .d-grid.gap-2 {
    gap: 10px !important;
}


/* ============================================================
   15. СТРАНИЦА СТАТЕЙ (article_detail.html / article_list.html)
   ============================================================ */

/* Бейдж типа статьи поверх картинки */
.article-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Карточка статьи в списке */
.article-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.article-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.article-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card .card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.article-card .card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке */
.article-card:hover .card-title a {
    color: #6c757d;
}

.article-card .description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
    flex: 1;
}

.article-card .article-engine {
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.article-card .card-footer {
    background: transparent;
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Похожие статьи в правой колонке article_detail */
.similar-articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.similar-article-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}

.similar-article-item:hover {
    background: #f8f9fa;
    border-color: #ffc107;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.similar-article-img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: cover !important;
    border-radius: 8px;
    background: #f8f9fa;
    flex-shrink: 0;
    display: block;
    font-size: 1.5rem;
}

.similar-article-info {
    flex: 1;
    min-width: 0;
}

.similar-article-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.similar-article-specs {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Правая колонка article_detail */
#article-right-column > .card {
    margin-bottom: 24px;
}

#article-right-column .d-grid.gap-2 {
    gap: 10px !important;
}


/* ============================================================
   16. ПРАВАЯ ПАНЕЛЬ ГИДА ПО СВАПУ (swap_guide_detail.html)
   Единый стиль с правой панелью карточки двигателя.
   ============================================================ */
#right-column > .card {
    margin-bottom: 24px;
}

#guide-image-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

#guide-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Строки «Информация» и «Двигатель» — разделители */
#right-column .card-body ul.list-unstyled li {
    font-size: 0.9rem;
    padding-bottom: 4px;
    border-bottom: 1px solid #f5f5f5;
}

#right-column .card-body ul.list-unstyled li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#right-column .card-body ul.list-unstyled li strong {
    color: #495057;
    font-weight: 600;
}

#right-column .d-grid.gap-2 {
    gap: 10px !important;
}


/* ============================================================
   17. АДАПТИВНОСТЬ (уникальные элементы)
   ============================================================ */

/* --- Планшет (до 992px): фильтры в 2 колонки, правая колонка под левой --- */
@media (max-width: 992px) {
    .filter-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .filter-field-actions {
        grid-column: 1 / -1;
    }

    .filter-actions {
        justify-content: flex-end;
    }

    .filter-label {
        font-size: 0.64rem;
    }

    .filter-input {
        font-size: 0.82rem;
        padding: 6px 10px;
        height: 34px;
    }

    .btn-apply,
    .btn-reset {
        height: 34px;
        font-size: 0.8rem;
        padding: 0 14px;
    }

    #right-column {
        margin-top: 8px;
    }

    #right-column > .card {
        margin-bottom: 20px;
    }

    #engine-image-card img {
        max-height: 220px !important;
    }

    #guide-image-card img {
        max-height: 220px !important;
    }

    #article-right-column {
        margin-top: 8px;
    }

    #article-right-column > .card {
        margin-bottom: 20px;
    }
}

/* --- Карусель: 2 карточки в ряд на планшетах --- */
@media (max-width: 992px) and (min-width: 577px) {
    .featured-carousel-wrapper {
        padding: 0 40px;
    }

    .featured-carousel .featured-article-card {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}

/* --- Мобильный (до 768px): секции в столбик --- */
@media (max-width: 768px) {
    .catalog-header {
        padding: 25px 20px;
    }

    .catalog-header h1 {
        font-size: 1.8rem;
    }

    .engine-card .card-img-top {
        height: 150px;
    }

    .engine-header-card .card-body {
        padding: 20px;
    }

    .guide-header-card .card-body {
        padding: 20px;
    }

    .engine-header-card .engine-title {
        font-size: 1.5rem;
    }

    .guide-title {
        font-size: 1.5rem;
    }

    /* Компактный вариант шагов */
    .step-item {
        padding: 18px 20px;
    }

    .step-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .step-content {
        font-size: 0.95rem;
    }

    .search-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* --- Маленькие мобильные (до 576px): фильтры в 1 колонку --- */
@media (max-width: 576px) {
    .header-search-box {
        padding: 12px;
        border-radius: 10px;
        margin-top: 15px;
    }

    .header-search-box .form-control {
        font-size: 0.88rem;
        padding: 8px 14px;
        height: 40px;
    }

    .header-search-box .btn-warning {
        padding: 0 16px;
        font-size: 0.85rem;
        height: 40px;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .filter-field-actions {
        grid-column: auto;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .btn-apply,
    .btn-reset {
        flex: 1;
        justify-content: center;
    }

    .featured-carousel-wrapper {
        padding: 0;
    }

    .featured-carousel .featured-article-card {
        flex: 0 0 100%;
    }

    .featured-carousel-arrow {
        display: none;
    }

    .featured-carousel {
        padding: 8px 0 20px 0;
        gap: 12px;
    }

    .catalog-header h1 { font-size: 1.5rem; }
    .engine-header-card .engine-title { font-size: 1.25rem; }
    .guide-title { font-size: 1.25rem; }

    /* Ещё компактнее шаги */
    .step-item {
        padding: 16px 18px;
    }

    .step-title {
        font-size: 0.95rem;
    }

    .step-content {
        font-size: 0.92rem;
        line-height: 1.65;
    }

     .step-content ul {
        margin: 0.6rem 0 0 1.2rem;
        padding-left: 0.4rem;
    }

    /* Уменьшенные картинки похожих двигателей */
    .similar-engine-img {
        width: 48px !important;
        height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
    }

    .similar-engine-name {
        font-size: 0.85rem;
    }

    /* Уменьшенные картинки похожих статей */
    .similar-article-img {
        width: 48px !important;
        height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
    }

    .similar-article-name {
        font-size: 0.85rem;
    }
}


/* ============================================================
   18. КАРТОЧКИ-ССЫЛКИ (link-card)
   Вся карточка кликабельна через .stretched-link.
   Фирменный ховер и эффект приподнимания.
   ============================================================ */
.link-card {
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Убираем синий цвет у всех ссылок внутри такой карточки */
.link-card a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

/* Ховер — по карточке, чтобы работало с .stretched-link */
.link-card:hover a {
    color: #6c757d;
}

/* Вся карточка приподнимается и получает тень при наведении */
.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Курсор-указатель на заголовке, чтобы показать кликабельность */
.link-card .card-title a.stretched-link {
    cursor: pointer;
}

/* Бейджи и футер внутри карточки не должны перекрывать stretched-link */
.link-card .badge,
.link-card .card-footer {
    position: relative;
    z-index: 1;
}

/* Если внутри карточки есть кнопки — они должны быть выше stretched-link */
.link-card .btn {
    position: relative;
    z-index: 2;
}

/* Лёгкий эффект нажатия на тач-устройствах */
.link-card:active {
    transform: scale(0.98);
}


/* ============================================================
   19. КАРТОЧКИ-ССЫЛКИ ВНУТРИ КАРТОЧКИ ДВИГАТЕЛЯ
   Приводим рамку и радиус к единому стилю с .modification-card.
   Касается только карточек в блоках «Статьи и обзоры» и
   «Гиды по свапу» на странице двигателя.
   ============================================================ */
.engine-header-card .link-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: none;
    background: #fff;
}

.engine-header-card .link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-color: #e9ecef;
}

/* ============================================================
   20. ИКОНКИ В ЗАГОЛОВКАХ СЕКЦИЙ КАТАЛОГА — ФИРМЕННЫЙ СЕРЫЙ
   Цвет #6c757d — нейтральный серый, мягкий акцент.
   ============================================================ */
.catalog-section h4 i,
.catalog-section h4 .bi,
.search-section-header h4 i,
.search-section-header h4 .bi {
    color: #6c757d;
}