/*
 * mobile-nav.css  v1.2
 * KaroTrip — Mobile Bottom Navigation
 * Floating pill nav + slide-up drawer for sub-menus.
 * Companion: mobile-fixes.css
 */

:root {
    --nav-height: 72px;
    --nav-bg: #111827;
    --nav-radius: 28px;
    --nav-shadow: 0 -4px 32px rgba(0,0,0,.28), 0 2px 12px rgba(0,0,0,.18);
    --nav-icon-color: #9ca3af;
    --nav-label-color: #6b7280;
    --nav-active-bg: #9E0100;
    --nav-active-icon: #ffffff;
    --nav-active-label: #ffffff;
    --nav-margin-x: 14px;
    --nav-margin-b: 14px;
    --drawer-bg: #ffffff;
    --drawer-item-bg: #f1f5f9;
    --drawer-item-hover: #fdf2f2;
    --drawer-icon-color: #9E0100;
}

body {
    padding-bottom: calc(var(--nav-height) + var(--nav-margin-b) + 16px);
}

.mobile-nav {
    position: fixed;
    bottom: var(--nav-margin-b);
    left: var(--nav-margin-x);
    right: var(--nav-margin-x);
    height: var(--nav-height);
    background: var(--nav-bg);
    border-radius: var(--nav-radius);
    box-shadow: var(--nav-shadow);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    z-index: 1040;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease;
    color: #6cb5f3;
}

.nav-tab:active {
    transform: scale(0.92);
}

.nav-tab-bubble {
    width: 42px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.22s ease, transform 0.22s ease;
}

.nav-tab-bubble i {
    font-size: 17px;
    color: var(--nav-icon-color);
    transition: color 0.18s ease;
}

.nav-tab-label {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--nav-label-color);
    letter-spacing: 0.01em;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.nav-tab.active .nav-tab-bubble {
    background: var(--nav-active-bg);
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 6px 18px rgba(158,1,0,.35);
}

.nav-tab.active .nav-tab-bubble i {
    color: var(--nav-active-icon);
}

.nav-tab.active .nav-tab-label {
    color: var(--nav-active-bg);
    font-weight: 600;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 1045;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
}

.drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--drawer-bg);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 40px rgba(0,0,0,.18);
    z-index: 1050;
    -webkit-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: -webkit-transform 0.32s ease;
    transition: transform 0.32s ease;
    max-height: 75%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 90px;
}

.nav-drawer.open {
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 99px;
    margin: 14px auto 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f1f5f9;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: var(--drawer-bg);
    z-index: 1;
}

.drawer-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
}

.drawer-close:active {
    background: #e5e7eb;
}

.drawer-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
}

.drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--drawer-item-bg);
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    width: calc(33.333% - 7px);
}

.drawer-item:active {
    background: var(--drawer-item-hover);
    border-color: #f5c0c0;
    text-decoration: none;
}

.drawer-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(158,1,0,.12);
}

.drawer-item-icon i {
    font-size: 18px;
    color: var(--drawer-icon-color);
}

.drawer-item-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.nav-scroll-lock {
    overflow: hidden;
}

@media (min-width: 992px) {
    .mobile-nav,
    .nav-drawer,
    .drawer-overlay {
        display: none !important;
    }
    body {
        padding-bottom: 0;
    }
}
