/* --- 淘园商城专用样式 --- */

/* 全局与排版 */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

a {
    text-decoration: none;
    transition: color 0.2s;
}

/* 导航栏 */
.mall-navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0.8rem 1rem;
}

.mall-brand {
    font-weight: 700;
    color: #0d6efd;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mall-search-container {
    max-width: 500px;
    width: 100%;
}

.nav-link-custom {
    color: #555;
    font-weight: 500;
}
.nav-link-custom:hover {
    color: #0d6efd;
}

/* 分类展示区域 (修改：取消滚动条，改为自动换行) */
.category-scroll-wrapper {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
}

.category-scroll {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* 允许换行 */
    justify-content: center; /* 居中显示 */
    padding: 0 10px;
}

.cat-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
    user-select: none;
    margin-bottom: 5px; /* 换行后的行间距 */
}

.cat-pill:hover {
    background-color: #e9ecef;
    color: #333;
}

.cat-pill.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
    font-weight: 500;
}

/* 商品卡片 */
.product-card {
    border: none;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.img-link {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 正方形 */
    background-color: #f4f4f4;
    overflow: hidden;
}

.img-link img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .img-link img {
    transform: scale(1.05);
}

.card-info {
    padding: 10px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* SKU 缩略图滚动条 (保持横向滚动) */
.sku-thumbs-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 8px;
    padding-bottom: 4px;
    white-space: nowrap;
    scrollbar-width: none;
    min-height: 45px; /* 增加高度以容纳文字 */
}
.sku-thumbs-scroll::-webkit-scrollbar {
    display: none; 
}

/* 缩略图容器 (图片+文字) */
.sku-thumb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    width: 32px; /* 限制宽度 */
}

.sku-thumb-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #eee;
    object-fit: cover;
    transition: border-color 0.2s;
}

.sku-thumb-container:hover .sku-thumb-item, 
.sku-thumb-container.active .sku-thumb-item {
    border-color: #333;
    border-width: 1px;
}

.sku-thumb-name {
    font-size: 9px;
    color: #999;
    margin-top: 2px;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}

.product-title-code {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 6px;
    font-weight: 700;
    font-family: monospace;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price-tag {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
}

/* 详情页样式 */
.detail-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin-top: 20px;
}

.detail-gallery-main {
    width: 100%;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #eee;
    position: relative;
    padding-top: 100%; /* 1:1 */
}

.detail-gallery-main img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sku-selector-group {
    margin-bottom: 20px;
}

.sku-option {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    margin-right: 8px;
    margin-bottom: 8px;
    cursor: default;
    background-color: #fff;
    transition: border-color 0.2s;
}
.sku-option:hover {
    border-color: #333;
}

.sku-option img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 6px;
    background: #eee;
}

.sku-option span {
    font-size: 0.9rem;
    color: #333;
}

.price-large {
    font-size: 2rem;
    color: #e74c3c;
    font-weight: bold;
}

.detail-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.info-badge {
    font-size: 0.85rem;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 4px;
    color: #555;
    margin-right: 10px;
    border: 1px solid #eee;
}

/* 底部 */
.mall-footer {
    margin-top: 40px;
    padding: 30px 0;
    background-color: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .category-scroll {
        justify-content: flex-start; /* 手机端左对齐看起来更自然 */
    }
    .product-card {
        border-radius: 6px;
    }
    .card-info {
        padding: 8px;
    }
    .price-tag {
        font-size: 1rem;
    }
    .sku-thumb-item {
        width: 28px;
        height: 28px;
    }
    .sku-thumb-container {
        width: 30px;
    }
}