.container{
    display: flex;
    flex-direction: row;
    gap: 24px;
    margin-top: 32px;
    margin-left: 40px;
    margin-right: 40px;
    margin-bottom: 48px;
}
.breadcrumbs{
    margin-top: 140px;
    margin-left: 40px;
    
}
.breadcrumbs ul li, .breadcrumbs ul li a{
    color: var(--ac) !important;
}
/*Categories*/
.sidebar {
    position: -webkit-sticky; /* для поддержки Safari */
    position: sticky;
    top: 120px;
    flex: 1;
    max-height: calc(100vh - 120px); /* Ограничение высоты с учетом отступа сверху */
    overflow-y: auto; /* Позволяет прокрутку внутри элемента */
    padding: 16px 32px;
    background-color: var(--bc);
    box-shadow: 0 0 2px 0 gray;
    border-radius: 12px;
}

.sub-topics {
    word-wrap: break-word; /* Разрешает перенос слов при необходимости */
    overflow-x: hidden; /* Скрывает горизонтальную прокрутку */
}
:root {
    --bc: #f0f0f0;
}

/* Стилизация скроллбара для WebKit браузеров */
.sidebar::-webkit-scrollbar {
    width: 6px;
    height: 50%;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 12px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--light-bc); 
    border-radius: 12px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--light-main); 
}

.sub-topics-mobile{
    display: none;

}
.sub-topics h2, .sub-topics-mobile h2{
    margin: 0;
    text-align: center;
}
.sub-topics ul, .sub-topics-mobile ul{
    list-style: none;
    padding: 0;
}
.sub-topics li, .sub-topics-mobile li {
    margin-bottom: 10px; 
}
.sub-topics a, .sub-topics-mobile a{
    font-size: 18px;
    color: var(--ac);
    text-decoration: none;
    flex-basis: 48%;
}
.sub-topics a:hover{
    text-decoration: underline;
}
.category_link{
    color: var(--ac);
    text-decoration: none;
}
.post{
    flex:4;
}
.post .main_image{
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
}
.post h1{
    font-size: 32px;
    margin: 0;
    color: var(--ac);
    font-family: "Open Sans", sans-serif;
    margin-top: 21px;
}
.post .post-info{
    margin-top: 18px;
    display: flex;
    flex-direction: row;
    gap: 24px;
    font-family: "Open Sans", sans-serif;

}
.post .post-info > div{
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    color: var(--light-main);
}
.post .post-short-description{
    margin-top: 21px;
    color: var(--light-main);
    font-size: 21px;
}
.post-body{
    margin-top: 21px;
    display: flex;
    flex-direction: column;
    gap: 21px;
}
.post-body .section{
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.post-body .section h2{
    font-size: 24px;
    color: var(--ac);
    margin: 0;
}
.post-body .section h3{
    font-size: 21px;
    color: var(--ac);
    margin: 8px 0;
}
.post-body .section p, .post-body .section li{
    font-size: 21px;
    color: var(--ac);
    margin: 0;
}
.post-body .section a{
    color: var(--ac);
}
.post-body .section img{
    margin: 14px 0;
    max-width: 400px;
    max-height: 400px;
    height: auto;
    display: block;
    margin-left: auto;
    object-fit: contain;
    margin-right: auto;
    filter: drop-shadow(0px 0px 2px gray);
}
.products{
    margin:21px 40px;
}
.products_list{
    display: flex;
    flex-direction: row;
    justify-content: start;
    gap: 24px;
    flex-wrap: wrap;
}
.rec_posts{
    margin: 21px 40px;
}
.rec_posts_list{
    display: flex;
    flex-direction: row;
    justify-content: start;
    gap: 24px;
    flex-wrap: wrap; 
}
.rec_posts_list .rec_post{
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 450px;
}
.rec_posts_list .rec_post .main_image{
    width: 450px;
    height: 225px;
    object-fit: cover;
    border-radius: 12px;
}
.rec_posts_list .rec_post .post-info{
    display: flex;
    flex-direction: column;
    font-family: "Open Sans", sans-serif;

    gap: 12px;
}
.rec_posts_list .rec_post .post-info .post-header{
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}
.rec_posts_list .rec_post .post-info .post-header > div{
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    color: var(--light-main);
}

.rec_posts_list .rec_post .post-info .post-body{
    display: flex;
    flex-direction: column;
    gap: 12px;    
}
.rec_posts_list .rec_post .post-info .post-body .title{
    font-size: 24px;
    font-weight: 500;
}
.rec_posts_list .rec_post .post-body{
    margin-top: 4px;
}
.rec_posts_list .rec_post .post-info .post-body p{
    font-size: 18px;
    margin: 0;
}
.rec_posts_list .rec_post .post-info .post-body a{
    color: var(--ac);
}
@media screen and (max-width: 982px) {
    .sidebar{
        display: none;
    }
    .sub-topics-mobile {
        display: block;
        margin: 21px 0;
        overflow: hidden;
        transition: height 0.3s ease;
        padding: 10px;
        background-color: var(--bc);
        box-shadow: 0 0 2px 0 gray;
        border-radius: 12px;
        
    }
    
    .sub-topics-mobile ul {
        list-style: none;
        display: none;
        padding: 0;
        margin: 0;
        margin-top: 12px;
    }
    
    .sub-topics-mobile ul.collapsed {
        height: 0;
    }
    
    .sub-topics-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;

    }
    
    .sub-topics-header h2 {
        margin: 0;
        font-size: 24px;
    }
    
    .sub-topics-header .material-symbols-outlined {
        transition: transform 0.3s ease;
    }
    
    .sub-topics-header span.rotated {
        transform: rotate(180deg); /* Поворот иконки на 180 градусов */
        transition: transform 0.3s; /* Плавный переход для поворота */
    }
    
    .sub-topics-header span {
        transition: transform 0.3s; /* Плавный переход для поворота */
    }
    .rec_posts{
        margin: 21px 0;
        display: block;
    }
    .rec_posts h2{
        text-align: center;
    }
    .rec_posts_list{
        justify-content: center;
    }
    .rec_posts_list .rec_post .post-info .post-body{
        margin-top: 0px;
    }
    
}
@media screen and (max-width: 600px) {
    .container{
        margin-left: 18px;
        margin-right: 18px;
    }
    .post h1{
        text-align: center;
    }
    .post .post-info{
        justify-content: center;
    }
    .products{
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    .products h2{
        text-align: center;
    }
    .products_list{
        justify-content: center;
    }
    .rec_posts_list .rec_post{
        max-width: 380px;
    }
    .rec_posts_list .rec_post .main_image{
        width: 380px;
        height: 200px;
    }

}
