/* AI Search Component Styles */

/* ================================
   Search Toggle Button in Navbar
   ================================ */
.search-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    color: var(--primary-color, #6366f1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.search-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.search-toggle-btn:hover::before {
    opacity: 1;
}

.search-toggle-btn:hover i {
    color: white;
    position: relative;
    z-index: 1;
}

.search-toggle-btn i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* ================================
   Search Modal Styles
   ================================ */
#searchModal .modal-dialog {
    max-width: 680px;
    margin: 5vh auto;
}

#searchModal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    background: var(--bg-color, #ffffff);
}

.search-modal-content {
    background: var(--bg-color, #ffffff);
    border-radius: 20px;
    overflow: hidden;
}

/* Modal Header */
.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 18px;
    color: #6366f1;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.search-modal-input {
    width: 100%;
    height: 52px;
    padding: 0 120px 0 50px;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 500;
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-color, #1e293b);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal-input:focus {
    outline: none;
    border-color: #6366f1;
    background: var(--bg-color, #ffffff);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-modal-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-shortcuts {
    position: absolute;
    right: 50px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.search-shortcuts kbd {
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.search-modal-clear {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-modal-clear:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.search-modal-clear.show {
    display: flex;
}

.search-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Modal Body */
.search-modal-body {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.search-modal-body::-webkit-scrollbar {
    width: 6px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Welcome State */
.search-welcome {
    text-align: center;
    padding: 40px 20px;
}

.search-welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
}

.search-welcome-icon i {
    font-size: 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
}

.search-welcome h5 {
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin-bottom: 8px;
}

.search-welcome p {
    font-size: 0.9rem;
}

/* Search Sections */
.search-section {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.search-section:last-child {
    border-bottom: none;
}

.search-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-section-header .view-all-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}

.search-section-header .view-all-link:hover {
    text-decoration: underline;
}

/* Suggestion Items */
.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-color, #1e293b);
    text-decoration: none;
    gap: 12px;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
}

.search-suggestion-item.active {
    border-left: 3px solid #6366f1;
}

.search-suggestion-item i {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.search-suggestion-item .suggestion-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--text-color, #1e293b);
    font-weight: 500;
    display: inline-block;
}

.search-suggestion-item strong,
.search-suggestion-item mark {
    font-weight: 600;
    color: #6366f1;
    background: transparent;
}

/* Product Items */
.product-suggestion-item {
    padding: 14px 20px;
}

.product-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    color: var(--text-color, #1e293b);
}

.product-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
}

.product-price {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-price .original-price {
    font-size: 0.8rem;
    color: #94a3b8;
}

.product-price .sale-price {
    font-weight: 700;
    color: #ef4444;
}

.product-price .regular-price {
    font-weight: 700;
    color: #059669;
}

/* Category Items */
.category-suggestion-item {
    padding: 10px 20px;
}

.category-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.category-icon i {
    color: #d97706;
    font-size: 1rem;
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color, #1e293b);
}

.category-count {
    font-size: 0.8rem;
    color: #64748b;
}

/* Trending Tags */
.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 20px 16px;
}

.trending-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trending-tag:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.trending-tag i {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.trending-tag .trending-text {
    color: #dc2626;
    font-weight: 500;
}

/* Recent Search Items */
.recent-item {
    position: relative;
}

.recent-item .delete-recent-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
}

.recent-item:hover .delete-recent-btn {
    opacity: 1;
}

.recent-item .delete-recent-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Loading State */
.search-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.search-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.search-empty-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    margin-bottom: 16px;
}

.search-empty-icon i {
    font-size: 1.8rem;
    color: #94a3b8;
}

.search-empty h6 {
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin-bottom: 8px;
}

.search-empty p {
    font-size: 0.9rem;
    color: #64748b;
    max-width: 300px;
}

/* Modal Footer */
.search-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.search-tips {
    display: flex;
    gap: 16px;
}

.search-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #64748b;
}

.search-tip kbd {
    padding: 3px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #475569;
    background: #e2e8f0;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

.search-powered {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
}

/* Badge */
.search-suggestion-item .badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    font-weight: 600;
    border-radius: 20px;
}

/* ================================
   Dark Mode Styles
   ================================ */
[data-theme="dark"] .search-toggle-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
}

