/* EL JAWARIYA Fidélité — Bottom navigation native selection v0.4.0 */

/*
 * Rendu final :
 * - barre fixe, pleine largeur, non flottante ;
 * - safe area iPhone conservée ;
 * - ligne utile compacte de 52 px ;
 * - sélection marron compacte à l’intérieur de l’onglet ;
 * - aucune grande colonne marron jusqu’au bas de l’écran.
 */

:root {
    --ej-tabbar-row-height: 52px;
    --ej-tabbar-safe-bottom: env(safe-area-inset-bottom);
    --ej-tabbar-total-height: calc(
        var(--ej-tabbar-row-height) + var(--ej-tabbar-safe-bottom)
    );
    --ej-tabbar-surface: #fffdfb;
}

.customer-app-body {
    padding-bottom: var(--ej-tabbar-total-height) !important;
}

.customer-app-body .public-main {
    padding-bottom: calc(78px + var(--ej-tabbar-safe-bottom)) !important;
}

body.customer-app-body .customer-bottom-nav {
    position: fixed !important;
    z-index: 190 !important;

    inset: auto 0 0 0 !important;

    display: flex !important;
    align-items: flex-start !important;
    justify-content: stretch !important;

    width: 100vw !important;
    min-width: 100vw !important;
    max-width: none !important;

    height: var(--ej-tabbar-total-height) !important;
    min-height: var(--ej-tabbar-total-height) !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box !important;
    transform: none !important;

    overflow: hidden !important;

    border: 0 !important;
    border-top: 1px solid rgba(88, 68, 70, .12) !important;
    border-radius: 0 !important;

    background: var(--ej-tabbar-surface) !important;
    box-shadow: 0 -5px 14px rgba(88, 68, 70, .05) !important;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Neutralise tous les anciens fonds artificiels */
body.customer-app-body .customer-bottom-nav::before,
body.customer-app-body .customer-bottom-nav::after {
    display: none !important;
    content: none !important;
}

body.customer-app-body .customer-bottom-nav a {
    position: relative !important;
    z-index: 1 !important;

    display: flex !important;
    flex: 1 1 25% !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    width: 25% !important;
    min-width: 0 !important;
    max-width: none !important;

    height: var(--ej-tabbar-row-height) !important;
    min-height: var(--ej-tabbar-row-height) !important;

    margin: 0 !important;
    padding: 0 2px !important;

    box-sizing: border-box !important;

    gap: 2px !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    color: var(--ej-muted) !important;
    text-decoration: none !important;

    transition: color .18s ease;
    -webkit-tap-highlight-color: transparent;
}

/*
 * Sélection compacte.
 * Le fond reste marron mais ne remplit plus tout l’onglet.
 */
body.customer-app-body .customer-bottom-nav a::before {
    content: "";
    position: absolute;
    z-index: -1;

    top: 4px;
    right: 7px;
    bottom: 4px;
    left: 7px;

    display: block !important;

    border-radius: 11px;
    background: transparent;

    transition:
        background-color .18s ease,
        transform .18s ease;
}

body.customer-app-body .customer-bottom-nav a::after {
    display: none !important;
    content: none !important;
}

body.customer-app-body .customer-bottom-nav a.active::before {
    background: var(--ej-ink);
}

body.customer-app-body .customer-bottom-nav a small {
    display: block !important;

    margin: 0 !important;
    padding: 0 !important;

    color: currentColor !important;

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9.3px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    letter-spacing: .08px !important;

    white-space: nowrap !important;
}

body.customer-app-body .customer-bottom-nav .customer-nav-icon {
    display: block !important;

    width: 21px !important;
    height: 21px !important;
    flex: 0 0 21px !important;

    margin: 0 !important;
    padding: 0 !important;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;

    color: currentColor !important;
    transform: none !important;
}

body.customer-app-body .customer-bottom-nav a.active {
    background: transparent !important;
    color: var(--ej-accent) !important;
}

body.customer-app-body .customer-bottom-nav a.active small,
body.customer-app-body .customer-bottom-nav a.active .customer-nav-icon {
    color: var(--ej-accent) !important;
    stroke: currentColor !important;
}

body.customer-app-body .customer-bottom-nav a:focus-visible {
    outline: 2px solid var(--ej-accent);
    outline-offset: -4px;
}

@media (max-width: 390px) {
    :root {
        --ej-tabbar-row-height: 50px;
    }

    .customer-app-body .public-main {
        padding-bottom: calc(74px + var(--ej-tabbar-safe-bottom)) !important;
    }

    body.customer-app-body .customer-bottom-nav a::before {
        top: 4px;
        right: 4px;
        bottom: 4px;
        left: 4px;
        border-radius: 10px;
    }

    body.customer-app-body .customer-bottom-nav a small {
        font-size: 8.8px !important;
    }

    body.customer-app-body .customer-bottom-nav .customer-nav-icon {
        width: 20px !important;
        height: 20px !important;
        flex-basis: 20px !important;
    }
}
