﻿/* 詳情頁彈跳廣告＋右側活動頁籤；頁籤尺寸比照 compare.css 的 .compare-rail，紅底白字＋禮物圖示 */

/* ---------- 彈窗 ---------- */
.popup-banner {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.popup-banner.is-open {
    display: flex;
}

.popup-banner-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.popup-banner.is-show .popup-banner-mask {
    opacity: 1;
}

.popup-banner-dialog {
    position: relative;
    width: min(30rem, 88vw);
    opacity: 0;
    transform: scale(.92);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
}

.popup-banner.is-show .popup-banner-dialog {
    opacity: 1;
    transform: none;
}

.popup-banner-link {
    display: block;
}

.popup-banner-img {
    display: block;
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: .75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

.popup-banner-close {
    position: absolute;
    top: .625rem;
    right: .625rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.popup-banner-close svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: var(--color-black, #0f0f0f);
    stroke-width: 2.4;
    stroke-linecap: round;
}

.popup-banner-close:hover svg {
    stroke: var(--color-red, #eb0a1e);
}

/* ---------- 右側頁籤（疊在「車輛比較」上方） ---------- */
.popup-rail {
    position: fixed;
    right: 0;
    top: calc(50% - 4.25rem);
    transform: translateY(-50%);
    z-index: 60;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .125rem;
    width: 3.5rem;
    height: 3.5rem;
    padding: .25rem;
    background: var(--color-red, #eb0a1e);
    color: var(--color-white, #fff);
    border: 0;
    border-radius: .5rem 0 0 .5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    cursor: pointer;
}

.popup-rail.is-show {
    display: flex;
    animation: popup-rail-in .35s ease;
}

.popup-rail:hover {
    filter: brightness(.88);
}

.popup-rail-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

/* 後台可設 1～6 字，每行最多 3 字、最多兩行，維持正方形 */
.popup-rail-text {
    max-width: 3em;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    word-break: break-all;
}

@keyframes popup-rail-in {
    from { transform: translate(100%, -50%); }
    to { transform: translateY(-50%); }
}

@keyframes popup-rail-in-mobile {
    from { transform: translateX(100%); }
    to { transform: none; }
}

@media (max-width: 767px) {
    .popup-rail {
        top: auto;
        bottom: 10rem;
        width: 3.25rem;
        height: 3.25rem;
        transform: none;
    }

    .popup-rail.is-show {
        animation-name: popup-rail-in-mobile;
    }

    .popup-rail-text {
        font-size: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .popup-banner-mask,
    .popup-banner-dialog {
        transition: none;
    }

    .popup-rail.is-show {
        animation: none;
    }
}
