/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden; /* ⭐ ВАЖНО: запрещаем горизонтальную прокрутку страницы */
    width: 100%;
    max-width: 100vw;
}

/* Шапка (фон) */
.page-header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/testbg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: normal;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
    overflow-x: clip; /* ⭐ БЫЛО overflow-x: hidden */
    width: 100%;
}

/* Шапка сайта (nav) */
header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown {
    position: relative;
}

/* Desktop Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: #333;
    padding: 0.8rem 1rem;
    display: block;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: #3498db;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2.0rem;
    cursor: pointer;
}

/* Основной контент */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Шапка страницы (текст) */
.page-header {
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.content {
    max-width: 960px;
    margin: 0 auto;
}

.text-block {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    line-height: 1.8;
    overflow: hidden; /* ⭐ ВАЖНО: содержимое не выходит за рамки блока */
    max-width: 100%;
}

.text-block h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    font-size: 1.3em;
}

.image-placeholder {
    width: 100%;
    background: linear-gradient(45deg, #e0e0e0, #f0f0f0);
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    overflow: hidden;
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 100%;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-grid .image-placeholder {
    margin: 0;
}

/* ============================================ */
/* СТИЛИ ДЛЯ ТАБЛИЦ - ИСПРАВЛЕННЫЕ */
/* ============================================ */

/* Контейнер для адаптивной прокрутки таблиц */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: white;
    display: block; /* ⭐ ВАЖНО: block вместо table для работы overflow */
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    min-width: 500px; /* ⭐ Минимальная ширина таблицы для прокрутки */
    display: table;
}

.specs-table thead {
    background: #2c3e50;
    color: white;
}

.specs-table th,
.specs-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

.specs-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.specs-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Подвал */
footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    margin-left: 10px;
}


.footer-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #3498db;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
	font-weight: 500;
	font-size: 16px;
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #3498db;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* Блокировка прокрутки body при открытом меню */
body.menu-open {
    overflow: hidden;
}

/* ============================================ */
/* АДАПТИВНОСТЬ - МОБИЛЬНАЯ ВЕРСИЯ */
/* ============================================ */
@media (max-width: 768px) {
    .mobile-toggle {
        margin-right: 10px;
        display: block;
        padding: 10px;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: #2c3e50;
        width: 100%;
        text-align: left;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 1rem 0;
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item.dropdown {
        position: relative;
        display: block;
        margin-bottom: 5px;
        width: 90%;
        margin-left: 5%;
    }

    .nav-link {
        font-size: 1.3rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 18px 60px 18px 20px;
        display: block;
        color: #fff !important;
        text-decoration: none;
        width: 100%;
        margin: 0;
        border-radius: 8px;
        background: rgba(255,255,255,0.08);
        box-sizing: border-box;
        position: relative;
    }

    .nav-link:hover {
        background: rgba(255,255,255,0.15) !important;
    }

    .dropdown-toggle {
        position: absolute;
        top: 13px;
        right: 20px;
        transform: none;
        background: rgba(255,255,255,0.15);
        border: none;
        color: white;
        font-size: 1.2rem;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 10;
        padding: 10px;
    }

    .dropdown-toggle:active {
        background: rgba(255,255,255,0.3);
    }

    .dropdown.active .dropdown-toggle {
        transform: rotate(180deg);
        background: rgba(52, 152, 219, 0.5);
    }

    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.2);
        width: 100%;
        margin: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0;
        border-radius: 8px;
        margin-top: 5px;
        margin-bottom: 10px;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        color: #ddd;
        font-size: 1rem;
        font-weight: 400;
        text-transform: none;
        padding: 14px 20px;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        width: 100%;
        margin-left: 0;
        border-radius: 0;
        box-sizing: border-box;
    }

    .dropdown-menu a:first-child {
        border-radius: 8px 8px 0 0;
    }

    .dropdown-menu a:last-child {
        border-radius: 0 0 8px 8px;
        border-bottom: none;
    }

    .dropdown-menu a:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }

    .nav-item:not(.dropdown) {
        display: flex;
        justify-content: center;
        margin-bottom: 5px;
        width: 90%;
        margin-left: 5%;
    }

    .nav-item:not(.dropdown) > .nav-link {
        margin: 0;
        width: 100%;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .text-block {
        padding: 1.5rem 1rem;
    }

    /* ⭐ АДАПТИВНОСТЬ ТАБЛИЦ НА МОБИЛЬНЫХ */
    .table-responsive {
        margin: 15px -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
        box-shadow: none;
        border-top: 2px solid #3498db;
        border-bottom: 2px solid #3498db;
    }

    .table-responsive::before {
        content: "👉 Прокрутите таблицу горизонтально";
        display: block;
        text-align: center;
        padding: 8px;
        background: linear-gradient(135deg, #3498db, #2c3e50);
        color: white;
        font-size: 12px;
        font-weight: bold;
    }

    .specs-table {
        font-size: 13px;
        min-width: 600px;
    }

    .specs-table th,
    .specs-table td {
        padding: 10px 12px;
    }

    .image-placeholder {
        width: 100%;
        margin: 1.5rem 0;
    }

    .image-placeholder img {
        width: 100%;
        object-fit: cover;
    }
}

/* ⭐ ВАЖНО: ЗАКРЫВАЕМ МЕДИА-ЗАПРОС! */
/* Это было пропущено в оригинальном коде */

/* Десктоп - скрываем кнопку стрелки и возвращаем обычные стили */
@media (min-width: 769px) {
    .dropdown-toggle {
        display: none;
    }

    .nav-link {
        text-transform: none;
        font-size: 1rem;
        font-weight: 400;
        padding: 0.5rem 1rem;
        width: auto;
        margin: 0;
        border-radius: 4px;
    }

    .nav-item.dropdown > .nav-link,
    .nav-item:not(.dropdown) > .nav-link {
        background: transparent;
    }

    .nav-item.dropdown {
        display: block;
    }

    .nav-item:not(.dropdown) {
        display: block;
    }
} /* ⭐ ВОТ ЭТА СКОБКА БЫЛА ПРОПУЩЕНА! */

/* Для очень маленьких экранов */
@media screen and (max-width: 480px) {
    .specs-table {
        font-size: 12px;
        min-width: 500px;
    }

    .specs-table th,
    .specs-table td {
        padding: 8px 10px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .text-block {
        padding: 1rem 0.75rem;
    }
}