/*
 * Bottom bar: navigasi utama di web dan panel, untuk semua lebar layar.
 *
 * Ikon: Flaticon UIcons Regular Rounded. Font berisi hanya ikon yang dipakai di sini, karena
 * font dan CSS utuhnya sekitar 540 KB dan akan dimuat di setiap halaman. Untuk menambah ikon,
 * buat ulang subset dari paket npm @flaticon/flaticon-uicons, lalu tambahkan kelasnya di bawah.
 * Lisensi: ../vendors/flaticon-uicons/LICENSE (versi gratis mewajibkan kredit, lihat footer).
 */
@font-face {
    font-family: uicons-regular-rounded;
    src: url("../vendors/flaticon-uicons/uicons-regular-rounded-subset.woff2") format("woff2");
    font-display: block;
}

.fi-rr-apps:before { content: "\f16c"; }
.fi-rr-home:before { content: "\f7b8"; }
.fi-rr-book-alt:before { content: "\f274"; }
.fi-rr-chalkboard-user:before { content: "\f397"; }
.fi-rr-shopping-bag:before { content: "\fbf7"; }
.fi-rr-blog-text:before { content: "\f262"; }
.fi-rr-handshake:before { content: "\f779"; }
.fi-rr-graduation-cap:before { content: "\f70f"; }
.fi-rr-link-alt:before { content: "\f8b5"; }

:root {
    --bottom-bar-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

.bottom-bar-spacer {
    height: var(--bottom-bar-height);
}

.bottom-bar {
    --bottom-bar-surface: #ffffff;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background-color: var(--bottom-bar-surface);
    border-top: 1px solid #ececec;
    box-shadow: 0 -3px 10px 0 rgba(0, 0, 0, 0.05);
}

/* Bayangan di tepi hanya muncul selama masih ada menu yang bisa digeser ke arah itu. */
.bottom-bar-list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(to right, var(--bottom-bar-surface) 30%, transparent) left / 40px 100% no-repeat local,
        linear-gradient(to left, var(--bottom-bar-surface) 30%, transparent) right / 40px 100% no-repeat local,
        linear-gradient(to right, rgba(15, 23, 42, 0.14), transparent) left / 14px 100% no-repeat scroll,
        linear-gradient(to left, rgba(15, 23, 42, 0.14), transparent) right / 14px 100% no-repeat scroll;
}

.bottom-bar-list::-webkit-scrollbar {
    display: none;
}

.bottom-bar.has-horizontal-overflow .bottom-bar-list {
    width: calc(100% - 40px);
}

.bottom-bar-scroll-right {
    display: none;
}

