.food-ai-chat-search-container {
    max-width: 650px;
    width: 100%;
    margin: 20px auto;
    position: relative;
    padding: 0 10px;
}

.food-ai-chat-search-container .search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.food-ai-chat-search-container .search-wrapper:hover,
.food-ai-chat-search-container .search-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
}

.food-ai-chat-search-container .search-wrapper i.dashicons-format-chat {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #3b82f6;
    margin-right: 12px;
}

.food-ai-chat-search-container .search-wrapper input {
    flex: 1;
    border: none;
    outline: none !important;
    font-size: 16px;
    color: #1e293b;
    font-weight: 500;
    padding: 8px 0;
    background: transparent;
}

.food-ai-chat-search-container .search-wrapper input::placeholder {
    color: #94a3b8;
}

.food-ai-chat-search-btn {
    background: #3b82f6 !important;
    border: none !important;
    color: #ffffff !important;
    width: 44px;
    height: 44px;
    border-radius: 9999px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.food-ai-chat-search-btn:hover {
    background: #2563eb !important;
    transform: scale(1.05);
}

.food-ai-chat-search-btn span.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Floating AI Chat Overlay Popup */
.food-ai-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInAI 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInAI {
    from { opacity: 0; }
    to { opacity: 1; }
}

.food-ai-chat-popup {
    background: #f8fafc;
    width: 100%;
    max-width: 680px;
    height: 80vh;
    max-height: 700px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpAI 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}

@keyframes slideUpAI {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
.food-ai-chat-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.food-ai-chat-header .title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.food-ai-chat-header .ai-avatar {
    background: #eff6ff;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bfdbfe;
}

.food-ai-chat-header .ai-avatar i {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #3b82f6;
}

.food-ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.food-ai-chat-header .ai-status {
    font-size: 11px;
    color: #22c55e;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.food-ai-chat-header .ai-status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.food-ai-chat-close-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    font-size: 24px !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 9999px !important;
    padding: 0 !important;
    transition: all 0.2s ease;
}

.food-ai-chat-close-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Chat Body */
.food-ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.food-ai-chat-msg {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 4px;
}

.food-ai-chat-msg.user {
    align-self: flex-end;
    align-items: flex-end;
}

.food-ai-chat-msg.ai {
    align-self: flex-start;
    align-items: flex-start;
}

.food-ai-chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
}

.food-ai-chat-msg.user .food-ai-chat-bubble {
    background: #3b82f6;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.food-ai-chat-msg.ai .food-ai-chat-bubble {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.food-ai-chat-time {
    font-size: 10px;
    color: #94a3b8;
    margin: 4px;
}

.food-ai-chat-msg.user .food-ai-chat-time {
    text-align: right;
}

/* Typing Indicator */
.food-ai-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    display: none;
}

.food-ai-chat-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: bounceDot 1.4s infinite ease-in-out both;
}

.food-ai-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.food-ai-chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Card Results Grid in AI response */
.food-ai-chat-msg .food-ai-chat-grid-results {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important; /* Single column on PC and Mobile as requested */
    gap: 12px !important;
    margin-top: 10px !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-card {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    float: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-card-inner {
    padding: 10px !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-link-wrapper {
    display: flex !important;
    align-items: center !important;
    flex-grow: 1 !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-logo-container {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    border-radius: 8px !important;
    margin-right: 12px !important;
    overflow: hidden !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-info {
    flex-grow: 1 !important;
    overflow: hidden !important;
    min-width: 0 !important;
    text-align: left !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 0 4px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-meta {
    font-size: 11px !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 2px !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-details {
    font-size: 11px !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .food-res-quick-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-left: 8px !important;
    padding-left: 8px !important;
    border-left: 1px solid #e2e8f0 !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .quick-action {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
}

.food-ai-chat-msg .food-ai-chat-grid-results .quick-action i {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
}

/* Blog Post Cards inside AI Chat */
.food-ai-chat-post-card {
    display: flex !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 10px !important;
    margin-top: 10px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.2s ease !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.food-ai-chat-post-card:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
}

.food-ai-chat-post-card .post-card-thumb {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
}

.food-ai-chat-post-card .post-card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.food-ai-chat-post-card .post-card-content {
    flex: 1 !important;
    overflow: hidden !important;
    text-align: left !important;
}

.food-ai-chat-post-card .post-card-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    letter-spacing: 0.05em !important;
    display: inline-block !important;
    margin-bottom: 4px !important;
}

.food-ai-chat-post-card .post-card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 0 4px 0 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
}

.food-ai-chat-post-card .post-card-excerpt {
    font-size: 12px !important;
    color: #64748b !important;
    margin: 0 0 4px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
}

.food-ai-chat-post-card .post-card-date {
    font-size: 10px !important;
    color: #94a3b8 !important;
    display: block !important;
}

/* Promotion Cards inside AI Chat */
.food-ai-chat-promo-card {
    display: flex !important;
    background: #ffffff !important;
    border: 1px solid #fee2e2 !important;
    border-radius: 12px !important;
    padding: 10px !important;
    margin-top: 10px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.2s ease !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.food-ai-chat-promo-card:hover {
    border-color: #fecaca !important;
    background: #fff5f5 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(239,68,68,0.05) !important;
}

.food-ai-chat-promo-card .promo-card-thumb {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fee2e2 !important;
}

.food-ai-chat-promo-card .promo-card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.food-ai-chat-promo-card .promo-card-content {
    flex: 1 !important;
    overflow: hidden !important;
    text-align: left !important;
}

.food-ai-chat-promo-card .promo-card-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 4px !important;
    gap: 8px !important;
}

.food-ai-chat-promo-card .promo-card-badge {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #fee2e2 !important;
    letter-spacing: 0.05em !important;
}

.food-ai-chat-promo-card .promo-card-price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
}

.food-ai-chat-promo-card .promo-card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 0 2px 0 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
}

.food-ai-chat-promo-card .promo-card-restaurant {
    font-size: 11px !important;
    color: #64748b !important;
    margin: 0 !important;
}

.food-ai-chat-cards-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Footer / Input area */
.food-ai-chat-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
}

.food-ai-chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.food-ai-chat-input-container input {
    flex: 1;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 0 18px;
    font-size: 14px;
    outline: none !important;
    color: #1e293b;
    transition: all 0.2s ease;
}

.food-ai-chat-input-container input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.food-ai-chat-input-btn {
    background: #3b82f6 !important;
    border: none !important;
    color: #ffffff !important;
    width: 44px;
    height: 44px;
    border-radius: 9999px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 !important;
}

.food-ai-chat-input-btn:hover {
    background: #2563eb !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .food-ai-chat-popup {
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .food-ai-chat-msg .food-ai-chat-grid-results {
        grid-template-columns: 1fr !important;
    }
    .food-ai-chat-overlay {
        padding: 0;
    }
}