[data-theme="dark"] .search-modal-content {
    background: #1e1e2d;
}

[data-theme="dark"] .search-modal-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .search-modal-input {
    background: #2a2a40;
    color: #e2e8f0;
    border-color: #3d3d5c;
}

[data-theme="dark"] .search-modal-input:focus {
    background: #1e1e2d;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .search-modal-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .search-shortcuts kbd {
    background: #3d3d5c;
    border-color: #4a4a6a;
    color: #94a3b8;
}

[data-theme="dark"] .search-modal-clear {
    background: #2a2a40;
    color: #94a3b8;
}

[data-theme="dark"] .search-modal-clear:hover {
    background: #3d3d5c;
}

[data-theme="dark"] .search-modal-close {
    background: #2a2a40;
    color: #94a3b8;
}

[data-theme="dark"] .search-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .search-modal-body {
    scrollbar-color: #4a4a6a transparent;
}

[data-theme="dark"] .search-modal-body::-webkit-scrollbar-thumb {
    background: #4a4a6a;
}

[data-theme="dark"] .search-welcome-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
}

[data-theme="dark"] .search-welcome h5 {
    color: #e2e8f0;
}

[data-theme="dark"] .search-section {
    border-bottom-color: #2a2a40;
}

[data-theme="dark"] .search-section-header {
    color: #94a3b8;
}

[data-theme="dark"] .search-suggestion-item {
    color: #e2e8f0;
}

[data-theme="dark"] .search-suggestion-item:hover,
[data-theme="dark"] .search-suggestion-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 100%);
}

[data-theme="dark"] .product-name,
[data-theme="dark"] .category-name {
    color: #e2e8f0;
}

[data-theme="dark"] .product-meta,
[data-theme="dark"] .category-count {
    color: #94a3b8;
}

[data-theme="dark"] .product-thumb {
    border-color: #3d3d5c;
}

[data-theme="dark"] .category-icon {
    background: linear-gradient(135deg, #3d3a20 0%, #4d4a30 100%);
}

[data-theme="dark"] .trending-tag {
    background: linear-gradient(135deg, #3d2020 0%, #4d2a2a 100%);
    border-color: #5d3535;
    color: #f87171;
}

[data-theme="dark"] .trending-tag:hover {
    background: linear-gradient(135deg, #4d2a2a 0%, #5d3535 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .trending-tag .trending-text {
    color: #f87171;
}

[data-theme="dark"] .search-suggestion-item .suggestion-text {
    color: #e2e8f0;
}

[data-theme="dark"] .recent-item .delete-recent-btn {
    color: #64748b;
}

[data-theme="dark"] .recent-item .delete-recent-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .search-empty-icon {
    background: #2a2a40;
}

[data-theme="dark"] .search-empty-icon i {
    color: #64748b;
}

[data-theme="dark"] .search-empty h6 {
    color: #e2e8f0;
}

[data-theme="dark"] .search-modal-footer {
    background: #16161f;
    border-top-color: #2a2a40;
}

[data-theme="dark"] .search-tip {
    color: #94a3b8;
}

[data-theme="dark"] .search-tip kbd {
    background: #3d3d5c;
    border-color: #4a4a6a;
    color: #94a3b8;
}

/* ================================
   Mobile Responsive
   ================================ */
@media (max-width: 768px) {
    #searchModal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .search-modal-header {
        padding: 12px 16px;
    }

    .search-modal-input {
        height: 48px;
        font-size: 1rem;
        padding: 0 80px 0 44px;
    }

    .search-input-icon {
        left: 14px;
        font-size: 1rem;
    }

    .search-shortcuts {
        display: none;
    }

    .search-modal-body {
        max-height: 60vh;
    }

    .search-suggestion-item {
        padding: 10px 16px;
    }

    .product-thumb {
        width: 48px;
        height: 48px;
    }

    .search-modal-footer {
        padding: 10px 16px;
    }

    .search-tips {
        display: none;
    }

    .search-powered {
        width: 100%;
        text-align: center;
    }

    .trending-tags {
        padding: 8px 16px 12px;
    }

    .trending-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .search-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .search-toggle-btn i {
        font-size: 0.9rem;
    }
}

/* ================================
   Animation Classes
   ================================ */
#searchModal.show .modal-dialog {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Backdrop blur effect */
#searchModal.show .modal-backdrop {
    backdrop-filter: blur(4px);
}

/* ================================
   AI Search New Components
   ================================ */

/* AI Mode Banner */
.ai-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.ai-mode-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-mode-info i {
    font-size: 1.5rem;
}

.ai-mode-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color, #1e293b);
}

