/* ═══════════════════════════════════════════════════
   منوی پایین — موبایل و تبلت
   ═══════════════════════════════════════════════════ */

.bottom-nav {
    display: none;  /* به‌طور پیش‌فرض مخفی (دسکتاپ) */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;

    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);

    padding-bottom: env(safe-area-inset-bottom, 0);

    direction: rtl;
    font-family: inherit;
}

@media (max-width: 1024px) {
    .bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
    }

    /* در صفحه جزئیات آگهی، منوی پایین پیش‌فرض مخفی شود
       (چون نوار ثابت تماس/ارسال پیام جایگزین می‌شود) */
    body.page-ad-detail .bottom-nav {
        display: none !important;
    }
}
    /* فاصله‌ی انتهای محتوا تا زیر منو نره */
    body {
        padding-bottom: 76px;
    }

/* ─── آیتم‌ها ─── */
.bottom-nav__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    cursor: pointer;
}

.bottom-nav__item:active {
    transform: scale(0.94);
}

.bottom-nav__item:hover {
    color: #374151;
    text-decoration: none;
}

.bottom-nav__item.is-active {
    color: var(--color-primary);
}

/* ─── آیکون ─── */
.bottom-nav__icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.bottom-nav__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bottom-nav__item.is-active .bottom-nav__icon {
    transform: translateY(-1px);
}

/* ─── برچسب ─── */
.bottom-nav__label {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ─── نشان (badge) ─── */
.bottom-nav__badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--color-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════
   آیتم ویژه: ثبت آگهی (برجسته با دایره رنگی)
   ═══════════════════════════════════════════════════ */
.bottom-nav__item.is-primary {
    color: var(--color-primary);
}

.bottom-nav__item.is-primary .bottom-nav__icon {
    width: 42px;
    height: 42px;
    background: var(--color-primary);
    color: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(21, 94, 89, 0.35);
    margin-top: -16px;
    border: 4px solid #FFFFFF;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bottom-nav__item.is-primary:hover .bottom-nav__icon {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 16px rgba(21, 94, 89, 0.45);
    transform: translateY(-2px);
}

.bottom-nav__item.is-primary .bottom-nav__icon svg {
    width: 22px;
    height: 22px;
}

.bottom-nav__item.is-primary.is-active .bottom-nav__icon {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.bottom-nav__item.is-primary .bottom-nav__label {
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 2px;
}
/* ═══════════════════════════════════════════════════
   تبلت: آیتم‌های بزرگ‌تر
   ═══════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
    .bottom-nav__item {
        font-size: 12px;
        padding: 10px 6px 8px;
    }

    .bottom-nav__icon {
        width: 26px;
        height: 26px;
    }

    .bottom-nav__label {
        font-size: 12px;
    }

    .bottom-nav__item.is-primary .bottom-nav__icon {
        width: 46px;
        height: 46px;
    }

    body {
        padding-bottom: 84px;
    }
}

/* ═══════════════════════════════════════════════════
   منوی پایین + باز بودن کیبورد در موبایل: مخفی شود
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    body.keyboard-open .bottom-nav {
        display: none;
    }
}