/**
 * 手機版年輕族群 UX 優化
 */

/* ===== 手機版搜尋列 ===== */
.mobile-search-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-search-bar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 900;
        background: #fff;
        padding: 8px 12px 10px;
        border-bottom: 1px solid #eee;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .mobile-search-form {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .mobile-search-input-wrap {
        flex: 1;
        display: flex;
        align-items: center;
        background: #f5f5f5;
        border-radius: 24px;
        padding: 0 14px;
        min-height: 42px;
    }

    .mobile-search-input-wrap i {
        color: #999;
        font-size: 1rem;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .mobile-search-input-wrap input,
    .mobile-search-input-wrap select {
        flex: 1;
        border: none;
        background: transparent;
        font-size: 15px;
        outline: none;
        min-width: 0;
        padding: 8px 0;
        color: #313131;
    }

    .mobile-search-submit {
        flex-shrink: 0;
        background: var(--ci1, #ffca3a);
        border: none;
        border-radius: 20px;
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 600;
        color: #313131;
        cursor: pointer;
    }

    .mobile-search-tags {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-top: 8px;
        padding-bottom: 2px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-search-tags::-webkit-scrollbar {
        display: none;
    }

    .mobile-search-tag {
        flex-shrink: 0;
        padding: 5px 12px;
        border-radius: 16px;
        background: #fff3cd;
        color: #856404;
        font-size: 13px;
        text-decoration: none;
        white-space: nowrap;
        border: 1px solid #ffe69c;
    }

    /* 手機版隱藏頂部 logo */
    header #logo {
        display: none !important;
    }

    /* 隱藏輪播小箭頭，改用手勢滑動 */
    .swiper-prev.arrow,
    .swiper-next.arrow,
    .banner_prev,
    .banner_next {
        display: none !important;
    }

    /* 主內容底部留白給 Tab 列 */
    body.has-mobile-tab main {
        padding-bottom: 80px;
    }

    body.has-mobile-tab .site-footer {
        padding-bottom: 68px;
    }

    /* 舊浮動按鈕改位置，避免與 Tab 重疊 */
    body.has-mobile-tab .top_menu {
        bottom: 76px !important;
    }

    body.has-mobile-tab #footer_float {
        display: none !important;
    }
}

