/**
 * TurboSearch for WooCommerce - Frontend Stylesheet
 *
 * @package TurboSearch
 * @version 1.2.3
 */

/* =================================================================
   1. Main Container & Form
==================================================================== */
.ts-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    corner-shape: squircle;
    overflow: hidden;
    background-color: #f5f5f5;
    padding: 3px;
    transition: all 0.2s ease-in-out;
    direction: rtl;
}

.ts-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-size: 16px;
}

.ts-form {
    margin: 0;
    padding: 0;
    width: 100%;
}

.ts-input-wrapper:focus-within {
    border-color: #d0d0d0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.ts-submit:hover {
    background-color: #f9f9f9;
}

.ts-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    border-radius: 20px !important;
    corner-shape: squircle;
    background-color: #ffffff !important;
    color: #555 !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer;
}

.ts-icon-search {
    width: 20px;
    height: 20px;
}

.ts-input {
    flex-grow: 1;
    width: 100%;
    border: none !important;
    padding: 8px 10px !important;
    margin: 0 5px !important;
    background: transparent !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    outline: none !important;
    box-shadow: none !important;
    text-align: right;
}

.ts-input::placeholder {
    color: #999;
    transition: color 0.2s ease;
}

.ts-input:focus::placeholder {
    color: transparent;
}


/* =================================================================
   2. Results Dropdown
==================================================================== */

.ts-results-wrapper {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
    direction: rtl;
}

.ts-results-wrapper.ts-show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.ts-results {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px 0;
}

/* =================================================================
   3. Individual Result Item
==================================================================== */

.ts-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-result-item {
    margin: 0;
    padding: 0;
}

.ts-result-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.ts-result-link:hover {
    background-color: #f5f5f5;
    text-decoration: none;
}

.ts-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    margin-left: 15px;
    border-radius: 5px;
    overflow: hidden;
    background-color: #eee;
}

.ts-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ts-content {
    flex: 1;
    min-width: 0;
}

.ts-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.ts-price {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.ts-highlight {
    background-color: #fff3a3;
    font-weight: bold;
}


/* =================================================================
   4. States (Loader, No Results, Footer)
==================================================================== */

.ts-footer {
    padding: 12px 16px;
    margin-top: 8px;
    border-top: 1px solid #eee;
    text-align: center;
}

.ts-view-all {
    font-size: 14px;
    font-weight: 500;
    color: #007cba;
    text-decoration: none;
}

.ts-no-results,
.ts-error {
    padding: 30px 16px;
    text-align: center;
    color: #666;
}

.ts-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: #999;
    font-style: italic;
}