.ai-mode-info small {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

/* AI Mode Toggle Switch */
.ai-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.toggle-track {
    display: block;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-track.active {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-track.active .toggle-thumb {
    left: 22px;
}

/* AI Search Loading Animation */
.ai-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    gap: 16px;
}

.ai-loading-animation {
    display: flex;
    gap: 8px;
}

.ai-loading-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    animation: aiDotBounce 1.4s ease-in-out infinite;
}

.ai-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aiDotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-search-loading span {
    font-size: 0.9rem;
    color: #6366f1;
    font-weight: 500;
}

/* AI Search Message */
.ai-search-message {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.ai-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-avatar i {
    color: white;
    font-size: 1rem;
}

.ai-message-content {
    flex: 1;
}

.ai-message-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color, #1e293b);
    line-height: 1.6;
}

.ai-message-content strong {
    color: #6366f1;
    font-weight: 700;
}

.ai-message-content em {
    font-style: italic;
    color: inherit;
}

.ai-message-content del {
    color: #94a3b8;
    text-decoration: line-through;
}

/* AI Message Links (parsed from markdown) */
.ai-message-link {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-message-link:hover {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.2);
    text-decoration: none;
}

.ai-message-link::after {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    opacity: 0.7;
}

.ai-language-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 20px;
}

/* AI Products Section */
.ai-products-section {
    padding: 12px 0;
}

.ai-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px 20px;
}

/* AI Product Card */
.ai-product-card {
    background: var(--bg-color, #ffffff);
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-product-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.ai-product-card.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.ai-product-card.out-of-stock {
    opacity: 0.7;
}

.ai-product-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.ai-product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8fafc;
}

.ai-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ai-product-card:hover .ai-product-image img {
    transform: scale(1.05);
}

.ai-product-image .discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 6px;
}

.ai-product-image .stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.ai-product-info {
    padding: 10px;
}

.ai-product-name {
    margin: 0 0 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color, #1e293b);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.ai-product-category {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 4px;
}

.ai-product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ai-product-price .original-price {
    font-size: 0.7rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.ai-product-price .sale-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ef4444;
}

.ai-product-price .regular-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #059669;
}

.ai-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #64748b;
}

.ai-product-rating i {
    font-size: 0.65rem;
}

/* AI Product Footer - pushes to bottom with margin-top: auto */
.ai-product-footer {
    margin-top: auto;
    padding: 0;
}

/* AI Product Actions */
.ai-product-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: stretch;
    gap: 6px;
    padding: 8px 10px 10px;
    width: 100%;
    box-sizing: border-box;
}

.ai-action-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-add-cart {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
}

.ai-add-cart:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.ai-add-cart:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.ai-add-cart.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-add-wishlist {
    background: #f1f5f9;
    color: #64748b;
}

.ai-add-wishlist:hover:not(:disabled) {
    background: #fee2e2;
    color: #ef4444;
}

.ai-add-wishlist.success,
.ai-add-wishlist.in-wishlist {
    background: #fee2e2;
    color: #ef4444;
}

.ai-add-wishlist.in-wishlist i {
    font-weight: 900;
}

/* AI Quick Replies */
.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
}

.ai-quick-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-quick-reply-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.ai-quick-reply-btn i {
    font-size: 0.8rem;
}

/* Related Suggestions */
.related-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 20px 16px;
}

