/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ВЕРХНЯЯ ПАНЕЛЬ ===== */
.top-bar {
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-bar-left {
    display: flex;
    gap: 2rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.top-bar-item:hover {
    opacity: 0.9;
}

.top-bar-item i {
    font-size: 0.9rem;
}

.social-mini {
    display: flex;
    gap: 0.8rem;
}

.social-mini-link {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.social-mini-link:hover {
    background: white;
    color: #3b82f6;
    transform: translateY(-2px);
}

/* ===== ГЛАВНАЯ НАВИГАЦИЯ ===== */
.main-nav {
    background: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 1rem;
} 

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Логотип */
.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-icon {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 5px;
}

.logo-pulse {
    position: absolute;
    top: -5px;
    left: -20px;
    right: -20px;
    bottom: -5px;
    border-radius: 15px;
    border: 2px solid #3b82f6;
    animation: pulse 2s infinite;
    opacity: 0.7;
}

.logo-text {
    display: flex;
    margin-left: 50px;
    flex-direction: column;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fafafa;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.8rem;
    color: #fafafa;
    font-weight: 500;
}

/* Основное меню */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.nav-link.active {
    background: #3b82f6;
    color: white;
}

.nav-link i {
    font-size: 1rem;
}

.link-underline {
    display: none;
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ (УСЛУГИ) ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 10px;
    padding: 12px 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
    border: 1px solid #e2e8f0;
}

/* Для десктопов (больше 768px) - hover эффект */
@media screen and (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .dropdown:hover > .nav-link {
        background: rgba(59, 130, 246, 0.1);
        color: #1d4ed8;
    }
    
    .dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }
}

/* Открытое состояние dropdown (по клику для мобильных) */
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown.active > .nav-link {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

/* Стрелка для dropdown */
.dropdown-arrow {
    margin-left: 5px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Пункты выпадающего меню */
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: #f1f5f9;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    padding-left: 24px;
}

.dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: #64748b;
}

.dropdown-menu a:hover i {
    color: #3b82f6;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (768px и меньше) ===== */
@media screen and (max-width: 768px) {
    /* Отключаем hover на мобильных */
    .dropdown:hover .dropdown-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
    }
    
    .dropdown:hover > .nav-link {
        background: transparent !important;
        color: inherit !important;
    }
    
    .dropdown:hover .dropdown-arrow {
        transform: rotate(0deg) !important;
    }
    
    /* Мобильный dropdown */
    .dropdown-menu {
        position: static !important;
        background: #f8fafc;
        border: none;
        box-shadow: none;
        margin: 5px 0 10px 15px;
        padding: 0;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        width: calc(100% - 30px);
        border-radius: 6px;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 400px;
        padding: 8px 0;
    }
    
    .dropdown-menu a {
        padding: 10px 16px;
        margin: 2px 0;
        border-radius: 4px;
        border-left: none;
    }
    
    .dropdown-menu a:hover {
        padding-left: 16px;
    }
    
    .dropdown-arrow {
        margin-left: auto;
        transform: rotate(0deg);
    }
    
    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
}

/* Подсветка активного dropdown */
.dropdown.active > .nav-link {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

/* Пункты выпадающего меню */
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #dbdfe6;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: #f1f5f9;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    padding-left: 24px;
}

.dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: #64748b;
}

.dropdown-menu a:hover i {
    color: #3b82f6;
}

/* Кнопки действий */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-action-btn.phone-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.nav-action-btn.consult-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.nav-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ===== ДОПОЛНИТЕЛЬНАЯ ПАНЕЛЬ ===== */
.nav-extra {

    padding: 0.8rem 0;
    border-top: 1px solid #e2e8f0;
    color: #fafafa;
}

.nav-extra-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.nav-extra-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #ffffff;
    font-size: 0.9rem;
}

.nav-extra-item i {
    color: #3b82f6;
    font-size: 1rem;
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
    z-index: 1002;
}

