/* ========== ОСНОВНЫЕ СТИЛИ ========== */


.blog {
    margin-top: 30px;
}

.blog-filter {
    display: flex;
    gap:     4px;
}

.blog-filter__item {
    align-items:     center;
    display:         flex;
    justify-content: space-between;
}

.blog-filter__item-dropdown {
    align-items:     center;
    background:      var(--bg-filter);
    border-radius:   var(--second-br);
    display:         flex;
    justify-content: center;
    padding:         6px 4px 6px 8px;
}

.blog-items {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    overflow:       hidden;
    padding:        0 16px 46px;
}

.blog-item {
    align-items:     start;
    background:      rgba(0, 0, 0, 0.72);
    border-radius:   var(--main-br);
    cursor:          pointer;
    display:         flex;
    flex-direction:  column;
    gap:             8px;
    justify-content: end;
    min-height:      356px;
    overflow:        hidden;
    padding:         16px;
    position:        relative;
    text-decoration: none;
    z-index:         1;
}

.img.line {
    display: flex;
    margin:  0;
    padding: 0;
}

.img.line img {
    margin:  0;
    padding: 0;
}

.article-ajax-loader {
    left:      50%;
    min-width: 200px;
    position:  absolute;
    top:       50%;
    transform: translate(-50%, -50%);
    z-index:   1000;
}

.blog-item-img {
    display:         block;
    filter:          brightness(80%);
    height:          auto;
    left:            0;
    object-fit:      cover;
    object-position: center;
    position:        absolute;
    scale:           1;
    top:             0;
    transition:      scale 0.2s;
    width:           100%;
    z-index:         -1;
}

.blog-item:hover .blog-item-img {
    scale:      1.05;
    transition: scale 0.2s;
}

.blog-item__label,
.blog-item__top-label,
.blog-item__title,
.blog-item__descr,
.blog-item__date {
    color:           var(--text-main-contrast);
    text-decoration: none;
}

.blog-item__title {
    font-size:     24px;
    font-weight:   600;
    margin-bottom: 8px;
}

.blog-item__descr {
    font-size: 14px;
    opacity:   0.9;
}

.blog-item__date {
    font-size:     14px;
    margin-bottom: 4px;
    opacity:       0.8;
}

.blog-item__tags {
    display:    flex;
    flex-wrap:  wrap;
    gap:        8px;
    margin-top: 12px;
}

.blog-item__tags .tag {
    background:     rgba(255, 255, 255, 0.2);
    border-radius:  20px;
    color:          white;
    font-size:      12px;
    letter-spacing: 0.5px;
    padding:        4px 12px;
    text-transform: uppercase;
}

.blog-item__top-label {
    display: none;
}

.blog-filters {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    margin-bottom:  24px;
}

/* ========== СТИЛИ ДЛЯ ФИЛЬТРОВ ========== */
.blog-filter__dropdown {
    align-items:   center;
    background:    var(--bg-filter);
    border-radius: var(--second-br);
    cursor:        pointer;
    display:       inline-flex;
    gap:           8px;
    padding:       8px 12px;
    position:      relative;
}

.blog-filter__dropdown-toggle {
    align-items: center;
    display:     flex;
    gap:         8px;
}

.blog-filter__dropdown-list {
    background:    white;
    border:        1px solid #ccc;
    border-radius: 8px;
    box-shadow:    0 4px 12px rgba(0, 0, 0, 0.15);
    display:       none;
    left:          0;
    min-width:     200px;
    padding:       8px 0;
    position:      absolute;
    top:           100%;
    z-index:       1000;
}

.blog-filter__dropdown-list.open {
    display: block;
}

.blog-filter__dropdown-list-item {
    color:      #333;
    cursor:     pointer;
    padding:    8px 16px;
    transition: background-color 0.2s;
}

.blog-filter__dropdown-list-item:hover {
    background-color: #f5f5f5;
}

.blog-filter__dropdown-list-item.active {
    background-color: #e5e5e5;
    font-weight:      500;
}

/* ========== ДЕТАЛЬНАЯ СТРАНИЦА ========== */
.blogs-detail {
    display:        flex;
    flex-direction: column;
    gap:            32px;
    padding:        0 16px;
}

.blog-detail__wrapper {
    display:        flex;
    flex-direction: column;
    gap:            16px;
}

.left-column {
    display:        flex;
    flex-direction: column;
    gap:            16px;
}

.right-column {
    display:        flex;
    flex-direction: column;
    gap:            24px;
}

.item-title {
    color:         #666;
    font-weight:   600;
    margin-bottom: 12px;
}

.blogs-detail__table {
    display:        flex;
    flex-direction: column;
}

