/**
 * WPKoda — Search Autocomplete Styles
 */

/* ============================================
   Dropdown Container
   ============================================ */
.wpkac-dropdown {
    position: absolute !important;
    z-index: 999998 !important;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    direction: rtl !important;
    font-family: 'Cairo', sans-serif !important;
    max-height: 520px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    color: #1e293b !important;
    animation: wpkacFadeIn 0.2s ease !important;
}

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

.wpkac-dropdown::-webkit-scrollbar {
    width: 6px !important;
}
.wpkac-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

/* ============================================
   Section Title
   ============================================ */
.wpkac-section {
    margin-bottom: 4px !important;
}
.wpkac-section:last-child {
    margin-bottom: 0 !important;
}
.wpkac-section-title {
    padding: 8px 12px 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}
.wpkac-title-products { color: #ec4899 !important; }
.wpkac-title-posts    { color: #3b82f6 !important; }
.wpkac-title-services { color: #10b981 !important; }

/* ============================================
   Item (بطاقة منتج/مقال)
   ============================================ */
.wpkac-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.15s !important;
    cursor: pointer !important;
    direction: rtl !important;
}
.wpkac-item:hover,
.wpkac-item.wpkac-active {
    background: #f1f5f9 !important;
}

/* ============================================
   Thumbnail
   ============================================ */
.wpkac-thumb {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
    flex-shrink: 0 !important;
}
.wpkac-thumb-sm {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
}
.wpkac-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
}
.wpkac-thumb-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    color: rgba(255,255,255,0.85) !important;
}
.wpkac-placeholder-product {
    background: linear-gradient(135deg, #ec4899, #f43f5e) !important;
}
.wpkac-placeholder-post {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
}
.wpkac-placeholder-service {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* ============================================
   Item Info
   ============================================ */
.wpkac-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
.wpkac-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
}
.wpkac-meta {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 3px !important;
    font-size: 12px !important;
}

/* ============================================
   Rating
   ============================================ */
.wpkac-rating {
    color: #f59e0b !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* ============================================
   Price (WooCommerce price HTML)
   ============================================ */
.wpkac-price {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #ec4899 !important;
    line-height: 1 !important;
}
.wpkac-price ins {
    background: transparent !important;
    text-decoration: none !important;
    color: #ec4899 !important;
    font-weight: 700 !important;
}
.wpkac-price del {
    color: #94a3b8 !important;
    font-size: 11px !important;
    opacity: 0.8 !important;
    margin: 0 4px !important;
}
.wpkac-price .woocommerce-Price-amount {
    color: inherit !important;
}
.wpkac-price bdi {
    color: inherit !important;
}

/* ============================================
   Footer (عرض كل النتائج)
   ============================================ */
.wpkac-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    margin-top: 6px !important;
    border-top: 1px solid #f1f5f9 !important;
    color: #3b82f6 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 0 0 10px 10px !important;
    transition: background 0.15s !important;
    direction: rtl !important;
}
.wpkac-footer:hover,
.wpkac-footer.wpkac-active {
    background: #eff6ff !important;
    color: #2563eb !important;
}
.wpkac-footer-arrow {
    font-size: 14px !important;
}

/* ============================================
   Loading
   ============================================ */
.wpkac-loading {
    text-align: center !important;
    padding: 30px 20px !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* ============================================
   Empty State
   ============================================ */
.wpkac-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 20px !important;
    text-align: center !important;
    gap: 8px !important;
}
.wpkac-empty-icon {
    font-size: 32px !important;
    opacity: 0.5 !important;
}
.wpkac-empty-text {
    font-size: 13px !important;
    color: #64748b !important;
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 600px) {
    .wpkac-dropdown {
        max-height: 400px !important;
        border-radius: 10px !important;
    }
    .wpkac-thumb {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }
    .wpkac-thumb-sm {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
    .wpkac-title {
        font-size: 13px !important;
    }
    .wpkac-price {
        font-size: 12px !important;
    }
    .wpkac-price ins {
        font-size: 12px !important;
    }
}
