/* Dahila Live AJAX Search Styles */
.dahila-live-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    width: 100%;
    min-width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    z-index: 999999;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    box-sizing: border-box;
    overflow: hidden;
}

.dahila-live-search-dropdown * {
    box-sizing: border-box;
}

/* Items Scrollable Container (Shows all results with smooth scroll) */
.dahila-ls-items-container {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dahila-ls-items-container::-webkit-scrollbar {
    width: 6px;
}

.dahila-ls-items-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.dahila-ls-items-container::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Individual Search Result Item */
.dahila-ls-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none !important;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.18s ease;
}

.dahila-ls-item:last-child {
    border-bottom: none;
}

.dahila-ls-item:hover,
.dahila-ls-item.dahila-ls-active {
    background-color: #f8fafc;
}

/* Thumbnail Image */
.dahila-ls-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dahila-ls-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* Info: Title & Badge */
.dahila-ls-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dahila-ls-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.dahila-ls-title mark {
    background-color: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

/* Soft & Clear Badges (#540188 with light 0.12 background for high text legibility) */
.dahila-ls-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    width: fit-content;
    line-height: 1.4;
    color: #540188 !important;
    background-color: rgba(84, 1, 136, 0.12) !important;
    border: 1px solid rgba(84, 1, 136, 0.22) !important;
}

.dahila-ls-badge-product,
.dahila-ls-badge-post {
    color: #540188 !important;
    background-color: rgba(84, 1, 136, 0.12) !important;
    border: 1px solid rgba(84, 1, 136, 0.22) !important;
}

/* Loading & Empty States - Single Line & No Wrap */
.dahila-ls-loading,
.dahila-ls-empty {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dahila-ls-loading span {
    white-space: nowrap !important;
    font-size: 13px;
    color: #475569;
}

.dahila-ls-spinner {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #540188;
    border-radius: 50%;
    animation: dahila-spin 0.7s linear infinite;
}

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

/* Mobile Responsive - Expanded by 30px from Left */
@media (max-width: 768px) {
    .dahila-live-search-dropdown {
        left: -30px !important;
        width: calc(100% + 30px) !important;
        min-width: calc(100% + 30px) !important;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    .dahila-ls-items-container {
        max-height: 350px;
    }
    .dahila-ls-item {
        padding: 10px 12px;
        gap: 10px;
    }
    .dahila-ls-thumb {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }
    .dahila-ls-title {
        font-size: 13px;
    }
    .dahila-ls-loading span {
        font-size: 12px;
    }
}
