body {
    font-family: sans-serif; 
    line-height: 1.6; 
    color: #333; 
    margin: 0; 
    background: #fdfdfd; 
}

/* Общий контейнер центровки контента */
.container { 
    max-width: 2000px; 
    margin: 0 auto; 
    padding: 0 15px;      
    box-sizing: border-box; 
}

/* Универсальный заголовок страниц сайта (с крокодилом) */
.page-header {
    background: #ffffff;
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;          
    align-items: center;    
    justify-content: center; 
    gap: 20px;              
    position: static !important; 
}

.header-logo {
    width: 70px;            
    height: auto;
    flex-shrink: 0;         
}

.header-text {
    text-align: left;       
}

.page-header h1 {
    margin: 0;
    color: #0044cc;
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
}

/* Линия под главным заголовком хедера */
.page-header h1::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: #EEAE00;
    margin-top: 5px;
}

.page-header p {
    margin: 5px 0 0 0;
    font-style: italic;
    color: #666;
    font-size: 1em;
}

/* Универсальные кнопки возврата "Назад" */
.nav-back { 
    display: inline-block; 
    color: #0066cc; 
    font-weight: bold; 
    text-decoration: none;
    border: 1px solid #0066cc; 
    padding: 5px 12px;
    border-radius: 4px;
    transition: 0.2s;
}
.nav-back:hover { 
    background: #0066cc; 
    color: white; 
}

/* Глобальный подвал сайта */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
    color: #777;
}

/* =========================================================================
   2. АДАПТИВНАЯ ЛИПКАЯ ПАНЕЛЬ НАВИГАЦИИ (МЕНЮ САЙТА)
   ========================================================================= */
.main-nav-wrap {
    position: sticky; 
    top: 0; 
    background: #BFBFBF; 
    z-index: 1001; 
    border-bottom: 1px solid #ccc; 
    width: 100%;
    box-sizing: border-box;
}

.main-nav {
    display: flex; 
    flex-wrap: nowrap;          /* Запрещаем перенос кнопок на новые строки */
    gap: 10px; 
    justify-content: center;    /* Центрируем кнопки на мониторах ПК */
    background: #E5E5E5; 
    padding: 8px 15px; 
    box-sizing: border-box;
    width: 100%;
}

.main-nav a {
    display: inline-block;
    text-decoration: none; 
    color: #333; 
    background: #ADD8E6; 
    padding: 8px 16px; 
    border: 2px solid #0066cc; 
    border-radius: 5px; 
    transition: 0.2s; 
    font-weight: bold; 
    white-space: nowrap;        /* Текст внутри кнопок строго в одну строку */
    flex-shrink: 0;             /* Запрещаем деформацию кнопок */
}

.main-nav a:hover { 
    background: #0066cc; 
    color: white; 
}

/* Превращение меню в компактную скролл-ленту на смартфонах */
@media (max-width: 900px) {
    .main-nav {
        justify-content: flex-start !important; 
        overflow-x: auto !important;            /* Горизонтальный скролл пальцем */
        overflow-y: hidden !important;          
        padding: 6px 10px !important;           /* Сжимаем высоту для ультракомпактности */
        -webkit-overflow-scrolling: touch;      /* Плавный скролл на iOS */
    }
    .main-nav a {
        padding: 5px 12px !important;
    }
    .main-nav a span {
        font-size: 11pt !important;             
    }
    /* Скрываем полосу прокрутки в разных браузерах */
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav { scrollbar-width: none; -ms-overflow-style: none; }
}

/* =========================================================================
   3. СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (INDEX.PHP)
   ========================================================================= */

/* Hero-блок с панорамной фоновой картинкой лаборатории */
.hero-section {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0.3)), 
                url('lab_background.jpg?v=2') no-repeat center center !important;
    background-size: cover !important;
    background-attachment: fixed !important; 
    width: 100%;
    margin-bottom: 40px;
    padding: 40px 0; 
    border-bottom: 4px solid #EEAE00;
}

.hero-content h1 { 
    font-size: 3em; 
    margin-bottom: 0.2em; 
    color: #0000FF; 
    line-height: 1.1; 
}

.hero-content h2 { 
    font-size: 1.8em; 
    font-weight: bold; 
    color: #0000FF; 
    margin-bottom: 30px; 
}

/* Внутренний текстовый блок-подложка */
.lead-text {
    max-width: 800px;
    margin: 20px auto 0;
    font-size: 1.4em;
    font-style: italic;
    color: #00008b;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.3); 
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    backdrop-filter: blur(3px);
}

.hero-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
}

/* =========================================================================
   4. ЖЕСТКАЯ МОБИЛЬНАЯ АДАПТАЦИЯ ХЕДЕРА И ГЛАВНОЙ СТРАНИЦЫ (ДО 600px)
   ========================================================================= */
@media (max-width: 600px) {
    /* Исправление универсального хедера с Крокодилом */
    .page-header {
        flex-direction: row !important; /* Удерживаем в одну строку */
        align-items: center !important;
        gap: 12px !important;
        padding: 10px !important;
    }
    
    .header-logo {
        width: 50px !important; /* Пропорционально уменьшаем крокодила на смартфонах */
        height: auto !important;
    }
    
    .page-header h1 {
        font-size: 1.25em !important; /* Защита от обрезки слога "ма" */
        line-height: 1.2 !important;
    }
    
    .page-header p {
        font-size: 0.85em !important;
    }

    /* Адаптация панорамного блока Лаборатории */
    .hero-section {
        min-height: 300px !important; /* Уменьшаем высоту на телефонах */
        padding: 20px 10px !important;
        background-attachment: scroll !important; /* Отключаем fixed, так как iOS-смартфоны его не поддерживают */
    }
    
    .hero-logo {
        width: 60px !important; /* Логотип внутри самого hero-блока */
        margin-bottom: 10px !important;
    }

    .hero-content h1 { font-size: 1.8em !important; }
    .hero-content h2 { font-size: 1.1em !important; margin-bottom: 15px !important; }
    .lead-text { font-size: 0.95em !important; padding: 10px 15px !important; margin-top: 10px !important; }
}

