/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    font-family: 'Inter', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.page {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 10% 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    height: 100vh;
}

.header {
    background: #1a1a1a;
    color: #aaa;
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
}

.site-subtitle {
    font-size: 13px;
    color: #e31e24;
    margin-top: 2px;
    font-weight: 500;
}

.photoheader {
    margin-left: auto;
    padding: 0 20px;
}

.photoheader img {
    width: auto;
    height: 60px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.photoheader a:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(227, 30, 36, 0.5);
}

.left {
    grid-row: 2 / 4;
    background-color: rgb(191, 191, 191);
    position: relative;
}

.content {
    grid-row: 2 / 4;
    padding: 20px 30px 40px 30px;
    margin: 0;
    overflow-y: auto;
    background: #f5f5f5;
}

.footer {
    background: #1a1a1a;
    color: #aaa;
    grid-column: 1/-1;
    grid-row: 4;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.menu {
    display: flex;
    gap: 20px;
}

.nav {
    width: 18px;
    padding: 15px;
    margin: 5px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.submenu {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background-color: rgb(191, 191, 191);
    transform: translateX(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    visibility: hidden;
    z-index: 1000;
}

.submenu>div {
    padding: 5px 10px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.submenu>div:hover {
    transform: translateX(5px);
    background-color: #4f74cb;
}

.nav:hover .submenu {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
}

a {
    outline: none;
    text-decoration: none;
    color: black;
}

/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ "ЧАСТЫЕ ПОЛОМКИ" ========== */
.page-title {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 0;
    color: #1a1a1a;
    border-left: 5px solid #e31e24;
    padding-left: 20px;
    letter-spacing: 1px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 30px;
    margin-top: 0;
}

.failure-card {
    background: #181e26;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: default;
}

.failure-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 38px -14px rgba(0, 0, 0, 0.6);
    border-color: rgba(227, 30, 36, 0.5);
}

.card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 2px solid #2c313a;
}

.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(to top, #0f141c, transparent);
    pointer-events: none;
}

.category-title {
    position: absolute;
    bottom: 16px;
    left: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    z-index: 2;
    text-shadow: 0 4px 12px black;
    color: #ffffff;
    letter-spacing: 1px;
}

.card-content {
    padding: 20px 18px 18px 18px;
    background: #0f141c;
    position: relative;
}

.card-desc {
    font-size: 0.85rem;
    color: #bdc3d0;
    margin-bottom: 14px;
    border-left: 3px solid #e31e24;
    padding-left: 12px;
    font-weight: 400;
}

.hover-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.25s ease;
    background: #10161f;
    border-radius: 18px;
    border: 1px solid #2a313e;
}

.failure-card:hover .hover-menu {
    max-height: 400px;
    opacity: 1;
    margin-top: 18px;
}

.menu-list {
    list-style: none;
    padding: 10px 6px;
}

.menu-list li {
    padding: 10px 14px;
    margin: 6px 8px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #1b212c;
    transition: all 0.2s;
    cursor: pointer;
    color: #f0f3fa;
    border-left: 3px solid #e31e24;
}

.menu-list li a {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.menu-list li:hover {
    background: #2c3546;
    transform: translateX(6px);
    color: #ffffff;
    border-left-color: #ff5e5e;
}

/* ===== ПУНКТ МЕНЮ С ПОДМЕНЮ - ПРОСТОЕ РЕШЕНИЕ ===== */
.menu-item-with-submenu {
    position: relative;
    padding: 10px 14px;
    margin: 6px 8px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #1b212c;
    transition: all 0.2s;
    cursor: pointer;
    color: #f0f3fa;
    border-left: 3px solid #e31e24;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-item-with-submenu:hover {
    background: #2c3546;
    transform: translateX(6px);
    color: #ffffff;
    border-left-color: #ff5e5e;
}

.submenu-arrow {
    font-size: 12px;
    margin-left: 8px;
}

/* Всплывающее окно - ПРОСТОЕ И НАДЕЖНОЕ */
.engine-submenu {
    position: fixed;
    background: #0f141c;
    border-radius: 16px;
    min-width: 280px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid #e31e24;
    z-index: 999999;
    display: none;
}

.engine-submenu ul {
    list-style: none;
}

.engine-submenu li {
    padding: 8px 18px;
    font-size: 0.85rem;
    color: #e0e4f0;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.engine-submenu li:hover {
    background: #2c3546;
    border-left-color: #e31e24;
    color: white;
}

.engine-submenu li a {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* КАРТИНКИ */
.img-chassis {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.2)), url('https://i.pinimg.com/736x/c0/9a/5e/c09a5ee9e301ac880beb555364866a8f.jpg');
    background-size: cover;
}

.img-engine {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2)), url('https://i.pinimg.com/736x/e9/62/79/e962794fd6e1d09802bcaf9dd781b494.jpg');
    background-size: cover;
    background-position: center 45%;
}

.img-transmission {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2)), url('https://i.pinimg.com/736x/a4/1b/83/a41b836cd15a0273ca90b91081386336.jpg');
    background-size: cover;
}

.img-body {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2)), url('https://i.pinimg.com/736x/c4/98/47/c49847717b2d8b9e078d80954b8dd1ff.jpg');
    background-size: cover;
    background-position: center 25%;
}

/* АДАПТАЦИЯ */
@media (max-width: 850px) {
    .content {
        padding: 15px 18px 40px 18px;
    }
    .page-title {
        font-size: 26px;
        padding-left: 15px;
        margin-bottom: 15px;
    }
    .category-title {
        font-size: 1.4rem;
        bottom: 12px;
        left: 14px;
    }
    .cards-grid {
        gap: 20px;
    }
}

@media (max-width: 700px) {
    .page {
        grid-template-columns: 15% 1fr;
    }
    .left {
        background-color: #b0b0b0;
    }
}






/* ===== ВСПЛЫВАЮЩИЕ ОКНА ДЛЯ ДВИГАТЕЛЕЙ ===== */
.engine-parent {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.engine-trigger {
    flex: 1;
}

.engine-popup {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    background: #0f141c;
    border-radius: 16px;
    min-width: 300px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid #e31e24;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.engine-parent:hover .engine-popup {
    opacity: 1;
    visibility: visible;
}

.engine-popup ul {
    list-style: none;
}

.engine-popup li {
    padding: 8px 18px;
    font-size: 0.85rem;
    color: #e0e4f0;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    margin: 0;
    border-radius: 0;
}

.engine-popup li:hover {
    background: #2c3546;
    border-left-color: #e31e24;
    color: white;
}

.engine-popup li a {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* Для мобильных устройств - окно вниз */
@media (max-width: 850px) {
    .engine-popup {
        left: 0;
        top: 100%;
        margin-left: 0;
        margin-top: 8px;
        min-width: 260px;
    }
}