/* ============================================================
   📱 Mobile Horizontal Reading Mode — 通用滑動佈局
   原本只針對 #equip-tab-layout，現在擴展到所有 .visual-layout-pure-grid
   ============================================================ */

@media (max-width: 1024px) {

    /* 通用水平滾動容器 */
    body.mobile-hswipe .visual-layout-pure-grid,
    body.mobile-hswipe .mobile-hswipe-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        padding: 0 !important;
        scroll-behavior: smooth;
        /* 隱藏捲軸 */
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100% !important;
    }

    body.mobile-hswipe .visual-layout-pure-grid::-webkit-scrollbar {
        display: none;
    }

    /* 每個直屬子元素作為一頁。
       在較寬的手機/平板 (900px - 1280px) 顯示兩欄以優化空間利用 */
    body.mobile-hswipe .visual-layout-pure-grid>div,
    body.mobile-hswipe .mobile-hswipe-grid>div {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        scroll-snap-align: start;
        box-sizing: border-box !important;
        padding: 8px !important;
    }

    @media (min-width: 750px) {

        body.mobile-hswipe .visual-layout-pure-grid>div,
        body.mobile-hswipe .mobile-hswipe-grid>div {
            flex: 0 0 50% !important;
            width: 50% !important;
            min-width: 50% !important;
            max-width: 50% !important;
        }
    }

    /* 頁面指示器 */
    .layout-page-indicator {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 10px 0 6px 0;
    }

    .layout-page-indicator .lpi-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .layout-page-indicator .lpi-dot.active {
        width: 24px;
        border-radius: 10px;
        background: linear-gradient(90deg, var(--gold), #ffb347);
        box-shadow: 0 0 8px rgba(255, 217, 61, 0.4);
    }

    .layout-page-indicator .lpi-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        margin-left: 6px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    /* 左右箭頭提示 */
    .layout-page-indicator .lpi-arrow {
        font-size: 14px;
        color: rgba(255, 217, 61, 0.5);
        user-select: none;
        cursor: pointer;
        padding: 0 4px;
        transition: color 0.2s;
    }

    .layout-page-indicator .lpi-arrow:hover {
        color: var(--gold);
    }

    .layout-page-indicator .lpi-arrow.disabled {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    /* 修正某些 grid-box-container 在滑動模式下的內距 */
    body.mobile-hswipe .grid-box-container {
        padding: 0 !important;
    }
}

/* 桌面版不顯示手機指示器，且確保某些容器恢復 block 佈局 */
@media (min-width: 1025px) {
    .layout-page-indicator {
        display: none !important;
    }

    .mobile-hswipe-grid {
        display: block !important;
    }
}