﻿/* branches.css */
/* Базовые сбросы стилей для меню */
.main-menu * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.main-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-menu a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Контейнер меню */
.main-menu {
    font-size: 16px;
    position: relative;
}

/* Кнопка гамбургера - скрыта по умолчанию */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 1000;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #084272;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 1-й уровень меню - десктопная версия */
.main-menu > ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background-color: #084272;
}

.main-menu > ul > li {
    position: relative;
}

.main-menu > ul > li > a,
.main-menu > ul > li > .menu-item-parent {
    display: block;
    padding: 12px 20px;
    color: #fff;
    font-weight: bold;
    line-height: 25px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

/* 2-й уровень меню (выпадающее) */
.main-menu > ul > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #0a5aa0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.main-menu > ul > li > ul > li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.main-menu > ul > li > ul a {
    padding: 12px 20px;
    color: #f6f6f6;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

/* Показ выпадающего меню при ховере */
.main-menu > ul > li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Стили при ховере и фокусе */
.main-menu a:hover,
.main-menu a:focus,
.main-menu .menu-item-parent:hover,
.main-menu .menu-item-parent:focus {
    background-color: #0c6dc3;
    outline: none;
}

/* Стрелка для пунктов с подменю */
.menu-item-parent::after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 8px;
    display: inline-block;
}

/* Мобильная версия */
@media screen and (max-width: 768px) {
    /* Показываем кнопку гамбургера */
    .menu-toggle {
        display: flex;
    }

    /* Скрываем основное меню по умолчанию */
    .main-menu > ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #084272;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }

    /* Когда меню открыто */
    .main-menu > ul.active {
        display: flex;
    }

    /* Пункты меню в мобильной версии */
    .main-menu > ul > li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Выпадающие меню в мобильной версии */
    .main-menu > ul > li > ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: #0a5aa0;
        min-width: auto;
        padding-left: 20px;
    }

    .main-menu > ul > li > ul.active {
        display: block;
    }

    /* Стрелка для мобильной версии */
    .menu-item-parent::after {
        content: "►";
        float: right;
    }

    /* Анимация для кнопки гамбургера при открытии */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Улучшения для очень маленьких экранов */
@media screen and (max-width: 480px) {
    .main-menu > ul > li > a,
    .main-menu > ul > li > .menu-item-parent {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .main-menu > ul > li > ul a {
        padding: 12px 20px 12px 30px;
    }
}


/* Стили для шапки сайта */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: relative;
}

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

.header-logo {
    flex: 0 0 auto;
}

.logo-image {
    max-width: 250px;
    height: auto;
    display: block;
}

.header-contacts {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: "Calibri", sans-serif;
    color: #084272;
    text-align: center;
}

.contact-item {
    white-space: nowrap;
}

.contact-link {
    color: #084272;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #0c6dc3;
    text-decoration: underline;
}

.header-search {
    flex: 0 0 auto;
    min-width: 250px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #084272;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Адаптивность для планшетов */
@media screen and (max-width: 1024px) {
    .header-container {
        justify-content: center;
        gap: 30px;
    }
    
    .header-logo {
        order: 1;
        flex: 0 0 100%;
        text-align: center;
    }
    
    .header-contacts {
        order: 3;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .header-search {
        order: 2;
        min-width: 300px;
    }
}

/* Адаптивность для мобильных */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    
    .header-logo {
        order: 1;
    }
    
    .header-search {
        order: 2;
        width: 100%;
        max-width: 300px;
        min-width: unset;
    }
    
    .header-contacts {
        order: 4;
        flex-direction: column;
        display: none;
        width: 100%;
        background-color: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin-top: 10px;
    }
    
    .header-contacts.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .logo-image {
        max-width: 180px;
    }
}

/* Для очень маленьких экранов */
@media screen and (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo-image {
        max-width: 150px;
    }
    
    .contact-link {
        font-size: 1em;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input,
    .search-button {
        width: 100%;
    }
}