.calc-categories-menu {
    min-width: 98%;    
    color: white;    
}

.calc-category {
    border-bottom: 1px solid #34495e;
}

.calc-category-header {
    cursor: pointer;
    margin-right: 5px;
    margin-left: 5px;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    font-weight: bold;
    border-radius: 4px;
    font-size: 1.2em;
}

.calc-category-header:hover {
    background-color: #ff6600;

}

.calc-category-header::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.calc-category-header.active::after {
    transform: rotate(180deg);
}

.calc-subcategory-list {
    margin-left: 10px;
    margin-right: 6px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #2c3e50;

}

.calc-subcategory-list.active {
    max-height: 500px;

}

.calc-subcategory-item {
    padding: 12px 20px 12px 30px;
    display: block;
    color: #cbd0d3; 
    font-style: italic;
    font-size: 1.3em;   
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid black
}

.calc-subcategory-item:hover {    
    background-color: #4a87b5;    
    color: black;    
    border-left-color: #ff6600;
}

.calc-subcategory-item.active {
    background-color: #00bfff;
    color: white;
    text-shadow:
    -1px -1px 0 black,
    1px -1px 0 black,
    -1px 1px 0 black,
    1px 1px 0 black;
}

.calc-subcategory-item.active:hover {
    background-color: #4a87b5;
    color: white;

}

}


/* ========== МОБИЛЬНОЕ ПОДМЕНЮ ДЛЯ КАЛЬКУЛЯТОРОВ ========== */
/* Адаптация существующих стилей под мобильную версию */

.mobile-submenu .calc-categories-menu {
    min-width: 100%;
    color: white;
}

.mobile-submenu .calc-category {
    border-bottom: 1px solid #2c3e50;
}

.mobile-submenu .calc-category-header {
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    font-weight: bold;
    border-radius: 4px;
    font-size: 1rem;
    background-color: transparent;
}

.mobile-submenu .calc-category-header:hover {
    background-color: #ff6600;
}

.mobile-submenu .calc-category-header::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
}

.mobile-submenu .calc-category-header.active::after {
    transform: rotate(180deg);
}

.mobile-submenu .calc-subcategory-list {
    margin-left: 8px;
    margin-right: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #2c3e50;
    border-radius: 4px;
}

.mobile-submenu .calc-subcategory-list.active {
    max-height: 500px;
}

.mobile-submenu .calc-subcategory-item {
    padding: 10px 16px 10px 24px;
    display: block;
    color: #cbd0d3;
    font-style: italic;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #1a2632;
}

.mobile-submenu .calc-subcategory-item:last-child {
    border-bottom: none;
}

.mobile-submenu .calc-subcategory-item:hover {
    background-color: #4a87b5;
    color: black;
    border-left-color: #ff6600;
}

.mobile-submenu .calc-subcategory-item.active {
    background-color: #00bfff;
    color: white;
    font-weight: bold;
    border-bottom: 1px solid #1a2632;
    width: 100%;
    display: block;
    /* Явно задаём такие же отступы как у обычного элемента */
    padding: 10px 16px 10px 24px;
    margin: 0;
    line-height: normal;
    box-sizing: border-box;
}

.mobile-submenu .calc-subcategory-item.active:hover {
    background-color: #4a87b5;
    color: white;
}

/* Дополнительные улучшения для мобилки */
.mobile-submenu .calc-category-header {
    font-size: 0.95rem;
    padding: 10px 14px;
}

.mobile-submenu .calc-subcategory-item {
    font-size: 0.85rem;
    padding: 8px 12px 8px 20px;
}