/* --- Общие стили --- */
body {
    font-family: -apple-system, BlinkMacMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
}

/* ИЗМЕНЕНО: .container теперь без max-width, чтобы padded-container мог работать */
.container {
    margin: 0 auto;
    padding: 25px 20px; /* Сохраняем внутренние отступы, если нет padded-container */
}
/* НОВЫЙ КЛАСС: Для 20% отступов по бокам */
.padded-container {
    padding-left: 20%;
    padding-right: 20%;
}
/* ИЛИ, если вы хотите, чтобы max-width работал вместе с 20% отступами */
/* .padded-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20%;
} */


h1, h2, h3 { color: #212529; font-weight: 600; }
a { color: #007bff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Шапка и навигация --- */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Левая часть: Логотип + Название компании */
.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #212529;
    flex-shrink: 0;
}
.logo-image { height: 50px; width: auto; display: block; }
.company-name-text { font-size: 1.4em; font-weight: 600; white-space: nowrap; letter-spacing: 0.5px; }
/* Стили для Яндекс.Информера, чтобы он был хорошо виден */
.yandex-informer {
    /* Можете добавить свои стили, например, отступы */
    margin-left: 40px; /* Отступ от меню */
}
/* Центральная часть: Меню */
#navbarNavDropdown {
    flex-grow: 1;
    justify-content: center;
    display: flex;
}
.navbar-nav {
    display: flex;
    justify-content: center;
    flex-grow: 0;
    margin-left: auto;
    margin-right: auto;
}
.navbar-nav .nav-link {
    font-weight: 500;
    color: #495057;
    transition: color 0.3s ease;
    padding: 10px 15px;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #007bff;
}

/* Правая часть: Телефоны и Email */
.contact-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.phone-icon-header {
    height: 30px;
    width: auto;
    display: block;
}
.contact-details {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-size: 0.9em;
}
.contact-details a {
    color: #343a40;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
}
.contact-details a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Стили для кнопки-гамбургера */
.navbar-toggler {
    order: 1;
    margin-left: auto;
}

/* --- Стили для rgm_content.html (встраиваемого iframe) --- */

/* Общие стили для секций внутри iframe */
/* Используем отличные классы или специфичность, если это отдельные секции */
.feature-section,
.content-section {
    padding: 60px 0;
    background-color: #f8f8f8;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.feature-section:nth-of-type(odd) {
    background-color: #ffffff;
}

/* Заголовки для rgm_content.html */
/* NOTE: section-title уже определен выше, переопределяем специфичные для iframe */
.feature-section .section-title,
.content-section .section-title {
    font-size: 2.5em;
    color: #333;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.feature-section .section-title::after,
.content-section .section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #007bff;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.8em;
    color: #555;
    margin-bottom: 25px;
    text-align: center;
    margin-top: 30px;
}

/* Стили для описания компании в rgm_content.html */
.production-intro-text p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
    text-align: justify;
}

/* Стили для списка продукции в две колонки (используем ваши новые стили) */
.product-list-two-columns {
    display: flex;
    flex-wrap: wrap;
    /* list-style: none; -- УДАЛЯЕМ ЭТУ СТРОКУ, чтобы маркеры вернулись */
    padding-left: 20px; /* Добавляем общий отступ для ul, чтобы маркеры были видны */
    margin: 0;
    gap: 15px; /* Добавим gap для промежутков, это лучше чем margin-right */
}

.product-list-two-columns li {
    flex: 1 1 calc(50% - 15px); /* Каждый элемент занимает примерно 50% минус половина gap */
    box-sizing: border-box;
    /* margin-right: 2%; -- УДАЛЯЕМ, используем gap */
    margin-bottom: 5px;
    list-style-position: inside;
    text-indent: -1em;
    padding-left: 1em;
    background-color: #e9f5ff; /* Легкий синий фон для элементов списка */
    padding: 12px 20px; /* Внутренние отступы */
    border-radius: 5px;
    font-size: 1.1em;
    color: #222;
    border-left: 5px solid #007bff; /* Акцентная полоска слева */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.product-list-two-columns li:hover {
    transform: translateX(5px);
    background-color: #d0e9ff;
}
/* Удаляем margin-right у каждого второго элемента, так как gap это обрабатывает */
.product-list-two-columns li:nth-child(2n) {
    /* margin-right: 0; */ /* НЕ НУЖНО С GAP */
}

