/* Header and Footer Styles - SOVBau */

/* CSS Variables */
:root {
    --primary-color: #4673AF;
    --primary-dark: #345a8d;
    --primary-light: #5a85c7;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-dark: #2c3e50;
    --text-medium: #555555;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Styles */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--bg-light);
    padding: 10px 0;
    font-size: 14px;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
}

.icon {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-link {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.lang-link:hover,
.lang-link.active {
    background: var(--primary-color);
    color: white;
}

/* Navigation */
.header-main {
    padding: 20px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    height: auto;
    line-height: 1.5;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-white);
    min-width: 250px;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    padding: 10px 0;
    
    /* Многоколоночная структура */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* Для сервисного меню с большим количеством элементов - используем 2 колонки */
.nav-dropdown .dropdown-content {
    grid-template-columns: repeat(2, 1fr);
    min-width: 420px;
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    border-radius: 4px;
    margin: 2px 10px;
}

.dropdown-content a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 50px 0 20px;
}

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

.footer-column h3 {
    margin-bottom: 20px;
}

.footer-column p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

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

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: white;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-info svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary-color);
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Floating Contact Buttons */
.floating-contacts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    animation: bounceIn 0.8s ease;
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.floating-btn.phone {
    background: var(--primary-color);
    color: white;
}

.floating-btn.whatsapp {
    background: #25d366;
    color: white;
}

.floating-btn.telegram {
    background: #0088cc;
    color: white;
}

.floating-btn svg {
    width: 24px;
    height: 24px;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
/* Планшеты */
@media (max-width: 1024px) and (min-width: 769px) {
    .dropdown-content {
        min-width: 350px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-menu {
        gap: 20px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .header-top-content {
        flex-direction: column;
        gap: 10px;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .navbar {
        position: relative;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        height: 100vh;
        padding: 80px 20px 20px;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
        z-index: 999;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
        justify-content: space-between;
        width: 100%;
    }

    /* Специальные стили для пункта с выпадающим списком */
    .nav-dropdown {
        width: 100%;
        display: block;
    }

    .nav-dropdown .nav-link {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Скрываем выпадающий контент по умолчанию в мобильной версии */
    .dropdown-content {
        display: none;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        grid-template-columns: 1fr;
        min-width: auto;
        max-width: none;
        margin: 0;
        border-radius: 0;
        background: transparent;
    }

    /* Показываем выпадающий контент при клике/наведении */
    .nav-dropdown:hover .dropdown-content,
    .nav-dropdown.active .dropdown-content {
        display: block;
        background: var(--bg-light);
        border-radius: 0;
        margin-top: 10px;
        padding: 10px 0;
    }

    /* Анимация стрелочки в мобильной версии */
    .nav-dropdown.active .dropdown-icon {
        transform: rotate(180deg);
    }

    .dropdown-content a {
        margin: 0;
        padding: 10px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        display: block;
        color: var(--text-secondary);
        font-size: 14px;
    }

    .dropdown-content a:hover {
        background: var(--primary-color);
        color: white;
    }

    .dropdown-content a:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}