/* === ГАЛЕРЕЯ (СТРАНИЦА ТОВАРА): КНОПКИ НА ИЗОБРАЖЕНИИ === */
.product_images {
    position: relative;
}

.product_images .gallery-favorite,
.product_images .gallery-compare {
    position: absolute;
    bottom: 180px;
    right: 20px;
    z-index: 2;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    text-decoration: none;
}

.product_images .gallery-compare {
    right: 80px;
}

.product_images .gallery-compare input {
    display: none;
}

.product_images .gallery-favorite::before,
.product_images .gallery-compare::before {
    font-family: 'icons';
    font-size: 26px;
    color: #1e2e36;
    line-height: 1;
    display: block;
}

.product_images .gallery-favorite::before {
    content: '\e92a';
}

.product_images .gallery-compare::before {
    content: '\e908';
}

.product_images .gallery-favorite.active::before {
    color: #e53935;
}

.product_images .gallery-compare:has(input:checked)::before {
    color: #1e88e5;
}

/* Адаптив галереи */
@media (max-width: 576px) {
    .product_images .gallery-favorite,
    .product_images .gallery-compare {
        width: 38px;
        height: 38px;
        bottom: 160px;
        right: 10px;
    }
    .product_images .gallery-compare {
        right: 60px;
    }
    .product_images .gallery-favorite::before,
    .product_images .gallery-compare::before {
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .product_images .gallery-favorite,
    .product_images .gallery-compare {
        bottom: 120px;
    }
}

/* Эффект при наведении для галереи */
.product_images .gallery-favorite:hover,
.product_images .gallery-compare:hover {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* === КАТАЛОГ: КНОПКИ НА ИЗОБРАЖЕНИИ === */
.catalog_image_wrapper {
    position: relative;
}

.catalog_image_wrapper .catalog-favorite,
.catalog_image_wrapper .catalog-compare {
    position: absolute !important;
    bottom: 15px;
    right: 10px;
    z-index: 2;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    text-decoration: none;
}

.catalog_image_wrapper .catalog-compare {
    right: 55px !important;
}

.catalog_image_wrapper .catalog-compare input {
    display: none;
}

.catalog_image_wrapper .catalog-favorite::before,
.catalog_image_wrapper .catalog-compare::before {
    font-family: 'icons';
    font-size: 22px;
    color: #1e2e36;
    line-height: 1;
    display: block;
}

.catalog_image_wrapper .catalog-favorite::before {
    content: '\e92a';
}

.catalog_image_wrapper .catalog-compare::before {
    content: '\e908';
}

.catalog_image_wrapper .catalog-favorite.active::before {
    color: #e53935;
}

.catalog_image_wrapper .catalog-compare:has(input:checked)::before {
    color: #1e88e5;
}

/* === КАТАЛОГ: СТРОКА ЦЕНА + КНОПКА КУПИТЬ === */
.catalog_items .price-buy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
    padding-right: 0;
}

.catalog_items .price-buy-row .price {
    margin-bottom: 0;
    font-weight: 700;
    white-space: nowrap;
}

.catalog_items .price-buy-row .ms2_form {
    margin: 0;
    margin-right: 20px;
}

/* Стили кнопки Купить */
.catalog_items .price-buy-row .addcart.cart {
    display: inline-block;
    background-color: rgba(244, 179, 14, 0.85);
    color: #1e2e36;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700 !important;       /* перебиваем !important из index.css */
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.2;
    white-space: nowrap;
}

.catalog_items .price-buy-row .addcart.cart:hover {
    background-color: #e09d00;
}

/* Адаптив для каталога */
@media (max-width: 576px) {
    .catalog_image_wrapper .catalog-favorite,
    .catalog_image_wrapper .catalog-compare {
        width: 32px;
        height: 32px;
        bottom: 10px;
        right: 5px;
    }
    .catalog_image_wrapper .catalog-compare {
        right: 45px;
    }
    .catalog_image_wrapper .catalog-favorite::before,
    .catalog_image_wrapper .catalog-compare::before {
        font-size: 18px;
    }
    .catalog_items .price-buy-row .price {
        font-size: 12px;
    }
    .catalog_items .price-buy-row .addcart.cart {
        padding: 6px 16px;
        font-size: 14px;
		font-weight: 700 !important;
    }
    .catalog_items .price-buy-row .ms2_form {
        margin-right: 10px;
    }
}
.catalog_image_wrapper {
    line-height: 0;       /* убирает возможные пробелы от inline-элементов */
    font-size: 0;
}

.catalog_image_wrapper .img_block {
    height: auto;         /* отменяем фиксированную высоту, если нужно */
}

/* Если нужно сохранить пропорции, можно задать aspect-ratio */
.catalog_image_wrapper .img_block {
    aspect-ratio: 1 / 1;  /* квадратное изображение, подберите под ваш дизайн */
    height: auto;
}
/* === ВЫРАВНИВАНИЕ КАРТОЧЕК ПО НИЖНЕМУ КРАЮ === */

/* Карточка товара становится flex-колонкой */
.catalog_items {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Текстовый блок растягивается, занимая доступное пространство */
.catalog_items .text_block {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Блок с ценой и кнопкой прижимается к низу */
.catalog_items .price-buy-row {
    margin-top: auto;
    padding-top: 10px;   /* небольшой отступ от текста, можно регулировать */
}
/* Адаптация заголовков категорий на главной */
@media (max-width: 1199px) and (min-width: 768px) {
    .main_category .main_category_item .title {
        font-size: 20px;           /* уменьшаем шрифт */
        padding: 10px 15px;        /* можно чуть сжать отступы */
        min-height: auto;          /* убираем фиксированную высоту, если нужно */
        text-align: center;        /* на всякий случай, если justify-content не срабатывает */
        justify-content: center;   /* уже есть, оставляем */
    }
}