/* ===== 底部 Tab 導覽 ===== */
.mobile-bottom-tab {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-tab {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background:
            radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 34%),
            linear-gradient(120deg, #e8fbff 0%, #dff7ef 44%, #edf0ff 100%);
        border-top: 1px solid rgba(45, 169, 190, 0.28);
        box-shadow: 0 -10px 26px rgba(16, 88, 122, 0.2);
        padding: 9px 8px calc(9px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: stretch;
        gap: 7px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-bottom-tab a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0;
        text-decoration: none;
        color: #ffffff;
        font-size: 11px;
        font-weight: 700;
        gap: 5px;
        -webkit-tap-highlight-color: transparent;
        height: 66px;
        min-height: 66px;
        max-height: 66px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow: 0 8px 18px rgba(22, 94, 124, 0.16);
        position: relative;
        overflow: hidden;
        transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
        box-sizing: border-box;
    }

    .mobile-bottom-tab a::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.04));
        opacity: 0.82;
        pointer-events: none;
    }

    .mobile-bottom-tab a:nth-child(1) {
        background: linear-gradient(145deg, #20c7b5 0%, #53d8ff 100%);
    }

    .mobile-bottom-tab a:nth-child(2) {
        background: linear-gradient(145deg, #35a7ff 0%, #2563eb 100%);
    }

    .mobile-bottom-tab a:nth-child(3) {
        background: linear-gradient(145deg, #10bfae 0%, #7c5cff 100%);
        box-shadow: 0 10px 24px rgba(76, 118, 224, 0.26);
    }

    .mobile-bottom-tab a:nth-child(4) {
        background: linear-gradient(145deg, #7c5cff 0%, #3d7cff 100%);
    }

    .mobile-bottom-tab a:nth-child(5) {
        background: linear-gradient(145deg, #f5c542 0%, #30c77b 100%);
    }

    .mobile-bottom-tab a .tab-label,
    .mobile-bottom-tab a.tab-ai .tab-label {
        line-height: 1.1;
        position: relative;
        z-index: 1;
        text-shadow: 0 1px 3px rgba(0, 42, 68, 0.25);
        color: #ffffff;
        font-weight: 700;
    }

    /* 圖示圓圈：五顆按鈕完全統一 */
    .mobile-bottom-tab a .tab-icon-circle {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.92);
        border: 1.5px solid rgba(255, 255, 255, 0.85);
        box-shadow: 0 4px 12px rgba(0, 64, 96, 0.18);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        box-sizing: border-box;
    }

    /* Bootstrap Icon 字型圖示（父 flex 圓圈自動居中）*/
    .mobile-bottom-tab a .tab-bi-icon {
        font-size: 17px;
        line-height: 1;
        display: block;
        color: #2563eb;
        pointer-events: none;
    }

    /* 所有圖示統一尺寸與填滿方式 */
    .mobile-bottom-tab a .tab-icon {
        display: block;
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        max-width: 24px;
        max-height: 24px;
        object-fit: contain;
        object-position: center;
        pointer-events: none;
        padding: 0;
        margin: 0;
        border: none;
        background: none;
        border-radius: 0;
        box-shadow: none;
        flex-shrink: 0;
    }

    .mobile-bottom-tab a.active {
        color: #ffffff;
        transform: none;
        box-shadow: 0 13px 28px rgba(20, 88, 128, 0.3);
        filter: saturate(1.12);
    }

    .mobile-bottom-tab a.active .tab-icon-circle {
        transform: none;
        background: #ffffff;
        border-color: #ffffff;
        box-shadow: 0 7px 16px rgba(0, 72, 112, 0.24);
    }

    .mobile-bottom-tab a:active .tab-icon-circle {
        transform: scale(0.94);
    }

    .mobile-bottom-tab a:nth-child(1).active .tab-icon-circle { box-shadow: 0 7px 16px rgba(32, 199, 181, 0.46); }
    .mobile-bottom-tab a:nth-child(2).active .tab-icon-circle { box-shadow: 0 7px 16px rgba(53, 167, 255, 0.46); }
    .mobile-bottom-tab a:nth-child(3).active .tab-icon-circle { box-shadow: 0 10px 22px rgba(124, 92, 255, 0.48); }
    .mobile-bottom-tab a:nth-child(4).active .tab-icon-circle { box-shadow: 0 7px 16px rgba(90, 124, 255, 0.46); }
    .mobile-bottom-tab a:nth-child(5).active .tab-icon-circle { box-shadow: 0 7px 16px rgba(48, 199, 123, 0.42); }

    .mobile-bottom-tab a:not(.active):active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ===== 首頁手機版區塊排序 ===== */
@media (max-width: 768px) {
    body#index main {
        display: flex;
        flex-direction: column;
    }

    body#index .m-order-banner { order: 1; }
    body#index .m-order-video { order: 2; }
    body#index .m-order-featured { order: 3; }
    body#index .m-order-movies { order: 4; }
    body#index .m-order-accommodation { order: 5; }
    body#index .mobile-hide-duplicate { display: none !important; }

    body#index .area_title {
        font-size: 1.35rem;
        padding-left: 12px;
    }

    body#index .banner_box {
        margin-bottom: 0;
    }

    /* 卡片顯示關注數提示 */
    body#index .swiper-slide .info .title::after {
        content: none;
    }

    body#index .swiper-slide .card-social-hint {
        font-size: 12px;
        color: #ff4757;
        margin-top: 4px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    body#index .swiper-slide .card-social-hint i {
        font-size: 12px;
    }
}

/* ===== dest 頁手機版 ===== */
@media (max-width: 768px) {
    /* 直式 4:5 圖片比例 */
    body#dest .swiper1 .swiper-slide .img {
        padding-bottom: 125% !important;
    }

    /* 分享按鈕加大 */
    body#dest .bar.mt-1 .shares img {
        height: 32px !important;
        margin: 0 4px !important;
    }

    /* 固定底部動作列 */
    body#dest .dest-mobile-sticky-bar {
        position: fixed;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        z-index: 950;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid #eee;
        padding: 8px 12px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: 4px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    }

    body#dest .dest-mobile-sticky-bar .sticky-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        background: none;
        border: none;
        color: #555;
        font-size: 11px;
        text-decoration: none;
        padding: 4px 8px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body#dest .dest-mobile-sticky-bar .sticky-action i {
        font-size: 22px;
        line-height: 1;
    }

    body#dest .dest-mobile-sticky-bar .sticky-action.active,
    body#dest .dest-mobile-sticky-bar .sticky-action.active i {
        color: #dc3545;
    }

    body#dest .dest-mobile-sticky-bar .sticky-action.share-btn i {
        color: #0d6efd;
    }

    body#dest main {
        padding-bottom: 120px;
    }

    /* 隱藏原本分散的動作按鈕區（已由底部列取代） */
    body#dest .dest-action-row .favorite-btn-compact,
    body#dest .dest-action-row .comment-btn-compact {
        display: none !important;
    }
}
