/**
 * J Banner Tool Public Styles
 */

/* Elementor Widget 容器 - 使用固定高度 */
.elementor-widget-j-banner > .elementor-widget-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Banner 容器基本樣式 - 填滿 widget container */
.jbt-banner {
    position: relative !important;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 移除 auto 模式,統一使用 16:9
.jbt-banner[data-aspect-ratio=""] {
    aspect-ratio: auto;
    min-height: 200px;
}
*/

/* 全寬度 Banner */
.jbt-banner-fullwidth {
    width: 100% !important;
    margin: 0;
}

.jbt-banner-fullwidth .jbt-banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.jbt-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jbt-banner-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .jbt-banner.jbt-mobile-hidden {
        display: none;
    }
}

@media (max-width: 480px) {
    .jbt-banner {
        width: 100% !important;
    }
}

/* 載入動畫 */
.jbt-banner.jbt-loading {
    background: #f5f5f5;
    min-height: 200px;
}

.jbt-banner.jbt-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: jbt-rotate 0.8s linear infinite;
}

@keyframes jbt-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 懸停效果 */
.jbt-banner-link:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Banner 輪播容器 */
.jbt-banner-slider {
    position: relative;
    overflow: hidden;
}

/* 新版輪播容器（完全 Elementor 化版本） */
.jbt-banner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Banner 項目基礎樣式 */
.jbt-banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 0;
    overflow: hidden;
}

/* 當前顯示的項目 */
.jbt-banner-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Banner 項目圖片 */
.jbt-banner-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jbt-banner-item a {
    display: block;
    text-decoration: none;
}

/* 確保輪播容器有足夠的空間顯示箭頭 */
.jbt-banner-slider .jbt-banner-slider-wrapper {
    position: relative;
}

.jbt-banner-slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.jbt-banner-slide {
    flex: 0 0 100%;
    width: 100%;
}

/* 點點導航 */
.jbt-slider-dots,
.jbt-banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.jbt-slider-dot,
.jbt-banner-dots button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
    padding: 0;
}

.jbt-slider-dot:hover,
.jbt-banner-dots button:hover {
    background: rgba(255, 255, 255, 0.8);
}

.jbt-slider-dot.active,
.jbt-banner-dots button.active {
    background: #fff;
    transform: scale(1.2);
}

/* 箭頭導航 */
.jbt-slider-arrow,
.jbt-banner-prev,
.jbt-banner-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    z-index: 100 !important;
    opacity: 0.8;
    user-select: none;
}

.jbt-slider-arrow:hover,
.jbt-banner-prev:hover,
.jbt-banner-next:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateY(-50%) scale(1.1) !important;
}

.jbt-slider-arrow.jbt-prev,
.jbt-banner-prev {
    left: 15px !important;
    right: auto !important;
}

.jbt-slider-arrow.jbt-next,
.jbt-banner-next {
    right: 15px !important;
    left: auto !important;
}

/* 響應式設計 - 調整小螢幕上的箭頭大小 */
@media (max-width: 768px) {
    .jbt-slider-arrow,
    .jbt-banner-prev,
    .jbt-banner-next {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .jbt-slider-arrow.jbt-prev,
    .jbt-banner-prev {
        left: 10px !important;
    }

    .jbt-slider-arrow.jbt-next,
    .jbt-banner-next {
        right: 10px !important;
    }

    .jbt-slider-dots,
    .jbt-banner-dots {
        bottom: 10px;
    }

    .jbt-slider-dot,
    .jbt-banner-dots button {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .jbt-slider-arrow,
    .jbt-banner-prev,
    .jbt-banner-next {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* 關閉按鈕（用於可關閉的 Banner） */
.jbt-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.3s;
}

.jbt-banner-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 倒數計時器 */
.jbt-banner-timer {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* 全螢幕 Banner */
.jbt-banner-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
}

.jbt-banner-fullscreen .jbt-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

/* 固定位置 Banner */
.jbt-banner-fixed {
    position: fixed;
    z-index: 999;
}

.jbt-banner-fixed.top {
    top: 0;
    left: 0;
    right: 0;
}

.jbt-banner-fixed.bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

/* 浮動 Banner */
.jbt-banner-floating {
    position: fixed;
    z-index: 999;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.jbt-banner-floating.bottom-right {
    bottom: 20px;
    right: 20px;
}

.jbt-banner-floating.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* 自訂動畫 */
@keyframes jbt-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.jbt-banner.jbt-pulse {
    animation: jbt-pulse 2s ease-in-out infinite;
}