/**
 * 手機版底部浮動導航欄
 */

/* === 底部導航容器 === */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    display: none; /* 預設隱藏 */
    padding: 8px 0 max(8px, env(safe-area-inset-bottom)); /* 支援 iPhone 瀏海 */
}

/* === 導航項目容器 === */
.mobile-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

/* === 導航項目 === */
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 60px;
    position: relative;
}

.mobile-bottom-nav .nav-item:hover {
    color: #007bff;
    text-decoration: none;
    background: rgba(0, 123, 255, 0.1);
}

.mobile-bottom-nav .nav-item.active {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

/* === 導航圖示 === */
.mobile-bottom-nav .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-item:hover i {
    transform: scale(1.1);
}

/* === 導航文字 === */
.mobile-bottom-nav .nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

/* === 購物車數量徽章 === */
.mobile-bottom-nav .cart-badge {
    position: absolute;
    top: 0px;
    right: 8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-align: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.mobile-bottom-nav .cart-badge.hidden {
    display: none;
}

/* === 票夾數量徽章 === */
.mobile-bottom-nav .ticket-badge {
    position: absolute;
    top: 0px;
    right: 8px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-align: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.mobile-bottom-nav .ticket-badge.hidden {
    display: none;
}

/* === 響應式顯示控制 === */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    /* 為底部導航留出空間 */
    body {
        padding-bottom: 70px;
    }
    
    /* 隱藏原本的桌面版導航中的相關項目 */
    .navbar .nav-item:has([href="cart.php"]),
    .navbar .nav-item:has([href="member.php"]) {
        display: none;
    }
}

/* === 超小螢幕調整 === */
@media (max-width: 480px) {
    .mobile-bottom-nav .nav-item {
        min-width: 50px;
        padding: 4px 6px;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 1.2rem;
    }
    
    .mobile-bottom-nav .nav-item span {
        font-size: 0.65rem;
    }
    
    .mobile-bottom-nav .cart-badge,
    .mobile-bottom-nav .ticket-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
        font-weight: 700;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
        top: 1px;
        right: 6px;
    }
}

/* === 深色模式支援 === */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #212529;
        border-top-color: #495057;
    }
    
    .mobile-bottom-nav .nav-item {
        color: #adb5bd;
    }
    
    .mobile-bottom-nav .nav-item:hover,
    .mobile-bottom-nav .nav-item.active {
        color: #007bff;
        background: rgba(0, 123, 255, 0.2);
    }
}

/* === 動畫效果 === */
@keyframes bounceIn {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
    }
}

.mobile-bottom-nav.animate-in {
    animation: bounceIn 0.6s ease-out;
}

/* === 點擊效果 === */
.mobile-bottom-nav .nav-item:active {
    transform: scale(0.95);
    background: rgba(0, 123, 255, 0.2);
} 