/* 輪播區塊主設計 */
.wc-product-carousel-section {
    margin-bottom: 50px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

.carousel-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.carousel-title:before,
.carousel-title:after {
    content: "";
    height: 1px;
    background: #333;
    width: 30px;
    flex: none;
    margin: 0 15px;
}

.wc-product-carousel {
    position: relative;
}

/* Swiper 容器設定 */
.wc-product-carousel .swiper {
    width: 100%;
    position: relative;
    padding: 0 60px;
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

.wc-product-carousel .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* 確保每排只顯示5個 */
.wc-product-carousel .swiper-slide {
    width: 20%;
    padding: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    height: auto;
    position: relative;
    transition-property: transform;
    overflow: hidden;
}

/* 隱藏非活動幻燈片 */
.wc-product-carousel .swiper-slide:not(.swiper-slide-active):not(.swiper-slide-next):not(.swiper-slide-next + .swiper-slide):not(.swiper-slide-next + .swiper-slide + .swiper-slide):not(.swiper-slide-next + .swiper-slide + .swiper-slide + .swiper-slide) {
    visibility: hidden;
}

/* 產品卡片設計 */
.product-card {
    text-align: center;
    transition: all 0.3s ease;
    background: transparent;
    box-shadow: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* 產品圖片容器 */
.product-image-wrapper {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 50px;
    position: relative;
    /* 添加硬件加速，防止閃屏 */
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

.product-card .product-image {
    display: block;
    transition: transform 0.4s ease;
    /* 添加硬件加速，防止閃屏 */
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.product-card .product-image img {
    width: 100%;
    height: auto;
    border-radius: 50px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

/* 產品標題 */
.product-card .product-title {
    margin: 12px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    display: -webkit-box;
    display: box;
}

.product-card .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card .product-title a:hover {
    color: #e8363c;
}

/* 代儲值按鈕 */
.product-card .button {
    display: inline-block;
    width: 150px;
    padding: 8px 24px;
    background: #e8363c;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(232, 54, 60, 0.3);
    box-sizing: border-box;
}

.product-card .button:hover {
    background: #d12d33;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 54, 60, 0.4);
}

/* 導航按鈕設計 */
.swiper-button-next,
.swiper-button-prev {
    width: 40px;
    height: 40px;
    background: #FFE763;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    color: #333;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin: 0;
}

.swiper-button-prev {
    left: 10px;
}

.swiper-button-next {
    right: 10px;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #e8363c;
    color: #fff;
    transform: scale(1.1);
}

/* 禁用的按鈕樣式 */
.swiper-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 查看更多按鈕 */
.view-more-wrapper {
    text-align: center;
    margin-top: 30px;
}

.view-more-button {
    display: inline-block;
    padding: 10px 30px;
    background-color: #f8f8f8;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.view-more-button:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* 響應式設計 */
@media screen and (max-width: 1200px) {
    .wc-product-carousel .swiper-slide {
        width: 20%;
    }
}

@media screen and (max-width: 768px) {
    .wc-product-carousel .swiper-slide {
        width: 33.333%;
        padding: 5px;
    }
    
    .carousel-title {
        font-size: 24px;
    }
    
    .carousel-title:before,
    .carousel-title:after {
        margin: 0 10px;
    }
    
    .product-card .product-title {
        font-size: 14px;
        height: 40px;
        margin: 8px 0 0;
    }
    
    .product-image-wrapper {
        border-radius: 30px;
        margin-bottom: 5px;
    }
    
    .product-card .product-image img {
        border-radius: 30px;
    }
    
    .product-card .button {
        display: none;
    }
}

@media screen and (max-width: 600px) {
    .wc-product-carousel .swiper {
        padding: 0 35px;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px;
        height: 30px;
    }
}

@media screen and (max-width: 480px) {
    .wc-product-carousel .swiper {
        padding: 0 30px;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px;
        height: 30px;
    }
    
    .swiper-button-prev {
        left: 0;
    }
    
    .swiper-button-next {
        right: 0;
    }
    
    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 14px;
    }
}