/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 16px;
    overflow-x: hidden;
}

/* ЕДИНЫЙ КОНТЕЙНЕР ДЛЯ ВСЕХ СТРАНИЦ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Обновленные стили для header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: #2c3e50;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 2px solid #34495e;
    position: relative;
}

.header-top .container {
    max-width: 1200px;
    position: relative;
}

.header-bottom {
    background-color: #34495e;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-bottom .container {
    max-width: 1200px;
    padding: 0;
}

.header-top .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-align: center;
}

.header-top .logo img {
    margin-right: 15px;
    max-width: 60px;
    height: auto;
}

/* Навигация для десктопа */
.header-bottom nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.header-bottom nav ul li {
    margin: 0;
}

.header-bottom nav ul li a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    display: block;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
}

.header-bottom nav ul li a:hover,
.header-bottom nav ul li a.active {
    background-color: #3498db;
    color: white;
    border-bottom-color: #2980b9;
}

/* Мобильное меню - СКРЫТО ПО УМОЛЧАНИЮ */
.mobile-menu-toggle {
    display: none; /* Важно: скрыто по умолчанию */
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* Базовые стили для секций */
section {
    margin-bottom: 2rem;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    line-height: 1.3;
}

h1 {
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1rem;
}

/* Кнопки */
.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    font-weight: 500;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Подвал */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

footer .container {
    max-width: 1200px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #34495e;
    border-radius: 3px;
    transition: background-color 0.3s;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

.social-link:hover {
    background-color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* ============================ */
/* МЕДИА-ЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ */
/* ============================ */

/* Планшеты и маленькие ноутбуки */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 15px;
    }
    
    .header-top .logo {
        font-size: 1.3rem;
    }
    
    .header-top .logo img {
        max-width: 50px;
    }
}

/* Планшеты в портретной ориентации и телефоны */
@media screen and (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .header-top .logo {
        font-size: 1.1rem;
        flex-direction: row;
        text-align: left;
        padding-right: 60px;
        justify-content: flex-start;
    }
    
    .header-top .logo img {
        margin-right: 10px;
        margin-bottom: 0;
        max-width: 40px;
    }
    
    .header-top .logo span {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    /* ПОКАЗЫВАЕМ кнопку меню ТОЛЬКО на мобильных */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .header-bottom {
        position: static;
    }
    
    /* Скрываем навигацию по умолчанию на мобильных */
    .header-bottom nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(52, 73, 94, 0.98);
        z-index: 999;
        padding: 2rem;
        overflow-y: auto;
    }
    
    /* Показываем навигацию когда активна */
    .header-bottom nav.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-bottom nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 300px;
    }
    
    .header-bottom nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .header-bottom nav ul li:last-child {
        border-bottom: none;
    }
    
    .header-bottom nav ul li a {
        display: block;
        padding: 1.2rem 1rem;
        width: 100%;
        font-size: 1.1rem;
        text-align: center;
        border-radius: 5px;
        margin: 0.2rem 0;
        border-bottom: none;
    }
    
    .header-bottom nav ul li a:hover,
    .header-bottom nav ul li a.active {
        background-color: #3498db;
        transform: none;
    }
    
    .header-top {
        padding: 0.8rem 0;
    }
    
    /* Уменьшаем отступы для мобильных */
    main {
        padding: 1rem 0;
    }
    
    section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Маленькие телефоны */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .header-top .logo {
        font-size: 1rem;
        padding-right: 50px;
    }
    
    .header-top .logo span {
        font-size: 0.8rem;
    }
    
    .mobile-menu-toggle {
        right: 10px;
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .header-bottom nav ul li a {
        padding: 1rem 0.8rem;
        font-size: 1rem;
    }
    
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .social-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    footer {
        padding: 1.5rem 0 1rem;
        margin-top: 2rem;
    }
}

/* Очень маленькие телефоны */
@media screen and (max-width: 360px) {
    .header-top .logo {
        font-size: 0.9rem;
    }
    
    .header-top .logo span {
        font-size: 0.75rem;
    }
    
    .mobile-menu-toggle {
        right: 8px;
        width: 36px;
        height: 36px;
    }
}

/* ============================ */
/* ДЕСКТОП - меню всегда видно */
/* ============================ */

/* Для десктопа - убедимся, что обычное меню видно */
@media screen and (min-width: 769px) {
    .header-bottom nav {
        display: block !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn, .header-bottom nav ul li a, .social-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Предотвращение масштабирования при двойном тапе на iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Улучшение читаемости на мобильных */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    p, li {
        text-rendering: optimizeLegibility;
        font-size: 0.95rem;
    }
    
    section {
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
}

/* Исправление проблем с viewport на iOS */
@viewport {
    width: device-width;
    zoom: 1.0;
}

@-ms-viewport {
    width: device-width;
}

/* Гарантия, что на десктопе кнопка меню скрыта */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}
