/**
 * 小屏底部导航栏样式
 * Mobile Bottom Navigation Bar
 */

/* 仅在小屏显示 */
@media screen and (max-width: 768px) {
    
    /* 底部导航栏容器 */
    .cb-mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        background-color: #ffffff;
        border-top: 1px solid #eeeeee;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 999;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    }

    /* 每个导航项 */
    .cb-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        cursor: pointer;
        text-decoration: none;
        color: #666666;
        position: relative;
        transition: color 0.3s ease;
        font-size: 12px;
    }

    .cb-mobile-nav-item:active {
        background-color: #f5f5f5;
    }

    .cb-mobile-nav-item.active {
        color: var(--primary-color, #1a237e);
    }

    /* 图标 */
    .cb-mobile-nav-icon {
        font-size: 24px;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        line-height: 1;
    }

    /* SVG 图标自动适配 */
    .cb-mobile-nav-icon svg {
        width: 24px;
        height: 24px;
        display: block;
    }
    
    /* 强制 SVG 和内部元素使用主题色 - 最高优先级 */
    .cb-mobile-nav-icon svg,
    .cb-mobile-nav-icon svg * {
        fill: var(--primary-color, #1a237e) !important;
        stroke: var(--primary-color, #1a237e) !important;
        color: var(--primary-color, #1a237e) !important;
    }
    
    /* 覆盖任何可能内联的 fill/stroke 样式 */
    .cb-mobile-nav-icon svg[fill],
    .cb-mobile-nav-icon svg[style*="fill"],
    .cb-mobile-nav-icon svg * [fill],
    .cb-mobile-nav-icon svg *[style*="fill"] {
        fill: var(--primary-color, #1a237e) !important;
    }

    /* 标签文本 */
    .cb-mobile-nav-label {
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
    }

    /* 角标（如购物车数量） */
    .cb-mobile-nav-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        background-color: #ff5722;
        color: #ffffff;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        min-width: 18px;
    }

    /* ===== 显示模式样式 ===== */
    
    /* 仅图标模式 - 图标居中，隐藏文字 */
    .cb-nav-mode-icon_only .cb-mobile-nav-item {
        flex-direction: row;
        gap: 0;
    }
    .cb-nav-mode-icon_only .cb-mobile-nav-icon {
        margin-bottom: 0;
    }
    .cb-nav-mode-icon_only .cb-mobile-nav-label {
        display: none;
    }
    
    /* 仅文字模式 - 文字居中，隐藏图标 */
    .cb-nav-mode-text_only .cb-mobile-nav-item {
        flex-direction: row;
        gap: 0;
    }
    .cb-nav-mode-text_only .cb-mobile-nav-icon {
        display: none;
    }
    .cb-nav-mode-text_only .cb-mobile-nav-label {
        font-size: 14px;
        font-weight: 500;
    }
    
    /* 图标+文字模式 - 恢复默认布局（列式） */
    .cb-nav-mode-icon_text .cb-mobile-nav-item {
        flex-direction: column;
    }

    /* 身体主容器向下移动，为底部导航留出空间 */
    body.cb-mobile-nav-active {
        padding-bottom: 60px;
    }

    /* 页面内容适配 */
    .cb-mobile-nav-active .cb-custom-header,
    .cb-mobile-nav-active .wp-header,
    .cb-mobile-nav-active header {
        margin-bottom: 0;
    }

    /* 主题色变量 */
    :root {
        --primary-color: #1a237e;
    }
}

/* 大屏隐藏 */
@media screen and (min-width: 769px) {
    .cb-mobile-bottom-nav {
        display: none !important;
    }
}
