/*
Theme Name: OilAuto Divi Child
Template: Divi
Version: 1.0.0
Author: OilAuto
*/

/* === A11y: ФОКУС ВИДЕН === */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #d9531e;
    outline-offset: 2px;
}
.et_pb_button:focus {
    box-shadow: 0 0 0 3px rgba(217, 83, 30, 0.5);
}

/* === A11y: КОНТРАСТНОСТЬ === */
body { color: #1a1a1a; }
a { color: #0056b3; text-decoration: underline; }
.et_pb_button {
    background-color: #d9531e;
    color: #ffffff;
    font-weight: 600;
}

/* === A11y: SKIP-LINK === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 99999;
    transition: top 0.3s;
}
.skip-link:focus { top: 0; }

/* === МОБИЛЬНАЯ: FONT-SIZE 16px ДЛЯ INPUT === */
input, textarea, select {
    font-size: 16px !important;
}

/* === МОБИЛЬНАЯ: WP BOTTOM MENU НЕ ПЕРЕКРЫВАЕТ === */
@media (max-width: 768px) {
    body { padding-bottom: 60px; }
}

/* === МОБИЛЬНАЯ: КЛИКАБЕЛЬНЫЕ ЭЛЕМЕНТЫ === */
.dsm_image_reveal_module,
.dsm_block_reveal_image_module {
    min-height: 44px;
    min-width: 44px;
}

/* === ИСПРАВЛЕНИЕ DSM IMAGE REVEAL: SPAN → DIV === */
.dsm-image-reveal-image_wrap {
    display: block;
}

/* === ИСПРАВЛЕНИЕ ВЛОЖЕННОГО UL В МЕНЮ === */
.menu-container > ul > ul {
    display: none;
}
.menu-container ul li ul {
    display: block;
}

/* === ИЗОБРАЖЕНИЯ ТОВАРОВ (ВСЕ МИНИАТЮРЫ) === */
.products li a img,
.products li img,
.et_pb_shop .et_shop_image img,
.woocommerce ul.products li.product a img {
    width: 100% !important;
    height: 300px !important;
    object-fit: contain !important;
    object-position: center !important;
}
/* === ВЫРАВНИВАНИЕ КАРТОЧЕК ТОВАРОВ В СЕТКУ === */
.woocommerce ul.products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Регулируйте отступ между карточками */
}

.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    flex: 1 1 calc(25% - 20px); /* 4 колонки на ПК */
    max-width: calc(25% - 20px);
    margin: 0 !important; /* Убираем стандартные отступы WooCommerce */
}

/* Растягиваем ссылку с изображением на всю ширину карточки */
.woocommerce ul.products li.product a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Картинка занимает всё доступное пространство по ширине */
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 300px; /* Ваша фиксированная высота */
    object-fit: contain;
    object-position: center;
}

/* Название и кнопка прижимаются к низу карточки */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    flex: 1;
    margin-top: 10px;
}

.woocommerce ul.products li.product .button {
    margin-top: auto;
}