.table-item {
    align-items:     start;
    border-top:      1px solid var(--border-main);
    display:         flex;
    gap:             16px;
    justify-content: space-between;
    padding:         16px 0;
}

.table-item:last-child {
    border-bottom: 1px solid var(--border-main);
}

.table-item__name {
    flex-shrink: 0;
    max-width:   50%;
}

.table-item__value {
    text-align: end;
}

.blogs-galery {
    display:        flex;
    flex-direction: column;
    gap:            4px;
}

/* ========== СТИЛИ ДЛЯ КОНТЕНТА БЛОГА ========== */
.blog-detail__content {

    font-family: var(--inter);
    font-size:   16px;
    font-weight: 400;
    line-height: 24px;
}

.blog-detail__content h1,
.blog-detail__content h2,
.blog-detail__content h3,
.blog-detail__content h4 {
    color:  #000;
    margin: 1.5em 0 0.8em;
}

.blog-detail__content h1 {
    font-size: 28px;
}

.blog-detail__content h2 {
    font-size: 24px;
}

.blog-detail__content h3 {
    font-size: 20px;
}

.blog-detail__content h4 {
    font-size: 18px;
}

.blog-detail__content p {
    font-family: var(--inter);
    font-size:   16px;
    font-weight: 400;
    line-height: 24px;
    margin:      0 0 1.2em;
}

.blog-detail__content li {
    font-weight: bold;
    list-style:  decimal;
}

.blog-detail__content ul li {
    font-family: var(--inter);
    font-weight: normal;
    list-style:  circle;
}

.blog-detail__content ol li {
    font-family: var(--inter);
    font-weight: normal;
    /*list-style:  circle;*/
}

.blog-detail__content div {
    margin-top: 40px;
}

.blog-detail__content img {
    border-radius: var(--main-br);
    display:       block;
    height:        auto;
    margin:        20px 0;
    max-width:     100%;
}

.blog-detail__content img[style*="float: left"],
.blog-detail__content img[style*="float:left"] {
    margin-bottom: 10px;
    margin-right:  20px;
}

.blog-detail__content img[style*="float: right"],
.blog-detail__content img[style*="float:right"] {
    margin-bottom: 10px;
    margin-left:   20px;
}

.blog-detail__content table {
    border-collapse: collapse;
    font-size:       15px;
    margin:          20px 0;
    width:           100%;
}

.blog-detail__content th {
    background:  var(--bg-filter);
    border:      1px solid #ddd;
    font-weight: 600;
    padding:     12px;
    text-align:  left;
}

.blog-detail__content td {
    border:  1px solid #ddd;
    padding: 10px 12px;
}

.blog-detail__content tr:nth-child(even) {
    background: #f9f9f9;
}

.blog-detail__content blockquote {
    background:  #f5f5f5;
    border-left: 4px solid var(--bg-button-light-hover);
    font-style:  italic;
    margin:      20px 0;
    padding:     15px 20px;
}

.blog-detail__content ul,
.blog-detail__content ol {
    margin:  0 0 1.2em 20px;
    padding: 20px;
}

.blog-detail__content li {
    margin: 5px 0;
}

.blog-detail__content iframe {
    border:        none;
    border-radius: var(--main-br);
    margin:        20px 0;
    max-width:     100%;
}

