/* =====================================================
   RESET И БАЗОВЫЕ СТИЛИ
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0879C9;
    --primary-dark: #065a9e;
    --secondary: #1D334C;
    --gray-light: #f5f5f5;
    --gray: #848484;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #fff;
}

/* =====================================================
   ОБЁРТКА ДЛЯ ПРИЖАТИЯ ФУТЕРА + ФОН right2.png
   ===================================================== */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.site-wrapper::before {
    content: "";
    position: fixed;
    bottom: 100px;
    right: 0;
    width: 280px;
    height: 280px;
    background: url("/right2.png") no-repeat bottom right;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

@media (max-width: 768px) {
    .site-wrapper::before {
        width: 140px;
        height: 140px;
        bottom: 70px;
        opacity: 0.2;
    }
}

.header,
.menu,
.main,
.menu-bottom,
.footer {
    position: relative;
    z-index: 1;
}

.main {
    flex: 1;
}

/* =====================================================
   КОНТЕЙНЕР
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =====================================================
   ШАПКА (HEADER)
   ===================================================== */
.header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 0;
    border-bottom: 3px solid var(--primary);
    background-image: url('/back1.png');
    background-repeat: repeat-x;
    background-position: top center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    flex-shrink: 0;
}

.logo-img {
    max-width: 200px;
    height: auto;
    display: block;
}

/* Текст вместо logo2.png */
.header-center {
    text-align: center;
    flex: 1;
}

.company-name {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-weight: bold;
    font-size: 35px;
    color: var(--primary);
    letter-spacing: -1px;
    margin-bottom: -10px;
    white-space: nowrap;
}

.company-slogan {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-weight: normal;
    font-size: 20px;
    color: var(--gray);
    letter-spacing: -1px;
    margin-bottom: 0;
    white-space: nowrap;
}

.company-services {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-weight: normal;
    font-size: 14px;
    color: var(--gray);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.header-contacts {
    text-align: right;
    flex-shrink: 0;
}

.phone-label {
    font-weight: bold;
    color: var(--gray);
    font-size: 12px;
    text-transform: uppercase;
}

.phone-number {
    font-weight: bold;
    font-size: 28px;
    line-height: 1.2;
    margin: 5px 0;
    white-space: nowrap;
}

.phone-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.phone-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.address {
    color: var(--gray);
    font-size: 12px;
    white-space: nowrap;
}

/* =====================================================
   АДАПТИВНОСТЬ ШАПКИ
   ===================================================== */

/* Планшеты и узкие экраны (до 1100px) — уменьшаем шрифты */
@media (max-width: 1100px) {
    .company-name {
        font-size: 28px;
        letter-spacing: -0.8px;
        margin-bottom: -8px;
    }
    
    .company-slogan {
        font-size: 16px;
        letter-spacing: -0.8px;
    }
    
    .company-services {
        font-size: 11px;
        letter-spacing: -0.3px;
    }
    
    .phone-number {
        font-size: 22px;
    }
    
    .logo-img {
        max-width: 160px;
    }
}

/* Средние экраны (до 900px) — всё в колонку */
@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-center {
        order: 2;
    }
    
    .header-contacts {
        order: 3;
        text-align: center;
    }
    
    .logo {
        order: 1;
    }
    
    .company-name,
    .company-slogan,
    .company-services,
    .phone-number,
    .address {
        white-space: normal;
    }
    
    .company-name {
        font-size: 28px;
        margin-bottom: 5px;
    }
    
    .company-slogan {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .company-services {
        font-size: 12px;
    }
    
    .phone-number {
        font-size: 24px;
    }
}

/* Мобильные (до 600px) */
@media (max-width: 600px) {
    .header {
        padding: 15px 0;
    }
    
    .logo-img {
        max-width: 140px;
    }
    
    .company-name {
        font-size: 22px;
        letter-spacing: -0.5px;
    }
    
    .company-slogan {
        font-size: 13px;
        letter-spacing: -0.5px;
    }
    
    .company-services {
        font-size: 10px;
    }
    
    .phone-number {
        font-size: 20px;
    }
    
    .phone-label {
        font-size: 10px;
    }
    
    .address {
        font-size: 10px;
    }
}

/* Очень маленькие телефоны (до 400px) */
@media (max-width: 400px) {
    .company-name {
        font-size: 18px;
    }
    
    .company-slogan {
        font-size: 11px;
    }
    
    .company-services {
        font-size: 9px;
    }
    
    .phone-number {
        font-size: 18px;
    }
}

/* =====================================================
   ПОЛОСА (polosa.png)
   ===================================================== */
.polosa {
    background-image: url('/polosa.png');
    background-repeat: repeat-x;
    background-position: top left;
    height: 120px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .polosa {
        height: 60px;
        background-size: auto 60px;
    }
}

.polosa img {
    max-height: 100%;
    width: auto;
}

/* =====================================================
   ВЕРХНЕЕ МЕНЮ
   ===================================================== */
.menu {
    background: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
    width: 100%;
}

.menu-toggle:hover {
    background: var(--primary);
}

.menu-list {
    display: flex;
    list-style: none;
    justify-content: space-around;
    transition: all 0.3s ease;
}

.menu-item {
    flex: 1;
    text-align: center;
}

.menu-link {
    display: block;
    padding: 15px 10px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    transition: background 0.3s;
}

.menu-link:hover,
.menu-item.active .menu-link {
    background: var(--primary);
}

/* =====================================================
   НИЖНЕЕ МЕНЮ
   ===================================================== */
.menu-bottom {
    background: var(--gray-light);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.menu-bottom-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 20px;
    padding: 10px 0;
}

.menu-bottom-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    transition: color 0.3s;
}

