/* Basic Styles for TRB Product Search */

/* Container */
.trb-product-search-container {
    margin-bottom: 20px;
}

/* Form */
.trb-product-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    /* For dropdown positioning */
}

.trb-product-search-form .search-field {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.trb-product-search-form .search-submit {
    padding: 8px 15px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.trb-product-search-form .search-submit:hover {
    background-color: #555;
}

/* Dropdown */
.trb-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.trb-search-dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trb-dropdown-item {
    border-bottom: 1px solid #eee;
}

.trb-dropdown-item:last-child {
    border-bottom: none;
}

.trb-dropdown-item a {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.trb-dropdown-item a:hover {
    background-color: #f7f7f7;
}

.trb-dropdown-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 3px;
}

.trb-dropdown-item span {
    flex-grow: 1;
    font-weight: 500;
}

.trb-dropdown-item .price {
    flex-grow: 0;
    font-weight: bold;
    color: #007cba;
    font-size: 0.9em;
}

.trb-loading,
.trb-no-results,
.trb-error {
    padding: 10px;
    text-align: center;
    color: #777;
    font-style: italic;
}

/* Suggestion */
.trb-search-suggestion {
    padding: 10px;
    font-size: 0.9em;
    background-color: #fff8e5;
    border-bottom: 1px solid #eee;
    color: #333;
}

.trb-search-suggestion strong {
    color: #e67e22;
}


/* Normal Results List (Non-dropdown) */
.trb-product-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Single Result Item */
.trb-product-result {
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 5px;
    transition: box-shadow 0.2s;
    background: #fff;
}

.trb-product-result:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.trb-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.trb-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin-bottom: 10px;
}

.trb-product-title {
    font-size: 16px;
    margin: 5px 0;
    color: #333;
    line-height: 1.2;
}

.trb-product-info .price {
    display: block;
    font-weight: bold;
    color: #007cba;
    /* WooCommerce defaultish blue */
    margin-bottom: 5px;
}

.trb-product-info .button {
    display: inline-block;
    font-size: 12px;
    background: #f7f7f7;
    padding: 5px 10px;
    border-radius: 3px;
    color: #555;
    margin-top: 5px;
}