/* Медиа-запрос для мобильных устройств: возвращаем один столбец */
@media (max-width: 768px) {
    .product-list-two-columns {
        padding-left: 20px;
        gap: 0; /* Убираем gap на мобильных, если элементы идут в 1 колонку */
    }
    .product-list-two-columns li {
        flex: 1 1 100%;
        margin-right: 0;
        text-indent: -1em;
        padding-left: 1em;
    }
}


/* Стили для галереи оборудования в rgm_content.html */
.production-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.production-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.production-gallery a:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.production-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 00.3s ease-in-out;
}

.production-gallery a:hover img {
    transform: scale(1.05);
}

/* Стили для фильтров галереи продукции в rgm_content.html */
.filter-buttons {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-buttons button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.filter-buttons button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.filter-buttons button.is-checked {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Стили для сетки продукции (Isotope grid) в rgm_content.html */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.grid-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-7px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.grid-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* Стили для деталей производства (литье, мех. обработка) в rgm_content.html */
.production-details h4 {
    font-size: 1.6em;
    color: #333;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.production-details ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 20px;
}

.production-details ul li {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
    margin-bottom: 10px;
}

.production-details ul li b {
    color: #007bff;
}
.production-details h5 {
    color: #007bff;
}
/* --- Конец стилей для rgm_content.html --- */


/* --- Адаптивность для шапки --- */
@media (max-width: 1200px) { /* На средних десктопах */
    .navbar-custom-layout {
        max-width: 1200px;
    }
    .navbar-nav .nav-link {
        padding: 8px 12px;
    }
    .company-name-text {
        font-size: 1.3em;
    }
    .contact-details {
        font-size: 0.85em;
    }
}

@media (max-width: 992px) { /* На планшетах */
    .navbar-custom-layout {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        max-width: 100%;
        padding: 0 15px;
    }
    .navbar-brand-custom, .contact-info-header {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .navbar-brand-custom {
        margin-bottom: 10px;
    }
    .company-name-text {
        white-space: normal;
    }
    .contact-info-header {
        justify-content: flex-start;
        margin-top: 10px;
    }
    .contact-details {
        text-align: left;
    }
    .navbar-toggler {
        position: absolute;
        right: 15px;
        top: 20px;
        z-index: 1001;
    }

    /* Меню на мобильных (когда раскрыто) */
    #navbarNavDropdown {
        width: 100%;
        flex-direction: column;
        text-align: center;
        margin-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid #eee;
    }
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
}

@media (max-width: 768px) {
    .logo-image { height: 40px; }
    .company-name-text { font-size: 1.2em; }
    .contact-info-header { font-size: 0.8em; }
    .phone-icon-header { height: 25px; }
}

/* Переопределяем Bootstrap-стили для .navbar-toggler, чтобы не конфликтовали */
.navbar-custom-layout .navbar-toggler {
    order: 99;
    margin-left: auto;
}
/* Стили для кнопки в Hero секции */
#hero-section .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}
#hero-section .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}


/* --- Hero Section --- */
#hero-section {
    background-image: url('/img/test4.png');
    background-size: cover; /* Изображение умещается полностью, сохраняя пропорции */
    background-position: bottom; /* Центрируем изображение в контейнере */
    background-repeat: no-repeat; /* <-- ВОТ ЭТО ВАЖНО: Запрещаем повторение изображения */
    color: #ffffff;
    text-align: left;
    padding: 100px 0;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 500px;
    height: 50vh; /* Или на всю высоту экрана */
    overflow: hidden; /* Если изображение "вылазит" */
}
#hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

#hero-section .container {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

#hero-section h1 {
    font-size: 3.2em;
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.2;
}

#hero-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #e9ecef;
}


/* --- Общие стили секций --- */
section { padding: 10px 0; } /* Это более общий padding, чем для feature-section */
.section-title { text-align: center; font-size: 2.5em; margin-bottom: 50px; }

