/* public/css/style.css - v2.1 (Full Mobile Adaptation) */

/* --- Глобальные переменные --- */
:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #eef2f6;
    --accent: #ff7675;
    
    --glass-bg: rgba(255, 255, 255, 0.95); /* Чуть плотнее для читаемости */
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --shadow-soft: 0 10px 40px rgba(52, 152, 219, 0.15);
    --shadow-hover: 0 15px 50px rgba(52, 152, 219, 0.25);
    
    --font-main: 'Montserrat', sans-serif;
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    line-height: 1.7;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Скроллбар */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #b2bec3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- 1. Top Bar (Верхняя полоска) --- */
.top-bar {
    background: #fff;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 101;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.contact-info a { color: var(--primary); font-weight: 600; margin-right: 15px; }
.contact-info span { color: var(--text-light); }

.lang-switcher a { 
    margin-left: 5px; opacity: 0.6; font-weight: 700; font-size: 12px;
    padding: 4px 8px; border-radius: 4px; text-transform: uppercase;
}
.lang-switcher a.active, .lang-switcher a:hover { 
    opacity: 1; background: var(--primary); color: white; 
}

/* --- 2. Header --- */
.site-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    height: 80px;
    display: flex; align-items: center;
    position: sticky; top: 0; z-index: 1000;
    transition: all 0.4s ease;
    width: 100%;
}

.site-header.scrolled {
    height: 65px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.header-container { 
    display: flex; justify-content: space-between; align-items: center; 
    width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; 
}

.logo { 
    font-size: 24px; font-weight: 800; letter-spacing: -0.5px; 
    color: var(--text-main); display: flex; align-items: center; text-transform: uppercase;
}
.logo span { color: var(--primary); }
.logo img { height: 40px; transition: 0.3s; margin-right: 10px; }

/* --- 3. Menu (Desktop) --- */
.main-nav > ul { display: flex; gap: 30px; align-items: center; }
.main-nav > ul > li > a {
    font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 10px 0; display: block; position: relative; color: var(--text-main);
}
.main-nav > ul > li > a::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); 
    width: 0; height: 2px; background: var(--primary); transition: 0.3s;
}
.main-nav > ul > li:hover > a::after { width: 100%; }
.main-nav > ul > li:hover > a { color: var(--primary); }

/* Выпадающее меню (Desktop) */
.has-submenu { position: relative; }
.submenu {
    position: absolute;
    top: 100%; left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0; visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: block;
}
.has-submenu:hover .submenu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.submenu li a {
    display: block; padding: 10px 20px;
    font-size: 14px; color: #333;
    white-space: nowrap; text-transform: none; font-weight: 500;
}
.submenu li a:hover {
    background: #f8f9fa; color: var(--primary); padding-left: 25px;
}
.arrow { font-size: 10px; margin-left: 5px; opacity: 0.5; }

/* --- 4. Buttons --- */
.btn {
    padding: 12px 30px; border-radius: 50px; font-weight: 700; text-transform: uppercase; font-size: 12px;
    letter-spacing: 1px; display: inline-block; cursor: pointer; transition: all 0.3s; border: none;
    position: relative; overflow: hidden; z-index: 1; text-align: center;
}
.btn-primary {
    background: linear-gradient(45deg, var(--primary), #5dade2); color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px); box-shadow: 0 8px 25px rgba(52, 152, 219, 0.6);
}
.btn-sm { padding: 8px 20px; font-size: 11px; }

/* --- 5. Контент --- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.page-content { padding: 80px 0; position: relative; z-index: 10; flex: 1; }

h1, h2, h3 { color: var(--text-main); margin-top: 0; font-weight: 800; }
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 50px; position: relative; }
h2::after {
    content: ''; display: block; width: 60px; height: 4px; background: var(--primary);
    margin: 15px auto 0; border-radius: 2px;
}

/* Сетки */
.services-grid, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px;
}

