/* sly_product_filters_block styles */
.sly-filter-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.sly-filter-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.sly-filter-button:hover {
    background-color: #e0e0e0;
    border-color: #aaa;
}

.sly-filter-button.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.sly-reset-filters-button {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-left: 20px;
}

.sly-reset-filters-button:hover {
    background-color: #333;
    border-color: #333;
}

/* sly_search_block styles */
.sly-search-block {
    margin-bottom: 20px;
}

#sly-product-search {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* ************** CORE GRID LAYOUT STYLES - Висока специфічність для Elementor ************** */
/* Цей селектор цілиться на ваш контейнер товарів, що знаходиться всередині віджету Elementor */
.elementor-widget-container #sly-products-container.sly-products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 4 колонки */
    gap: 20px !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    /* Перекриваємо потенційні Flex-властивості від Elementor */
    flex-basis: auto !important;
    flex-grow: unset !important;
    flex-shrink: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
    flex-direction: unset !important;
}

/* ************** СТИЛІ КАРТКИ ТОВАРУ ************** */
.product-item {
    border: 1px solid #000 !important; /* Чорна рамка 1px */
    border-radius: 0 !important; /* Прибрати скруглення кутів */
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Можна прибрати, якщо тінь не потрібна */
    display: flex; /* Flex для внутрішнього розташування контенту картки */
    flex-direction: column;
    justify-content: space-between;
    
    width: auto !important; 
    max-width: 100% !important; 
    box-sizing: border-box !important;
    
    /* Забезпечуємо правильне позиціонування всередині Grid */
    grid-column: auto !important; 
    flex-basis: auto !important;
    flex-grow: unset !important;
    flex-shrink: unset !important;
}

.product-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 15px;
    border-radius: 0 !important; /* Прибрати скруглення кутів на зображенні */
}

.product-item .product-title {
    font-size: 1.1em;
    margin-top: 10px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-item .product-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.product-item .product-title a:hover {
    color: #007bff;
}

/* Стили для сообщения "Товаров не найдено" */
#sly-products-container p {
    text-align: center;
    width: 100%;
    grid-column: 1 / -1; /* Займає всю доступну ширину в сітці */
    margin-top: 30px;
    font-size: 1.2em;
    color: #555;
}


/* ========================================= */
/* СТИЛІ ДЛЯ МОБІЛЬНОЇ ВЕРСІЇ */
/* ========================================= */
@media (max-width: 768px) { 
    .sly-filter-button,
    .sly-reset-filters-button {
        font-size: 12px;
        padding: 6px 10px;
        min-width: unset;
        height: auto;
    }

    .sly-filter-buttons-container {
        gap: 8px;
        justify-content: center;
    }

    .sly-reset-filters-button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    #sly-products-container p {
        font-size: 1em;
        margin-top: 20px;
    }

    /* На мобільних екранах повертаємо адаптивні колонки для вашої сітки */
    .elementor-widget-container #sly-products-container.sly-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; 
        gap: 15px !important;
    }
}

.display-none-class {
    display: none !important;
}


[data-widget_type="button.default"] {
    display: none;
}

[data-elementor-type="wp-page"] [data-widget_type="button.default"] {
    display: block !important;
}
