/**
 * Compare Module Fixes
 * 修复 SHOP-44, SHOP-42, SHOP-40 相关的 compare 模块显示问题
 *
 * @package Laifen_Russia
 */

/* ========== 修复 choose-shaver 特性图标布局 - 垂直排列并水平对齐 ========== */

/* 确保产品卡片使用固定高度的区块 */
.choose-shaver__product {
    display: flex !important;
    flex-direction: column !important;
}

/* 产品顶部区域固定高度，确保对齐 */
.choose-shaver__product-top {
    display: flex !important;
    flex-direction: column !important;
    min-height: 500px !important;
}

/* 产品信息区域固定高度 */
.choose-shaver__product-info {
    min-height: 200px !important;
}

/* 徽章固定高度，即使为空也占位 */
.choose-shaver__badge {
    min-height: 28px !important;
    margin-bottom: 8px !important;
}

/* 标题固定高度 */
.choose-shaver__product-title {
    min-height: 30px !important;
}

/* 副标题固定高度 */
.choose-shaver__product-subtitle {
    min-height: 34px !important;
}

/* 价格固定高度 */
.choose-shaver__price {
    min-height: 24px !important;
}

/* 颜色选择器固定高度 */
.choose-shaver__swatches {
    min-height: 25px !important;
    margin-bottom: 20px !important;
}

/* 特性图标垂直排列，一列显示 */
.choose-shaver__features {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 30px 15px 15px !important;
}

/* 每个特性图标水平居中，固定高度确保对齐 */
.choose-shaver__feature {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 200px !important;
    height: 140px !important;
    min-height: 140px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 图标尺寸优化 */
.choose-shaver__feature-icon {
    height: 32px !important;
    width: auto !important;
    margin-bottom: 8px !important;
    flex-shrink: 0 !important;
}

/* 文字样式优化 */
.choose-shaver__feature-title {
    text-align: center !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    min-height: auto !important;
}

/* 副标题样式 */
.choose-shaver__feature-subtitle {
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    margin: 2px 0 0 0 !important;
    color: #999 !important;
}

/* ========== 优化按钮尺寸 ========== */

/* 缩小按钮尺寸 - 减小内边距 */
.choose-shaver__button {
    width: 80px !important;
    height: 36px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* 调整按钮容器间距 - 减小间距 */
.choose-shaver__button-wrapper {
    margin-bottom: 4px !important;
}

/* Learn More 链接样式优化 - 减小间距 */
.choose-shaver__learn-more {
    margin-bottom: 10px !important;
}

.choose-shaver__learn-more a {
    font-size: 13px !important;
}

/* ========== 修复 SHOP-40: PC端剃须刀P3内容页compare模块鼠标悬停按钮文案不展示 ========== */

/* 确保按钮文案始终可见 */
.compare-product-cta,
.comparison-btn {
    display: inline-block;
    text-align: center;
    line-height: normal;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    color: #fff;
    background-color: #51A2FE;
    border: 1px solid #51A2FE;
    transition: all 0.3s ease;
}

/* 悬停状态 - 确保文案可见 */
.compare-product-cta:hover,
.comparison-btn:hover {
    background-color: #3a8fe8;
    color: #fff;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 确保按钮有足够的内边距 */
.compare-product-cta {
    padding: 8px 20px;
    min-width: 80px;
    font-size: 14px;
    font-weight: 500;
}

.comparison-btn {
    padding: 6px 16px;
    min-width: 70px;
    font-size: 12px;
    font-weight: 500;
}

/* ========== 通用修复：确保所有 compare 模块的图标和文字正确显示 ========== */

/* V3 版本的 compare 模块修复 */
.product-comparison-v3 .shaver-info__inner img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto;
}

.product-comparison-v3 .sub-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-comparison-v3 .sub-title2 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 确保图标容器有足够空间 */
.shaver-info__inner {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ========== 表格版本的 compare 模块修复 ========== */

.compare-features-table {
    table-layout: auto;
    width: 100%;
}

.compare-features-table th,
.compare-features-table td {
    vertical-align: middle;
    padding: 12px 8px;
}

/* 确保表格内容不会溢出 */
.compare-td-value {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 200px;
}

.compare-td-value img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px auto;
}

/* ========== 移动端表格优化 ========== */

@media (max-width: 767px) {
    .compare-features-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .compare-features-table {
        min-width: 600px;
    }
    
    .compare-features-table th,
    .compare-features-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .compare-td-value {
        max-width: 150px;
        font-size: 10px;
    }
    
    .comparison-btn {
        padding: 4px 10px;
        font-size: 10px;
        min-width: 50px;
    }
}

/* ========== 确保图片加载失败时的占位符 ========== */

.compare-product-image img,
.shaver-info__inner img {
    background-color: #f5f5f5;
    border-radius: 8px;
}

/* 图片加载动画 */
@keyframes imageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.compare-product-image img {
    animation: imageLoad 0.3s ease-in;
}
