/* SMP-2400 hero（斜切版型，手法同 gocayin meetingPost+ mp-banner.css）
 * 全寬底色：左 40% #f8f8f8、右 60% SMP 紫
 * 內容：max-width 1200px，左文案斜切+疊右欄，右圖+斜色條
 * 桌面→平板全用 clamp()/vw 連續公式等比縮小（同 smp-8100），600px 以下才改上下堆疊
 * 只作用於 .smpBanner-section，不影響其他產品頁 .productHeader
 */

/* 子選單底色：SMP 主色，經 .whiteSelector 半透明白疊亮後呈現淡 SMP 色（同 smp-8100 效果） */
.menubackground.smp-2400 {
    background-color: #70326d;
}

.menubackground.smp-8100 {
    background-color: #70326d;
}

.menubackground.smp-2200 {
    background-color: #70326d;
}

/* CMS-WS override: Sky Cyan #349BE0 */
.smpBanner-section.smpBanner-section--slant.cms-ws {
    --smp-bg: #f8f8f8;
    --smp-right-bg: #349be0;
    --smp-purple: #349be0;
    --smp-stripe: rgba(52, 155, 224, 0.7);
}

.smpBanner-section--slant.cms-ws .smpBanner-copy__inner .logo.smp {
    border-color: #bfe3fa;
}

.smpBanner-section.smpBanner-section--slant.cms-ws {
    --smp-image-position-x: 20%;
}

/* CMS-SE override: Bronze #A08959 */
.smpBanner-section.smpBanner-section--slant.cms-se {
    --smp-bg: #f8f8f8;
    --smp-right-bg: #a08959;
    --smp-purple: #a08959;
    --smp-stripe: rgba(160, 137, 89, 0.7);
}

.smpBanner-section--slant.cms-se .smpBanner-copy__inner .logo.smp {
    border-color: #e3d5b5;
}

.smpBanner-section.smpBanner-section--slant.cms-se {
    --smp-image-position-x: 20%;
}

.smpBanner-section.smpBanner-section--slant {
    /* ══ 手動調整區：尺寸與位置 ══
       全部改用 clamp()/vw 連續公式，取代原本 1170px 的斷點跳變，
       讓 hero 從桌面到平板寬度像 smp-8100 一樣「等比縮小」，
       只在 600px（手機）才改版型為上下堆疊。 */
    /* 1200px：與 .productName / .header_wrap 同寬，文字起始點才會對齊子選單 */
    --smp-hero-max: 1200px;
    /* 文案欄寬度：連續公式，讓文案欄在視窗變窄時「相對」多分到一點空間
       （1200px 時 = 480px／40%；600px 時 = 300px／50%），避免標題被擠到換行 */
    --smp-inner-left: clamp(300px, calc(30vw + 120px), 480px);
    /* 全寬左右分界 */
    --smp-full-bg-left: 40%;
    /* 斜切邊套用在文案「下緣」：白色區上寬下窄。
       百分比是相對文案欄自身寬度，欄位變窄時會自動等比縮放，不需要斷點 */
    --smp-slant-end: 84%;
    --smp-copy-overlap: -4%;

    /* 圖片向左/右延伸量：連續公式，桌面 1200px 時 = 200/300px，
       600px 手機斷點前 ≈ 20/30px，兩者之間平滑內插 */
    --smp-media-extend-left: clamp(20px, calc(30vw - 160px), 200px);
    --smp-media-extend-right: clamp(30px, calc(45vw - 240px), 300px);
    --smp-image-position-x: 56%;
    --smp-image-position-y: 100%;

    /* 色塊斜角（deg）：固定角度，斜切量 = tan(角度) × hero 高度，
       高度用 clamp() 連續縮小時，斜切量會自動等比例縮小 */
    --smp-stripe-skew-deg: 16deg;

    /* hero 高度：桌面同 smp-8100 的 530px，隨視窗寬度連續縮小到 360px（手機斷點前） */
    --smp-hero-h: clamp(360px, 45vw, 530px);

    /* 斜切量 fallback：舊瀏覽器（不支援 CSS tan()）用固定值
       tan(16deg) ≈ 0.2867 × 530px ≈ 152px */
    --smp-img-slant-offset: 152px;

    /* 色條（#70326e 70%）寬度：要加寬/變窄改這裡（vw 本身已連續） */
    --smp-stripe-primary-width: 3vw;

    /* 色票（SMP-2400 紫色系） */
    --smp-bg: #f8f8f8;
    --smp-right-bg: #70326e;
    --smp-purple: #70326e;
    --smp-stripe: rgba(80, 34, 78, 0.7);

    position: relative;
    width: 100%;
    min-height: var(--smp-hero-h);
    max-height: 530px;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    background: var(--smp-right-bg);
}

