/* Стили поиска */
.hw-search-container {
    position: relative;
    margin-bottom: 20px;
}

.hw-search-form {
    display: flex;
    gap: 10px;
}

.hw-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.hw-search-button {
    padding: 10px 20px;
    background-color: #FFD5BA;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.hw-search-button svg {
    width: 20px;
    height: 20px;
    fill: #666;
}

.hw-search-results {
    margin-top: 20px;
}

.hw-loading {
    text-align: center;
    padding: 20px;
}

.hw-loading svg {
    animation: spin 1s infinite linear;
    width: 24px;
    height: 24px;
}

.hw-no-results {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Стили для сетки товаров */
.woocommerce .products.custom-products-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 1fr;
    list-style: none;
    padding: 0;
}

/* Карточка товара */
.woocommerce .products.custom-products-grid .product {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    margin: 0 !important;
}

/* Изображение товара */
.woocommerce .products.custom-products-grid .product .product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.woocommerce .products.custom-products-grid .product .product-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.woocommerce .products.custom-products-grid .product .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.woocommerce .products.custom-products-grid .product .product-image:hover img {
    transform: scale(1.1);
}

/* Информация о товаре */
.woocommerce .products.custom-products-grid .product .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Наличие товара */
.woocommerce .products.custom-products-grid .product .stock-quantity {
    margin: 0 0 8px;
    font-size: 14px;
    color: #333;
}

.woocommerce .products.custom-products-grid .product .stock-label {
    color: #333;
}

.woocommerce .products.custom-products-grid .product .stock-value {
    color: #333;
}

/* Название товара */
.woocommerce .products.custom-products-grid .product .woocommerce-loop-product__title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    font-weight: 400;
}

.woocommerce .products.custom-products-grid .product .woocommerce-loop-product__title a {
    color: #333;
    text-decoration: none;
}

/* Цены */
.woocommerce .products.custom-products-grid .product .price {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    white-space: nowrap;
}

/* Форма добавления в корзину */
.woocommerce .products.custom-products-grid .product .cart-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Поле ввода количества */
.woocommerce .products.custom-products-grid .product .quantity-wrapper {
    width: 100%;
    height: 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.woocommerce .products.custom-products-grid .product .quantity {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    color: #333;
    padding: 0 5px;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box;
}

/* Кнопка добавления в корзину */
.woocommerce .products.custom-products-grid .product .single_add_to_cart_button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #FFBE98;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-height: 45px;
    width: 100%;
    font-size: 16px;
}

.woocommerce .products.custom-products-grid .product .single_add_to_cart_button:hover {
    background-color: #FFB589;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .woocommerce .products.custom-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .woocommerce .products.custom-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .woocommerce .products.custom-products-grid .product {
        padding: 10px;
    }

    .woocommerce .products.custom-products-grid .product .woocommerce-loop-product__title {
        font-size: 14px;
    }

    .woocommerce .products.custom-products-grid .product .price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .woocommerce .products.custom-products-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}