/**
 * Universal Carousel Styles
 * 通用轮播控件样式 - 基于test.html的设计
 */

/* ===== 基础轮播容器样式 ===== */
.universal-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 60px;
    overflow: hidden;
}

.universal-carousel .swiper-wrapper {
    align-items: stretch;
}

.universal-carousel .swiper {
    overflow: hidden;
}

.universal-carousel .swiper-container {
    overflow: hidden;
}

/* ===== 基础卡片样式 ===== */
.carousel-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== 卡片悬停效果 ===== */
.hover-lift .carousel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.hover-scale .carousel-card:hover {
    transform: scale(1.03);
}

/* ===== 统一高度模式 ===== */
.universal-carousel[data-uniform-height="yes"] .swiper-slide {
    height: auto;
    display: flex;
}

.universal-carousel[data-uniform-height="yes"] .carousel-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== 产品卡片专用样式 ===== */
.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

/* ===== 产品徽章样式 ===== */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.badge-red { background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%); }
.badge-blue { background: linear-gradient(135deg, #4ecdc4 0%, #88d3ce 100%); }
.badge-green { background: linear-gradient(135deg, #55a3ff 0%, #83c5ff 100%); }
.badge-orange { background: linear-gradient(135deg, #f7b731 0%, #f5d76e 100%); }
.badge-purple { background: linear-gradient(135deg, #a55eea 0%, #d63384 100%); }

/* ===== 产品信息区域 ===== */
.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.3;
}

/* ===== 评分样式 ===== */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.stars {
    color: #ffa500;
    font-size: 14px;
    line-height: 1;
}

.rating-text {
    color: #666;
    font-size: 13px;
}

/* ===== 产品特性样式 ===== */
.product-features {
    margin-bottom: 16px;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.product-features p,
.product-features div {
    margin-bottom: 4px;
}

/* ===== 价格样式 ===== */
.product-price {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

/* ===== 按钮样式 ===== */
.product-button {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4ecdc4 0%, #88d3ce 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    margin-top: auto;
}

.product-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(78, 205, 196, 0.4);
    text-decoration: none;
    color: white;
}

/* ===== 导航箭头样式 ===== */
.universal-carousel .swiper-button-next,
.universal-carousel .swiper-button-prev {
    width: 50px;
    height: 50px;
    margin-top: -25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.universal-carousel .swiper-button-next:hover,
.universal-carousel .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.universal-carousel .swiper-button-next::after,
.universal-carousel .swiper-button-prev::after {
    font-size: 18px;
    color: #666;
    font-weight: 600;
}

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

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

/* ===== 分页指示器样式 ===== */
.universal-carousel .swiper-pagination {
    position: relative;
    margin-top: 30px;
}

.universal-carousel .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: all 0.3s ease;
}

.universal-carousel .swiper-pagination-bullet-active {
    background: #4ecdc4;
    transform: scale(1.2);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .universal-carousel {
        padding: 20px 50px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .current-price {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .universal-carousel {
        padding: 20px 40px;
    }
    
    .universal-carousel .swiper-button-next,
    .universal-carousel .swiper-button-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }
    
    .universal-carousel .swiper-button-next::after,
    .universal-carousel .swiper-button-prev::after {
        font-size: 14px;
    }
    
    .product-image-container {
        height: 160px;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-title {
        font-size: 15px;
    }
    
    .current-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .universal-carousel {
        padding: 15px 35px;
    }
    
    .universal-carousel .swiper-button-prev {
        left: 5px;
    }
    
    .universal-carousel .swiper-button-next {
        right: 5px;
    }
    
    .product-image-container {
        height: 140px;
    }
    
    .product-info {
        padding: 14px;
    }
    
    .product-button {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* ===== 加载状态样式 ===== */
.universal-carousel.swiper-loading {
    opacity: 0.5;
    pointer-events: none;
}

.universal-carousel.swiper-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4ecdc4;
    border-radius: 50%;
    animation: carousel-loading 1s linear infinite;
    z-index: 10;
}

@keyframes carousel-loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Elementor 编辑器兼容性 ===== */
.elementor-editor-active .universal-carousel .swiper-button-next,
.elementor-editor-active .universal-carousel .swiper-button-prev {
    z-index: 1;
}

/* ===== 无障碍访问支持 ===== */
.carousel-card:focus {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}

.product-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ===== 客户评论轮播专用样式 ===== */
.testimonial-carousel-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.testimonial-header {
    margin-bottom: 40px;
    text-align: center;
}

.testimonial-main-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.2;
}

.testimonial-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
    opacity: 0.8;
}

/* ===== 评论卡片内部布局 ===== */
.testimonial-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 1;
    min-height: 180px;
}

/* 星星评分 - 置顶显示 */
.testimonial-rating {
    order: 1;
    margin-bottom: 12px;
}

.testimonial-rating .stars {
    color: #4ecdc4;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1px;
}

/* 引号图标 - 放在星星评分下方 */
.quote-icon {
    order: 2;
    color: rgba(78, 205, 196, 0.6);
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-start;
}

.quote-icon svg {
    width: 24px;
    height: 24px;
}

/* 评论内容 - 主要内容区域 */
.testimonial-content {
    order: 3;
    flex: 1 1 auto;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #555;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    min-height: 200px;
    max-width: 100%;
    width: 100%;
    display: block !important;
}

.testimonial-content p {
    margin: 0 0 8px 0;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.6;
}

/* 客户信息 - 底部固定 */
.customer-info {
    order: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.customer-details {
    flex: 1;
}

.customer-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 1px 0;
    line-height: 1.3;
}

.customer-title {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.2;
}

/* ===== 评论轮播容器调整 ===== */
.testimonial-carousel-wrapper .universal-carousel {
    padding: 20px 60px 40px;
    overflow: hidden;
}

.testimonial-carousel-wrapper .carousel-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    min-height: 200px;
    position: relative;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

/* ===== 评论轮播响应式样式 ===== */
@media (max-width: 768px) {
    .testimonial-main-title {
        font-size: 24px;
    }
    
    .testimonial-subtitle {
        font-size: 14px;
    }
    
    .testimonial-header {
        margin-bottom: 30px;
    }
    
    .testimonial-carousel-wrapper .universal-carousel {
        padding: 15px 40px 30px;
    }
    
    .testimonial-carousel-wrapper .carousel-card {
        padding: 16px;
        min-height: 180px;
    }
    
    .testimonial-rating {
        margin-bottom: 10px;
    }
    
    .testimonial-content {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .customer-info {
        gap: 8px;
        padding-top: 10px;
    }
    
    .customer-avatar {
        width: 36px;
        height: 36px;
    }
    
    .customer-name {
        font-size: 13px;
    }
    
    .customer-title {
        font-size: 11px;
    }
    
    .quote-icon {
        margin-bottom: 8px;
    }
    
    .quote-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .testimonial-main-title {
        font-size: 20px;
    }
    
    .testimonial-carousel-wrapper .universal-carousel {
        padding: 10px 35px 25px;
    }
    
    .testimonial-carousel-wrapper .carousel-card {
        padding: 14px;
        min-height: 160px;
    }
    
    .testimonial-content {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .customer-avatar {
        width: 32px;
        height: 32px;
    }
    
    .customer-name {
        font-size: 12px;
    }
    
    .customer-title {
        font-size: 10px;
    }
    
    .quote-icon {
        margin-bottom: 6px;
    }
    
    .quote-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .universal-carousel .swiper-button-next,
    .universal-carousel .swiper-button-prev,
    .universal-carousel .swiper-pagination {
        display: none;
    }
    
    .universal-carousel .swiper-wrapper {
        display: flex !important;
        flex-wrap: wrap;
        transform: none !important;
    }
    
    .universal-carousel .swiper-slide {
        width: 50% !important;
        flex: none;
        page-break-inside: avoid;
    }
}

/* ===== WordPress 兼容性修复 ===== */
/* 强制覆盖WordPress主题可能的CSS冲突 */
body .testimonial-content,
.wp-block .testimonial-content,
.elementor-widget .testimonial-content {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-overflow: initial !important;
    display: block !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 60px !important;
}

body .testimonial-content p,
.wp-block .testimonial-content p,
.elementor-widget .testimonial-content p {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.6 !important;
}

/* 确保卡片容器有足够高度 */
body .testimonial-carousel-wrapper .carousel-card,
.wp-block .testimonial-carousel-wrapper .carousel-card,
.elementor-widget .testimonial-carousel-wrapper .carousel-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 200px !important;
    height: 100% !important;
    overflow: visible !important;
}