/* ==========================================================
   v6.x.5d bottom 5-tab shortcut bar — 全域底部導航
   - 出處:LINE GO 會員中心 4-tab 設計 + 中間主 CTA(充電)置中
   - 5 顆 tab:首頁 / 充電地圖 / 充電(中, owl logo) / 紀錄 / 會員
   - 主色沿用 #1f9d3e(active 狀態)
   - tokens 從 v6x5.css 來,這檔只做元件
   ========================================================== */

.bottom_tab {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: var(--card);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -2px 14px rgba(20, 30, 22, 0.05);
    max-width: 480px;
    margin: 0 auto;
}

.bottom_tab .bt_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.06em;
    transition: color 0.18s var(--ease-out),
                opacity 0.15s var(--ease-out),
                transform 0.1s var(--ease-out);
    min-width: 0;
    border: 0;
    background: none;
    font-family: var(--type-display);
    cursor: pointer;
}

.bottom_tab .bt_item:active {
    opacity: 0.7;
    transform: scale(0.96);
}

.bottom_tab .bt_item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -4px;
    border-radius: var(--radius-sm);
}

.bottom_tab .bt_item .bt_icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s var(--ease-out);
}

.bottom_tab .bt_item .bt_icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.bottom_tab .bt_item.is_active {
    color: var(--brand);
}

.bottom_tab .bt_item.is_active .bt_icon {
    transform: translateY(-2px);
}

/* 中間主 CTA 充電 — owl logo,稍微大一點 */
.bottom_tab .bt_item.is_center .bt_icon {
    position: relative;
    overflow: hidden;
    width: 22px;
    height: 30px;
    margin-top: -4px;
}

.bottom_tab .bt_item.is_center .bt_icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* 平時跟其他 tab 一樣灰階,active 才還原 */
    filter: grayscale(100%) brightness(0.55);
    transition: filter 0.18s var(--ease-out);
}

.bottom_tab .bt_item.is_center.is_active .bt_icon img {
    filter: none;
}

/* 白光斜掃動畫 — 從左上刷到右下,週期性 repeat */
.bottom_tab .bt_item.is_center .bt_icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.7) 50%,
        transparent 70%
    );
    transform: translateX(-180%) skewX(-20deg);
    animation: owlShineSweep 2.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes owlShineSweep {
    0%   { transform: translateX(-180%) skewX(-20deg); }
    55%  { transform: translateX(260%)  skewX(-20deg); }
    100% { transform: translateX(260%)  skewX(-20deg); }
}

@media (prefers-reduced-motion: reduce) {
    .bottom_tab .bt_item.is_center .bt_icon::after {
        animation: none;
        transform: translateX(-180%) skewX(-20deg);
    }
}

/* 會員 tab 大頭貼 */
.bottom_tab .bt_avatar .bt_avatar_circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    background-color: var(--line);
    box-sizing: border-box;
    transition: border-color 0.18s var(--ease-out);
}

.bottom_tab .bt_avatar .bt_avatar_circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bottom_tab .bt_avatar.is_active .bt_avatar_circle {
    border-color: var(--brand);
}

/* container bottom padding for fixed tab */
body.has_bottom_tab {
    padding-bottom: calc(var(--tab-height, 64px) + env(safe-area-inset-bottom, 0));
}

@media (max-width: 360px) {
    .bottom_tab .bt_item { font-size: 10.5px; }
    .bottom_tab .bt_item .bt_icon svg { width: 22px; height: 22px; }
    .bottom_tab .bt_avatar .bt_avatar_circle { width: 28px; height: 28px; }
    .bottom_tab .bt_item.is_center .bt_icon { width: 20px; height: 28px; margin-top: -3px; }
}
