/**
 * 小屏类别页面样式
 * Mobile Category Page - 参考淘宝/1688风格
 */

/* 类别页面全屏遮罩 */
.cb-mobile-category-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* 留出底部导航空间 */
    background: #f5f5f5;
    z-index: 998;
    display: none;
    flex-direction: column;
}

.cb-mobile-category-overlay.active {
    display: flex;
}

/* 顶部搜索栏 */
.cb-mc-header {
    padding: 10px 15px;
    background: #fff;
    flex-shrink: 0;
}

.cb-mc-search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.cb-mc-search-icon {
    color: #999;
    font-size: 16px;
    flex-shrink: 0;
}

.cb-mc-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #333;
}

.cb-mc-search-input::placeholder {
    color: #bbb;
}

/* 横向分类标签区域 - 带图标的卡片 */
.cb-mc-tabs-wrap {
    background: #fff;
    padding: 12px 0 8px;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
}

.cb-mc-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 15px;
    gap: 12px;
}

.cb-mc-tabs::-webkit-scrollbar {
    display: none;
}

.cb-mc-tab-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.cb-mc-tab-icon {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
}

.cb-mc-tab-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-mc-tab-icon-text {
    font-size: 20px;
    color: #fff;
    font-weight: 500;
}

/* 标签（如"佛跳墙"） */
.cb-mc-tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

.cb-mc-tab-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-mc-tab-card.active .cb-mc-tab-icon {
    border: 2px solid var(--cb-primary-color, #1a237e);
}

.cb-mc-tab-card.active .cb-mc-tab-name {
    color: var(--cb-primary-color, #1a237e);
    font-weight: 600;
}

/* 主体内容区 - 左右分栏 */
.cb-mc-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧分类列表 */
.cb-mc-sidebar {
    width: 90px;
    background: #f8f8f8;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.cb-mc-sidebar-item {
    padding: 16px 8px;
    font-size: 13px;
    color: #666;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.cb-mc-sidebar-item.active {
    background: #fff;
    color: var(--cb-primary-color, #1a237e);
    font-weight: 600;
    border-left-color: var(--cb-primary-color, #1a237e);
}

.cb-mc-sidebar-item:active {
    background: #eee;
}

/* 右侧内容区 */
.cb-mc-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

/* 商品列表样式 */
.cb-mc-products {
    padding: 10px;
}

.cb-mc-product-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
}

.cb-mc-product-item:last-child {
    border-bottom: none;
}

.cb-mc-product-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    position: relative;
    background: #f5f5f5;
}

.cb-mc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-mc-product-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.cb-mc-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cb-mc-product-title {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.cb-mc-product-tags {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cb-mc-product-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fff3e0;
    color: #ff6b00;
    border: 1px solid #ffe0b2;
}

.cb-mc-product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.cb-mc-product-price {
    font-size: 18px;
    color: #ff3b30;
    font-weight: 600;
}

.cb-mc-product-price-symbol {
    font-size: 12px;
    margin-right: 2px;
}

.cb-mc-product-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.cb-mc-product-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cb-primary-color, #1a237e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 商品列表样式 */
.cb-mc-products {
    padding: 0;
}

.cb-mc-product-item {
    display: flex;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    gap: 12px;
    position: relative;
    text-decoration: none;
    color: #333;
}

.cb-mc-product-item:last-child {
    border-bottom: none;
}

.cb-mc-product-item:active {
    background: #f9f9f9;
}

/* 商品图片 */
.cb-mc-product-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #f5f5f5;
}

.cb-mc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 图片占位符 */
.cb-mc-product-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cb-mc-product-placeholder[data-index="2"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.cb-mc-product-placeholder[data-index="3"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.cb-mc-product-placeholder[data-index="4"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.cb-mc-product-placeholder[data-index="5"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.cb-mc-product-placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.8;
}

/* NEW标签 */
.cb-mc-product-new-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px 0 8px 0;
    line-height: 1.2;
    text-align: center;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

/* 商品信息容器 */
.cb-mc-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

/* 行内标签（极速达等） */
.cb-mc-product-inline-badges {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.cb-mc-inline-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    display: inline-block;
    line-height: 1.3;
}

.cb-mc-badge-express {
    background: linear-gradient(135deg, #ff6b00 0%, #ff8800 100%);
    color: #fff;
}

.cb-mc-badge-other {
    background: #fff3e0;
    color: #ff6b00;
    border: 1px solid #ffe0b2;
}

/* 商品标题 */
.cb-mc-product-title {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin: 0;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 商品描述 */
.cb-mc-product-desc {
    font-size: 12px;
    line-height: 1.4;
    color: #999;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 店铺和销量信息 */
.cb-mc-product-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.cb-mc-product-shop {
    color: #666;
}

.cb-mc-product-sales {
    color: #999;
}

/* 底部价格和购物车 */
.cb-mc-product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8px;
}

.cb-mc-product-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.cb-mc-product-price {
    font-size: 20px;
    color: #ff3b30;
    font-weight: 600;
    line-height: 1;
}

.cb-mc-product-price-symbol {
    font-size: 13px;
    margin-right: 1px;
    font-weight: 500;
}

.cb-mc-product-original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

/* 购物车按钮 */
.cb-mc-product-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cb-primary-color, #1a237e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    padding: 0;
}

.cb-mc-product-cart .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.cb-mc-product-cart:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cb-mc-product-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 加载更多 */
.cb-mc-load-more {
    text-align: center;
    padding: 20px;
}

.cb-mc-load-more-btn {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--cb-primary-color, #1a237e);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--cb-primary-color, #1a237e);
    font-size: 14px;
    background: #fff;
    font-weight: 500;
}

.cb-mc-load-more-btn:hover {
    background: var(--cb-primary-color, #1a237e);
    color: #fff;
}

.cb-mc-load-more-btn:active {
    transform: scale(0.98);
}

.cb-mc-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 旋转动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 简洁链接列表样式（无图片） */
.cb-mc-links {
    padding: 0;
}

.cb-mc-link-item {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
}

.cb-mc-link-item:last-child {
    border-bottom: none;
}

.cb-mc-link-item:active {
    background: #f9f9f9;
}

.cb-mc-link-item .cb-mc-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cb-primary-color, #1a237e) 0%, #3949ab 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.cb-mc-link-item .cb-mc-link-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.cb-mc-link-item .cb-mc-link-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 空状态 */
.cb-mc-empty {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.cb-mc-empty-icon {
    font-size: 56px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.cb-mc-empty-text {
    font-size: 14px;
}

/* 加载状态 */
.cb-mc-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cb-mc-loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid #f0f0f0;
    border-top-color: var(--cb-primary-color, #1a237e);
    border-radius: 50%;
    animation: cb-mc-spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes cb-mc-spin {
    to { transform: rotate(360deg); }
}
