/* Premium floating bottom dock — 8om platform */
.bottom-nav {
    --bn-accent: #03ccda;
    --bn-accent-soft: rgba(3, 204, 218, 0.16);
    --bn-label: rgba(214, 224, 236, 0.58);
    --bn-label-active: #f4fbff;
    --bn-icon: rgba(220, 230, 240, 0.72);
    --bn-fab: linear-gradient(160deg, #7af0fa 0%, #03ccda 42%, #0194a3 100%);
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    flex-direction: row;
    width: auto;
    min-height: 68px;
    height: auto;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 9000;
    padding: 0.35rem 0.35rem 0.45rem;
    box-sizing: border-box;
    gap: 0.1rem;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(28, 36, 50, 0.72) 0%, rgba(10, 14, 22, 0.88) 100%);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

.bottom-nav--premium::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(120% 80% at 50% -20%, rgba(3, 204, 218, 0.14), transparent 55%);
}

.bottom-nav--premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    pointer-events: none;
}

.nav-slot {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    background: transparent;
    text-decoration: none;
    color: var(--bn-label);
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.nav-slot--fab {
    flex: 0 0 70px;
    overflow: visible;
    justify-content: flex-end;
    padding-bottom: 0.05rem;
    gap: 0;
    position: relative;
}

.nav-slot.curve {
    flex: 0 0 70px;
    background-image: none;
    background-color: transparent;
    width: auto;
    height: auto;
    transform: none;
    overflow: visible;
    justify-content: flex-end;
    padding-bottom: 0.05rem;
    position: relative;
}

.nav-slot.curve .floating-button {
    position: absolute;
    bottom: auto;
    margin-top: 0;
}

.bottom-nav-link {
    width: 100%;
    height: auto;
    line-height: 1.1;
    padding: 0.28rem 0.1rem 0.2rem !important;
    border-radius: 16px;
    transition: color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.bottom-nav-link:active {
    transform: scale(0.96);
}

.bottom-nav-icon-wrap {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bn-icon);
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bn-ico {
    width: 20px;
    height: 20px;
    display: block;
}

.bn-ico--fab {
    width: 22px;
    height: 22px;
}

/* Fallback while FA icons are still in cached HTML */
.bottom-nav-icon-wrap > i {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1;
    opacity: 0.92;
}

.bottom-nav-label {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.bottom-nav-link.active,
.bottom-nav-link:hover {
    color: var(--bn-label-active);
    background: transparent;
}

.bottom-nav-link.active .bottom-nav-icon-wrap,
.bottom-nav-link:hover .bottom-nav-icon-wrap {
    color: var(--bn-accent);
    transform: translateY(-1px);
    background: var(--bn-accent-soft);
    border-color: rgba(3, 204, 218, 0.28);
    box-shadow: 0 0 0 1px rgba(3, 204, 218, 0.08), 0 6px 16px rgba(3, 204, 218, 0.12);
}

.bottom-nav-link.active .bottom-nav-label {
    color: #ffffff;
    font-weight: 600;
}

/* Soft active pill under icon instead of harsh top bar */
.bottom-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(3, 204, 218, 0.2), #03ccda, rgba(3, 204, 218, 0.2));
    box-shadow: 0 0 10px rgba(3, 204, 218, 0.55);
}

/* Legacy img icons */
.bottom-nav-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.9;
    filter: brightness(0) saturate(100%) invert(88%) sepia(8%) saturate(286%) hue-rotate(173deg) brightness(90%) contrast(88%);
    transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.bottom-nav-link.active .bottom-nav-icon,
.bottom-nav-link:hover .bottom-nav-icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(72%) sepia(85%) saturate(1726%) hue-rotate(140deg) brightness(98%) contrast(98%);
}

.floating-button {
    position: absolute;
    top: -26px;
    left: 50%;
    width: 54px;
    height: 54px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    color: #041018;
    background: var(--bn-fab);
    box-shadow:
        0 10px 26px rgba(3, 204, 218, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -2px 6px rgba(0, 80, 90, 0.18);
    z-index: 2;
    transform: translateX(-50%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.floating-button__ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid rgba(3, 204, 218, 0.35);
    box-shadow: 0 0 0 4px rgba(8, 12, 18, 0.55);
    pointer-events: none;
}

.floating-button__hint {
    display: block;
    margin-top: auto;
    padding-bottom: 0.05rem;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(214, 224, 236, 0.7);
    line-height: 1;
    font-family: "Poppins", "Segoe UI", sans-serif;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.floating-button:hover,
.floating-button.is-open {
    transform: translateX(-50%) translateY(-4px) scale(1.05);
    box-shadow:
        0 14px 32px rgba(3, 204, 218, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.floating-button.is-open .bn-ico--fab {
    transform: rotate(45deg);
}

.floating-button .bn-ico--fab {
    transition: transform 0.22s ease;
    color: #041018;
}

.popover-menu {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    min-width: min(292px, calc(100vw - 2rem));
    padding: 0.45rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(24, 30, 42, 0.97) 0%, rgba(10, 13, 20, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(3, 204, 218, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.popover-menu[hidden] {
    display: none !important;
}

.popover-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.7rem;
    border-radius: 13px;
    text-decoration: none;
    color: #e8eef5;
    transition: background 0.15s ease, transform 0.15s ease;
}

.popover-menu__item + .popover-menu__item {
    margin-top: 0.12rem;
}

.popover-menu__item:hover,
.popover-menu__item:focus-visible {
    background: rgba(3, 204, 218, 0.1);
    outline: none;
}

.popover-menu__item:active {
    transform: scale(0.98);
}

.popover-menu__ico,
.popover-menu__item > i {
    width: 2.15rem;
    height: 2.15rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(3, 204, 218, 0.12);
    color: var(--bn-accent);
    border: 1px solid rgba(3, 204, 218, 0.18);
    font-size: 0.95rem;
}

.popover-menu__ico .bn-ico {
    width: 17px;
    height: 17px;
}

.popover-menu__item span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    text-align: left;
    min-width: 0;
}

.popover-menu__item strong {
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.popover-menu__item small {
    font-size: 0.68rem;
    color: rgba(180, 192, 208, 0.88);
    line-height: 1.25;
}

@media (max-width: 767.98px) {
    body:not(.om-drawer-open) main {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
}
