@charset "utf-8";

/* --- 基礎排版 --- */
.title {
    text-align: center;
    color: #333;
    font-size: 20px;
    margin-bottom: 25px;
}

/* --- 優惠外層容器 --- */
.w-simImg .image-w {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    /* 確保容器高度足以撐開，避免後續項目崩塌 */
    min-height: 200px; 
}

/* --- 優惠背景容器 (父層) --- */
.image-w .promotion-text {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit; /* 繼承外層最小高度 */
    overflow: hidden;
    border-radius: 8px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 讓內容垂直置中 */
    padding: 20px;
    
    /* 核心對齊：確保背景屬性一致，讓偽元素繼承 */
    background-size: cover !important; 
    background-position: right center !important;
    background-repeat: no-repeat;
}

/* --- 背景動畫層 (::before) --- */
.image-w .promotion-text::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* 鎖定繼承：強制同步父層的背景設定 */
    background-image: inherit;
    background-size: inherit;
    background-position: inherit;
    background-repeat: inherit;
    
    /* 解決跳動關鍵：固定縮放原點在右側中心 */
    transform-origin: right center; 
    
    /* 視覺效果：初始亮度較暗以利文字閱讀 */
    filter: brightness(50%);
    z-index: -1; 
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease;
    border-radius: inherit;
    
    /* 強制重置任何來自舊類別的位移干擾 */
    transform: scale(1) translate(0, 0); 
}

/* --- 滑過放大變亮效果 --- */
.image-w .promotion-text:hover::before {
    /* 往左方及上下擴展，右緣固定不動 */
    transform: scale(1.1); 
    filter: brightness(100%);
}

/* --- 文字內容層確保 (提升層級) --- */
.promotion-text h2, 
.promotion-text h3, 
.promotion-text .promotion-sub, 
.promotion-text .promotion-btn-box {
    position: relative;
    z-index: 2;
    color: #fff; /* 確保在暗色背景下清晰 */
    text-shadow: 0px 2px 4px rgba(0,0,0,0.5); /* 增加文字辨識度 */
}

/* --- 舊有組件相容性修正 (防止 spec5/imgScaleBig 干擾) --- */
.simImg_spec5:hover .promotion-text::before,
.imgScaleBig:hover .promotion-text::before {
    /* 確保我們的 scale 邏輯不被舊的 imgScaleBig 蓋掉 */
    transform: scale(1.1) !important;
}

/* 移除不需要的舊動畫干擾 */
.simImg_spec5 h3, .simImg_spec5 p {
    transform: none !important;
    opacity: 1 !important;
}

/* --- 響應式調整 --- */
@media (max-width: 960px) {
    .image-w .promotion-text {
        min-height: 180px;
        padding: 15px;
    }
    .promotion-text h2 { font-size: 1.2rem; }
    .promotion-text h3 { font-size: 1rem; }
    .simImg_spec p { font-size: 90%; }
}