.category-products {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

@media (max-width: 768px) {
    .category-products {
        margin-left: -10px;
        margin-right: -10px;
    }
}

.category-products .catalog-items-list {
    display: flex;
    flex-wrap: wrap;
    max-width: 1366px;
    justify-content: space-evenly;
    width: 100%
}

.category-products .catalog-item-container {
    flex: 0 0 50%;
    padding: 20px;
    transition: box-shadow .15s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 340px;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

@media not screen and (min-width: 650px) {
    .category-products .catalog-item-container {
        padding: 9px;
    }
}

@media (min-width: 992px) {
    .category-products .catalog-item-container {
        flex: 0 0 20%;
        max-width: 20%;
    }
    .category-products .catalog-item-container:hover {
        box-shadow: 0 0 15px 1px rgba(0, 0, 0, .25);
    }
}

.category-products .catalog-item-container .catalog-item-image {
    width: 100%;
    max-width: 300px;
    max-height: 300px;
    margin: 0 auto;
    position: relative;
    height: 100%;
    flex: 1 1 0;
}

.category-products .catalog-item-container .catalog-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-products .catalog-item-container .promotion-badge {
    background-color: #bd3937;
    color: #fff !important;
    /*display: none;*/
}

.catalog-item-image-badge-container {
    display: flex;
    margin-top: 5px;
}
.catalog-item-image-badge-container > .product-badge {
    padding: 2px;
    font-size: 12px;
    flex: 0 0 41px;
    width: 45px;
    text-align: center;
    height: 24px;
    margin-right: 2px;
}

.category-products .catalog-item-container .catalog-item-name {
    font-size: 16px;
    font-family: 'Play Bold', Arial, Sans-serif, serif;
    margin-top: 10px;
    text-align: center;
    flex: 1 0 auto;
    /*white-space: nowrap;*/
    /*text-overflow: ellipsis;*/
    /*overflow: hidden;*/
}

.category-products .catalog-item-container .catalog-item-description-container {
    margin-top: 15px;
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
}

.category-products .catalog-item-container .catalog-item-price-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: baseline;
}

.category-products .catalog-item-container .catalog-item-price-container .price-new {
    color: #000000;
    font-size: 20px;
    line-height: 20px;
    font-family: 'Play Bold', Arial, Sans-serif, serif;
}

@media not screen and (min-width: 375px){
    .category-products .catalog-item-container .catalog-item-price-container .price-new {
        font-size: 16px;
    }

    .category-products .catalog-item-container .catalog-item-price-container .price-old {
        font-size: 14px !important;
    }
}

@media not screen and (min-width: 320px){
    .category-products .catalog-item-container .catalog-item-price-container .price-new {
        font-size: 14px;
    }

    .category-products .catalog-item-container .catalog-item-price-container .price-old {
        font-size: 13px !important;
    }
}

.category-products .catalog-item-container .catalog-item-price-container .price-new.promoted{
    /*color: #bb3938 !important;*/
    color: #000 !important;
    white-space: nowrap;
}


.category-products .catalog-item-container .catalog-item-link {
    /*background-color: var(--primary-500);*/
    /*border: none;*/
    padding: 6px 10px;
    /*color: white;*/
    text-decoration: none;
    /*transition: background-color .3s;*/
    display: inline-block;
    font-family: 'Play Bold', Arial, Sans-serif, serif;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;

}

@media not screen and (min-width: 675px) {
    .category-products .catalog-item-container .catalog-item-price-container {
        flex: 1 0 100%;
    }

    .category-products .catalog-item-container .catalog-item-link {
        flex: 1;
        margin-top: 9px;
    }
}


.badge-container {
    display: flex;
    margin-bottom: 10px;
}

.badge-container .product-badge {
    padding: 2px;
    font-size: 12px;
    flex: 0 0 41px;
    width: 45px;
    text-align: center;
    height: 24px;
    margin-right: 2px;
}

.badge-container .product-badge.promotion-badge {
    background-color: #bd3937;
    color: #fff !important;
    /*display: none;*/
}




.category-main-title {
    text-transform: none;
    text-align: center;
    font-family: "Play reg", sans-serif !important;
    font-weight: 400 !important;
    font-size: 29px;
    margin: 0 0 20px;
    color: #000;
}

/* Limit Select block */
.category-controls-row,
.category-controls-row-top {
    display: flex;
    justify-content: flex-end !important; /* Возвращаем к правой стороне */
    align-items: center;
    width: 100%;
    padding: 0 0 20px;
}
.category-limit-select {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}
.category-limit-select label {
    margin-bottom: 0; /* Override bootstrap margin */
    display: flex;
    align-items: center;
}
.category-limit-select select {
    padding: 5px 30px 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    background-color: #fff;
    cursor: pointer !important;
}
.category-limit-select select option {
    cursor: pointer !important;
}

.custom-load-more-btn {
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 40px !important;
    height: 62px !important; /* Четко заданная высота для идеальной центровки */
    font-size: 16px !important;
    text-transform: uppercase !important;
    font-family: "Play reg", sans-serif !important;
    font-weight: 400 !important;
    border: 1px solid #999 !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    color: #000 !important;
    line-height: normal !important; /* Совпадает с высотой для текстовой центровки */
    text-decoration: none !important;
    box-shadow: none !important;
}

/* Явно убиваем любые эффекты при наведении */
.custom-load-more-btn:hover,
.custom-load-more-btn:active,
.custom-load-more-btn:focus {
    border-color: #999 !important;
    color: #000 !important;
    background-color: transparent !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.custom-load-more-btn i.fa-refresh {
    margin-right: 12px !important;
    margin-left: 0 !important;
    float: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 100 !important;
    /* Сбрасываем влияние огромного line-height кнопки на иконку */
    line-height: normal !important;
    vertical-align: middle !important;
    position: relative !important;
    top: -1px !important;
}

@media (max-width: 767px) {
    ul.pagination.custom-pagination > li.p-prev,
    ul.pagination.custom-pagination > li.p-next {
        display: none !important;
    }
}

/* Subcategories Grid */
.category-levels-wrapper {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #ddd;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 15px 0 0;
}

@media (max-width: 991px) {
    .subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .subcategories-grid {
        grid-template-columns: 1fr;
    }
}

.subcategory-card {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 0 15px 0 0 !important; /* Image on left has no padding */
    transition: all 0.25s ease-in-out;
    color: #000 !important;
    min-height: 60px;
    overflow: hidden; /* Ensure image and border-radius work together */
}

.subcategory-card:hover {
    border-color: #000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.subcategory-card.active {
    border-color: #000 !important;
    border-width: 1px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Category Navigation & Children UI */

/* 1. Навигационная панель (Назад + Текущая) */
.category-nav-row {
    grid-template-columns: repeat(2, 1fr);
    /* margin-bottom: 20px; */
}

@media (max-width: 480px) {
    .category-nav-row {
        grid-template-columns: 1fr;
    }
}

.category-nav-row .subcategory-card {
    min-height: 45px;
    padding: 0 10px !important; /* Убираем место под фото */
}

.category-nav-row .subcategory-name {
    font-size: 14px;
    margin: 0;
    padding: 0;
    line-height: inherit;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-nav-row .subcategory-name i {
    margin-right: 8px;
    line-height: 0;
}

h1.subcategory-name {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: normal;
    font-weight: 400;
    display: flex;
    justify-content: center;
    border: none;
}

.category-nav-row .nav-back:hover {
    border-color: #000 !important;
}

.category-nav-row .nav-current {
    cursor: default;
    border-color: #000 !important;
    border-width: 1px !important;
    background-color: #f9f9f9;
}

/* 2. Сетка дочерних категорий */
.category-child-grid .subcategory-card {
    min-height: 60px;
}

.category-child-grid .subcategory-image {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
}

.category-child-grid .subcategory-name {
    font-size: 15px;
}

.subcategory-image {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fdfdfd;
}

.subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}



.subcategory-name {
    flex: 1;
    display: flex;
    justify-content: center; /* Центрируем блок текста в свободном месте */
    text-align: center; /* Весь текст теперь по центру */
    font-family: "Play reg", sans-serif !important;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
    padding: 0 10px;
}

/* Category Description Box */
.category-description {
    border-top: 1px solid #ddd;
    margin: 0 0 20px 30px;
    padding-top: 25px;
    font-family: "Play reg", sans-serif !important;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

