/* Custom Reviews Plugin Styles */
/* Version: 1.1.3 - Smooth Scrolling */

.custom-reviews-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px 20px;
}

.custom-reviews-container {
    position: relative;
}

/* 横版模式 */
.custom-reviews-horizontal .custom-reviews-container {
    padding: 0 60px;
}

/* 竖版模式容器 */
.custom-reviews-vertical .custom-reviews-container {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.custom-reviews-carousel {
    overflow: hidden;
    margin: 0 auto;
}

.custom-reviews-track {
    display: flex;
    gap: 30px;
    transition: transform 0.4s ease-in-out;
    user-select: none;
}

/* 横版模式 - 横向排列 */
.custom-reviews-horizontal .custom-reviews-track {
    flex-direction: row;
}

/* 竖版模式 - 纵向排列 */
.custom-reviews-vertical .custom-reviews-track {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: none; /* 移除transition，使用JS控制平滑滚动 */
}

/* 竖版模式轮播区域 - 关键：固定高度，超出隐藏，可滚动 */
.custom-reviews-vertical .custom-reviews-carousel {
    flex: 1;
    max-height: 600px;  /* 默认高度，会被内联样式覆盖 */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    position: relative;
    scroll-behavior: smooth; /* 添加平滑滚动行为 */
}

/* 隐藏竖版模式的滚动条，但保持可滚动 */
.custom-reviews-vertical .custom-reviews-carousel::-webkit-scrollbar {
    width: 0;
    display: none;
}

.custom-reviews-vertical .custom-reviews-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 滚动指示点容器 */
.cr-scroll-indicators {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 5px;
    align-items: center;
    flex-shrink: 0;
}

/* 横版模式隐藏指示点 */
.custom-reviews-horizontal .cr-scroll-indicators {
    display: none;
}

/* 单个指示点 */
.cr-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cr-indicator-dot:hover {
    background: #ff8c42;
    transform: scale(1.2);
}

.cr-indicator-dot.active {
    background: #ff8c42;
    height: 20px;
    border-radius: 4px;
}

/* 评论卡片样式 */
.review-card {
    flex: 0 0 auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

/* 横版卡片 - JavaScript 动态设置宽度 */
.custom-reviews-horizontal .review-card {
    padding: 30px;
}

/* 竖版卡片 - 紧凑布局 */
.custom-reviews-vertical .review-card {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    min-height: auto;
}

.review-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 竖版模式 - 左侧区域（图标+头像） */
.custom-reviews-vertical .review-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* 竖版模式 - 右侧区域（内容） */
.custom-reviews-vertical .review-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 评论头部 */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* 竖版模式调整头部 */
.custom-reviews-vertical .review-header {
    margin-bottom: 0;
    justify-content: flex-start;
    gap: 10px;
}

/* 评论图标 */
.review-icon {
    width: 35px;
    height: 35px;
    background: #fff5f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.review-icon svg {
    width: 18px;
    height: 18px;
}

/* 横版模式隐藏图标 */
.custom-reviews-horizontal .review-icon {
    display: none;
}

/* 星级评分样式 */
.review-stars {
    display: flex;
    gap: 3px;
}

.custom-reviews-vertical .review-stars {
    margin-bottom: 0;
}

.review-stars .star {
    font-size: 16px;
    color: #e0e0e0;
    transition: color 0.2s;
    line-height: 1;
}

.review-stars .star.filled {
    color: #ff8c42;
}

/* 评论内容样式 */
.review-content {
    flex: 1;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    position: relative;
    max-height: 150px;
    overflow: hidden;
}

/* 竖版模式内容样式 - 更紧凑 */
.custom-reviews-vertical .review-content {
    max-height: 60px;
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
}

.review-content.expanded {
    max-height: none;
}

.review-content p {
    margin: 0 0 8px 0;
}

.review-content p:last-child {
    margin-bottom: 0;
}

/* 展开按钮 */
.review-show-more {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 3px 0;
    text-align: left;
    letter-spacing: 0.3px;
    font-weight: 500;
    transition: color 0.2s;
    display: none;
}

.review-card.has-overflow .review-show-more {
    display: block;
}

.review-show-more:hover {
    color: #ff8c42;
}

/* 作者信息样式 */
.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* 竖版模式作者信息 - 紧凑样式 */
.custom-reviews-vertical .review-author {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-direction: row;
    gap: 0;
    position: relative;
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

/* 竖版模式头像 - 稍小一些 */
.custom-reviews-vertical .author-avatar {
    width: 60px;
    height: 60px;
    font-size: 16px;
    -ms-flex: 0 0 60px;
    flex: 0 0 60px;
    margin-right: 10px;
}

/* 头像图片样式 */
.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* 头像首字母样式 */
.author-avatar .avatar-letter {
    position: relative;
    z-index: 1;
}

.author-name {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 竖版模式姓名 - 放在内容区域底部 */
.custom-reviews-vertical .author-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    margin-top: 0px;
}

/* 导航按钮样式 - 仅横版模式显示 */
.cr-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: #333;
}

.cr-nav-btn:hover:not(:disabled) {
    background: #ff8c42;
    border-color: #ff8c42;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.cr-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cr-nav-prev {
    left: 0;
}

.cr-nav-next {
    right: 0;
}

/* 后台管理样式 */
.cr-avatar-upload-wrapper {
    max-width: 400px;
}

.cr-avatar-preview {
    margin-bottom: 15px;
    min-height: 100px;
    display: flex;
    align-items: center;
}

.cr-remove-avatar-btn {
    margin-left: 10px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .review-card {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .custom-reviews-horizontal .custom-reviews-container {
        padding: 0 50px;
    }

    .review-card {
        min-width: 260px;
    }

    .custom-reviews-vertical .review-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .custom-reviews-vertical .review-left {
        width: 100%;
        justify-content: space-between;
    }

    .cr-nav-btn {
        width: 40px;
        height: 40px;
    }

    .cr-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .custom-reviews-wrapper {
        padding: 20px 10px;
    }

    .custom-reviews-horizontal .custom-reviews-container {
        padding: 0 40px;
    }

    .review-card {
        padding: 20px;
        min-width: 240px;
    }

    .custom-reviews-vertical .review-card {
        padding: 12px 15px;
    }

    .author-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

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

    .cr-nav-btn {
        width: 36px;
        height: 36px;
    }
}