.menu-line {
    display: block;
    width: 100%;
    height: 3px;
    background: #1e293b;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.menu-line:nth-child(1) { top: 0; }
.menu-line:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-line:nth-child(3) { bottom: 0; }

.menu-toggle.active .menu-line:nth-child(1) {
    top: 30%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-line:nth-child(3) {
    bottom: 3%;
    transform: translateY(50%) rotate(-45deg);
}

/* ===== ФУТЕР ===== */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    margin: 0.5rem 0;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section i {
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== АНИМАЦИИ ===== */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown.active .dropdown-menu {
    animation: fadeInDown 0.3s ease;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 30px;
    position: relative;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.theme-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffd700;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.theme-icon.moon {
    color: #a0c8ff;
}

.theme-toggle-slider {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffd700, #ff9500);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Темная тема активна */
body.dark-theme .theme-toggle-slider {
    left: calc(100% - 26px);
    background: linear-gradient(135deg, #a0c8ff, #4a6fff);
}

body.dark-theme .theme-icon.sun {
    opacity: 0.5;
}

body:not(.dark-theme) .theme-icon.moon {
    opacity: 0.5;
}

/* ===== CSS ПЕРЕМЕННЫЕ ДЛЯ ТЕМ ===== */
:root {
    /* Светлая тема по умолчанию */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --accent-primary: #0d6efd;
    --accent-secondary: #6610f2;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --topbar-bg: #f8f9fa;
    --card-bg: #ffffff;
}

/* Светлая тема */
body.light-theme {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body.light-theme .top-bar {
    background: var(--topbar-bg);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .top-bar-item {
    color: var(--text-secondary);
}

body.light-theme .main-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .nav-link {
    color: var(--text-primary);
}

body.light-theme .nav-link:hover {
    color: var(--accent-primary);
    background: rgba(13, 110, 253, 0.05);
}

body.light-theme .dropdown-menu {
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px var(--shadow-color);
}

body.light-theme .dropdown-menu a {
    color: var(--text-primary);
}

body.light-theme .dropdown-menu a:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--accent-primary);
}

body.light-theme .dropdown.active > .nav-link {
    background: rgba(13, 110, 253, 0.1);
    color: var(--accent-primary);
}

body.light-theme .nav-action-btn.phone-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

body.light-theme .nav-action-btn.consult-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

body.light-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

/* Темная тема */
body.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --border-color: #475569;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.95);
    --topbar-bg: #1e293b;
    --card-bg: #1e293b;
}

body.dark-theme {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-theme .main-nav {
    background: var(--nav-bg);
}

body.dark-theme .top-bar {
    background: var(--topbar-bg);
    color: var(--text-secondary);
}

body.dark-theme .nav-link {
    color: var(--text-primary);
}

body.dark-theme .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

body.dark-theme .dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Для мобильных устройств (1000px и меньше) */
@media screen and (max-width: 1000px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 5rem 1.5rem 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        gap: 1rem;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        justify-content: flex-start;
        padding: 0.8rem 1rem;
    }
    
    /* Мобильный dropdown */
    .dropdown-menu {
        position: static !important;
        background: #f8fafc;
        border: none;
        box-shadow: none;
        margin: 5px 0 10px 15px;
        padding: 0;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        width: calc(100% - 30px);
        border-radius: 6px;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 400px;
        padding: 8px 0;
    }
    
    .dropdown-menu a {
        padding: 10px 16px;
        margin: 2px 0;
        border-radius: 4px;
        border-left: none;
    }
    
    .dropdown-menu a:hover {
        padding-left: 16px;
    }
    
    .dropdown-arrow {
        margin-left: auto;
        transform: rotate(0deg);
    }
    
    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }
    
    .nav-action-btn {
        justify-content: center;
        width: 100%;
    }
    
    .theme-toggle {
        width: 45px;
        height: 28px;
        margin-left: 0;
    }
    
    /* Скрываем лишние элементы на мобильных */
    .top-bar {
        display: none;
    }
    
    .nav-extra {
        display: none;
    }
}

/* Для экранов 769px - 1100px (планшеты) */
@media screen and (min-width: 769px) and (max-width: 1100px) {
    .nav-links {
        gap: 0.3rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .dropdown-menu {
        min-width: 220px;
    }
    
    /* Скрываем верхнюю панель на планшетах */
    .top-bar {
        display: none;
    }
    
    .nav-extra {
        display: none;
    }
}

/* Для мобильных телефонов (480px и меньше) */
@media screen and (max-width: 480px) {
    .logo-title {
        font-size: 1.2rem;
    }
    
    .logo-subtitle {
        font-size: 0.7rem;
    }
    
    .nav-menu {
        width: 100%;
        padding: 5rem 1rem 2rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 26px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section p {
        justify-content: center;
    }
}

/* Для очень маленьких телефонов (360px и меньше) */
@media screen and (max-width: 360px) {
    .logo-title {
        font-size: 0.9rem;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* Поддержка темной темы в мобильном меню */
@media screen and (max-width: 1000px) {
    body.light-theme .nav-menu {
        background: white;
    }
    
    body.light-theme .dropdown-menu {
        background: #f8fafc;
    }
    
    body.dark-theme .nav-menu {
        background: #1e293b;
    }
    
    body.dark-theme .dropdown-menu {
        background: #334155;
    }
    
    body.dark-theme .menu-line {
        background: #f1f5f9;
    }
}

/* Анимация для мобильного меню */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-menu.active .nav-item {
    animation: slideInRight 0.4s ease forwards;
}

.nav-menu.active .nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-menu.active .nav-item:nth-child(2) { animation-delay: 0.15s; }
.nav-menu.active .nav-item:nth-child(3) { animation-delay: 0.2s; }
.nav-menu.active .nav-item:nth-child(4) { animation-delay: 0.25s; }
.nav-menu.active .nav-item:nth-child(5) { animation-delay: 0.3s; }
.nav-menu.active .nav-actions { animation-delay: 0.35s; }

/* Плавный скролл */
@media screen and (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Улучшение доступности для сенсорных устройств */
@media (hover: none) and (pointer: coarse) {
    .nav-link, 
    .nav-action-btn,
    .social-mini-link {
        min-height: 44px;
    }
    
    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}