/* Fast Woo Search - استایل‌های فرم جستجو */

:root {
    --fws-primary: #96588a;
    --fws-radius:  8px;
    --fws-shadow:  0 4px 20px rgba(0,0,0,.12);
    --fws-border:  #ddd;
    --fws-bg:      #fff;
    --fws-text:    #333;
    --fws-result-hover: #f7f4f8;
}

/* ── Wrapper ── */
.fws-wrap {
    position: relative;
    width: 100%;
    font-family: inherit;
}

/* ── Form ── */
.fws-form {
    margin: 0;
}

.fws-inner {
    display: flex;
    align-items: center;
    background: var(--fws-bg);
    border: 1.5px solid var(--fws-border);
    border-radius: var(--fws-radius);
    transition: border-color .2s, box-shadow .2s;
    overflow: hidden;
}

.fws-inner:focus-within {
    border-color: var(--fws-primary);
    box-shadow: 0 0 0 3px rgba(150,88,138,.15);
}

/* ── Icon ── */
.fws-icon {
    display: flex;
    align-items: center;
    padding: 0 10px 0 12px;
    color: #999;
    flex-shrink: 0;
    pointer-events: none;
}

/* ── Input ── */
.fws-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 10px 8px 10px 0;
    font-size: 15px;
    color: var(--fws-text);
    min-width: 0;
}

.fws-input::placeholder { color: #aaa; }

/* ── Spinner ── */
.fws-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #eee;
    border-top-color: var(--fws-primary);
    border-radius: 50%;
    margin: 0 8px;
    flex-shrink: 0;
    animation: fws-spin .7s linear infinite;
}

.fws-wrap.is-loading .fws-spinner { display: block; }

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

/* ── Submit Button ── */
.fws-submit {
    background: var(--fws-primary);
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 100%;
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

.fws-submit:hover { background: #7a4672; }

/* ── Results Dropdown ── */
.fws-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--fws-bg);
    border-radius: var(--fws-radius);
    box-shadow: var(--fws-shadow);
    border: 1px solid var(--fws-border);
    z-index: 9999;
    max-height: 480px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.fws-results[hidden] { display: none; }

/* ── نتیجه تکی ── */
.fws-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}

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

.fws-item:hover,
.fws-item.is-active {
    background: var(--fws-result-hover);
}

.fws-item-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.fws-item-no-img {
    width: 44px;
    height: 44px;
    background: #f0eff0;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.fws-item-body {
    flex: 1;
    min-width: 0;
}

.fws-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fws-item-title strong {
    color: var(--fws-primary);
    font-weight: 700;
}

.fws-item-meta {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fws-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--fws-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── پیام بدون نتیجه ── */
.fws-no-results {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ── لینک «مشاهده همه» ── */
.fws-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: var(--fws-primary);
    border-top: 1px solid #eee;
    text-decoration: none;
    font-weight: 600;
}

.fws-view-all:hover { background: var(--fws-result-hover); }

/* ── RTL ── */
[dir="rtl"] .fws-icon { padding: 0 12px 0 10px; }
[dir="rtl"] .fws-input { padding: 10px 0 10px 8px; }
