﻿/* اصلاح اولویت نمایش مودال */
/* حل مشکل قرارگیری سایه روی مودال */
.modal {
    z-index: 2147483647 !important; /* بالاترین حد ممکن */
}

.modal-backdrop {
    z-index: 2147483646 !important; /* یک واحد کمتر از مودال */
}
/* جلوگیری از تداخل اسکرول */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}


/* --- 1. منوی پایین موبایل --- */
.bq-nav-fixed-wrapper {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #ffffff !important;
    box-shadow: 0 -3px 15px rgba(0,0,0,0.15) !important;
    z-index: 2147483647 !important;
    direction: rtl !important;
    backface-visibility: hidden !important;
    will-change: transform !important;
}

.bq-nav-container {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    height: 100% !important;
}

.bq-nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #888 !important;

}

    .bq-nav-item.active {
        color: #f39c12 !important;
    }

        .bq-nav-item.active .bq-svg {
            fill: #f39c12 !important;
        }

.bq-svg {
    width: 22px;
    height: 22px;
    fill: #888;
}

    .bq-svg.white {
        fill: #fff;
    }

.bq-nav-item span {
    font-size: 10px;
    margin-top: 3px;
    font-weight: bold;
}

/* سبد خرید برجسته */
.bq-nav-cart {
    position: relative !important;
    top: -12px !important;
}

.bq-cart-circle {
    background: #f39c12 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 4px solid #fff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.bq-badge {
    position: absolute !important;
    top: 2px !important; /* از -2 به 2 تغییر کرد تا بیاید پایین‌تر */
    right: 6px !important; /* از -2 به 6 تغییر کرد تا بیاید داخل‌تر */
    background: #e74c3c !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 2px 5px !important; /* کمی پدینگ بیشتر برای ظاهر بهتر */
    font-size: 10px !important; /* کمی بزرگتر برای خوانایی */
    line-height: 1 !important;
    font-weight: bold !important;
    border: 1px solid #fff !important; /* یک دورخط سفید ظریف برای جدا شدن از نارنجی */
    z-index: 5 !important;
}

.bq-avatar {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    border: 1px solid #ccc !important;
    object-fit: cover;
}