.menu-bottom-link:hover,
.menu-bottom-item.active .menu-bottom-link {
    color: var(--primary);
}

/* =====================================================
   ОСНОВНОЙ КОНТЕНТ (2 КОЛОНКИ)
   ===================================================== */
.content-wrapper {
    display: flex;
    gap: 30px;
    padding: 40px 0;
}

/* =====================================================
   ЛЕВАЯ КОЛОНКА (САЙДБАР С ГАЛЕРЕЕЙ)
   ===================================================== */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-placeholder {
    background: var(--gray-light);
    height: 300px;
    border-radius: 8px;
}

/* =====================================================
   ПРАВАЯ КОЛОНКА (КОНТЕНТ)
   ===================================================== */
.content {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 24px;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* =====================================================
   ОБЫЧНЫЙ КОНТЕНТ СТРАНИЦ
   ===================================================== */
.page-content {
    line-height: 1.6;
    font-size: 14px;
    color: #333;
}

.page-content h2,
.page-content h3 {
    color: var(--secondary);
    margin: 20px 0 10px;
}

.page-content p {
    margin-bottom: 15px;
}

.page-content a {
    color: var(--primary);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content ul,
.page-content ol {
    margin: 10px 0 15px 25px;
}

.page-content li {
    margin-bottom: 5px;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.page-content th,
.page-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.page-content th {
    background: var(--gray-light);
    font-weight: bold;
}

.page-content img {
    max-width: 100%;
    height: auto;
}

/* =====================================================
   БЛОК НОВОСТЕЙ НА ГЛАВНОЙ
   ===================================================== */
.main-content {
    margin-bottom: 30px;
}

.main-content p {
    margin-bottom: 15px;
}

.main-content a {
    color: var(--primary);
    text-decoration: none;
}

.main-content a:hover {
    text-decoration: underline;
}

.news-block {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.news-block-title {
    font-size: 22px;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.news-all-link {
    text-align: right;
    margin-top: 20px;
}

.btn-all-news {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-all-news:hover {
    background: var(--primary-dark);
}

/* =====================================================
   ЭЛЕМЕНТЫ НОВОСТЕЙ
   ===================================================== */
.news-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.news-item:last-child {
    border-bottom: none;
}

.news-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.news-date {
    color: var(--gray);
    font-size: 12px;
}

.news-date-large {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 20px;
}

.news-title {
    font-weight: bold;
    color: var(--secondary);
    text-decoration: none;
    font-size: 16px;
    text-transform: uppercase;
}

.news-title:hover {
    color: var(--primary);
    text-decoration: underline;
}

.news-preview {
    color: #666;
    line-height: 1.5;
}

.news-content-full {
    line-height: 1.6;
}

.news-content-full a {
    color: var(--primary);
    text-decoration: none;
}

.news-content-full a:hover {
    text-decoration: underline;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
}

.read-more:hover {
    text-decoration: underline;
}

.news-back {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-back {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.btn-back:hover {
    text-decoration: underline;
}

/* =====================================================
   ПАГИНАЦИЯ
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link,
.page-current,
.page-dots {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--secondary);
    border-radius: 4px;
    transition: all 0.3s;
}

.page-link {
    background: white;
    cursor: pointer;
}

.page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-dots {
    border: none;
    background: none;
}

/* =====================================================
   АДАПТИВНЫЕ ТАБЛИЦЫ
   ===================================================== */
div[style*="overflow-x: auto"] {
    width: 100%;
    margin: 20px 0;
}

/* =====================================================
   ФУТЕР
   ===================================================== */
.footer {
    background: var(--secondary);
    padding: 20px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copyright,
.footer-counters {
    color: white;
    font-size: 12px;
}

/* =====================================================
   АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА)
   ===================================================== */
@media (max-width: 992px) {
    .header-inner {
        justify-content: center;
        text-align: center;
    }
    
    .header-contacts {
        text-align: center;
    }
    
    .phone-number {
        font-size: 24px;
    }
    
    .company-name {
        font-size: 26px;
        letter-spacing: -0.75px;
        margin-bottom: -8px;
    }
    
    .company-slogan {
        font-size: 15px;
        letter-spacing: -0.75px;
    }
    
    .company-services {
        font-size: 10.5px;
        letter-spacing: -0.38px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .gallery {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .menu-list {
        display: none;
        flex-direction: column;
    }
    
    .menu-list.open {
        display: flex;
    }
    
    .menu-item {
        text-align: left;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .menu-bottom-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .news-block-title {
        font-size: 18px;
    }
    
    .news-title {
        font-size: 14px;
    }
    
    .company-name {
        font-size: 17.5px;
        letter-spacing: -0.5px;
        margin-bottom: -5px;
    }
    
    .company-slogan {
        font-size: 10px;
        letter-spacing: -0.5px;
    }
    
    .company-services {
        font-size: 7px;
        letter-spacing: -0.25px;
    }
}

@media (max-width: 480px) {
    .phone-number {
        font-size: 20px;
    }
    
    .logo-img {
        max-width: 150px;
    }
}