/* index.css - 首页特有样式 */

/* 分类导航 */
.category-nav {
    background-color: #fff;
    padding: 15px 0;
    margin: 15px 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 15px;
}

@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-item {
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 8px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #e02b41;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    font-size: 12px;
}

/* 轮播图 */
.hero-slider {
    position: relative;
    height: 350px;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    touch-action: pan-y;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.slide.active {
    opacity: 1;
}

.slide-1 {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.slide-2 {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1555529771-7888783a18d3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.slide-3 {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1608506375591-b91b98fe3189?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.slide-content {
    color: white;
    padding: 0 50px;
    max-width: 600px;
}

.slide-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
}

.slide-description {
    font-size: 16px;
    margin-bottom: 25px;
}

.slide-btn {
    padding: 12px 25px;
    background: #e02b41;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.slider-dot.active {
    background: white;
}

/* 促销横幅 */
.promo-banners {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.promo-banner {
    position: relative;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.promo-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.promo-banner:hover img {
    transform: scale(1.05);
}

.promo-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.promo-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.promo-description {
    font-size: 12px;
}

/* 倒计时区域 */
.countdown-section {
    display: flex;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.countdown-left {
    flex: 1;
    text-align: center;
    padding-right: 20px;
    border-right: 1px solid #f0f0f0;
}

.countdown-title {
    font-size: 20px;
    font-weight: bold;
    color: #e02b41;
    margin-bottom: 15px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.countdown-unit {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 8px;
    min-width: 60px;
}

.countdown-value {
    font-size: 24px;
    font-weight: bold;
    color: #e02b41;
}

.countdown-label {
    font-size: 12px;
    color: #666;
}

.countdown-right {
    flex: 1;
    padding-left: 20px;
    position: relative;
    height: 150px;
    overflow: hidden;
}

.countdown-products {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.5s;
}

.countdown-product {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
}

.countdown-product-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 10px;
}

.countdown-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.countdown-product-info {
    flex: 1;
}

.countdown-product-name {
    font-size: 14px;
    margin-bottom: 5px;
    cursor: pointer;
}

.countdown-product-price {
    font-size: 16px;
    color: #e02b41;
    font-weight: bold;
}

/* 移动端倒计时区域样式 */
.countdown-mobile {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.countdown-mobile-title {
    font-size: 18px;
    font-weight: bold;
    color: #e02b41;
    margin-bottom: 15px;
    text-align: center;
}

.countdown-mobile-timer {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.countdown-mobile-unit {
    background: #f8f8f8;
    padding: 8px;
    border-radius: 6px;
    min-width: 50px;
}

.countdown-mobile-value {
    font-size: 20px;
    font-weight: bold;
    color: #e02b41;
}

.countdown-mobile-label {
    font-size: 10px;
    color: #666;
}

.countdown-mobile-products {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 10px;
}

.countdown-mobile-product {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
}

.countdown-mobile-product-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 10px;
}

.countdown-mobile-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.countdown-mobile-product-info {
    flex: 1;
}

.countdown-mobile-product-name {
    font-size: 14px;
    margin-bottom: 5px;
    cursor: pointer;
}

.countdown-mobile-product-price {
    font-size: 16px;
    color: #e02b41;
    font-weight: bold;
}

/* 倒计时商品图片和名称链接样式 */
.countdown-product-img,
.countdown-mobile-product-img {
    display: block;
    text-decoration: none;
}

.countdown-product-img img,
.countdown-mobile-product-img img {
    display: block;
    width: 100%;
    height: auto;
}

.countdown-product-name,
.countdown-mobile-product-name {
    color: #333;
    text-decoration: none;
    display: block;
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 5px;
}

.countdown-product-name:hover,
.countdown-mobile-product-name:hover {
    color: #e44d3a;
    text-decoration: underline;
}

/* 移除原来的点击事件绑定，因为现在使用a标签 */
.countdown-product,
.countdown-mobile-product {
    cursor: default; /* 恢复默认光标 */
}

/* 商品区域 */
.section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: #e02b41;
}

.section-more {
    color: #e02b41;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s;
}

.section-more:hover {
    color: #4caf50;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 160px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

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

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e02b41;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
    cursor: pointer;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.current-price {
    font-size: 16px;
    color: #e02b41;
    font-weight: bold;
    margin-right: 10px;
}

.original-price {
    font-size: 12px;
    color: #666;
    text-decoration: line-through;
}

/* 商品特殊标签样式 */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.product-special {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.product-special.hot {
    background: #ff5252;
    color: white;
}

.product-special.recommend {
    background: #ff9800;
    color: white;
}

.product-special.new {
    background: #2196f3;
    color: white;
}

.product-special.discount {
    background: #4caf50;
    color: white;
}

.product-special.limited {
    background: #9c27b0;
    color: white;
}

.product-special.free-shipping {
    background: #3f51b5;
    color: white;
}

.product-special.buy-one-get-one {
    background: #e91e63;
    color: white;
}

.product-special.half-off {
    background: #ff5722;
    color: white;
}

.product-special.time-sale {
    background-color: #edf7f6;
    color: #006d75;
    border: 1px solid #b2d4d2;
}

.product-special.point {
    background-color: #f8faf0;
    color: #8eb92a;
    border: 1px solid #d8e8a6;
}

.product-special svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.product-rating {
    display: flex;
    align-items: center;
}

.product-rating i {
    color: #ffa800;
    margin-right: 3px;
}

.product-favorites {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.product-favorites i {
    margin-right: 3px;
    transition: color 0.3s;
}

.product-favorites .far {
    color: #999;
}

.product-favorites .fas {
    color: #e02b41;
}

.product-favorites.active .far {
    display: none;
}

.product-favorites:not(.active) .fas {
    display: none;
}

.btn-add-to-cart {
    width: 100%;
    padding: 8px;
    background: #e02b41;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-add-to-cart:hover {
    background: #c41e32;
}

/* 用户评论区域 */
.user-reviews {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.reviews-container {
    display: flex;
    transition: transform 0.5s;
}

.review-card {
    flex: 0 0 32%;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 10px;
    margin-right: 15px;
}

@media (max-width: 768px) {
    .review-card {
        flex: 0 0 100%;
    }
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-name {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 14px;
}

.review-rating {
    color: #ffa800;
    font-size: 12px;
}

.review-content {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.review-product {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.review-product a {
    color: #e02b41;
    text-decoration: none;
}

.review-media {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.review-media-item {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.review-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-media-item.video::after {
    content: '\f04b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0,0,0,0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 媒体查询 - 响应式设计 */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .review-card {
        flex: 0 0 48%;
    }
    
    .countdown-section {
        display: none;
    }
    
    .countdown-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .countdown-mobile {
        display: none;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .promo-banners {
        grid-template-columns: 1fr;
    }
    
    .review-card {
        flex: 0 0 100%;
    }
    
    .hero-slider {
        height: 250px;
    }
    
    .slide-title {
        font-size: 24px;
    }
    
    .slide-description {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .countdown-mobile-timer {
        gap: 5px;
    }
    
    .countdown-mobile-unit {
        min-width: 40px;
        padding: 5px;
    }
    
    .countdown-mobile-value {
        font-size: 16px;
    }
    
    .countdown-mobile-product {
        width: 240px;
    }
}