/* New Fiverr-Style Search Bar */
.wcfs-wrapper { width: 100%; }
.wcfs-form { position: relative; }

.wcfs-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-radius: 4px;
    padding: 0;
    border: 1px solid #B5B6BA;
    box-shadow: none;
    overflow: hidden;
    transition: border-color .2s ease;
}

.wcfs-input-wrap:focus-within {
    border-color: #222325;
}

.wcfs-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    fill: #777;
    opacity: 1;
    pointer-events: none;
    z-index: 2;
}

.wcfs-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.4;
    padding: 12px 10px 12px 48px;
    background: transparent;
}

.wcfs-btn {
    background: #222325;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}

.wcfs-btn:hover {
    background: #444;
    filter: none;
}

/* Suggestions */
.wcfs-suggestions {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,.12);
    padding: 8px;
    display: none;
    z-index: 9999;
    max-height: 460px;
    overflow: auto;
}
.wcfs-suggestions.is-open { display: block; }

/* Loader */
.wcfs-loader {
    width: 28px; height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #1dbf73;
    border-radius: 50%;
    animation: wcfs-spin 0.8s linear infinite;
    margin: 6px auto;
}
@keyframes wcfs-spin { to { transform: rotate(360deg); } }

/* Default panel (recent + popular) */
.wcfs-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px;
}
.wcfs-header-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #6b7280; }
.wcfs-clear {
    background: transparent;
    border: none;
    color: #888; /* आइकॉन का रंग */
    cursor: pointer;
    padding: 5px;
    line-height: 0; /* आइकॉन को सही से अलाइन करने के लिए */
    border-radius: 50%; /* गोल बनाने के लिए */
    transition: all 0.2s ease;
}

.wcfs-clear:hover {
    background-color: #f3f4f6; /* हॉवर करने पर हल्का बैकग्राउंड */
    color: #222; /* हॉवर करने पर आइकॉन का रंग */
}
.wcfs-recent, .wcfs-popular {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 0 10px 10px 10px;
}
.wcfs-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-size: 13px;
}
.wcfs-chip:hover { background: #e5e7eb; }

.wcfs-section {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    padding: 6px 10px;
}

.wcfs-suggest-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}
.wcfs-suggest-item:hover { background: #f9fafb; }

.wcfs-thumb {
    width: 40px; height: 40px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f0;
}
.wcfs-thumb--placeholder::before {
    content: '';
    display: block;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 8px;
}

.wcfs-text { display: flex; flex-direction: column; }
.wcfs-title { font-weight: 600; }
.wcfs-sub { font-size: 12px; color: #6b7280; }

.wcfs-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 6px;
    grid-column: 1 / span 1;
    text-align: center;
}

.wcfs-empty {
    padding: 10px;
    color: #6b7280;
    font-size: 14px;
}

/* RESULTS TEMPLATE */
.wcfs-results {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 12px;
}
.wcfs-results h1 {
    font-size: 24px;
    margin: 8px 0 16px 0;
}
.wcfs-catchips {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin: 8px 0 16px 0;
}
.wcfs-results .wcfs-chip { background: #eef2ff; }
.wcfs-results .wcfs-chip:hover { background: #e0e7ff; }

.wcfs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.wcfs-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    padding: 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.wcfs-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; background:#f3f4f6; }
.wcfs-card-title { font-weight: 600; }
.wcfs-card-price { color: #111827; font-weight: 700; }
.wcfs-muted { color: #6b7280; font-size: 14px; }

.wcfs-suggest-item.wcfs-sel{ background:#eef2ff; }


/* Classic Fiverr-Style Premium Searchbar */
.wcfs-container{
    display:flex;
    justify-content:center;
    margin:30px auto;
    max-width:760px;
}
.wcfs-input{
    width:100%;
    font-size:1.1rem;
    padding:14px 18px;
    border-radius:50px;
    border:1px solid #e5e7eb;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
    transition:all .2s ease;
}
.wcfs-input:focus{
    border-color:#6366f1;
    box-shadow:0 4px 12px rgba(99,102,241,0.2);
    outline:none;
}
.wcfs-suggestions{
    margin-top:10px;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 4px 14px rgba(0,0,0,0.1);
}
.wcfs-section-label{
    font-weight:600;
    font-size:0.9rem;
    color:#374151;
    margin:6px 0;
    padding-left:8px;
}
.wcfs-suggest-item{
    padding:10px 14px;
    border-bottom:1px solid #f3f4f6;
    cursor:pointer;
    transition:background .15s;
}
.wcfs-suggest-item:hover, .wcfs-suggest-item.wcfs-sel{
    background:#f9fafb;
}
.wcfs-chip{
    display:inline-block;
    padding:6px 12px;
    margin:4px;
    background:#f3f4f6;
    border-radius:20px;
    font-size:0.85rem;
    cursor:pointer;
    transition:background .15s;
}
.wcfs-chip:hover{
    background:#e0e7ff;
}

/* --- Instant open tweaks added to reduce open lag --- */
.wcfs-wrapper, .wcfs-input-wrap, .wcfs-results, .wcfs-chip, .wcfs-card { transition: none !important; -webkit-transition: none !important; animation: none !important; }
/* Preload marker - set by JS to indicate preloaded state */
.wcfs-wrapper[data-wcfs-preloaded='1'] {}


/* --- Assistant: added fixes --- */

/* === Stability fixes for loading/skeleton to prevent jumpy resize === */
/* Ensure input wrapper keeps consistent height during loading */
.wcfs-input-wrap {
    min-height: 44px;
    box-sizing: border-box;
}

/* Loading overlay: absolute positioned so it doesn't change layout */
#search-loading, .wcfs-loading {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    pointer-events: none; /* allow clicks to pass through to input if needed */
    color: transparent; /* hide text to avoid layout shift; use background for skeleton visuals */
    background: transparent;
}

/* If a skeleton/shimmer placeholder is used, force fixed size */
.wcfs-thumb--placeholder, .wcfs-skeleton, .wcfs-placeholder {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

/* Make sure suggestions/results container doesn't push the input during initial load */
.wcfs-results { max-height: 0; overflow: hidden; transition: max-height .18s ease; }
.wcfs-results.is-open { max-height: 600px; overflow: auto; }

/* Respect preloaded marker (used by JS to avoid initial animations) */
.wcfs-wrapper[data-wcfs-preloaded='1'] * { -webkit-transition: none !important; transition: none !important; animation: none !important; }
