/* 基础重置和页面布局 */
body, html { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: #f7f8fa; }
[v-cloak] { display: none; }
img { max-width: 100%; vertical-align: middle; }
a { text-decoration: none; color: inherit; }
.page-container {
    padding-top: 46px; /* [新增] 为顶部导航栏留出空间 */
    max-width: 600px;
    margin: 0 auto;
    background-color: #f9f9f9;
    padding: 0;
    box-sizing: border-box;
}

p {
	margin: 0; padding: 0;
}

/* Banner 样式 */
.my-swipe, .banner-placeholder { height: 200px; width: 100%; border-radius: 10px; overflow: hidden; margin: 15px 0 0 0; }
.my-swipe .van-swipe-item img, .banner-placeholder img { width: 100%; height: 100%; object-fit: cover; }

/* 【重要修改】Vant-Tabs 样式覆盖 - 新的胶囊样式 */
.van-tabs__nav {
    background-color: #fff;
    padding: 0; /* 移除默认padding，方便控制tab间距 */
}

/* 隐藏原有的下划线 */
.van-tabs__line {
    display: none !important;
}

/* 统一设置所有Tab的样式 */
.van-tab {
    flex-basis: auto !important; /* 让Tab宽度自适应内容 */
    margin: 8px 6px; /* Tab之间的上下和左右间距 */
    padding: 6px 16px !important; /* Tab内部的文字边距 */
    border-radius: 20px; /* 椭圆形的关键 */
    border: 1px solid #f0f0f0; /* 未选中时的边框 */
    background-color: #fff; /* 未选中时的背景 */
    color: #333; /* 未选中时的文字颜色 */
}

/* 设置激活状态的Tab样式 */
.van-tab--active {
    background-color: #1989fa; /* 选中的蓝色背景 */
    color: #fff !important; /* 选中的白色文字 */
    border-color: #1989fa; /* 边框同色 */
}

.van-sticky {

}
.product-grid {
    padding-top: 15px; /* tab和列表间距 */
}

/* 分类区块通用样式 */
.category-section, .all-products-section {
    margin-bottom: 20px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

/* 【关键修复】横向商品列表样式 */
.horizontal-product-list {
    display: flex;
    overflow-x: auto;
    /* 隐藏滚动条 */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.horizontal-product-list::-webkit-scrollbar {
    display: none;
}

/* 【关键修复】横向商品卡片样式 */
.product-card-horizontal {
    flex: 0 0 120px;
    width: 120px;
    margin-right: 12px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex; /* 改为flex布局 */
    flex-direction: column; /* 垂直排列 */
}
.product-card-horizontal:last-child {
    margin-right: 0; /* 最后一个卡片无右边距 */
}
.product-card-horizontal .product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 8px;
}
.product-card-horizontal .product-name {
    font-size: 13px;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 最多显示2行 */
    -webkit-box-orient: vertical;
}
/* [新增] 横向卡片中的简介样式 */
.product-card-horizontal .product-short-desc-horizontal {
    font-size: 12px;
    color: #999;
    padding: 0 8px;
    margin-top: 4px;
    white-space: nowrap; /* 强制单行 */
    overflow: hidden; /* 超出隐藏 */
    text-overflow: ellipsis; /* 显示省略号 */
}
.product-card-horizontal .product-price {
    font-size: 15px;
    color: #FF5000;
    font-weight: bold;
    padding: 0 8px 8px;
    margin-top: auto; /* 核心：将价格推到卡片底部 */
}


/* 纵向商品网格 */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.product-grid::after {
    content: '';
    width: calc(50% - 6px); /* 占位，解决最后一行对齐问题 */
}

/* 纵向商品卡片 */
.product-card-custom {
    width: calc(50% - 6px); /* 两列布局，中间间距12px */
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.product-card-custom .product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #f7f8fa;
}
.product-card-custom .product-info {
    padding: 10px;
}
.product-card-custom .product-name {
    font-size: 14px;
    margin: 0 0 8px 0;
    min-height: 38px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card-custom .product-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.product-card-custom .product-price {
    font-size: 18px;
    color: #FF5000;
    font-weight: bold;
}
.product-card-custom .product-sales {
    font-size: 12px;
    color: #999;
}


/* 悬浮操作按钮 (FAB) */
.fab-container { position: fixed; right: 20px; bottom: 80px; z-index: 100; }
.fab-button {
    width: 56px;
    height: 56px;
    background-color: #1989fa;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.fab-button:hover { transform: scale(1.05); }
.fab-button:active { transform: scale(0.95); }

/* 【新增】横向商品滚动容器 */
.horizontal-product-list-container {
    /* 【新增】白色背景和外边距，形成独立卡片 */
    margin: 0 10px 0;
    border-radius: 10px;

    padding: 6px 0 0;
    min-height: 180px;
    text-align: center;
}

.horizontal-product-list {
    display: flex;
    overflow-x: auto;
    padding: 0 16px 0 0;
    /* 隐藏滚动条 */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.horizontal-product-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.product-card-horizontal {
    /* 【修改】调整卡片宽度以匹配设计图 */
    flex: 0 0 42%;
    width: 46%;
    padding: 16px;
    background-color: #fff; /* 这个白色背景是卡片自身的，保持不变 */
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    display: block;
    color: #333;
}
.product-card-horizontal:last-child {
    margin-right: 0;
}
.product-card-horizontal .product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.product-card-horizontal .product-name {
    font-size: 14px;
    padding: 4px 8px;
    white-space: normal;
    word-break: break-all;
}
.product-card-horizontal .product-price {
    font-size: 14px;
    color: #ee0a24;
    font-weight: bold;
    padding: 0 8px 8px;
}


/* 【新增】全部分类区域 */
.all-products-section {
    /* 【新增】白色背景和外边距，形成独立卡片 */
    margin: 0 0 15px 0;
    border-radius: 10px;

    /* 【修改】统一使用内边距 */
    padding: 0 16px 16px 16px;
}
.section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
}

/* 【新增】纵向列表的卡片样式 */
.product-card-vertical {
    display: flex;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
	padding: 16px;
    overflow: hidden; /* 防止内容溢出 */
}
.product-image-vertical {
    width: 120px; /* 固定图片宽度 */
    height: 120px; /* 固定图片高度 */
    object-fit: cover;
    flex-shrink: 0;
}
/* [修改] 右侧信息区使用flex布局 */
.product-info-vertical {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0; /* 防止flex item内容溢出 */
}
.product-info-vertical .product-name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}
.product-info-vertical .product-short-desc {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}
.product-info-vertical .product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* 核心：将价格行推到容器底部 */
    padding-top: 8px; /* 与上方内容留出间距 */
}
.product-info-vertical .product-price {
    color: #ee0a24;
    font-size: 16px;
    font-weight: bold;
}
.product-info-vertical .product-sales {
    font-size: 12px;
    color: #999;
}
.van-tabs__nav{
	background-color: transparent;
}

/* [新增] 自定义导航栏样式 (参考 details.css 保持统一) */
.custom-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 600px; /* 与page-container保持一致 */
    margin: 0 auto; /* 居中 */
    height: 46px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-sizing: border-box;
    border-bottom: 1px solid #ebedf0;
    z-index: 100;
}
.custom-nav-bar__left, .custom-nav-bar__right {
    width: 40px; /* 左右占位宽度 */
    flex-shrink: 0;
}
.custom-nav-bar__title {
    font-size: 16px;
    font-weight: 500;
    color: #323233;
    flex-grow: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}