/* GT Live Search - Frontend Styles */

.gtls-search-wrap {
    position: relative;
    width: 100%;
}

.gtls-search-form {
    position: relative;
    width: 100%;
}

.gtls-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    position: relative;
}

.gtls-input {
    flex: 1;
    padding: 0 15px !important;
    margin: 0 !important;
    outline: none;
    text-shadow: none;
    line-height: normal;
    box-shadow: none !important;
    -webkit-appearance: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.gtls-input:focus {
    outline: none;
}

.gtls-cat-filter {
    padding: 0 10px;
    margin: 0;
    background: #fff;
    cursor: pointer;
    outline: none;
    font-size: 14px;
    min-width: 120px;
    max-width: 200px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    box-sizing: border-box;
}

.gtls-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    margin: 0;
    cursor: pointer;
    border-left: 0 !important;
    line-height: 1;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
}

.gtls-submit-btn svg {
    display: block;
}

/* Results Dropdown */
.gtls-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0 0 8px 8px;
    margin-top: 2px;
    box-sizing: border-box;
}

.gtls-result-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.gtls-result-item:last-child {
    border-bottom: none;
}

.gtls-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.gtls-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gtls-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gtls-result-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gtls-result-title mark {
    background: #fff3cd;
    color: inherit;
    padding: 0;
    border-radius: 2px;
}

.gtls-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gtls-result-price {
    font-size: 13px;
    font-weight: 700;
}

.gtls-result-sku {
    font-size: 12px;
    color: #999;
}

.gtls-result-category {
    font-size: 12px;
    color: #888;
}

.gtls-result-desc {
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
}

/* Loading */
.gtls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.gtls-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #e00000;
    border-radius: 50%;
    animation: gtls-spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes gtls-spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.gtls-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* View All */
.gtls-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #e00000 !important;
    text-decoration: none !important;
    border-top: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.gtls-view-all:hover {
    background: #fafafa;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gtls-cat-filter {
        display: none;
    }
    .gtls-result-image {
        width: 40px;
        height: 40px;
    }
    .gtls-result-item {
        padding: 8px 10px;
        gap: 10px;
    }
    .gtls-results-dropdown {
        max-height: 300px !important;
    }
}