/* Карточки */
.service-card, .news-card {
    display: flex; flex-direction: column; height: 100%;
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: 0.3s;
}
.service-card:hover, .news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.service-img-thumb, .news-thumb {
    width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid #eee;
}
.service-body, .news-body {
    padding: 20px; flex-grow: 1; display: flex; flex-direction: column;
}
.service-title a, .news-title a { color: var(--text-main); transition: 0.2s; font-weight: 700; font-size: 1.1rem; }
.service-title a:hover, .news-title a:hover { color: var(--primary); }
.service-desc { font-size: 14px; color: #666; margin: 10px 0 20px; flex-grow: 1; }
.service-price { margin-top: auto; color: var(--primary); font-weight: 800; font-size: 1.2rem; }
.news-date { font-size: 12px; color: #999; margin-bottom: 5px; display: block; }

/* Hero */
.hero-wrapper { height: 80vh; position: relative; overflow: hidden; background: #333; }
.hero-slide {
    height: 100%; width: 100%; position: absolute; top: 0; left: 0;
    background-size: cover; background-position: center; 
    display: flex; align-items: center; justify-content: center; text-align: center;
    opacity: 0; transition: opacity 1s ease-in-out;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
}
.hero-content { position: relative; z-index: 5; color: white; max-width: 800px; padding: 20px; }
.hero-title { font-size: 3.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.5); margin-bottom: 20px; color: white; line-height: 1.1; }
.hero-text { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; }

/* --- Footer --- */
.site-footer {
    background: #1a252f; color: #bdc3c7; padding: 60px 0 20px; margin-top: auto;
}
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer-links a { display: block; margin-bottom: 10px; font-size: 14px; opacity: 0.8; }
.footer-links a:hover { color: var(--primary); opacity: 1; padding-left: 5px; }
.copyright { border-top: 1px solid rgba(255,255,255,0.05); margin-top: 40px; padding-top: 20px; text-align: center; font-size: 12px; opacity: 0.5; }

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (RESPONSIVE)
   ========================================= */

/* Кнопка меню (бургер) */
.mobile-menu-btn { 
    display: none; background: none; border: none; 
    font-size: 28px; cursor: pointer; color: var(--text-main); 
    padding: 0; margin-left: auto; z-index: 1001;
}

@media (max-width: 992px) {
    /* Скрываем верхнюю полоску, чтобы сэкономить место */
    .top-bar { display: none; }
    
    /* Хедер */
    .site-header { height: 70px; padding: 0; }
    .header-container { padding: 0 15px; }
    
    /* Логотип */
    .logo { font-size: 20px; }
    .logo img { height: 32px; }

    /* Показываем бургер */
    .mobile-menu-btn { display: block; }

    /* Скрываем кнопку действия в хедере на мобильном, или переносим в меню */
    .header-actions { display: none; }

    /* --- МОБИЛЬНОЕ МЕНЮ --- */
    .main-nav {
        position: fixed;
        top: 70px; /* Высота хедера */
        left: 0;
        width: 100%;
        background: white;
        padding: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        
        /* Анимация появления */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .main-nav > ul {
        flex-direction: column;
        align-items: stretch; /* Растянуть на всю ширину */
        gap: 0;
    }

    .main-nav > ul > li {
        border-bottom: 1px solid #f5f5f5;
        width: 100%;
    }

    .main-nav > ul > li > a {
        padding: 15px 20px;
        font-size: 15px;
        color: #333;
    }
    
    .main-nav > ul > li > a::after { display: none; /* Убираем подчеркивание */ }
    .main-nav > ul > li:hover > a { background: #f9f9f9; color: var(--primary); }

    /* Мобильные подпункты */
    .has-submenu .submenu {
        position: static; /* Статичное позиционирование */
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: block;
        width: 100%;
        padding: 0;
        background: #fdfdfd;
        border-top: 1px solid #eee;
    }

    .submenu li a {
        padding: 12px 20px 12px 40px; /* Большой отступ слева */
        font-size: 14px;
        color: #666;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .arrow { float: right; transform: rotate(90deg); margin-right: 10px; }
}

@media (max-width: 768px) {
    /* Hero */
    .hero-wrapper { height: 60vh; min-height: 400px; }
    .hero-title { font-size: 2rem; }
    .hero-text { font-size: 1rem; }
    .btn { padding: 10px 25px; width: 100%; max-width: 300px; box-sizing: border-box; }

    /* Сетки в одну колонку */
    .services-grid, .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container { padding: 0 15px; }
    
    h2 { font-size: 1.8rem; margin-bottom: 30px; }
    .page-content { padding: 40px 0; }
    
    /* Футер */
    .site-footer { padding: 40px 0 20px; text-align: center; }
    .footer-col { margin-bottom: 30px; }
}

/* --- FIX: Блокировка горизонтального скролла --- */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

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

/* На случай, если проблема в контейнере */
.container, .header-container {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}