/* -------------------------------------------------------------------------
   WC Fiverr-Style Search - SUPER FAST MOBILE CLOSE FIX
-------------------------------------------------------------------------- */

/* 1. Main Container */
.wcfs-lite-wrapper {
    position: relative !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    z-index: 10 !important; 
}

/* 2. Header Layout */
.wcfs-mobile-header-layout {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0; 
}

/* 3. Back Button - HIDDEN ON DESKTOP */
.wcfs-lite-mobile-back {
    display: none !important; 
}

/* 4. Input Box Container */
.wcfs-lite-input-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-grow: 1 !important;
    background: #ffffff !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 8px !important;
    height: 50px !important;
    padding: 5px !important;
    box-sizing: border-box !important;
    
    /* IMPORTANT FIX: Removed 'transition: all'. Only animate shadow/color. 
       This prevents the "Lag" when resizing from mobile view. */
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; 
}

.wcfs-lite-input-wrap:focus-within { 
    box-shadow: none;
}

/* 5. Input Field */
input.wcfs-lite-input {
    flex-grow: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 0 10px !important;
    margin: 0 !important;
    font-size: 16px !important;
    color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}

input.wcfs-lite-input::placeholder {
    color: #888;
    font-weight: 400;
}

/* 6. Right Icons Wrapper */
.wcfs-lite-right-icons {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    flex-shrink: 0 !important;
}

/* --- ACTION ICONS --- */
.wcfs-lite-icon-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
}

/* Clear Icon */
.wcfs-lite-clear-icon {
    opacity: 0;
    pointer-events: none;
    width: 0 !important;
    margin-right: 0;
    transition: opacity 0.2s, width 0.2s; 
}
.wcfs-lite-input-wrap.has-content .wcfs-lite-clear-icon {
    opacity: 1 !important;
    pointer-events: auto;
    width: 30px !important;
    margin-right: 5px;
}
.wcfs-lite-clear-icon svg { width: 14px; height: 14px; fill: #999; }
.wcfs-lite-clear-icon:hover svg { fill: #333; }

/* Search Button */
.wcfs-lite-search-btn {
    width: 40px !important;
    height: 100% !important;
    background: #1c1d21 !important;
    border-radius: 6px !important;
    transition: background 0.2s ease;
}
.wcfs-lite-search-btn:hover { background: #000 !important; }
.wcfs-lite-search-btn svg { width: 18px; height: 18px; fill: #fff !important; }


/* --- DROPDOWN (Suggestions) --- */
.wcfs-lite-suggestions {
    display: none !important; 
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    margin-top: 6px !important;
    border-radius: 8px !important; 
    padding: 8px 0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important; 
    border: 1px solid #f0f0f0 !important;
    z-index: 100 !important; 
    overflow: hidden !important;
}
.wcfs-lite-suggestions.is-active { display: block !important; }

/* Dropdown Item Styling */
.wcfs-lite-item { 
    display: flex !important; 
    align-items: center !important; 
    padding: 12px 16px !important; 
    cursor: pointer !important; 
    font-size: 15px !important; 
    color: #404145 !important; 
    border-bottom: 1px solid #f9f9f9 !important; 
    transition: background 0.1s ease; 
}
.wcfs-lite-item:last-child { border-bottom: none !important; }
.wcfs-lite-item:hover { background-color: #f5f5f5 !important; }

.wcfs-lite-i-wrap {
    display: inline-flex !important; 
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
    width: 20px !important; 
}
.wcfs-lite-i-wrap svg { width: 16px; fill: #777 !important; }

.wcfs-lite-badge { 
    font-size: 10px !important; 
    background: #eee !important; 
    padding: 2px 6px !important; 
    border-radius: 4px !important; 
    margin-left: auto !important; 
    color: #666 !important; 
    font-weight: 600 !important; 
}
.wcfs-lite-no-res { padding: 12px 16px; color: #777; text-align: center; }


/* -------------------------------------------------------------------------
   MOBILE STYLES (NO LAG VERSION)
-------------------------------------------------------------------------- */
@media (max-width: 767px) {
    
    .wcfs-lite-wrapper.wcfs-mobile-active {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100vw !important; height: 100vh !important;
        background: #fff !important;
        z-index: 999999 !important;
        display: flex !important;
        flex-direction: column !important;
        /* Force GPU rendering to be smoother */
        transform: translateZ(0); 
    }
    
    .wcfs-mobile-header-layout {
        padding: 10px !important;
        border-bottom: none !important;
        gap: 10px !important; 
    }

    .wcfs-lite-wrapper.wcfs-mobile-active .wcfs-lite-mobile-back {
        display: flex !important; 
        width: 30px !important; height: 30px !important;
        align-items: center; justify-content: center;
        cursor: pointer;
    }

    .wcfs-lite-wrapper.wcfs-mobile-active .wcfs-lite-input-wrap {
        height: 42px !important;
        border-radius: 25px !important;
        padding: 2px 2px 2px 15px !important;
        background: #ffffff !important;
        border: none !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        
        /* CRITICAL FIX: No transition when in mobile mode to ensure instant snap */
        transition: none !important; 
    }
    
    .wcfs-lite-wrapper.wcfs-mobile-active .wcfs-lite-search-btn {
        background: #ffffff !important;
        width: 36px !important;
        box-shadow: none !important;
        border-radius: 50% !important;
    }
    .wcfs-lite-wrapper.wcfs-mobile-active .wcfs-lite-search-btn svg { fill: #333 !important; }

    .wcfs-lite-wrapper.wcfs-mobile-active .wcfs-lite-suggestions {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        overflow-y: auto !important;
        flex-grow: 1 !important;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    }
}





