/* ============================================================
   MOBIL PASTKI NAVIGATSIYA PANELI (≤768px, sayt bo'ylab)
   ------------------------------------------------------------
   resources/views/partials/mobile-tabbar.blade.php komponentining
   stillari. layouts/app.blade.php da guest.css'dan HAM, har bir
   sahifaning o'z @push('styles') fayllaridan (masalan compare.css)
   HAM keyin ulanadi — shuning uchun .compare-float/.lead-toast
   kabi eski qoidalarni, hatto ularning sahifaga xos takroriy
   nusxalarini ham, ishonchli ravishda bekor qiladi.

   Z-index: 250 — mobile-nav overlay (299) va drawer (300) dan past,
   barcha modal/overlay'lardan (≥998) past, oddiy sahifa kontentidan
   yuqori.
   ============================================================ */

.mobile-tabbar { display: none; }

@media (max-width: 768px) {
    /* Panel mavjud bo'lgan sahifalarda footer/kontent panel ostida
       qolib ketmasin (body.has-mobile-tabbar — layouts/app.blade.php). */
    body.has-mobile-tabbar {
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
    }

    .mobile-tabbar {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(58px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: #fff;
        border-top: 1px solid #e8ebed;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
        z-index: 250;
    }

    .mobile-tabbar__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 6px 2px 0;
        color: #8a97a3;
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        transition: color .15s;
    }
    .mobile-tabbar__item svg { width: 22px; height: 22px; flex-shrink: 0; }
    .mobile-tabbar__label {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-tabbar__item--active { color: #04a5b5; }

    /* ---- Markaziy AI tugmasi — biroz ko'tarilgan, teal doira ---- */
    .mobile-tabbar__center {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-tabbar__center-btn {
        position: absolute;
        top: -18px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 3px solid #fff;
        background: linear-gradient(135deg, #024a57, #04a5b5);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 16px rgba(4, 165, 181, .45);
        cursor: pointer;
        padding: 0;
    }
    .mobile-tabbar__center-btn svg { width: 24px; height: 24px; }
    .mobile-tabbar__center-btn:hover { background: linear-gradient(135deg, #013340, #038a98); }
    .mobile-tabbar__center-label {
        position: absolute;
        bottom: 6px;
        font-size: 10px;
        font-weight: 700;
        color: #04a5b5;
        white-space: nowrap;
    }

    /* ---- Boshqa pastki floating elementlarni panel ustiga ko'tarish ----
       Faqat panel mavjud sahifalarda (body.has-mobile-tabbar) — sahifaning
       o'z pastki paneli bo'lsa (masalan listing/show.blade.php) bu klass
       yo'q, eski offsetlar o'zgarmaydi. */
    body.has-mobile-tabbar .compare-float { bottom: 74px; }
    body.has-mobile-tabbar .lead-toast { bottom: 74px; }
}

/* ============================================================
   AI QIDIRUV VARAG'I (bottom sheet) — markaziy tugma ochadi.
   Barcha o'lchamlarda DOM'da mavjud, lekin trigger faqat mobil
   panelda (≤768px) ko'rinadi. id/class'lar "mai" prefiksi bilan —
   bosh sahifadagi #aiSearch* elementlari bilan to'qnashmaydi.
   ============================================================ */
.mai-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(2, 74, 87, .45);
    backdrop-filter: blur(2px);
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.mai-overlay.mai-open { display: flex; }

.mai-sheet {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .2);
    box-sizing: border-box;
    animation: maiSheetIn .22s ease-out;
}
@keyframes maiSheetIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.mai-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}
.mai-sheet__title { font-size: 1.15rem; font-weight: 800; color: #024a57; margin: 0; }
.mai-sheet__close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    cursor: pointer;
    padding: 0;
    transition: background .15s;
}
.mai-sheet__close:hover { background: #e5e5e5; }

.mai-sheet__hint { font-size: .85rem; color: #777; margin: 2px 0 14px; line-height: 1.4; }

.mai-sheet__textarea {
    display: block;
    width: 100%;
    min-height: 90px;
    resize: vertical;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .95rem;
    font-family: inherit;
    color: #222;
    box-sizing: border-box;
}
.mai-sheet__textarea:focus { outline: none; border-color: #04a5b5; }
.mai-sheet__textarea::placeholder { color: #aaa; }

.mai-sheet__error {
    display: none;
    color: #dc2626;
    font-size: .82rem;
    margin-top: 8px;
}
.mai-sheet__error.mai-show { display: block; }

.mai-sheet__submit {
    margin-top: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #024a57, #04a5b5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
.mai-sheet__submit:hover { opacity: .92; }
.mai-sheet__submit:disabled { opacity: .6; cursor: not-allowed; }

@media (min-width: 769px) {
    /* Desktop'da markaziy tugma yo'q (panel butunlay yashirin), lekin
       varaq o'zi DOM'da qoladi — hech qachon .mai-open qo'yilmaydi,
       shuning uchun qo'shimcha yashirish shart emas. */
}