/* 支援 CSS tan() 的瀏覽器：斜切量跟高度、角度連動 */
@supports (width: calc(tan(18deg) * 1px)) {
    .smpBanner-section.smpBanner-section--slant {
        --smp-img-slant-offset: calc(tan(var(--smp-stripe-skew-deg)) * var(--smp-hero-h));
    }
}

/* 全寬 50 / 50 底色 */
.smpBanner-section--slant::before,
.smpBanner-section--slant::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 0;
}

.smpBanner-section--slant::before {
    left: 0;
    width: 100%;
    background: var(--smp-bg);
}

.smpBanner-section--slant::after {

    right: 0;
    width: calc(100% - var(--smp-full-bg-left));
    background: var(--smp-right-bg);
}

/* 內容容器：跟 .productName span 用同一套「95% + max-width 1200px」公式，
   讓 logo/文字左緣在任何視窗寬度下都對齊子選單文字，且不會貼齊螢幕邊緣
   （viewport < 1200px 時自動出現左右各 2.5vw 的 padding，等比縮放不是固定 px） */
.smpBanner-section--slant .smpBanner-inner {
    position: relative;
    z-index: 1;
    max-width: var(--smp-hero-max);
    width: 95%;
    /* 用 height（不只 min-height）明確定義 grid row 高度：
       grid 隱式 row 預設用 auto 依內容撐高，文案較長的語系（如西班牙文）
       會把 row 撐超過 --smp-hero-h，導致圖片與斜色條的斜切角度基準不一致
       而在邊緣露出接縫。固定 height 讓兩者永遠用同一個高度計算 */
    height: var(--smp-hero-h);
    min-height: var(--smp-hero-h);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, var(--smp-inner-left)) minmax(0, 1fr);
    grid-template-rows: var(--smp-hero-h);
    align-items: stretch;
    box-sizing: border-box;
}

/* 內容區右欄底色：填滿斜色條右側空隙（用 left 定位取代 width，
   跟著 --smp-inner-left 的連續公式自動對齊，不用另外同步一份寬度變數） */
.smpBanner-section--slant .smpBanner-inner::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--smp-inner-left);
    right: 0;
    background: var(--smp-right-bg);
    z-index: 0;
    pointer-events: none;
}

/* 右欄：圖片 */
.smpBanner-section--slant .smpBanner-media {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    min-height: 100%;
    /* 向左延伸：圖片墊到白色斜切區後方，中間不會露出紫底 */
    margin-left: calc(-1 * var(--smp-media-extend-left));
    width: calc(100% + var(--smp-media-extend-left) + var(--smp-media-extend-right));
    overflow: visible;
}

.smpBanner-section--slant .smpBanner-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: var(--smp-hero-h);
    object-fit: cover;
    object-position: var(--smp-image-position-x) var(--smp-image-position-y);
    /* 右緣斜切：上緣滿版、下緣內縮（與左側白區斜切同方向） */
    clip-path: polygon(0 0,
            100% 0,
            calc(100% - var(--smp-img-slant-offset)) 100%,
            0 100%);
}

/* 圖右緣斜色塊 */
.smpBanner-section--slant .smpBanner-stripe {
    position: absolute;
    top: -5%;
    bottom: -5%;
    z-index: 2;
    pointer-events: none;
}