.related-suggestion-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-suggestion-tag:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.related-suggestion-tag i {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* AI Example Queries */
.ai-examples-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.02) 100%);
}

.ai-example-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 20px 16px;
}

.ai-example-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-example-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.ai-example-btn i {
    font-size: 0.9rem;
}

/* AI Search Toast */
.ai-search-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #1e293b;
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.ai-search-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ai-search-toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-search-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.ai-search-toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.ai-search-toast.info {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* AI Suggestions Help */
.ai-suggestions-help {
    margin-top: 16px;
    text-align: center;
}

/* Animate bounce for cart count */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.animate-bounce {
    animation: bounce 0.3s ease;
}

/* ================================
   Dark Mode - AI Components
   ================================ */
[data-theme="dark"] .ai-mode-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .ai-mode-info strong {
    color: #e2e8f0;
}

[data-theme="dark"] .toggle-track {
    background: #3d3d5c;
}

[data-theme="dark"] .ai-search-message {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .ai-message-content p {
    color: #e2e8f0;
}

[data-theme="dark"] .ai-message-content strong {
    color: #a5b4fc;
}

[data-theme="dark"] .ai-message-content del {
    color: #64748b;
}

[data-theme="dark"] .ai-message-link {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .ai-message-link:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .ai-language-badge {
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .ai-product-card {
    background: #1e1e2d;
    border-color: #3d3d5c;
}

[data-theme="dark"] .ai-product-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .ai-product-image {
    background: #2a2a40;
}

[data-theme="dark"] .ai-product-name {
    color: #e2e8f0;
}

[data-theme="dark"] .ai-product-category {
    color: #94a3b8;
}

[data-theme="dark"] .ai-add-wishlist {
    background: #2a2a40;
    color: #94a3b8;
}

[data-theme="dark"] .ai-add-wishlist:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .ai-quick-reply-btn {
    background: #2a2a40;
    border-color: #3d3d5c;
    color: #e2e8f0;
}

[data-theme="dark"] .ai-quick-reply-btn:hover {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .related-suggestion-tag {
    background: #2a2a40;
    color: #e2e8f0;
}

[data-theme="dark"] .related-suggestion-tag:hover {
    background: #3d3d5c;
}

[data-theme="dark"] .ai-examples-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
}

[data-theme="dark"] .ai-example-btn {
    background: #2a2a40;
    border-color: #3d3d5c;
    color: #e2e8f0;
}

[data-theme="dark"] .ai-example-btn:hover {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .ai-search-toast {
    background: #2a2a40;
}

/* ================================
   Mobile Responsive - AI Components
   ================================ */
@media (max-width: 768px) {
    .ai-mode-banner {
        padding: 10px 16px;
    }

    .ai-mode-info i {
        font-size: 1.25rem;
    }

    .ai-mode-info strong {
        font-size: 0.85rem;
    }

    .ai-mode-info small {
        display: none;
    }

    .ai-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 16px;
    }

    .ai-product-card {
        border-radius: 10px;
    }

    .ai-product-info {
        padding: 8px;
    }

    .ai-product-name {
        font-size: 0.75rem;
    }

    .ai-product-price .sale-price,
    .ai-product-price .regular-price {
        font-size: 0.8rem;
    }

    .ai-product-footer {
        margin-top: auto;
    }

    .ai-product-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 6px 8px 8px;
        gap: 4px;
    }

    .ai-action-btn {
        flex: 1 1 0;
        height: 28px;
        font-size: 0.75rem;
        min-width: 0;
    }

    .ai-quick-replies,
    .ai-example-queries {
        padding: 8px 16px;
    }

    .ai-quick-reply-btn,
    .ai-example-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .ai-search-message {
        padding: 12px 16px;
    }

    .ai-avatar {
        width: 32px;
        height: 32px;
    }

    .ai-avatar i {
        font-size: 0.9rem;
    }

    .ai-message-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ai-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ai-product-name {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
    }

    .ai-product-category {
        display: none;
    }

    .ai-product-rating {
        display: none;
    }
}
