/* 商品分类页样式 */

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #666;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #1890FF;
}

.breadcrumb .current {
    color: #1890FF;
    font-weight: 500;
}

/* 分类布局 */
.category-layout {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
}

/* 左侧分类导航 */
.category-sidebar {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.sidebar-title {
    font-size: 16px;
    margin-bottom: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: #1890FF;
}

.category-nav {
    margin-bottom: 20px;
}

.category-nav li {
    margin-bottom: 4px;
}

.category-nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 8px;
    color: #666;
    transition: all 0.3s;
}

.category-nav a:hover {
    background-color: #f5f9ff;
    color: #1890FF;
}

.category-nav li.active a {
    background-color: #1890FF;
    color: white;
}

.category-nav i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
}

.count {
    display: none;
}

.category-nav li.active .count {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 筛选条件 */
.sidebar-filter h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.price-range input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: white;
    cursor: pointer;
}

.filter-btn {
    width: 100%;
    margin-top: 10px;
}

/* 主内容区 */
.category-main {
    padding: 20px 0 40px;
    background-color: #f5f7fa;
    min-height: calc(100vh - 200px);
}

.category-content {
    background-color: transparent;
}

/* 品牌二级导航栏 */
.brand-nav-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    gap: 16px;
}

.brand-nav-label {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-nav-scroll {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.brand-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.brand-nav-list .brand-item {
    flex: 0 0 calc((100% - 7 * 8px) / 8);
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    min-width: 76px;
    position: relative;
}

.brand-item:hover {
    background-color: #f5f9ff;
}

.brand-item.active {
    background-color: #e6f4ff;
}

.brand-item.active .brand-name {
    color: #1890FF;
    font-weight: 600;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-item:hover .brand-icon {
    transform: scale(1.08);
}

.brand-name {
    font-size: 12px;
    color: #555;
    text-align: center;
    line-height: 1.3;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.brand-expand-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.brand-expand-btn:hover {
    border-color: #1890FF;
    color: #1890FF;
}

.brand-expand-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.brand-expand-btn.expanded i {
    transform: rotate(180deg);
}

.section-new,
.section-recommend {
    margin-bottom: 40px;
}

.section-title {
    font-size: 22px;
    margin-bottom: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 标题行（标题+视图切换） */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.view-toggle-group {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    width: 38px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 15px;
    transition: all 0.25s ease;
}

.view-btn:hover {
    color: #1890FF;
    background: #f5f9ff;
}

.view-btn.active {
    color: #fff;
    background: #1890FF;
}

.section-title i {
    color: #1890FF;
}

/* 商品容器 - 默认列表视图 */
.product-list-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ===== 横向列表模式（默认） ===== */
.prod-row {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    transition: all 0.25s ease;
    border-bottom: 1px solid #f0f0f0;
}

.prod-row:last-child {
    border-bottom: none;
}

.prod-row:hover {
    background: #fafcff;
    box-shadow: 0 2px 12px rgba(24, 144, 255, 0.08);
}

/* 左侧图片区 */
.prod-img-box {
    position: relative;
    width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.prod-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-tag {
    position: absolute;
    top: -1px;
    left: -1px;
    padding: 2px 7px;
    font-size: 11px;
    color: #fff;
    background: #ff4d4f;
    border-radius: 6px 0 6px 0;
    font-weight: 600;
}
.prod-tag.hot { background: #ff7a45; }
.prod-tag.new { background: #1890FF; }

/* 中间信息区 */
.prod-body {
    flex: 1;
    min-width: 0;
}

.prod-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s;
}

.prod-title:hover {
    color: #1890FF;
}

.prod-sub-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 12px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    background: #e6f7ff;
    color: #1890FF;
    border-radius: 4px;
    font-size: 11px;
}

.info-text {
    color: #999;
    text-decoration: line-through;
}

.prod-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}
.badge.blue { background: #e6f7ff; color: #1890FF; }
.badge.gray { background: #f5f5f5; color: #888; }
.badge.orange { background: #fff7e6; color: #fa8c16; }

/* 右侧价格+服务 */
.prod-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    min-width: 160px;
}

.prod-services {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.prod-services span {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.prod-price-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.prod-current-price {
    font-size: 22px;
    font-weight: 700;
    color: #ff4d4f;
}

.btn-buy-now {
    padding: 7px 18px;
    background: transparent;
    border: 1px solid #1890FF;
    color: #1890FF;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
}

.btn-buy-now:hover {
    background: #1890FF;
    color: #fff;
}

/* ===== 大图网格模式 ===== */
.product-list-container.grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.product-list-container.grid-view .prod-row {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-bottom: none;
    gap: 14px;
}

.product-list-container.grid-view .prod-img-box {
    width: 100%;
    height: 160px;
    border-radius: 10px;
}

.product-list-container.grid-view .prod-body {
    min-width: auto;
}

.product-list-container.grid-view .prod-right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: auto;
}

.product-list-container.grid-view .prod-services {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.product-list-container.grid-view .prod-title {
    font-size: 15px;
    text-align: center;
}

.product-list-container.grid-view .prod-sub-info {
    justify-content: center;
}

.product-list-container.grid-view .prod-badges {
    justify-content: center;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: white;
    color: #666;
    font-size: 16px;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.page-item:hover {
    background-color: #f5f9ff;
    color: #1890FF;
    border-color: #1890FF;
}

.page-item.active {
    background-color: #1890FF;
    color: white;
    border-color: #1890FF;
}

.page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 992px) {
    .category-layout {
        grid-template-columns: 170px 1fr;
        gap: 16px;
    }

@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr;
    }
    .category-sidebar {
        position: sticky;
        top: 80px;
        z-index: 100;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-img {
        height: 180px;
    }
}