/* --- 2. اصلاح دکمه بله و پیام (انیمیشن افقی) --- */
.bale-btn {
    position: fixed !important;
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    background: rgba(0,184,148,1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    z-index: 2147483640 !important;
    cursor: pointer !important;
    left: 15px !important;
    bottom: 35px !important;
}

    .bale-btn .bale-msg {
        position: absolute !important;
        left: 65px !important;
        bottom: 12px !important;
        background: #fff !important;
        padding: 7px 14px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
        color: #333 !important;
        box-shadow: 0 3px 12px rgba(0,0,0,0.2) !important;
        white-space: nowrap !important;
        pointer-events: none !important;
        /* تنظیمات انیمیشن */
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateX(-20px) !important;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        display: block !important;
    }

        /* این بخش مهم است: ظاهر شدن پیام */
        .bale-btn .bale-msg.show {
            opacity: 1 !important;
            visibility: visible !important;
            transform: translateX(0) !important;
        }



.bq-nav-fixed-wrapper {
    display: none;
}
/* ================================
   MOBILE HEADER - BUYQOOSH
   فقط برای همین ساختار HTML
================================ */

@media (max-width: 767px) {

    /* ویجت گفتینو */
    #goftino_widget,
    #goftino_w,
    .goftino-ri,
    .goftino-widget,
    .goftino-launcher {
        bottom: 72px !important;
        right: 10px !important;
        z-index: 9998 !important;
    }

    .bale-btn {
        bottom: 80px !important;
    }

    .bq-nav-fixed-wrapper {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 65px !important; /* یا هر ارتفاعی که داری */
        z-index: 999999 !important;
        background: #fff; /* مطمئن شو پس‌زمینه داره که محتوا از زیرش نیاد */
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        visibility: visible !important;
        opacity: 1 !important;
        padding-bottom: 20px !important;
    }

    .bq-nav-container {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        height: 65px !important;
    }

    body {
        padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
    }
    /* مخفی کردن چیزهای دسکتاپ */
    .left-cart, .header-user-menu, .top-menu, .header-extra-links, .mm-slideout, .navbar-Link {
        display: none !important;
    }

    /* هدر موبایل */
    .mobile-header-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9999;
        background: #fff;
    }

    /* نوار اطلاع‌رسانی بالا */
    .top-notice-bar {
        background: #1b233b;
        text-align: center;
        padding: 8px 10px;
        overflow: hidden;
        max-height: 40px;
        opacity: 1;
        transition: all 0.3s ease;
    }

        .top-notice-bar.hide-notice {
            max-height: 0;
            padding-top: 0;
            padding-bottom: 0;
            opacity: 0;
        }

    .notice-link {
        color: #f4c542;
        font-size: 11px;
        font-weight: 700;
        text-decoration: none !important;
        display: block;
        line-height: 1.4;
    }

    /* بخش سفید هدر */
    .mobile-sticky-header {
        background: #fff;
        padding: 8px 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    /* استایل عکس و متن داخل لیست */
    .autocomplete-item {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        padding: 10px;
        border-bottom: 1px solid #f9f9f9;
        text-decoration: none !important;
    }

    /* باکس جستجو */
    .mobile-search-container {
        background: #f5f5f5;
        border: 1px solid #e8e8e8;
        border-radius: 12px;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 10px;
        display: flex;
        align-items: center;
    }

    .search-bar-wrapper {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        direction: rtl !important;
    }

    /* لوگو */
    .search-logo-box {
        width: 90px !important;
        flex: none !important;
        margin-left: 10px;
        padding-left: 10px;
        border-left: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .inner-search-logo {
        width: 70px !important;
        height: auto !important;
        display: block;
    }

    /* فرم جستجو */
    .search-form-mobile {
        display: flex !important;
        flex: 1 !important;
        align-items: center !important;
    }

    .mobile-search-input {
        flex: 1 1 auto;
        border: none;
        background: transparent;
        height: 42px;
        font-size: 13px;
        color: #333;
        outline: none;
        box-shadow: none;
        padding: 0 8px;
        min-width: 0;
    }

        .mobile-search-input::placeholder {
            color: #888;
        }

    .search-btn-mobile {
        flex: 0 0 auto;
        border: none;
        background: transparent;
        color: #f39c12;
        font-size: 18px;
        padding: 0;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        outline: none;
        box-shadow: none;
    }

        .search-btn-mobile i {
            line-height: 1;
        }

    /* برای اینکه محتوا زیر هدر نرود */
    body {
        padding-top: 92px !important;
    }

        /* اگر نوار بالا مخفی شد، می‌توانی بعداً با JS کلاس اضافه کنی */
        body.notice-hidden {
            padding-top: 52px !important;
        }

    .mobile-sticky-header {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}


/* حذف هدر موبایل در دسکتاپ */
@media (min-width: 768px) {
    .mobile-header-wrapper,
    .mobile-page-offset {
        display: none !important;
    }
}

#results2 {
    position: relative !important;
    width: 100% !important;
    z-index: 999999;
}

/* خود لیست پیشنهادات */
.ui-autocomplete {
    position: absolute !important;
    /* فاصله جانبی 10px برای هماهنگی با حاشیه کادر موبایل */
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    background: #fff !important;
    border: 1px solid #eee !important;
    border-top: none !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    border-radius: 0 0 15px 15px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    list-style: none !important;
}

/* رفع مشکل نقاط سیاه کنار لیست در برخی گوشی‌ها */
.ui-menu-item {
    list-style: none !important;
}





/* این بخش باعث می‌شود لیست پیشنهادات دقیقاً زیر کادر قرار بگیرد */
#results2 .ui-autocomplete {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important; /* نسبت به والد خود یعنی results2 */
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    border-top: none;
    background: #fff;
    z-index: 9999;
    padding: 0;
    margin: 0;
    list-style: none;
}


/* حذف کادر اضافه دور لیست در موبایل */
.ui-helper-hidden-accessible {
    display: none !important;
}

/* رفع مشکل نمایش نقطه یا دایره کنار لیست */
.ui-helper-hidden-accessible {
    display: none !important;
}


/* استایل حالت هاور (روی هر آیتم) */
.ui-menu-item:hover {
    background-color: #fcfcfc !important;
}