/* ==========================================
   کد نهایی افزونه جستجو (mah-ads-search)
   ========================================== */

/* ۱. کانتینر بیرونی: اعمال فاصله ۴ پیکسلی از چپ و راست و هم‌ترازی با کادر بالا */
.mah-ads-search {
    width: calc(100% - 8px) !important;
    margin-right: 4px !important;
    margin-left: 4px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    direction: rtl !important;
}

/* ۲. کادر داخلی: حاشیه خاکستری، گوشه‌های گرد (۱۰ پیکسل) و ارتفاع ۵۰ پیکسلی هماهنگ */
.mah-ads-search__inner {
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    box-sizing: border-box !important;

    /* تراز عمودی المان‌ها */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;

    /* تنظیم فاصله عمودی با باکس انتخاب شهر به اندازه ۲ پیکسل */
    margin: 2px 0 0 0 !important; 
padding: 0 15px 0 16px !important;

    background: #ffffff !important;
    border: 1px solid #d7d7d7 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

/* ۳. استایل متن تایپ‌شده ورودی جستجو (اضافه شدن پدینگ ۸ پیکسلی برای هدایت متن به راست) */
.mah-ads-search__input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 8px 0 0 !important; /* ۸ پیکسل پدینگ از سمت راست */

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;

    text-align: right !important;
    direction: rtl !important;
    color: #444444 !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: normal !important;
}

/* ۴. استایل پلیس‌هولدر (متن پیش‌فرض جستجوی کالا و خدمات) */
.mah-ads-search__input::placeholder {
    color: #444444 !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

/* ۵. کانتینر قرارگیری آیکون‌ها در سمت چپ */
.mah-ads-search__actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important; /* فاصله بین دکمه میکروفون و تصویر */
    margin-right: 12px !important; /* فاصله آیکون‌ها از متن ورودی */
}

/* ۶. استایل کلی دکمه‌های آیکون‌ها */
.mah-ads-search__icon,
.mah-ads-search__image,
.mah-ads-search__voice {
    width: 25px !important;
    height: 25px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #c62828 !important; /* رنگ قرمز آیکون‌ها */
    transition: color 0.2s ease !important;
}

.mah-ads-search__icon:hover,
.mah-ads-search__image:hover,
.mah-ads-search__voice:hover {
    color: #a61f1f !important;
    background: transparent !important;
}

/* ۷. ابعاد تصاویر SVG داخل دکمه‌ها */
.mah-ads-search__icon svg,
.mah-ads-search__image svg,
.mah-ads-search__voice svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    fill: currentColor !important;
}

/* ۸. جابجایی دکمه‌ها (میکروفون به عنوان اولین آیکون، تصویر به عنوان دومین آیکون) */
.mah-ads-search__voice {
    order: 1 !important; /* میکروفون در سمت راستِ آیکون تصویر قرار می‌گیرد */
}

.mah-ads-search__image {
    order: 2 !important; /* آیکون تصویر بعد از میکروفون قرار می‌گیرد */
}

/* ۹. مخفی‌سازی دکمه متنی پیش‌فرض جستجو */
.mah-ads-search__submit {
    display: none !important;
}

/* ۱۰. حذف فضاهای داخلی اضافی ناشی از ویجت‌های المنتور جهت هم‌ترازی بدون نقص لبه‌ها */
.elementor-widget-mah-ads-search, 
.elementor-widget-mah-ads-search .elementor-widget-container {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ۱۱. انیمیشن حالت ضبط صدای فعال (میکروفون) */
.mah-ads-search__voice.is-listening {
    color: #ff0000 !important;
    animation: mah-ads-pulse 1.5s infinite !important;
}

@keyframes mah-ads-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}






/* SVG یکسان برای میکروفن جستجوی کالا و خدمات */
.mah-ads-search__voice svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
    stroke: none !important;
}

.mah-ads-search__voice svg path {
    fill: currentColor !important;
    stroke: none !important;
}












.lidoma-voice-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.lidoma-voice-modal[hidden] {
    display: none !important;
}

.lidoma-voice-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.lidoma-voice-modal__dialog {
    position: relative;
    z-index: 1;
    width: calc(100% - 32px);
    max-width: 360px;
    min-height: 320px;
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lidoma-voice-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lidoma-voice-modal__close:hover {
    background: #e5e7eb;
    color: #111827;
}

.lidoma-voice-modal__icon-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lidoma-voice-modal__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.lidoma-voice-modal__mic {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff5b5b 0%, #e53935 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(229, 57, 53, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lidoma-voice-modal__mic:hover {
    transform: scale(1.03);
}

.lidoma-voice-modal__mic svg {
    width: 32px;
    height: 32px;
}

.lidoma-voice-modal__mic.is-recording + .lidoma-voice-modal__pulse {
    animation: lidomaVoicePulse 1.6s ease-out infinite;
}

.lidoma-voice-modal__mic.is-recording {
    box-shadow: 0 16px 34px rgba(229, 57, 53, 0.35);
}

.lidoma-voice-modal__title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.lidoma-voice-modal__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.9;
    color: #6b7280;
}

.lidoma-voice-modal__text.is-error {
    color: #dc2626;
}

.lidoma-voice-modal__dialog.is-error .lidoma-voice-modal__mic {
    background: linear-gradient(180deg, #ff7b7b 0%, #ef4444 100%);
}

.lidoma-voice-modal-open {
    overflow: hidden;
}

@keyframes lidomaVoicePulse {
    0% {
        transform: scale(0.9);
        opacity: 0.55;
    }
    70% {
        transform: scale(1.35);
        opacity: 0;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}







/* مودال جستجوی تصویری */
.lidoma-image-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.lidoma-image-modal[hidden] { display: none !important; }

.lidoma-image-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.lidoma-image-modal__dialog {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lidoma-image-modal__close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
}

.lidoma-image-modal__icon {
    color: #3b82f6;
    margin-bottom: 15px;
}

.lidoma-image-modal__title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e293b;
}

.lidoma-image-modal__text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 25px;
}

.lidoma-image-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lidoma-image-btn {
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}





/* استایل دکمه اصلی (دوربین) با رنگ قرمز */
.lidoma-image-btn--primary {
    background: #ef4444; /* رنگ قرمز لیدوما/چهارسوق */
    color: #fff;
    border: none;
}

.lidoma-image-btn--primary:hover {
    background: #dc2626; /* قرمز تیره‌تر هنگام هاور */
}

/* آیکون بالای مودال نیز به رنگ قرمز تغییر کند تا با تم سازگار شود */
.lidoma-image-modal__icon {
    color: #ef4444;
    margin-bottom: 15px;
}

/* تغییر رنگ متن در حال آنالیز به قرمز ملایم‌تر جهت هماهنگی */
#lidoma-image-preview-container p {
    color: #ef4444 !important;
}

