/* DAYOFF 多媒體輪播器 v3.5.0（兩站統一版）
   合併自：DAYOFF v3.4.0（全螢幕 modal + blog 隱藏）
          + OFFBEAT v3.2.0（iframe 定位 + 手機 !important + 箭咀置中）
*/

.dayoff-slider-wrapper-outer {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dayoff-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #000;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

.dayoff-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.dayoff-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dayoff-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.dayoff-slide img,
.dayoff-slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #000;
}

.dayoff-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

/* YouTube iframe 必須絕對定位填滿，否則會用瀏覽器預設 300x150 */
.dayoff-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.dayoff-slider-prev,
.dayoff-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dayoff-slider-prev { left: 20px; }
.dayoff-slider-next { right: 20px; }

.dayoff-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dayoff-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.dayoff-dot.active {
    background: rgba(255,255,255,1);
}

@media screen and (max-width: 768px) {
    .dayoff-slider-container { height: 250px !important; }
    .dayoff-slide {
        width: 100% !important;
        height: 100% !important;
    }
    .dayoff-slide img,
    .dayoff-slide video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    .dayoff-slider-prev, .dayoff-slider-next { width: 40px; height: 40px; font-size: 16px; }
    .dayoff-slider-prev { left: 10px; }
    .dayoff-slider-next { right: 10px; }
}

@media screen and (max-width: 480px) {
    .dayoff-slider-container { height: 200px !important; }
    .dayoff-slider-prev, .dayoff-slider-next { width: 35px; height: 35px; font-size: 14px; }
    .dayoff-dot { width: 10px; height: 10px; }
}

/* 全螢幕模態框 */
.dayoff-fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.dayoff-fullscreen-modal.active {
    display: flex;
}

.dayoff-fullscreen-modal video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dayoff-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
}

/* Hide slider on blog / article pages */
.post-type-archive-post .dayoff-slider-wrapper-outer,
.archive-post .dayoff-slider-wrapper-outer,
.blog .dayoff-slider-wrapper-outer,
body.page-id-633 .dayoff-slider-wrapper-outer,
body.page-slug-blog .dayoff-slider-wrapper-outer {
    display: none !important;
}

/* ── v3.7.1 banner 下方間隙 ── dayoff-slider-gap ──────────────
   根因：auto_insert_other_slider() 掛 woocommerce_before_shop_loop:5，
   輸出 slider 之後直接接 <ul class="products">，wrapper 只有 margin:0 auto
   → banner 黐住產品圖，零間距（實證 2026-10-07）。
   統一俾所有 slider 加下方間隙：首頁 shortcode / archive hook / wp_footer 都適用。 */
.dayoff-slider-wrapper-outer {
    margin-bottom: 40px;
}

@media screen and (max-width: 767px) {
    .dayoff-slider-wrapper-outer {
        margin-bottom: 24px;
    }
}
