/* ========== HEADER MENU STYLES ========== */
.header-nav {
    position: relative;
}

/* Десктопное меню */
.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    color: #2c2c2c;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.nav-link:hover {
    color: #c83030;
}

.nav-item.active .nav-link {
    color: #c83030;
    font-weight: 600;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #c83030;
    border-radius: 1px;
}

.dropdown-icon {
    transition: transform 0.3s;
}

.nav-item.has-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Выпадающее меню */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 1000;
    padding: 8px 0;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-item {
    margin: 0;
}

.dropdown-link {
    display: block;
    padding: 12px 20px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
}

.dropdown-link:hover {
    background-color: #f5f5f5;
    color: #c83030;
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.menu-icon {
    display: block;
    width: 24px;
    height: 18px;
    position: relative;
}

.menu-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #2c2c2c;
    position: absolute;
    left: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-line:nth-child(1) {
    top: 0;
}

.menu-line:nth-child(2) {
    top: 8px;
}

.menu-line:nth-child(3) {
    top: 16px;
}

.mobile-menu-toggle.active .menu-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Оверлей мобильного меню */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Само мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #2c2c2c;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 16px;
}

.mobile-nav-link:hover,
.mobile-nav-item.active .mobile-nav-link {
    color: #c83030;
}

.mobile-dropdown-toggle {
    transition: transform 0.3s;
}

.mobile-nav-item.active .mobile-dropdown-toggle {
    transform: rotate(180deg);
}

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.mobile-nav-item.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu-item {
    border-top: 1px solid #f0f0f0;
}

.mobile-submenu-link {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.mobile-submenu-link:hover,
.mobile-submenu-link.active {
    color: #c83030;
    background: #f5f5f5;
}

/* Адаптивность */
@media (max-width: 992px) {
    .nav-list {
        gap: 16px;
    }

    .nav-link {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}