.smpBanner-section--slant .smpBanner-stripe--primary {
    /* 右緣錨定在圖片右緣，加寬時往畫面內（左）延伸。
       寬度多加 6px 緩衝，蓋過 clip-path 斜切與 skewX 斜切因不同運算方式
       在邊緣留下的次像素白色接縫 */
    right: -8px;
    width: calc(var(--smp-stripe-primary-width) + 6px);
    background: var(--smp-stripe);
    transform: skewX(calc(-1 * var(--smp-stripe-skew-deg)));
    transform-origin: top right;
}

.smpBanner-section--slant .smpBanner-stripe--secondary {
    display: none;
}

/* 左欄：文案（斜切疊在右欄上） */
.smpBanner-section--slant .smpBanner-copy {
    grid-column: 1 / 2;
    grid-row: 1;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    /* 文案較長的語系（如西班牙文）預設不能壓縮到低於內容高度，
       會把整個 grid row 撐高過 --smp-hero-h，導致圖片與斜色條的斜切
       角度基準不一致而在邊緣露出接縫。強制允許壓縮回固定高度 */
    min-height: 0;
    overflow: hidden;
    /* 不留左 padding：文字/logo 起始點對齊 .productName（1200px 容器左緣） */
    padding-left: 0;
    margin-right: var(--smp-copy-overlap);
    margin-left: 0;
    background: var(--smp-bg);
    /* 上緣滿版、下緣內縮：白色區上寬下窄 */
    clip-path: polygon(0 0, 100% 0, var(--smp-slant-end) 100%, 0 100%);
}

.smpBanner-section--slant .smpBanner-copy__inner {
    width: 100%;
    /* 直接吃滿文案欄（--smp-inner-left）的寬度，480px 只是桌面上限，
       不需要另一條 vw 公式，避免跟欄寬公式對不齊 */
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 14% 20px 0;
    box-sizing: border-box;
    /* 同 .smpBanner-copy：flex 子項預設 min-height:auto 會被內容（較長語系文案）
       撐高，連帶把整個 grid row 撐過 --smp-hero-h，造成圖片與斜色條接縫 */
    min-height: 0;
}

.smpBanner-section--slant .smpBanner-copy__inner .logo.smp {
    width: 90px;
    height: auto;
    border-radius: 20px;
    border: 2px solid #dec4de;
}

.smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
    margin: 0;
    color: #595959;
    /* 對齊 .productHeader .contents h1，覆蓋 .f35 預設字級 */
    font-size: 2em;
    line-height: 1.35;
    font-weight: normal;
}

.smpBanner-title__model {
    display: block;
    font-family: 'good-times', 'Poppins', sans-serif;
    font-weight: bold;
    /* f53 視覺比例：3.313em ÷ h1 2em ≈ 1.65 */
    font-size: 1.65em;
    line-height: 1.2;
    color: #595959;
}

.smpBanner-title__line {
    display: block;
}

.smpBanner-section--slant .header_link_wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    column-gap: 14px;
    row-gap: 6px;
}

/* 對齊 smp-8100：灰色連結（覆蓋 product_new.css 的 a { color: #007ed4 }） */
.smpBanner-section--slant .header_link_wrap .product_link,
.smpBanner-section--slant .header_link_wrap .header_link_btn {
    color: #595959;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
    text-align: left;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.smpBanner-section--slant .header_link_wrap .product_link:hover {
    text-decoration: underline;
}

/* ========== RWD ==========
   斷點結構比照 smp-8100（product_new.css）：
   - 基準（桌面/1920）：hero 530px
   - ≤1366px（涵蓋 1200 / 850 檢查點）：hero 380px（同 8100 的 .productHeader .contents 380px）
   - ≤600px：改上下堆疊，紫底置中版型（同 8100 手機版） */

/* ≤1680px：h1 字級（同 .productHeader .contents h1） */
@media screen and (max-width: 1680px) {
    .smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
        font-size: 1.8em;
    }
}

