/* ads-carousel.css — 廣告輪播（zh/components/promotion/ads-carousel）
   全部規則都用 .ads-carousel 前綴，唔再全域改 .carousel / .carousel-control
   尺寸沿用線上實測：容器 1140 寬（bootstrap container 內）、圖等比、指示點 10px+1px 白邊（=12px）、箭頭區 15% 寬 */

.ads-carousel {
    position: relative;
    width: 100%;
    max-width: var(--ads-w, 100%);
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;   /* 對齊舊版 AdsCarousel 的 inline style="margin-top: 10px" */
}

.ads-carousel__viewport {
    position: relative;
    overflow: hidden;
}

.ads-carousel__track {
    display: flex;
    flex-wrap: nowrap;
    transition: transform .45s ease;
    will-change: transform;
}

.ads-carousel__item {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    display: block;
}

.ads-carousel__link {
    display: block;
    line-height: 0;
}

.ads-carousel__img {
    display: block;
    width: 100%;
    height: auto;
    min-height: var(--ads-h, 0);
    aspect-ratio: var(--ads-ratio, auto);
    object-fit: var(--ads-fit, fill);
    border: 0;
}

/* ---------- 箭頭（舊版＝bootstrap 15% 寬的透明覆蓋層＋白色 chevron）---------- */
.ads-carousel__arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    padding: 0;
    border: 0;
    background: transparent;
    background-image: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    opacity: .7;
    cursor: pointer;
    transition: opacity .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ads-carousel__arrow:hover,
.ads-carousel__arrow:focus {
    opacity: 1;
    outline: none;
}

.ads-carousel__arrow i {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

.ads-carousel__arrow--prev {
    left: 0;
}

.ads-carousel__arrow--next {
    right: 0;
}

/* ---------- 指示點（照 bootstrap 3：10px + 1px 白邊，實測 12×12；白底＝當前）---------- */
.ads-carousel__dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 2;
}

.ads-carousel__dots li {
    float: left;
    margin: 1px;
    line-height: 0;
}

.ads-carousel__dot {
    display: block;
    box-sizing: content-box;   /* 對齊舊版量測：10px + 1px 白邊 = 12×12 */
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 10px;
    background-color: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.ads-carousel__dot.is-active {
    background-color: #fff;
}

/* ---------- 標題／副標（只在 showCaption = true 時出現）---------- */
.ads-carousel__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 20px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
    color: #fff;
    line-height: 1.35;
    pointer-events: none;
}

.ads-carousel__heading {
    font-size: 13px;
    opacity: .9;
}

.ads-carousel__title {
    font-size: 18px;
    font-weight: 600;
}

.ads-carousel--empty {
    padding: 24px;
    text-align: center;
    color: #757575;
    background: #f5f5f5;
    border-radius: 12px;
}

@media (max-width: 767px) {
    .ads-carousel__arrow {
        font-size: 24px;
    }

    /* 手機：banner 只有 ~63px 高，caption 改成左上角小膠囊（避開底部指示點） */
    .ads-carousel__caption {
        left: 10px;
        right: auto;
        top: 10px;
        bottom: auto;
        max-width: 70%;
        padding: 5px 10px;
        border-radius: 4px;
        background: rgba(0, 0, 0, .55);
        background-image: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ads-carousel__heading {
        display: inline;
        font-size: 11px;
        margin-right: 6px;
    }

    .ads-carousel__title {
        display: inline;
        font-size: 12px;
    }
}

/* 尊重系統「減少動態」設定 */
@media (prefers-reduced-motion: reduce) {
    .ads-carousel__track {
        transition: none;
    }
}
