.cbp-advanced-search {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
}

.cbp-dark .cbp-advanced-search {
    background: rgba(15, 23, 42, 0.6);
}

.cbp-advanced-search-text {
    font-size: 11px;
    margin-bottom: 6px;
    opacity: 0.85;
}

/* فرم جمع‌وجور کنار ورودی و دکمه */
.cbp-advanced-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

/* جلوگیری از زوم روی موبایل و هماهنگی با فونت سایت */
.cbp-advanced-search-input {
    flex: 1;
    font-size: 16px;           /* مهم برای جلوگیری از زوم موبایل */
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 999px;
    font-family: inherit;
}

/* دکمه جستجو شبیه دکمه ارسال، با متن وسط‌چین */
.cbp-advanced-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
}

.cbp-advanced-search-results {
    max-height: 200px;
    overflow-y: auto;
}

.cbp-advanced-search-item {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 4px;
}

.cbp-advanced-search-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

.cbp-dark .cbp-advanced-search-item:hover {
    background: rgba(148, 163, 184, 0.2);
}

.cbp-advanced-search-title {
    font-size: 13px;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cbp-advanced-search-meta {
    font-size: 11px;
    opacity: 0.7;
}

.cbp-advanced-search-empty {
    font-size: 12px;
    opacity: 0.8;
}

.cbp-advanced-search-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* برای اطمینان، روی موبایل همه ورودی‌های چت‌بات فونت 16px داشته باشند */

/* حالت آیکونی برای دکمه جستجو */
.cbp-advanced-search-btn.icon-mode {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cbp-advanced-search-btn.icon-mode svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .cbp-input {
        font-size: 16px;
    }
}

/* Rich cards */
.cbp-advanced-search-card {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
}

.cbp-advanced-search-link {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.cbp-advanced-search-thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.12);
}

.cbp-advanced-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cbp-advanced-search-content {
    flex: 1;
    min-width: 0;
}

.cbp-advanced-search-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cbp-advanced-search-type,
.cbp-advanced-search-price {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cbp-advanced-search-excerpt {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.4;
}

.cbp-advanced-search-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.cbp-advanced-search-addtocart {
    font-family: inherit;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1.2;
}

.cbp-advanced-search-addtocart:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Mobile fixes: prevent overflow and make actions stack nicely */
@media (max-width: 480px) {
    .cbp-advanced-search-card {
        flex-direction: column;
        align-items: stretch;
    }

    .cbp-advanced-search-link {
        width: 100%;
    }

    .cbp-advanced-search-actions {
        width: 100%;
        margin-inline-start: 0;
    }

    .cbp-advanced-search-addtocart {
        width: 100%;
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .cbp-advanced-search-title {
        font-size: 12.5px;
    }
}
