/* Custom Search Dropdown Styles */
#searchForm {
    position: relative;
    width: 100%;
}

.search-loader {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.search-loader .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #f26522; /* KS Home Theme Color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-results {
    background: #fff;
    width: 100%;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

/* Custom Scrollbar */
.search-results::-webkit-scrollbar {
    width: 5px;
}
.search-results::-webkit-scrollbar-track {
    background: #f9f9f9; 
}
.search-results::-webkit-scrollbar-thumb {
    background: #d4d4d4; 
    border-radius: 10px;
}
.search-results::-webkit-scrollbar-thumb:hover {
    background: #aaa; 
}

.ks-search-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block !important;
}

.ks-search-dropdown-list li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    clear: both !important;
    text-align: left !important;
}

.dropdown-heading {
    padding: 20px 0px 10px 0px;
    font-weight: 800;
    font-size: 13px;
    color: #f2a600; /* Orange color */
    text-transform: capitalize;
    background: transparent;
    border: none;
}

.search-item a {
    display: flex;
    align-items: center;
    padding: 8px 0px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
}

.search-item a:hover, .search-item a.active, .search-item a:focus {
    background-color: transparent;
    outline: none;
}
.search-item a:hover .text-cat-name, .search-item a.active .text-cat-name {
    color: #333;
}
.search-item a:hover p, .search-item a.active p {
    color: #000;
}

/* Text Categories (Top level) */
.text-category-item a {
    display: flex;
    /*justify-content: space-between;*/
    align-items: center;
    padding: 6px 0px;
}
.text-category-item span {
    font-size: 13px;
}
.text-category-item .text-cat-name {
    color: #777;
    font-weight: 600;
}
.text-category-item .text-parent {
    color: #aaa;
    font-weight: 400;
}
.text-category-item .arrow-icon {
    color: #888;
    font-size: 13px;
    font-weight: 300;
    padding-left: 15px; /* Offset from scrollbar slightly */
    padding-right: 15px; /* Offset from scrollbar slightly */
	margin-bottom: 5px;
}

/* Dive into Categories */
.dive-category-item a {
    display: flex;
    align-items: center;
    padding: 10px 0px;
    gap: 18px;
    border-bottom: 1px solid #f2f2f2;
}
.dive-category-item img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 12px;
    /*border: 1px solid #e8e8e8;*/
    flex-shrink: 0;
    background: #f7f7f7;
}
.dive-cat-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}
.dive-cat-name {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    color: #222;
}
.dive-cat-name p { margin-bottom: 0px !important; }
.dive-cat-options {
    font-size: 12px;
    font-weight: 800;
    color: #000;
}

/* Products */
.product-item a {
    display: flex;
    align-items: center;
    padding: 6px 0px;
}
.product-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 3px;
    border: 1px solid #eaeaea;
}
.product-item p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #222;
}

/* History adjustments */
.search-dropdown .hd-recent-search-list,
.search-dropdown .hd-popular-search-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin-top: 10px;
}
.search-dropdown .hd-recent-search-list li,
.search-dropdown .hd-popular-search-list li {
    display: inline-block !important;
    width: auto !important;
}
.search-dropdown .heading-title {
    color: #f2a600;
    font-weight: 800;
    font-size: 13px !important;
    margin-top: 15px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #777;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .tt-search-input {
        padding: 10px 15px 10px 40px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    /* On mobile, search is a full-screen overlay. Results should fill height cleanly */
    .search-results {
        position: static;
        width: 100%;
        max-height: calc(100vh - 120px); /* Leave room for mobile input */
        margin-top: 15px;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* Ensure the mobile search overlay covers any sticky filter bars ONLY when active */
    .tt-search-active .tt-dropdown-menu,
    .tt-search.is-open .tt-dropdown-menu,
    .tt-search.active .tt-dropdown-menu {
        z-index: 999999 !important;
        background-color: #fff !important;
    }
    
    /* Hide scrollbar visually on mobile for cleaner look */
    .search-results::-webkit-scrollbar {
        width: 4px;
    }
}