/* ≤1366px：整區縮小為 380px（同 smp-8100） */
@media screen and (max-width: 1366px) {
    .smpBanner-section.smpBanner-section--slant {
        --smp-hero-h: 380px;
        max-height: 380px;
        /* 舊瀏覽器 fallback：tan(16deg) ≈ 0.2867 × 380px ≈ 109px */
        --smp-img-slant-offset: 109px;
    }

    @supports (width: calc(tan(18deg) * 1px)) {
        .smpBanner-section.smpBanner-section--slant {
            --smp-img-slant-offset: calc(tan(var(--smp-stripe-skew-deg)) * var(--smp-hero-h));
        }
    }

    /* 內容跟著縮：logo、間距、內距（8100 同層級縮 logo 至 85px，
       我們的文案multi-行較多，縮小一點以塞進 380px） */
    .smpBanner-section--slant .smpBanner-copy__inner {
        gap: 8px;
        padding: 12px 14% 12px 0;
    }

    .smpBanner-section--slant .header_link_wrap {
        column-gap: 10px;
        row-gap: 4px;
    }

    .smpBanner-section--slant .header_link_wrap .product_link,
    .smpBanner-section--slant .header_link_wrap .header_link_btn {
        font-size: 0.92em;
    }

    .smpBanner-section--slant .smpBanner-copy__inner .logo.smp {
        width: 64px;
        border-radius: 14px;
    }

    .smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
        font-size: 1.5em;
    }
}

/* ≤1152px / ≤768px：h1 字級（同 smp-8100 平板區間） */
@media screen and (max-width: 1152px) {
    .smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
        font-size: 1.2em;
    }
}

@media screen and (max-width: 768px) {
    .smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
        font-size: 1.2em;
    }
}

/* 600px 以下：上下堆疊，比照 smp-8100 手機版
   （紫底、置中白字、logo/標題 → 圖片 → 白字連結列 → tags）。
   用 display:contents 把文案欄打散成 flex 項目，才能讓圖片插在標題與連結之間 */
@media screen and (max-width: 600px) {
    .smpBanner-section.smpBanner-section--slant {
        min-height: auto;
        max-height: none;
        background: var(--smp-purple);
    }

    .smpBanner-section--slant::before,
    .smpBanner-section--slant::after,
    .smpBanner-section--slant .smpBanner-inner::after,
    .smpBanner-section--slant .smpBanner-stripe {
        display: none;
    }

    .smpBanner-section--slant .smpBanner-inner {
        display: flex;
        flex-direction: column;
        min-height: auto;
        width: 100%;
        max-width: 100%;
    }

    /* 打散包層：copy 的子元素直接成為 inner 的 flex 項目，才可用 order 重排 */
    .smpBanner-section--slant .smpBanner-copy,
    .smpBanner-section--slant .smpBanner-copy__inner {
        display: contents;
    }

    /* 1. logo */
    .smpBanner-section--slant .smpBanner-copy__inner .logo.smp {
        order: 1;
        align-self: center;
        width: 72px;
        border-radius: 16px;
        margin-top: 24px;
    }

    /* 2. 標題（白字置中，字級同 smp-8100 手機版 2em） */
    .smpBanner-section--slant .smpBanner-copy__inner h1.smpBanner-title {
        order: 2;
        color: #fff;
        text-align: center;
        margin: 8px 16px 20px;
        font-size: 2em;
    }

    .smpBanner-section--slant .smpBanner-title__model {
        color: inherit;
    }

    /* 3. 圖片（滿版，插在標題與連結之間，同 8100 的 mobile_bg 位置） */
    .smpBanner-section--slant .smpBanner-media {
        order: 4;
        grid-column: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 0;
        width: 100%;
        margin-right: 0;
        min-height: auto;
    }

    .smpBanner-section--slant .smpBanner-media img {
        display: block;
        width: 100%;
        height: auto;
        min-height: clamp(180px, 48vw, 260px);
        margin: 0 auto;
        clip-path: none;
        object-fit: cover;
        object-position: center;
    }

    /* 5. 連結列：白字、單欄滿版、分隔線（同 8100 手機版） */
    .smpBanner-section--slant .header_link_wrap {
        order: 5;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        column-gap: 0;
    }

    .smpBanner-section--slant .header_link_wrap .product_link {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        color: #fff;
        padding: 14px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    /* 6. tags 置中收尾 */
    .smpBanner-section--slant .tags {
        order: 6;
        justify-content: center;
        margin: 20px 0 24px;
    }
}