/* --- Сетка продуктов на главной --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 30px;
    align-items: stretch;
}
.product-card { background-color: #ffffff; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; text-align: center; padding-bottom: 20px; display: flex; flex-direction: column;height: 100%; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 220px; object-fit: cover; }
.product-card h3 { font-size: 1.5em; margin: 15px 15px 10px; color: #007bff; }
.product-card p, .product-card ul { font-size: 0.95em; color: #6c757d; padding: 0 15px; margin-bottom: 15px; flex-grow: 1; }
.product-card ul { text-align: left; padding-left: 30px; list-style: disc; }
.product-card ul li { margin-bottom: 5px; }

/* --- Секция "О нас" --- */
.about-content { display: flex; align-items: center; gap: 40px; margin-top: 30px; }
.about-content img { max-width: 45%; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.about-text { flex: 1; }
.company-profile h3 { font-size: 1.5em; line-height: 1.4; color: #212529; }
.company-profile ul { list-style: disc; padding-left: 20px; }
.company-profile li { margin-bottom: 10px; }

/* --- СТИЛИ ДЛЯ СТРАНИЦ ПРОДУКЦИИ --- */
.catalog-page-content {
    padding-top: 40px;
    padding-bottom: 60px;
}
.catalog-frame { display: block; width: 80%; margin: 0 auto; height: 90vh; border: 1px solid #e9ecef; border-radius: 8px; }
.rmg-content, .zmm-content { display: flex; align-items: flex-start; gap: 40px; margin-top: 30px; }
.rmg-content img, .zmm-content img { max-width: 45%; height: auto; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.rmg-text, .zmm-text { flex: 1; }
.rmg-text h3, .zmm-text h3 { font-size: 1.8em; margin-bottom: 20px; color: #007bff; }
.rmg-text ul, .zmm-text ul { list-style: disc; padding-left: 20px; margin-top: 20px; }
.rmg-text li, .zmm-text li { margin-bottom: 10px; }

/* --- Контакты --- */
.contact-info { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.contact-info li { background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.contact-info strong { display: block; color: #212529; margin-bottom: 5px; }

/* --- Подвал --- */
footer { text-align: center; padding: 30px; background-color: #212529; color: #adb5bd; font-size: 0.9em; margin-top: 40px; }

/* --- Класс .hidden, если он вам нужен для других целей, но БЕЗ !important --- */
.hidden {
    display: none;
}

/* --- Адаптивность --- */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    /* Адаптивность для rgm_content.html */
    .feature-section,
    .content-section {
        padding: 50px 0;
    }
    .feature-section .section-title,
    .content-section .section-title {
        font-size: 2em;
    }
    .section-subtitle {
        font-size: 1.5em;
    }
    .production-intro-text p,
    .product-list-two-columns li,
    .production-details ul li {
        font-size: 1em;
    }
    .production-gallery,
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
    }
    .production-gallery img,
    .grid-item img {
        height: 180px;
    }
}
@media (max-width: 992px) {
    .padded-container {
        padding-left: 10%;
        padding-right: 10%;
    }
    #hero-section h1 { font-size: 2.5em; }
    .about-content, .rmg-content, .zmm-content { flex-direction: column; }
    .about-content img, .rmg-content img, .zmm-content img { max-width: 100%; }
    .catalog-frame { width: 95%; }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Адаптивность для rgm_content.html */
    .feature-section,
    .content-section {
        padding: 40px 0;
    }
    .feature-section .section-title,
    .content-section .section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    .section-subtitle {
        font-size: 1.3em;
    }
    .product-list-two-columns {
        grid-template-columns: 1fr; /* Одна колонка на узких экранах */
    }
    .production-gallery,
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    .production-gallery img,
    .grid-item img {
        height: 150px;
    }
    .filter-buttons button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .production-details h4 {
        font-size: 1.4em;
        margin-top: 30px;
    }
}
@media (max-width: 768px) {
    .padded-container {
        padding-left: 5%;
        padding-right: 5%;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
    /* Адаптивность для rgm_content.html */
    .feature-section .section-title,
    .content-section .section-title {
        font-size: 1.5em;
        margin-bottom: 25px;
    }
    .section-subtitle {
        font-size: 1.2em;
    }
    .filter-buttons {
        gap: 5px;
    }
    .filter-buttons button {
        padding: 7px 12px;
        font-size: 0.8em;
    }
    .production-gallery,
    .grid {
        grid-template-columns: 1fr; /* Одна колонка для очень маленьких экранов */
        gap: 5px;
    }
    .production-gallery img,
    .grid-item img {
        height: 200px;
    }
    .production-details ul {
        padding-left: 15px;
    }
    .production-details h4 {
        font-size: 1.2em;
    }
}

/* Дополнительный медиа-запрос для очень маленьких экранов */
@media (max-width: 480px) {
    .padded-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    #hero-section h1 { font-size: 2em; }
    #hero-section p { font-size: 1em; }
    .company-name-text { font-size: 1.1em; }
    .logo-image { height: 35px; }
    .contact-details { font-size: 0.75em; }
    .phone-icon-header { height: 20px; }
    .navbar-toggler {
        top: 15px; /* Корректировка положения кнопки гамбургера */
    }
}