/* =========================================================================
   SEARCH AUTOCOMPLETE SUGGESTIONS CSS — RUANK MARKETPLACE
   Clean, Lightweight (No Images), Mobile-Optimized & App-like UX
   ========================================================================= */

.search-input-wrap, 
.mob-search-input-wrap, 
.mp-search, 
.navbar-search-box {
    position: relative !important;
}

.search-input-wrap {
    overflow: visible !important;
}

/* Mobile Dim Backdrop */
.search-mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 30, 24, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9990;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-mobile-backdrop.show {
    display: block;
    opacity: 1;
}

/* Clear Input (X) Button */
.search-clear-btn {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E5E7EB;
    border: none;
    color: #6B7280;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 6;
    transition: all 0.15s ease;
    padding: 0;
}

.search-clear-btn:hover {
    background: #D1D5DB;
    color: #111827;
}

.search-clear-btn.show {
    display: flex;
}

.mob-search-input-wrap .search-clear-btn {
    right: 14px;
}

/* Dropdown Container */
.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E4E0D6;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(18, 55, 40, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    overflow: hidden;
    display: none;
    max-height: 440px;
    overflow-y: auto;
    text-align: left;
    animation: searchDropFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}

.search-suggestions-dropdown.show {
    display: block;
}

@keyframes searchDropFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar Styling */
.search-suggestions-dropdown::-webkit-scrollbar {
    width: 5px;
}

.search-suggestions-dropdown::-webkit-scrollbar-track {
    background: #F8F7F2;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #D5D0C5;
    border-radius: 4px;
}

/* 1. Global & Category Top Actions */
.search-drop-global-actions {
    padding: 8px;
    background: #FAF9F5;
    border-bottom: 1px solid #ECE8DE;
}

.search-drop-action-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #141715;
    transition: all 0.18s ease;
    cursor: pointer;
}

.search-drop-action-link:hover,
.search-drop-action-link:active {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-action-icon-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #E8ECE9;
    color: #183728;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.search-action-icon-circle.cat-icon {
    background: #E2ECE5;
    color: #183728;
}

.search-action-details {
    flex: 1;
    min-width: 0;
}

.search-action-title {
    font-size: 13px;
    font-weight: 600;
    color: #141715;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-action-subtitle {
    font-size: 11px;
    color: #6B726D;
    margin-top: 1px;
}

.search-cat-badge {
    font-size: 11px;
    font-weight: 700;
    color: #183728;
    background: #E7EFEA;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 2. Section Header */
.search-drop-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #8C948F;
    text-transform: uppercase;
}

.search-drop-count {
    font-weight: 600;
    color: #A3ABA5;
    letter-spacing: normal;
    text-transform: none;
    font-size: 11px;
}

/* 3. Products List (Ultra Lightweight - NO IMAGES) */
.search-drop-products-list {
    padding: 4px 6px 6px;
}

.search-drop-prod-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    border-bottom: 1px solid #F5F3ED;
    min-height: 48px;
    cursor: pointer;
}

.search-drop-prod-item:last-child {
    border-bottom: none;
}

.search-drop-prod-item:hover,
.search-drop-prod-item:active {
    background: #F4F2EB;
}

.search-prod-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #EEF2EF;
    color: #183728;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.search-drop-prod-item:hover .search-prod-icon-box {
    transform: scale(1.08);
    background: #183728;
    color: #FFFFFF;
}

.search-prod-info {
    flex: 1;
    min-width: 0;
}

.search-prod-title {
    font-size: 13px;
    font-weight: 600;
    color: #141715;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.search-prod-meta {
    font-size: 11px;
    color: #7B827D;
    font-weight: 500;
    margin-top: 2px;
}

.search-prod-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.search-prod-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #183728;
    white-space: nowrap;
}

.search-prod-arrow {
    color: #C3C9C4;
    font-size: 11px;
    transition: transform 0.18s ease, color 0.18s ease;
}

.search-drop-prod-item:hover .search-prod-arrow {
    color: #183728;
    transform: translateX(2px);
}

/* 4. Dropdown Footer */
.search-drop-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #FAF8F2;
    border-top: 1px solid #ECE7DE;
    font-size: 11.5px;
    color: #7B827D;
}

.search-drop-see-all {
    color: #183728;
    font-weight: 700;
    text-decoration: none;
}

.search-drop-see-all:hover {
    text-decoration: underline;
}

/* =========================================================================
   MOBILE RESPONSIVE TWEAKS (Touch-Optimized & Keyboard Safe)
   ========================================================================= */
@media (max-width: 768px) {
    .search-suggestions-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        border-radius: 14px;
        max-height: min(340px, calc(100vh - 200px));
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #DBD7CC;
        z-index: 9999;
    }

    .search-drop-global-actions {
        padding: 6px;
    }

    .search-drop-action-link {
        padding: 8px 10px;
        gap: 10px;
    }

    .search-action-icon-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .search-action-title {
        font-size: 12.5px;
    }

    .search-action-subtitle {
        font-size: 10.5px;
    }

    .search-cat-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .search-drop-products-list {
        padding: 2px 4px 4px;
    }

    .search-drop-prod-item {
        padding: 9px 8px;
        gap: 10px;
        min-height: 46px;
    }

    .search-prod-icon-box {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .search-prod-title {
        font-size: 12.5px;
    }

    .search-prod-meta {
        font-size: 10px;
    }

    .search-prod-price {
        font-size: 12px;
    }

    .search-drop-footer {
        padding: 8px 12px;
        font-size: 11px;
    }
}
