/* ==========================================================================
   MOBILE SLIDER - Biến lưới thành slide vuốt ngang trên mobile (scroll-snap)
   Dùng: thêm class "sc-mslider" vào khối cha (row / grid).
   Biến thể: "sc-mslider--sm" hiển thị ~2 thẻ / màn hình (thẻ nhỏ như danh mục).
   ========================================================================== */

.sc-mslider-dots { display: none; }

@media (max-width: 849px) {
    .sc-mslider {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Tràn ra mép màn hình để lộ thẻ kế tiếp */
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding: 6px 15px 18px !important;
        max-width: none !important;
    }
    .sc-mslider::-webkit-scrollbar { display: none; }

    .sc-mslider > * {
        flex: 0 0 80% !important;
        max-width: 80% !important;
        width: auto !important;
        min-width: 0;
        padding: 0 !important;
        margin: 0 !important;
        scroll-snap-align: start;
    }
    .sc-mslider.sc-mslider--sm > * {
        flex-basis: 44% !important;
        max-width: 44% !important;
    }

    /* Thẻ nằm ngoài khung nhìn ngang sẽ không kích hoạt hiệu ứng → luôn hiển thị */
    .sc-mslider [data-animate],
    .sc-mslider > [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    .sc-mslider .col-inner,
    .sc-mslider .smartcom-scard-wrap,
    .sc-mslider .sangoys-article-card-wrap { height: 100%; }

    /* Chấm chỉ vị trí */
    .sc-mslider-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        margin: 2px 0 8px;
    }
    .sc-mslider-dots button {
        width: 8px;
        height: 8px;
        min-height: 0;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 999px;
        background: rgba(11, 94, 215, 0.2);
        cursor: pointer;
        transition: width 0.3s ease, background 0.3s ease;
    }
    .sc-mslider-dots button.is-active {
        width: 22px;
        background: var(--smartcom-primary, #0b5ed7);
    }
}