.container.blog {
    display: none;
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination {
    display:         flex;
    gap:             8px;
    justify-content: center;
    list-style:      none;
    margin:          40px 0;
    padding:         0;
}

.pagination .page,
.pagination .prev,
.pagination .next {
    display: inline-block;
}

.pagination a,
.pagination span {
    align-items:     center;
    background:      var(--bg-filter);
    border-radius:   var(--second-br);
    color:           inherit;
    display:         flex;
    height:          40px;
    justify-content: center;
    min-width:       40px;
    padding:         0 8px;
    text-decoration: none;
    transition:      all 0.2s;
}

.pagination a:hover {
    background: var(--bg-button-light-hover);
}

.pagination .current span {
    /*background: var(--brand-2, #0066cc);*/
    /*color:      white;*/
}

.pagination .ctrl {
    /* стили для стрелок */
}

/* ========== ДЕСКТОПНЫЕ СТИЛИ ========== */
@media (min-width: 992px) {
    .blog-item__label {
        z-index: 0;
    }

    .blog-filters {
        padding: 0 34px;
    }

    .blog-filter {
        display: flex;
        padding: 0;
    }

    .blog-filter__title {
        width: 156px;
    }

    .blog-items {
        display:        flex;
        flex-direction: row;
        flex-wrap:      wrap;
        gap:            4px;
        padding:        0 34px 88px;
    }

    .blog-item {
        gap:        12px;
        min-height: 592px;
        padding:    24px;
        width:      calc(50% - 2px);
    }

    .blog-item-img {
        height: 100%;
    }

    .blog-item:hover .blog-item__top-label {
        background:    var(--brand-2);
        border-radius: 12px;
        display:       block;
        left:          24px;
        opacity:       1;
        padding:       4px 8px;
        position:      absolute;
        top:           24px;
    }

    .blog-item__top-label {
        background:     var(--brand-2);
        border-radius:  12px;
        color:          var(--text-main);
        display:        block;
        left:           24px;
        opacity:        0;
        padding:        4px 8px;
        position:       absolute;
        text-transform: uppercase;
        top:            -24px;
        transition:     all 0.3s ease;
    }

    .blog-item__title {
        padding-right: 15%;
        z-index:       0;
    }

    .blog-item__descr {
        padding-right: 30%;
        z-index:       0;
    }

    /* Детальная страница на десктопе */
    .blogs-detail {
        gap:     96px;
        padding: 0 34px;
    }

    .blog-detail__wrapper {
        flex-direction: row;
        gap:            0;
    }

    .left-column {
        /*padding-right: 20%;*/
        width: 0%;
    }

    .right-column {
        width: 100%;
    }

    .blogs-galery {
        flex-direction: row;
        flex-wrap:      wrap;
    }

    .galery-item {
        width: calc(50% - 2px);
    }
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */
@media (max-width: 991px) {
    .img.line {
        flex-direction: column;
    }

    .blog {
        margin-top: 0;
    }

    .blog-filter__dropdown {
        width: 100%;
    }

    .blog-filter__items {
        display: none;
    }

    .blog-item__title {
        font-size: 20px;
        z-index:   1;
    }

    .blog-item__descr {
        -webkit-box-orient: vertical;
        display:            -webkit-box;
        -webkit-line-clamp: 3;
        overflow:           hidden;
    }
}

/* ========== ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ ========== */
.container {
    margin:    0 auto;
    max-width: 1440px;
    padding:   0 16px;
}

.text-price {
    color:       #666;
    font-size:   14px;
    line-height: 1.4;
}

.text-control-s {
    font-size:   16px;
    line-height: 1.5;
}

.text-caption {
    font-size:   14px;
    line-height: 1.4;
    opacity:     0.9;
}

.h3 {
    font-size:   24px;
    font-weight: 600;
    line-height: 1.3;
}

.overlay {
    color:    white;
    position: relative;
}

.overlay::before {
    background:     rgba(0, 0, 0, 0.4);
    border-radius:  inherit;
    bottom:         0;
    content:        "";
    left:           0;
    pointer-events: none;
    position:       absolute;
    right:          0;
    top:            0;
    z-index:        0;
}

/* ========== ИКОНКИ ========== */
.icon-spoiler-down-m {
    background:   currentColor;
    display:      inline-block;
    height:       16px;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 10l5 5 5-5z\"/></svg>") center/contain no-repeat;
    mask:         url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 10l5 5 5-5z\"/></svg>") center/contain no-repeat;
    width:        16px;
}

/* Стили для тегов */
.blog-item__tags {
    display:    flex;
    flex-wrap:  wrap;
    gap:        8px;
    margin-top: 12px;
    position:   relative;
    z-index:    1;
}

.blog-item__tags .tag {
    background:      rgba(255, 255, 255, 0.2);
    border-radius:   20px;
    color:           white;
    font-size:       12px;
    letter-spacing:  0.5px;
    padding:         4px 12px;
    text-decoration: none;
    text-transform:  uppercase;
    transition:      background 0.2s;
}

.blog-item__tags .tag:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Стили для тегов в детальной */
.left-column .blog-item__tags {
    margin-top: 0;
}

.left-column .blog-item__tags .tag {
    background: var(--bg-filter);
    color:      inherit;
    display:    inline-block;
}

.left-column .blog-item__tags .tag:hover {
    background: var(--bg-button-light-hover);
}

/* Дата в списке */
.blog-item__date {
    color:         var(--text-caption-contrast);
    font-size:     14px;
    margin-bottom: 4px;
    opacity:       0.8;
    position:      relative;
    z-index:       1;
}

/* Для мобильных */
@media (max-width: 991px) {
    .blog-item__tags {
        gap: 4px;
    }

    .blog-item__tags .tag {
        font-size: 10px;
        padding:   2px 8px;
    }
}

/* Стили для фильтра блога - копия из blogs с заменой классов */
.blog-filter {
    display: flex;
    gap:     4px;
}

