/* --- MOBILE CSS cho .sanpham-gallery --- */
@media (max-width: 768px) {
    
    /* 1. Layout chung của Section */
    .sanpham-gallery {
        /* Giữ lề mặc định cho toàn section (text sẽ ăn theo lề này) */
        padding: 40px 20px; 
        overflow: hidden; /* Đảm bảo không bị vỡ khung khi dùng margin âm */
    }

    /* 2. Header (Tiêu đề) */
    .luot-header {
        margin-bottom: 25px;
        text-align: left; /* Canh trái cho giống phong cách tạp chí */
    }

    .luot-header .sub-title {
        display: block;
        font-size: 11px;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #2b2929;
    }

    .luot-header .main-title {
        font-size: 28px; 
        font-weight: 400; 
        color: #000;
        margin: 0;
        margin-bottom: -5px !important;
        line-height: 1.2;
        font-family: 'Be Vietnam pro', sans-serif;
    }

    /* 3. Slider Container & Track (Cốt lõi của việc vuốt) */
    .luot-viewport {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        
        
        /* 2. Giảm tốc độ trượt tự do (friction) */
        /* Thuộc tính này cực kỳ hiệu quả để làm slide "đầm" hơn */
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;

       
        margin-left: -20px; 
        margin-right: -20px;
        
        /* Bù lại khoảng trống bằng padding để card đầu tiên vẫn đúng vị trí ban đầu */
        padding-left: 20px; 
        padding-right: 20px;

        /* Điểm dừng (snap) phải khớp với lề 20px để card ăn vào đúng vị trí */
        scroll-padding-left: 20px;
    }


    .luot-viewport::-webkit-scrollbar {
        display: none; /* Ẩn thanh cuộn mặc định (Chrome/Safari) */
    }

    .luot-track {
        display: flex;
        gap: 9px; /* Khoảng cách giữa các card */
        width: max-content;
    }
    /* 4. Product Card (Thẻ sản phẩm) */
    .sanpham-card {
        /* 85vw hoặc con số mày ưng, giữ nguyên */
        width: 89vw; 
        flex-shrink: 0;
        scroll-snap-align: start; /* Dính sát lề khi trượt qua */
        scroll-snap-stop: always; 
    }
    /* Hình ảnh */
    .sanpham-image {
        position: relative;
        width: 100%;
        aspect-ratio: 6 / 7; /* Tỷ lệ ảnh dọc chuẩn e-commerce hiện nay */
        overflow: hidden;
        background-color: #f5f5f5; /* Màu nền chờ khi ảnh chưa load */
        margin-bottom: 15px;
    }

    .sanpham-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Nút Quick Add (Ẩn trên mobile hoặc hiện góc nhỏ, ở đây tao ẩn để sạch layout giống video) */
    .quick-add-btn {
        display: none; 
    }

    /* Thông tin sản phẩm */
    .sanpham-info {
        text-align: left;
    }

    .sanpham-info .badge {
        font-size: 10px;
        font-weight: 700;
        color: #666;
        text-transform: uppercase;
        display: block;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }

    .sanpham-info .name {
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 5px 0;
        color: #000;
        font-family: 'Be Vietnam Pro', sans-serif;
    }

    .sanpham-info .desc {
        font-size: 13px;
        color: #555;
        margin: 0 0 8px 0;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Giới hạn 2 dòng mô tả */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .sanpham-info .price {
        font-size: 14px;
        color: #000;
        font-weight: 500;
        margin: 0;
    }

    /* 5. Footer & Progress Bar */
    .luot-footer {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Ẩn nút mũi tên (Nav) trên mobile vì đã dùng vuốt */
    .luot-nav {
        display: none; 
    }

    /* Thanh Progress Bar */
    .luot-progress-container {
        width: 100%; /* Full width theo container cha */
        height: 2px; /* Thanh mảnh tinh tế */
        background-color: #e0e0e0; /* Màu nền xám nhạt */
        position: relative;
        overflow: hidden;
        margin-top: 10px;
    }

    .luot-progress-bar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 20%; /* Ví dụ độ dài ban đầu, JS sẽ tính lại cái này */
        background-color: #000; /* Màu đen chạy trên nền xám */
        transition: width 0.3s ease, left 0.3s ease;
    }
}