/* ==========================================================================
   HEADER LIVE AJAX SEARCH & PRODUCT SUGGESTIONS DROPDOWN
   ========================================================================== */

.ks-header-search {
    position: relative !important;
}

.ks-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Spinner indicator inside search field when typing */
.ks-search-spinner {
    display: none;
    position: absolute;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(16, 43, 70, 0.15);
    border-top-color: #F36B21;
    border-radius: 50%;
    animation: ksSearchSpin 0.6s linear infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes ksSearchSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.ks-header-search.is-loading .ks-search-spinner {
    display: block !important;
}

/* Dropdown Menu Container */
.ks-search-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1.5px solid #102B46;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 43, 70, 0.18), 0 4px 12px rgba(16, 43, 70, 0.08);
    z-index: 999999;
    overflow: hidden;
    max-height: 490px;
    display: flex;
    flex-direction: column;
    animation: ksDropdownSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

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

/* Header inside dropdown */
.ks-sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E5EAF0;
}

.ks-sd-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
}

.ks-sd-title mark {
    background: #FEF08A;
    color: #102B46;
    font-weight: 800;
    padding: 0 3px;
    border-radius: 2px;
}

.ks-sd-count {
    font-size: 11.5px;
    font-weight: 600;
    color: #0875C9;
    background: #EBF4FC;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Scrollable Suggestions List */
.ks-sd-list {
    overflow-y: auto;
    max-height: 380px;
    padding: 4px 0;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 #F1F5F9;
}

.ks-sd-list::-webkit-scrollbar {
    width: 6px;
}

.ks-sd-list::-webkit-scrollbar-track {
    background: #F8FAFC;
}

.ks-sd-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

/* Single Suggestion Item */
.ks-sd-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #F1F5F9;
    border-left: 3px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
}

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

.ks-sd-item:hover,
.ks-sd-item.is-selected {
    background-color: #F0F7FF;
    border-left-color: #F36B21;
    text-decoration: none;
}

/* Thumbnail */
.ks-sd-img-wrap {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
    box-sizing: border-box;
}

.ks-sd-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.ks-sd-item:hover .ks-sd-img,
.ks-sd-item.is-selected .ks-sd-img {
    transform: scale(1.08);
}

/* Product Info */
.ks-sd-info {
    flex: 1 1 auto;
    min-width: 0;
}

.ks-sd-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.ks-sd-cat {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748B;
    background: #F1F5F9;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.ks-sd-brand {
    font-size: 10.5px;
    font-weight: 700;
    color: #0875C9;
    white-space: nowrap;
}

.ks-sd-item-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1E293B !important;
    margin: 0 0 3px !important;
    line-height: 1.4 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s ease;
}

.ks-sd-item:hover .ks-sd-item-title,
.ks-sd-item.is-selected .ks-sd-item-title {
    color: #F36B21 !important;
}

.ks-sd-item-title mark {
    background: #FEF3C7;
    color: #0F172A;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Stock status */
.ks-sd-stock {
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ks-sd-stock.instock {
    color: #059669;
}

.ks-sd-stock.outofstock {
    color: #DC2626;
}

.ks-sd-stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

/* Price Column */
.ks-sd-price-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    padding-left: 14px;
}

.ks-sd-price {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #102B46 !important;
    line-height: 1.25 !important;
    white-space: nowrap;
}

.ks-sd-price .woocommerce-Price-amount,
.ks-sd-price bdi {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #102B46 !important;
}

.ks-sd-price .woocommerce-Price-currencySymbol {
    font-size: 12px !important;
    font-weight: 500 !important;
}

.ks-sd-mrp {
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #94A3B8 !important;
    margin-top: 2px;
    white-space: nowrap;
}

.ks-sd-mrp del,
.ks-sd-mrp .woocommerce-Price-amount,
.ks-sd-mrp bdi {
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #94A3B8 !important;
    text-decoration: line-through;
}

.ks-sd-arrow {
    display: inline-block;
    color: #CBD5E1;
    font-size: 13px;
    font-weight: 400;
    margin-top: 3px;
    transition: transform 0.18s ease, color 0.18s ease;
}

.ks-sd-item:hover .ks-sd-arrow,
.ks-sd-item.is-selected .ks-sd-arrow {
    color: #F36B21;
    transform: translateX(2px);
}
    transform: translateX(3px);
}

/* Footer / View All Link */
.ks-sd-footer {
    background: #F8FAFC;
    border-top: 1px solid #E5EAF0;
    padding: 9px 16px;
    text-align: center;
}

.ks-sd-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #F36B21;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ks-sd-view-all:hover {
    color: #102B46;
    text-decoration: underline;
}

.ks-sd-view-all svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.ks-sd-view-all:hover svg {
    transform: translateX(4px);
}

/* Empty State */
.ks-sd-empty {
    padding: 30px 20px;
    text-align: center;
}

.ks-sd-empty-icon svg {
    width: 36px;
    height: 36px;
    stroke: #94A3B8;
    margin-bottom: 10px;
}

.ks-sd-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #102B46;
    margin: 0 0 6px;
}

.ks-sd-empty-title strong {
    color: #F36B21;
}

.ks-sd-empty-sub {
    font-size: 12px;
    color: #64748B;
    margin: 0;
    line-height: 1.5;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ks-search-dropdown-menu {
        max-height: 380px;
    }
    .ks-sd-img-wrap {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }
    .ks-sd-item-title {
        font-size: 12px !important;
    }
    .ks-sd-price,
    .ks-sd-price .woocommerce-Price-amount,
    .ks-sd-price bdi {
        font-size: 12.5px !important;
    }
}