.blog-filter__title {
    font-size:   14px;
    line-height: 20px;
}

.blog-filter__items {
    display: none;
}

.blog-filter__dropdown {
    align-items:     center;
    background:      var(--bg-filter);
    border-radius:   var(--second-br);
    cursor:          pointer;
    display:         flex;
    font-family:     var(--inter);
    font-size:       14px;
    justify-content: center;
    line-height:     20px;
    padding:         4px;
    position:        relative;
}

.blog-filter__dropdown-toggle {
    align-items: center;
    display:     flex;
    gap:         8px;
}

.blog-filter__dropdown-list {
    background: white;
    border:     1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display:    none;
    opacity:    0;
    padding:    8px;
    position:   absolute;
    right:      0;
    top:        100%;
    transform:  translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    width:      200px;
    z-index:    10;
}

.blog-filter__dropdown-list.open {
    display:   block;
    opacity:   1;
    transform: translateY(0);
}

.blog-filter__dropdown-list-item {
    cursor:     pointer;
    padding:    8px;
    transition: background-color 0.2s ease;
}

.blog-filter__dropdown-list-item.active {
    background-color: #f0f0f0;
}

.blog-filter__dropdown-list-item:hover {
    background-color: #f8f8f8;
}

/* Десктопные стили */
@media (min-width: 992px) {
    .blog-filters {
        margin-bottom: 8px;
        padding:       0 34px;
    }

    .blog-filter {
        flex-direction:  row;
        gap:             60px;
        justify-content: start;
        padding:         0;
    }

    .blog-filter__title {
        font-size:   16px;
        line-height: 24px;
        width:       156px;
    }

    .blog-filter__items {
        display: flex;
        gap:     4px;
    }

    .blog-filter__item {
        align-items:     center;
        background:      var(--bg-filter);
        border-radius:   var(--second-br);
        cursor:          pointer;
        display:         flex;
        font-family:     var(--inter);
        font-size:       16px;
        justify-content: center;
        line-height:     24px;
        padding:         4px 8px;
    }

    .blog-filter__item.active {
        background-color: var(--bg-button-light-hover);
    }

    .blog-filter__item:hover {
        background-color: #f8f8f8;
    }

    .blog-filter__dropdown {
        display: none;
    }
}

/* Стили для блока тегов как фильтр */
.blog-detail__header .blog-filters {
    margin-bottom: 0;
    padding:       0;
}

.blog-detail__header .blog-filter {
    display:        flex;
    flex-direction: column;
    gap:            8px;
}

.blog-detail__header .blog-filter__title {
    color:         #666;
    font-size:     14px;
    font-weight:   600;
    line-height:   20px;
    margin-bottom: 0;
}

.blog-detail__header .blog-filter__items {
    display:   flex !important;
    flex-wrap: wrap;
    gap:       4px;
}

.blog-detail__header .blog-filter__item {
    align-items:     center;
    background:      var(--bg-filter);
    border-radius:   var(--second-br);
    color:           #000000; /* Черный цвет шрифта */
    cursor:          pointer;
    display:         flex;
    font-family:     var(--inter);
    font-size:       14px;
    justify-content: center;
    line-height:     20px;
    padding:         4px 8px;
    text-decoration: none;
    transition:      background-color 0.2s ease;
}

.blog-detail__header .blog-filter__item.active {
    background-color: var(--bg-button-light-hover);
    color:            #000000; /* Черный цвет для активного состояния */
}

.blog-detail__header .blog-filter__item:hover {
    background-color: #f0f0f0;
    color:            #000000; /* Черный цвет при наведении */
}

/* Десктопные стили */
@media (min-width: 992px) {
    .blog-detail__header .blog-filter {
        align-items:    center;
        flex-direction: row;
        gap:            60px;
    }

    .blog-detail__header .blog-filter__title {
        font-size:   16px;
        line-height: 24px;
        width:       156px;
    }

    .blog-detail__header .blog-filter__item {
        align-items:     center;
        background:      var(--bg-filter);
        border-radius:   var(--second-br);
        color:           #000000; /* Черный цвет шрифта на десктопе */
        cursor:          pointer;
        display:         flex;
        font-family:     var(--inter);
        font-size:       16px;
        justify-content: center;
        line-height:     24px;
        padding:         4px 8px;
    }

    .blog-detail__header .blog-filter__item.active {
        background-color: var(--bg-button-light-hover);
        color:            #000000;
    }

    .blog-detail__header .blog-filter__item:hover {
        background-color: #f0f0f0;
        color:            #000000;
    }
}

/* Скрываем дропдаун на всех устройствах */
.blog-detail__header .blog-filter__dropdown {
    display: none !important;
}