/**
 * Yoda Smart Search - Greenstyle Widget Styles
 *
 * Suggestions pills + Products cards + Categories
 * Inspired by Comfy.ua green style
 *
 * @package    YodaSearch
 * @author     Yoda
 * @license    GNU General Public License version 3
 */

/* Container override for Greenstyle layout */
.yodasearch-container.yodasearch-greenstyle {
    min-width: 500px;
    max-width: 700px;
    padding: 0;
}

/* Suggestions row */
.yodasearch-gs-suggestions {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.yodasearch-gs-search-icon {
    flex-shrink: 0;
    color: #999;
}

.yodasearch-gs-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yodasearch-gs-pill {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.yodasearch-gs-pill:hover {
    background: #e8e8e8;
    border-color: #ddd;
    text-decoration: none;
    color: #333;
}

/* Products section */
.yodasearch-gs-products {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.yodasearch-gs-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

/* Products grid */
.yodasearch-gs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Product card */
.yodasearch-gs-product {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.yodasearch-gs-product:hover {
    border-color: #00c853;
    box-shadow: 0 2px 8px rgba(0,200,83,0.15);
    text-decoration: none;
    color: #333;
}

/* Product image */
.yodasearch-gs-image {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}

.yodasearch-gs-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product info */
.yodasearch-gs-info {
    flex: 1;
}

.yodasearch-gs-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.yodasearch-gs-price {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.yodasearch-gs-special {
    color: #e53935;
}

.yodasearch-gs-old {
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
    font-size: 12px;
    margin-right: 6px;
}

/* View all card */
.yodasearch-gs-viewall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.15s;
}

.yodasearch-gs-viewall:hover {
    border-color: #00c853;
    background: #f0fff4;
    text-decoration: none;
    color: #333;
}

.yodasearch-gs-viewall-text {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.3;
}

.yodasearch-gs-viewall-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00c853;
    border-radius: 50%;
    color: #fff;
}

.yodasearch-gs-viewall:hover .yodasearch-gs-viewall-icon {
    background: #00b548;
}

/* Categories section */
.yodasearch-gs-categories {
    padding: 15px 20px;
}

.yodasearch-gs-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yodasearch-gs-cat-pill {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: all 0.15s;
}

.yodasearch-gs-cat-pill:hover {
    border-color: #00c853;
    color: #00c853;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .yodasearch-container.yodasearch-greenstyle {
        min-width: auto;
        max-width: none;
    }

    .yodasearch-gs-grid {
        grid-template-columns: 1fr 1fr;
    }

    .yodasearch-gs-suggestions {
        padding: 12px 15px;
    }

    .yodasearch-gs-products,
    .yodasearch-gs-categories {
        padding: 12px 15px;
    }

    .yodasearch-gs-pill {
        padding: 5px 10px;
        font-size: 12px;
    }

    .yodasearch-gs-image {
        height: 80px;
    }
}

/* Dark theme support */
.dark-theme .yodasearch-gs-pill,
[data-theme="dark"] .yodasearch-gs-pill {
    background: #3d3d3d;
    border-color: #555;
    color: #eee;
}

.dark-theme .yodasearch-gs-product,
.dark-theme .yodasearch-gs-viewall,
.dark-theme .yodasearch-gs-cat-pill,
[data-theme="dark"] .yodasearch-gs-product,
[data-theme="dark"] .yodasearch-gs-viewall,
[data-theme="dark"] .yodasearch-gs-cat-pill {
    background: #2d2d2d;
    border-color: #444;
    color: #eee;
}

.dark-theme .yodasearch-gs-name,
.dark-theme .yodasearch-gs-title,
[data-theme="dark"] .yodasearch-gs-name,
[data-theme="dark"] .yodasearch-gs-title {
    color: #eee;
}
