/**
 * Product Carousel Widget Styles
 * 产品轮播小部件样式
 * 基于产品列表样式 (product-list.css)
 */

/* ============================================
   轮播容器
   ============================================ */

.product-carousel-wrapper {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    position: relative;
}

.product-carousel-swiper {
    position: relative;
    overflow: hidden;
    padding: 0 60px;
}

.product-carousel-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.product-carousel-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* 确保产品项填满 slide */
.product-carousel-swiper .swiper-slide .yanjing-product-item {
    width: 100%;
    height: 100%;
    margin: 0;
    list-style: none;
}

/* ============================================
   导航按钮
   ============================================ */

.product-carousel-swiper .swiper-button-next,
.product-carousel-swiper .swiper-button-prev {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-carousel-swiper .swiper-button-next:after,
.product-carousel-swiper .swiper-button-prev:after {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.product-carousel-swiper .swiper-button-next:hover,
.product-carousel-swiper .swiper-button-prev:hover {
    background: #ab8e66;
    box-shadow: 0 4px 20px rgba(171, 142, 102, 0.3);
}

.product-carousel-swiper .swiper-button-next:hover:after,
.product-carousel-swiper .swiper-button-prev:hover:after {
    color: #fff;
}

/* 禁用状态 */
.product-carousel-swiper .swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 位置调整 */
.product-carousel-swiper .swiper-button-prev {
    left: 0;
}

.product-carousel-swiper .swiper-button-next {
    right: 0;
}

/* ============================================
   分页器
   ============================================ */

.product-carousel-swiper .swiper-pagination {
    position: relative;
    margin-top: 30px;
    bottom: auto;
}

.product-carousel-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ddd;
    opacity: 1;
    transition: all 0.3s ease;
}

.product-carousel-swiper .swiper-pagination-bullet-active {
    background: #ab8e66;
    width: 30px;
    border-radius: 5px;
}

/* ============================================
   产品样式继承（参考 product-list.css）
   ============================================ */

/* 单个产品项 */
.product-carousel-swiper .yanjing-product-item {
    background: transparent;
    border-radius: 0;
    transition: all 0.3s ease;
    box-shadow: none;
    position: relative;
}

.product-carousel-swiper .yanjing-product-item:hover {
    box-shadow: none;
    transform: none;
}

.product-carousel-swiper .yanjing-product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 产品图片区域 */
.product-carousel-swiper .yanjing-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 比例 */
    overflow: hidden;
    background: #f9f9f9;
}

.product-carousel-swiper .yanjing-product-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* 主图和悬停图 */
.product-carousel-swiper .yanjing-product-main-image,
.product-carousel-swiper .yanjing-product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.product-carousel-swiper .yanjing-product-main-image {
    opacity: 1;
    z-index: 1;
}

.product-carousel-swiper .yanjing-product-hover-image {
    opacity: 0;
    z-index: 2;
}

/* 悬停时切换图片 */
.product-carousel-swiper .yanjing-product-item:hover .yanjing-product-main-image {
    opacity: 0;
}

.product-carousel-swiper .yanjing-product-item:hover .yanjing-product-hover-image {
    opacity: 1;
}

/* 产品内容 */
.product-carousel-swiper .yanjing-product-content {
    padding: 15px 0;
    position: relative;
}

/* 默认信息 */
.product-carousel-swiper .yanjing-product-default-info {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* 有变体的产品，默认信息延迟显示 */
.product-carousel-swiper .yanjing-product-item.has-variations .yanjing-product-default-info {
    transition: opacity 0.3s ease 0.35s;
}

/* 品牌名称 */
.product-carousel-swiper .yanjing-product-brand {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    margin-bottom: 8px;
}

/* 产品标题 */
.product-carousel-swiper .yanjing-product-title {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 10px;
    min-height: 42px;
    text-transform: uppercase;
}

.product-carousel-swiper .yanjing-product-title a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-carousel-swiper .yanjing-product-title a:hover {
    color: #ab8e66;
}

/* 产品价格 */
.product-carousel-swiper .yanjing-product-price {
    font-size: 13px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
}

/* 愿望清单按钮 */
.product-carousel-swiper .yanjing-wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 1;
}

.product-carousel-swiper .yanjing-wishlist-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #000;
    transition: all 0.3s ease;
}

.product-carousel-swiper .yanjing-wishlist-btn:hover svg,
.product-carousel-swiper .yanjing-wishlist-btn.active svg {
    fill: #ab8e66;
    stroke: #ab8e66;
}

/* 变体信息 */
.product-carousel-swiper .yanjing-product-variations-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 15px 0;
}

.product-carousel-swiper .yanjing-product-item.has-variations .yanjing-product-content:hover .yanjing-product-default-info {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-carousel-swiper .yanjing-product-item.has-variations .yanjing-product-content:hover .yanjing-product-variations-info {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.1s;
}

/* 属性名称 */
.product-carousel-swiper .yanjing-variations-label {
    font-size: 13px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* 变体项 */
.product-carousel-swiper .yanjing-variation-item {
    width: 20px;
    height: 20px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

.product-carousel-swiper .yanjing-variation-item:hover {
    border-color: #ab8e66;
    transform: scale(1.1);
}

.product-carousel-swiper .yanjing-variation-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 变体网格 */
.product-carousel-swiper .yanjing-variations-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================
   无产品提示
   ============================================ */

.yanjing-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.yanjing-no-products p {
    margin: 0;
    font-size: 16px;
}

/* ============================================
   响应式布局
   ============================================ */

/* 平板 */
@media (max-width: 1024px) {
    .product-carousel-swiper {
        padding: 0 50px;
    }
    
    .product-carousel-swiper .swiper-button-next,
    .product-carousel-swiper .swiper-button-prev {
        width: 40px;
        height: 40px;
    }
    
    .product-carousel-swiper .swiper-button-next:after,
    .product-carousel-swiper .swiper-button-prev:after {
        font-size: 16px;
    }
}

/* 手机 */
@media (max-width: 767px) {
    .product-carousel-wrapper {
        padding: 40px 20px;
    }
    
    .product-carousel-swiper {
        padding: 0 20px;
    }
    
    /* 隐藏导航按钮 */
    .product-carousel-swiper .swiper-button-next,
    .product-carousel-swiper .swiper-button-prev {
        display: none;
    }
    
    /* 显示分页器 */
    .product-carousel-swiper .swiper-pagination {
        display: block;
        margin-top: 25px;
    }
    
    .product-carousel-swiper .yanjing-product-content {
        padding: 15px 10px;
    }
    
    .product-carousel-swiper .yanjing-product-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .product-carousel-swiper .yanjing-product-brand {
        font-size: 10px;
    }
    
    .product-carousel-swiper .yanjing-product-price {
        font-size: 14px;
    }
    
    .product-carousel-swiper .yanjing-wishlist-btn {
        width: 32px;
        height: 32px;
    }
    
    .product-carousel-swiper .yanjing-wishlist-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .product-carousel-swiper .yanjing-variation-item {
        width: 18px;
        height: 18px;
    }
}

/* Elementor 编辑器内样式 */
.elementor-editor-active .product-carousel-wrapper {
    min-height: 400px;
}

