/* Products Page Styles */
.products-main {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.products-main * {
    box-sizing: border-box;
}

/* Products Banner Section */
.products-hero-banner {
    width: 100%;
    height: 58rem;
    max-height: 58rem;
    position: relative;
    overflow: hidden;
}

.products-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.products-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.products-banner-content {
    position: absolute;
    bottom: 8rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    color: white;
    width: 100%;
}

.products-banner-title {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    color: white;
}

/* Products Container */
.products-container {
    max-width: 90rem;
    margin: 0 auto;
}

/* Products Tabs Section */
.products-tabs-section {
    padding: 5rem 0;
    background: white;
}

/* Tab Navigation */
.products-tab-navigation {
    display: flex;
    justify-content: center;
    gap: 1.875rem; /* 30px */
    margin-bottom: 5rem;
    width: 100%;
    max-width: 90rem; /* 1440px total */
    margin-left: auto;
    margin-right: auto;
}

.products-tab-item {
    width: 28.75rem; /* 460px */
    height: 7.5rem; /* 120px */
    background: #EDEDED;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: none;
    outline: none;
    flex-shrink: 0;
    padding: 1rem;
}

.products-tab-item:hover,
.products-tab-item.active {
    background: #B32A28;
}

.products-tab-item:hover .products-tab-text,
.products-tab-item.active .products-tab-text {
    color: #FFFFFF;
}

.products-tab-item:hover .products-tab-triangle,
.products-tab-item.active .products-tab-triangle {
    opacity: 1;
}

.products-tab-item:hover .tab-icon-default,
.products-tab-item.active .tab-icon-default {
    display: none !important;
}

.products-tab-item:hover .tab-icon-active,
.products-tab-item.active .tab-icon-active {
    display: block !important;
}

.products-tab-icon {
    position: relative;
    margin-bottom: 1rem;
    height: 2.75rem; /* 44px */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.tab-icon-active {
    display: none;
}

.tab-icon-default {
    display: block;
}

.products-tab-icon img {
    max-height: 100%;
    width: 12rem;
    object-fit: contain;
}

.products-tab-text {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.625rem; /* 26px */
    font-weight: 400; /* Regular */
    color: #AFAFAF;
    text-transform: uppercase;
    line-height: 1.1;
    transition: color 0.3s ease;
    text-align: center;
    letter-spacing: 0.05rem;
}

.products-tab-triangle {
    position: absolute;
    bottom: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.75rem solid transparent;
    border-right: 0.75rem solid transparent;
    border-top: 0.75rem solid #B32A28;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Tab Content */
.products-tab-content {
    position: relative;
}

.products-tab-panel {
    display: none;
}

.products-tab-panel.active {
    display: block;
}

/* Products Grid */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.875rem 19.75rem; /* 上下30px, 左右316px */
    max-width: 82.25rem; /* 1288px */
    margin: 0 auto;
    justify-content: center;
}

.products-item {
    width: 31.25rem; /* 500px */
    height: 40rem; /* 640px */
    background: white;
    border-radius: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.products-item:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.products-item-image {
    position: relative;
    width: 100%;
    height: 28.25rem; /* 500px, 保持正方形比例 */
    overflow: hidden;
}

.products-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.products-item:hover .products-item-image img {
    transform: scale(1.05);
}

.products-item-content {
    padding: 2rem;
    text-align: center;
    height: 11.75rem; /* 调整内容区域高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.products-item-title {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.625rem; /* 26px */
    font-weight: 400; /* Regular */
    color: #000; /* 黑色 */
    margin-bottom: 1rem;
    line-height: 1;
    min-height: 3.25rem; /* 确保标题高度一致 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-item-btn {
    background: transparent;
    color: #B32A28;
    border: 0.125rem solid #B32A28;
    padding: 0.4rem 2.5rem; /* 缩短按钮 */
    border-radius: 2rem;
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.625rem; /* 26px */
    font-weight: 400; /* Regular */
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    display: inline-block;
    text-decoration: none; /* 去除链接下划线 */
    text-align: center;
    width: auto;
    min-width: 8rem; /* 设置最小宽度 */
    line-height: 1;
    display: flex;
    align-items: center;
}

.products-item-btn:hover {
    background: #B32A28;
    color: #FFFFFF;
    text-decoration: none; /* 悬停时也去除下划线 */
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(179, 42, 40, 0.3);
}

/* Mobile Styles - 参考关于我们和新闻页面 */
@media (max-width: 48rem) {
    .products-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .products-hero-banner {
        height: 60vh;
        max-height: 60vh;
    }

    .products-banner-content {
        bottom: 8vw;
        max-width: 90%;
    }

    .products-banner-title {
        font-size: 5vw;
        font-weight: 700;
        text-transform: uppercase;
    }

    .products-tabs-section {
        padding: 6vw 0;
    }

    /* 移动端现代化胶囊滑动Tab */
    .products-tab-navigation {
        --tab-gap: 0px !important;
        
        position: relative !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        width: 90vw !important;
        margin: 0 auto 8vw auto !important;
        padding: 1.5vw !important;
        background-color: #E9E9E9 !important;
        border-radius: 50px !important;
        overflow: hidden !important;
        gap: 0 !important;
    }

    /* 滑动指示器 - 红色背景块 */
    .products-tab-navigation::before {
        content: "" !important;
        position: absolute !important;
        top: 1.5vw !important;
        left: 1.5vw !important;
        
        width: calc((100% - 3vw) / 3) !important;
        height: calc(100% - 3vw) !important;
        
        background-color: #C02C38 !important;
        border-radius: 50px !important;
        z-index: 1 !important;
        
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    }

    /* 第二个tab激活时 */
    .products-tab-navigation[data-active-tab="2"]::before {
        transform: translateX(100%) !important;
    }

    /* 第三个tab激活时 */
    .products-tab-navigation[data-active-tab="3"]::before {
        transform: translateX(200%) !important;
    }

    .products-tab-item {
        flex: 1 !important;
        height: auto !important;
        min-height: 12vw !important;
        padding: 3vw 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        z-index: 2 !important;
        transition: color 0.4s ease !important;
        cursor: pointer !important;
    }

    .products-tab-item.active .products-tab-text {
        color: #FFFFFF !important;
    }

    .products-tab-item:not(.active) .products-tab-text {
        color: #334155 !important;
    }

    .products-tab-icon {
        display: none !important;
    }

    .products-tab-text {
        font-size: clamp(3.2vw, 4vw, 4.8vw) !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        text-transform: capitalize !important;
        margin: 0 !important;
    }

    .products-tab-triangle {
        display: none !important;
    }

    .products-grid {
        flex-direction: column;
        align-items: center;
        gap: 6vw;
        max-width: 100%;
        padding: 0 4vw;
    }
    
    .products-item {
        width: 92vw;
        height: auto;
        aspect-ratio: 500/640;
    }

    .products-item-content {
        padding: 4vw;
        height: auto;
        min-height: 20vw;
    }
    
    .products-item-image {
        height: 72vw; /* 保持正方形比例 */
    }

    .products-item-title {
        font-size: 5vw; /* 对应桌面端26px */
        font-weight: 400; /* Regular */
        color: #000; /* 黑色 */
        margin-bottom: 3vw;
        min-height: auto;
    }

    .products-item-btn {
        padding: 2.5vw 5vw;
        border: 0.5vw solid #B32A28;
        font-size: 3.5vw;
        font-weight: 600;
        border-radius: 4vw;
        min-width: auto;
        width: 35vw;
        height: 8vw;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        margin: 0 auto;
        text-align: center;
    }

    .products-item-btn:hover {
        transform: translateY(-0.5vw);
    }
}