@media (max-width: 991px) {
    .bottom-bar.has-horizontal-overflow .bottom-bar-scroll-right:not([hidden]) {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        width: 44px;
        height: 59px;
        align-items: center;
        justify-content: center;
        padding: 0 0 0 4px;
        border: 0;
        border-radius: 24px 0 0 24px;
        background: var(--primary, #43d477);
        color: #ffffff;
        cursor: pointer;
        box-shadow: -4px 0 10px rgba(15, 23, 42, 0.12);
    }

    .bottom-bar-scroll-right:focus-visible {
        outline: 2px solid var(--primary, #43d477);
        outline-offset: -3px;
    }

    .bottom-bar-scroll-right:disabled {
        color: #ffffff;
        cursor: default;
    }

    .bottom-bar-scroll-right svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2;
    }
}

.bottom-bar-item {
    flex: 1 0 auto;
    min-width: 66px;
}

.bottom-bar-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 59px; /* ditambah border-top .bottom-bar = --bottom-bar-height */
    padding: 0 6px;
    color: #171347;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.bottom-bar-link:hover,
.bottom-bar-link:focus {
    color: var(--primary, #43d477);
    text-decoration: none;
}

.bottom-bar-link:focus-visible {
    outline: 2px solid var(--primary, #43d477);
    outline-offset: -3px;
}

.bottom-bar-icon {
    display: block;
    height: 20px;
    font-size: 20px;
    font-style: normal;
    line-height: 1;
}

.bottom-bar-icon:before {
    display: block;
    font-family: uicons-regular-rounded;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bottom-bar-item.active .bottom-bar-link {
    color: var(--primary, #43d477);
    font-weight: 600;
}

.bottom-bar-item.active .bottom-bar-link:after {
    content: "";
    position: absolute;
    top: 0;
    right: 8px;
    left: 8px;
    height: 4px;
    border-radius: 0 0 3px 3px;
    background-color: var(--primary, #43d477);
}

@media (min-width: 992px) {
    .bottom-bar,
    .bottom-bar-spacer {
        display: none;
    }

    #navbar .desktop-main-nav {
        display: flex;
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        min-width: 0;
        margin: 0 12px;
    }

    #navbar .desktop-main-nav .nav-link {
        padding: 10px 8px;
        white-space: nowrap;
    }

    #navbar .public-nav-actions {
        flex: 0 0 auto;
    }

    /* Daftar menu dibuat rapat agar ikon tidak terpencar di layar lebar. */
    .bottom-bar-list {
        max-width: 960px;
        width: auto !important;
        margin: 0 auto;
        overflow: visible;
        background: none;
    }

    .bottom-bar-scroll-right {
        display: none !important;
    }

    .bottom-bar-link {
        font-size: 12px;
    }

    .bottom-bar-icon,
    .bottom-bar-icon:before {
        height: 22px;
        font-size: 22px;
    }

    /* Di panel, bar dimulai setelah sidebar agar menu paling bawah sidebar tidak tertutup. */
    .bottom-bar-panel {
        left: 254px;
    }

    .rtl .bottom-bar-panel {
        right: 254px;
        left: 0;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    #navbar .desktop-main-nav {
        margin: 0 6px;
    }

    #navbar .desktop-main-nav .nav-link {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 12px;
    }
}

body.dark-mode .bottom-bar {
    --bottom-bar-surface: #1e293b;
    border-top-color: #334155;
    box-shadow: none;
}

body.dark-mode .bottom-bar-link {
    color: #e2e8f0;
}

body.dark-mode .bottom-bar-link:hover,
body.dark-mode .bottom-bar-link:focus,
body.dark-mode .bottom-bar-item.active .bottom-bar-link {
    color: var(--primary, #43d477);
}

/* Aturan dark mode di top_nav dan panel_layout memaksa warna semua span. */
body.dark-mode #bottomBar .bottom-bar-link span {
    color: inherit !important;
}

/* Blok menu sudah tidak ada di navbar, jadi ikon keranjang dan notifikasi panel tetap di kanan. */
#panel_app .nav-icons-or-start-live {
    flex-grow: 0;
}

/* Elemen melayang lain dinaikkan agar tidak tertutup bar. */
body .scroll-to-top-widget {
    bottom: calc(var(--bottom-bar-height) + 16px);
}

body .cookie-security-dialog {
    bottom: calc(var(--bottom-bar-height) + 12px);
}

@media (max-width: 767px) {
    body .cookie-security-dialog {
        bottom: var(--bottom-bar-height);
    }
}

body .jq-toast-wrap.bottom-left,
body .jq-toast-wrap.bottom-right {
    bottom: calc(var(--bottom-bar-height) + 12px);
}

body .floating-bar.position-bottom.is-fixed {
    bottom: var(--bottom-bar-height);
}

@media (min-width: 992px) {
    body .scroll-to-top-widget {
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    body .cookie-security-dialog {
        bottom: 12px;
    }

    body .jq-toast-wrap.bottom-left,
    body .jq-toast-wrap.bottom-right {
        bottom: 12px;
    }

    body .floating-bar.position-bottom.is-fixed {
        bottom: 0;
    }
}

@media print {
    .bottom-bar,
    .bottom-bar-spacer {
        display: none;
    }
}
