/**
 * Product Carousel Styles
 * 产品轮播样式
 */

/* 容器样式 */
.product-carousel-container {
    max-width: 1280px;
    margin: 0 auto;
}

.product-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden; /* 防止内容超出 */
}

/* Swiper 容器 */
.product-carousel-container .swiper {
    overflow: visible;
    padding-bottom: 1rem;
    margin-left: 0 !important; /* 移除左侧偏移 */
    margin-right: 0 !important; /* 移除右侧偏移 */
}

/* 产品项样式 */
.product-carousel-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-carousel-link {
    text-decoration: none;
    display: block;
}

/* 图片容器 */
.product-carousel-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px; /* 默认高度，可通过Elementor控制面板调整 */
    overflow: hidden;
    border-radius: 8px;
    background-color: #f3f4f6;
}

.product-carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-carousel-link:hover .product-carousel-image {
    transform: scale(1.05);
}

/* 购物车按钮 */
.product-carousel-cart-button {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: #111;
}

.product-carousel-cart-button:hover {
    background-color: #f9fafb;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.product-carousel-cart-button:active {
    transform: scale(0.95);
}

.product-carousel-cart-button.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-carousel-cart-button.loading svg {
    animation: spin 1s linear infinite;
}

.product-carousel-cart-button.added {
    background-color: #10b981;
    color: white;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 产品内容 */
.product-carousel-content {
    margin-top: 0.75rem;
    padding: 0 0.25rem;
}

.product-carousel-title-link {
    text-decoration: none;
    color: inherit;
}

.product-carousel-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.product-carousel-title-link:hover .product-carousel-title {
    color: #4b5563;
}

.product-carousel-price {
    font-size: 1rem;
    font-weight: 400;
    color: #1f2937;
    margin: 0;
}

.product-carousel-price .woocommerce-Price-amount {
    font-weight: 600;
}

/* 导航区域 */
.product-carousel-navigation {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.5rem;
    padding: 0.25rem 0;
}

/* 分页点 */
.product-carousel-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 0 0.75rem;
    flex: 1;
}

.product-carousel-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #d1d5db;
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 1;
    margin: 0;
}

.product-carousel-pagination .swiper-pagination-bullet:hover {
    background-color: #9ca3af;
}

.product-carousel-pagination .swiper-pagination-bullet-active {
    background-color: #111827;
    width: 24px;
}

/* 导航按钮区域 */
.product-carousel-nav-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* 导航按钮 */
.product-carousel-prev,
.product-carousel-next {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #111827;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.product-carousel-prev:hover,
.product-carousel-next:hover {
    background-color: #f3f4f6;
}

.product-carousel-prev:active,
.product-carousel-next:active {
    background-color: #e5e7eb;
}

.product-carousel-prev:disabled,
.product-carousel-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.product-carousel-prev .icon-prev,
.product-carousel-next .icon-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* 计数器 */
.product-carousel-counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    min-width: 3rem;
    text-align: center;
    margin: 0 0.5rem;
}

/* 无障碍隐藏 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Swiper 包装器 */
.product-carousel-container .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.product-carousel-container .swiper-slide {
    height: auto;
    display: flex;
}

/* 响应式样式 */
@media (min-width: 768px) {
    .product-carousel-container {
  
    }
    
    /* 桌面端隐藏超出部分 */
    .product-carousel-wrapper {
        overflow: hidden;
    }

    .product-carousel-title {
        font-size: 1.125rem;
    }

    .product-carousel-price {
        font-size: 1rem;
    }

    .product-carousel-counter {
        font-size: 1rem;
        min-width: 3.5rem;
    }

    .product-carousel-prev,
    .product-carousel-next {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 767px) {
    /* 移动端可见溢出（显示左右边缘） */
    .product-carousel-wrapper {
        overflow: visible;
    }
    
    .product-carousel-navigation {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .product-carousel-pagination {
        width: 100%;
        order: 2;
        padding-left: 0.25rem;
        justify-content: flex-start;
    }

    .product-carousel-nav-buttons {
        width: 100%;
        justify-content: flex-end;
        order: 1;
    }
}

