/* ============================================================
   bottomNav.css — La Poste Guinéenne (Front Office)
   Navigation basse mobile + drawers (services / profil)
   Masquée sur grand écran (>= 1200px).
   S'appuie sur les variables de customFront.css (--pg-*, --amber,
   --card-bg, --border, --text-muted …) pour le mode clair ET sombre.
   ============================================================ */

/* Empêche le scroll du fond quand un drawer est ouvert */
body.bn-scroll-lock {
    overflow: hidden !important;
}

/* Bouton compact (connexion rapide dans la navbar mobile) */
.pg-btn-sm {
    padding: 7px 12px;
    font-size: .8rem;
}

/* Compte (avatar) dans la navbar mobile */
.bn-nav-account {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.bn-nav-account .nav-avatar {
    width: 34px;
    height: 34px;
}

/* ── Barre de navigation basse ─────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: var(--card-bg, #fff);
    border-top: 1px solid var(--border, #dde8e5);
    box-shadow: 0 -6px 24px rgba(9, 45, 38, .10);
    z-index: 1050;
    overflow: visible;
    padding-bottom: env(safe-area-inset-bottom);
    font-family: var(--font-body);
}

@media (max-width: 1199.98px) {
    .bottom-nav {
        display: block;
    }
}

.bn-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    height: 64px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bn-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted, #7a9490);
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .01em;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease;
}

.bn-item .bn-icon-wrap {
    position: relative;
    width: 26px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bn-item .bn-icon-wrap i {
    font-size: 19px;
    transition: transform .18s ease;
}

.bn-item .bn-label {
    white-space: nowrap;
}

/* Pilule indicatrice de l'onglet actif */
.bn-pill {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 26px;
    height: 3px;
    background: var(--pg-800, #092d26);
    border-radius: 0 0 4px 4px;
    transition: transform .22s ease;
}

.bn-item.active {
    color: var(--pg-800, #092d26);
}

.bn-item.active .bn-icon-wrap i {
    transform: translateY(-1px);
}

.bn-item.active .bn-pill {
    transform: translateX(-50%) scaleX(1);
}

.bn-item:active {
    background: rgba(9, 45, 38, .05);
    border-radius: 10px;
}

/* Bouton central surélevé (Menu) */
.bn-item.bn-center {
    justify-content: flex-end;
    padding-bottom: 7px;
}

.bn-center-btn {
    width: 48px;
    height: 48px;
    margin-top: -22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pg-600, #17685a), var(--pg-800, #092d26));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--card-bg, #fff);
    box-shadow: 0 8px 18px rgba(9, 45, 38, .35);
    transition: transform .18s ease;
}

.bn-center-btn i {
    font-size: 19px;
    color: #fff;
}

/* Avatar de profil dans le bouton central */
.bn-center-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.bn-item.bn-center:active .bn-center-btn {
    transform: scale(.93);
}

/* ── Overlay commun ────────────────────────────────────────── */
.bn-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 45, 38, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 1045;
}

.bn-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Drawers (bas d'écran) ─────────────────────────────────── */
.bn-drawer,
.bn-profil-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg, #fff);
    border-radius: 20px 20px 0 0;
    padding: 10px 16px calc(90px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform .32s cubic-bezier(.33, 1, .68, 1);
    z-index: 1046;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(9, 45, 38, .18);
}

.bn-drawer.open,
.bn-profil-drawer.open {
    transform: translateY(0);
}

.bn-drawer-handle-bar,
.bn-profil-handle-bar {
    width: 36px;
    height: 4px;
    margin: 0 auto 16px;
    background: var(--border-md, #c5d8d4);
    border-radius: 2px;
}

.bn-drawer-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark, #0f1c18);
    margin-bottom: 14px;
    padding-left: 2px;
}

/* ── Drawer services : liste de liens ─────────────────────── */
.bn-svc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.bn-svc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--r-md, 12px);
    background: var(--surface, #f6f8f7);
    border: 1px solid var(--border, #dde8e5);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.bn-svc-item:active {
    background: var(--border-md, #c5d8d4);
}

.bn-svc-item.active {
    border-color: var(--pg-400, #3d9186);
    background: var(--pg-50, #e8f4f2);
}

.bn-svc-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--pg-50, #e8f4f2);
    color: var(--pg-700, #0d4037);
}

.bn-svc-icon.mc-amber {
    background: var(--amber-pale, #fdf3e3);
    color: #8a5a1a;
}

.bn-svc-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bn-svc-text strong {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-dark, #0f1c18);
    line-height: 1.2;
}

.bn-svc-text span {
    font-size: .72rem;
    color: var(--text-muted, #7a9490);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Rangées utilitaires (langue, thème) ──────────────────── */
.bn-drawer-sep {
    height: 1px;
    background: var(--border, #dde8e5);
    margin: 6px 0 14px;
}

.bn-util-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 2px;
}

.bn-util-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--text-mid, #3a4e49);
}

.bn-util-label i {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--pg-50, #e8f4f2);
    color: var(--pg-700, #0d4037);
    font-size: 13px;
}

.bn-lang-group {
    display: flex;
    gap: 6px;
}

.bn-lang-btn {
    width: 34px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border, #dde8e5);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.bn-lang-btn.active,
.bn-lang-btn:hover {
    border-color: var(--pg-400, #3d9186);
    background: var(--pg-50, #e8f4f2);
}

.bn-theme-btn {
    width: 38px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border, #dde8e5);
    background: transparent;
    color: var(--text-mid, #3a4e49);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, background .15s ease;
}

.bn-theme-btn:hover {
    border-color: var(--pg-400, #3d9186);
    background: var(--pg-50, #e8f4f2);
}

/* ── Drawer profil ─────────────────────────────────────────── */
.bn-profil-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 2px 16px;
    border-bottom: 1px solid var(--border, #dde8e5);
    margin-bottom: 10px;
}

.bn-profil-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pg-600, #17685a), var(--pg-800, #092d26));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.bn-profil-name {
    font-weight: 600;
    color: var(--text-dark, #0f1c18);
    font-size: .92rem;
    line-height: 1.2;
}

.bn-profil-role {
    font-size: .74rem;
    color: var(--text-muted, #7a9490);
}

.bn-profil-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    text-decoration: none;
    color: var(--text-main, #0f1c18);
    font-size: .88rem;
    font-weight: 500;
    border-radius: var(--r-sm, 8px);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background .15s ease;
}

.bn-profil-menu-item:active,
.bn-profil-menu-item:hover {
    background: rgba(9, 45, 38, .04);
}

.bn-profil-menu-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--pg-50, #e8f4f2);
    color: var(--pg-700, #0d4037);
}

.bn-profil-menu-icon.red {
    background: rgba(220, 38, 38, .10);
    color: #dc2626;
}

.bn-profil-menu-item.danger {
    color: #dc2626;
}

.bn-profil-menu-item .bn-chevron {
    margin-left: auto;
    font-size: .75rem;
    color: var(--text-muted, #7a9490);
}

/* ── Ajustements contenu / header sur mobile ──────────────── */
@media (max-width: 1199.98px) {
    header.header .navigation {
        height: 60px;
    }

    footer.footer {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    #scroll-container {
        padding-bottom: 8px;
    }
}

/* Sur grand écran : rien de tout cela ne doit exister */
@media (min-width: 1200px) {
    .bottom-nav,
    .bn-overlay,
    .bn-drawer,
    .bn-profil-drawer {
        display: none !important;
    }
}

/* ── MODE SOMBRE ──────────────────────────────────────────── */
html[data-theme="dark"] .bottom-nav {
    background: var(--card-bg, #16211f);
    border-top-color: var(--border, #24352f);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .bn-item {
    color: var(--text-muted, #839c96);
}

html[data-theme="dark"] .bn-item.active {
    color: var(--amber, #e8a44a);
}

html[data-theme="dark"] .bn-item.active .bn-icon-wrap i {
    color: var(--amber, #e8a44a);
}

html[data-theme="dark"] .bn-pill {
    background: var(--amber, #e8a44a);
}

html[data-theme="dark"] .bn-item:active {
    background: rgba(255, 255, 255, .06);
}

html[data-theme="dark"] .bn-drawer,
html[data-theme="dark"] .bn-profil-drawer {
    background: var(--card-bg, #16211f);
}

html[data-theme="dark"] .bn-drawer-handle-bar,
html[data-theme="dark"] .bn-profil-handle-bar {
    background: var(--border-md, #33483f);
}

html[data-theme="dark"] .bn-drawer-title,
html[data-theme="dark"] .bn-profil-name {
    color: var(--text-dark, #e6efec);
}

html[data-theme="dark"] .bn-svc-item {
    background: var(--surface, #0d1514);
    border-color: var(--border, #24352f);
}

html[data-theme="dark"] .bn-svc-item:active {
    background: var(--border-md, #33483f);
}

html[data-theme="dark"] .bn-svc-item.active {
    border-color: var(--pg-400, #3d9186);
    background: rgba(61, 145, 134, .16);
}

html[data-theme="dark"] .bn-svc-icon,
html[data-theme="dark"] .bn-util-label i,
html[data-theme="dark"] .bn-profil-menu-icon {
    background: rgba(61, 145, 134, .18);
    color: var(--pg-200, #8dbfb6);
}

html[data-theme="dark"] .bn-util-label {
    color: var(--text-mid, #aac3bd);
}

html[data-theme="dark"] .bn-lang-btn {
    border-color: var(--border, #24352f);
}

html[data-theme="dark"] .bn-lang-btn.active,
html[data-theme="dark"] .bn-lang-btn:hover {
    border-color: var(--pg-400, #3d9186);
    background: rgba(61, 145, 134, .16);
}

html[data-theme="dark"] .bn-theme-btn {
    border-color: var(--border, #24352f);
    color: var(--text-mid, #aac3bd);
}

html[data-theme="dark"] .bn-theme-btn:hover {
    border-color: var(--pg-400, #3d9186);
    background: rgba(61, 145, 134, .16);
}

html[data-theme="dark"] .bn-profil-menu-item {
    color: var(--text-main, #dce9e5);
}

html[data-theme="dark"] .bn-profil-menu-item:active,
html[data-theme="dark"] .bn-profil-menu-item:hover {
    background: rgba(255, 255, 255, .05);
}

html[data-theme="dark"] .bn-drawer-sep {
    background: var(--border, #24352f);
}
