/*!
 * Author : SiberMimar "Güray Avcı"
 * Website: www.sibermimar.com.tr
 */

/* ==========================================================================
   Emlok Extensions - Mobile Bottom Menu + Membership Badge + Vitrin helpers
   ========================================================================== */

@media (max-width: 991.98px) {
    :root {
        /* Total reserved space for the fixed bottom area (nav + quick buttons). */
        --emlok-bottom-menu-height: 112px;
    }

    body {
        padding-bottom: calc(var(--emlok-bottom-menu-height) + env(safe-area-inset-bottom)) !important;
        padding-bottom: calc(var(--emlok-bottom-menu-height) + constant(safe-area-inset-bottom)) !important;
    }

    .emlok-mobile-bottom-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;

        background: #ffffff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08);

        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        padding-bottom: calc(10px + constant(safe-area-inset-bottom));
    }

    /* Quick actions row (WhatsApp / Call) */
    .emlok-mobile-bottom-menu__quick {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
    }

    .emlok-mobile-bottom-menu__quick-btn {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;

        height: 36px;
        padding: 0 12px;

        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        background: #fff;

        text-decoration: none !important;
        color: #111827;

        font-size: 12px;
        font-weight: 700;
        line-height: 1;

        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .emlok-mobile-bottom-menu__quick-btn i {
        font-size: 16px;
        line-height: 1;
    }

    .emlok-mobile-bottom-menu__quick-btn--whatsapp i {
        color: #25D366;
    }

    .emlok-mobile-bottom-menu__quick-btn--call i {
        color: var(--primary-color);
    }

    .emlok-mobile-bottom-menu__quick-btn:active {
        transform: translateY(1px);
    }

    /* Bottom navigation */
    .emlok-mobile-bottom-menu__inner {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        gap: 6px;
    }

    .emlok-mobile-bottom-menu__item {
        flex: 1 1 0;
        min-width: 0;

        text-align: center;
        text-decoration: none !important;
        color: inherit;

        padding: 8px 4px;
        border-radius: 12px;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;

        min-height: 52px;

        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .emlok-mobile-bottom-menu__item:active {
        background: rgba(0, 0, 0, 0.06);
    }

    .emlok-mobile-bottom-menu__item--active {
        color: var(--primary-color);
        background: rgba(0, 0, 0, 0.04);
    }

    .emlok-mobile-bottom-menu__icon {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 24px;
        height: 24px;

        font-size: 18px;
        line-height: 1;
    }

    .emlok-mobile-bottom-menu__label {
        display: block;
        font-size: 11px;
        line-height: 1;
        white-space: nowrap;
    }

    /* Middle action (İlan Ver) as a FAB */
    .emlok-mobile-bottom-menu__item--primary {
        background: transparent;
        font-weight: 800;
        position: relative;
        top: -10px;
    }

    .emlok-mobile-bottom-menu__item--primary .emlok-mobile-bottom-menu__icon {
        width: 46px;
        height: 46px;
        border-radius: 999px;

        background: var(--primary-color);
        color: #fff;

        box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
    }

    .emlok-mobile-bottom-menu__item--primary:active .emlok-mobile-bottom-menu__icon {
        transform: translateY(1px);
    }

    /* Focus styles (keyboard) */
    .emlok-mobile-bottom-menu__item:focus-visible,
    .emlok-mobile-bottom-menu__quick-btn:focus-visible {
        outline: 2px solid rgba(0, 0, 0, 0.25);
        outline-offset: 2px;
    }

    /* action_footer position fix (avoid overlap with bottom menu) */
    .action_footer {
        bottom: calc(var(--emlok-bottom-menu-height) + 10px + env(safe-area-inset-bottom));
        bottom: calc(var(--emlok-bottom-menu-height) + 10px + constant(safe-area-inset-bottom));
        right: 12px;
        z-index: 10000;
    }

    .action_footer .cd-top {
        right: 0;
    }

    .action_footer__call {
        font-size: 17px;
    }
}

@media (min-width: 992px) {
    .emlok-mobile-bottom-menu {
        display: none !important;
    }
}

/* Membership badge */
.emlok-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.emlok-badge--silver {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.15);
}

.emlok-badge--gold {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid rgba(146, 64, 14, 0.18);
}

.emlok-badge--platinum {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid rgba(21, 94, 117, 0.18);
}

/* Vitrin button helpers */
.emlok-vitrin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.emlok-vitrin-actions .btn {
    border-radius: 10px;
}
