.nav-dropdown .mega-menu.active {
    opacity: 1;
    visibility: visible;

}

/* Стили для главной категории */
.main-category-section {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

.main-category-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.main-category-title a {
    color: #F56200;
}

.main-category-title a:hover {
    color: #2E1500;
    text-decoration: underline;
}

/* Разделительная линия */
.mega-menu-divider {
    grid-column: 1 / -1;
    height: 2px;
    background: #e5e7eb;
    margin: 1rem 0 2rem 0;
    position: relative;
}

.mega-menu-divider::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 4px;
    background: #F56200;
    border-radius: 2px;
}

.mega-menu-content .mega-menu-section:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 10%;
    height: 80%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e5e7eb, transparent);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    position: relative;
    color: #374151;
    transition: color 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.nav-btn:hover {
    color: #F56200;
}

.nav-btn.active {
    color: #F56200;
}

/* Стили для аккордеона */
.accordion-section {
    position: relative;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: rgba(245, 98, 0, 0.05);
}

.accordion-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: #9ca3af;
}

.accordion-header:hover .accordion-arrow {
    color: #F56200;
}

.accordion-section.active .accordion-arrow {
    transform: rotate(180deg);
    color: #F56200;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    opacity: 0;
    visibility: hidden;
}

.accordion-section.active .accordion-content {
    max-height: 500px; /* Достаточно большое значение для контента */
    opacity: 1;
    visibility: visible;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

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

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 2rem 0;
}



.mega-menu-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    position: relative;
}

.mega-menu-section {
    display: flex;
    flex-direction: column;
    position: relative;
}

.mega-menu-title a {
    color: #2E1500;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.mega-menu-title a:hover {
    color: #F56200;
}

.mega-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.mega-menu-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mega-menu-links a:hover {
    color: #F56200;
    padding-left: 0.25rem;
}

.product-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

/* Responsive Mega Menu */
@media (max-width: 1024px) {
    .mega-menu-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .nav {
        display: flex;
        align-items: center;
        column-gap: 2rem;
    }
}
