@media (max-width: 1023px) {
    /* ==========================================================================
       FMC DEVOPS FIX: GIỮ NATIVE SELECT - DIỆT TẬN GỐC CHỒNG Ô (SELECT2 & NICE-SELECT)
       ========================================================================== */
    /* 1. Ép hiển thị select gốc (native) gạch chân phẳng lỳ chạy mượt bộ chọn điện thoại */
    .woocommerce-checkout select#billing_city,
    .woocommerce-checkout select#billing_address_2,
    .billing-shipping-cart-block select.select {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        -webkit-appearance: select !important; /* Kích hoạt native UI picker của iOS */
        -moz-appearance: select !important;
        appearance: select !important;
        
        width: 100% !important;
        height: 40px !important;
        background-color: transparent !important;
        
        border: none !important;
        border-bottom: 1px solid #DFDFDF !important; /* Tạo đường gạch chân chuẩn */
        border-radius: 0 !important;
        box-shadow: none !important;
        
        padding: 8px 0 !important;
        font-size: 13px !important;
        color: #333 !important;
        
        /* Đẩy z-index lên đỉnh và mở pointer-events để ngón tay chạm phát ăn ngay */
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 9999 !important;
    }

    /* Ép các thẻ cha bọc ngoài không nuốt mất click cảm ứng của select gốc */
    .billing-shipping-cart-block,
    .billing-shipping-cart-block .form-row,
    .billing-shipping-cart-block .woocommerce-input-wrapper {
        pointer-events: auto !important;
    }

    /* 2. CHỐT HẠ: Vô hiệu hóa và xóa sổ hoàn toàn các container/thẻ span giả lập 
       của cả Select2 lẫn Nice-select sinh ra đè chồng lên gây liệt, dính cache */
    .billing-shipping-cart-block .select2,
    .billing-shipping-cart-block .select2-container,
    .billing-shipping-cart-block span.select2,
    .billing-shipping-cart-block .nice-select,
    .billing-shipping-cart-block div.nice-select,
    .woocommerce-checkout .nice-select,
    .woocommerce-checkout .select2-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }
    /* ========================================================================== */

    /* 1. Thiết luật luồng cuộn dọc và thứ tự ưu tiên */
    .woocommerce-checkout #customer_details {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .woocommerce-checkout #customer_details > .col-1 {
        display: contents !important;
    }

    /* Định nghĩa thứ tự hiển thị tuần tự */
    .fmc-mobile-order-1 { order: 1 !important; }
    .fmc-mobile-order-2 { order: 2 !important; }
    .fmc-mobile-order-3 { order: 3 !important; }
    .fmc-mobile-order-4 { order: 4 !important; }

    /* CHI TIẾT THANH TOÁN - CHỈ KHAI BÁO 1 LẦN DUY NHẤT Ở ĐÂY */
    .fmc-only-mobile {
        display: block !important;
        order: 5 !important;
        margin-bottom: 5px !important; /* Đã ép xuống 5px */
    }

    .fmc-only-mobile .heading {
        display: block !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        margin-bottom: 12px !important;
        color: #222 !important;
    }

    .fmc-mobile-order-payment-details .checkout-block {
        padding: 20px !important;
        background: #fff !important;
        border-radius: 16px !important;
        box-shadow: none !important;
        margin-bottom: 0 !important; /* Triệt tiêu margin của box trắng */
        font-size: 13px !important;
    }
    
    .fmc-mobile-order-payment-details .item-block {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Ép các khối xích lại gần nhau hơn nữa */
    .fmc-checkout#customer_details .col-1 .checkout-block {
        margin-bottom: 12px !important;
    }

    /* Riêng phần Mã ưu đãi (order 3) và Phương thức thanh toán (order 4) */
    .fmc-mobile-order-3, .fmc-mobile-order-4 {
        margin-bottom: 12px !important;
    }
    
    /* Thu hẹp khoảng cách với tiêu đề bên dưới */
    .fmc-only-mobile .heading {
        margin-bottom: 8px !important;
    }

    .fmc-mobile-order-payment-details.fmc-only-mobile {
        order: 5 !important;
        margin-bottom: 5px !important;  /* Thu nhỏ khoảng cách với Footer */
        display: block !important;
    }

    /* 3. THANH BAR NGANG CỐ ĐỊNH */
    .woocommerce form.woocommerce-checkout #customer_details > .col-2 {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 80px !important; 
        background: #ffffff !important;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.12) !important;
        z-index: 10000 !important;
        padding: 0 16px !important;
        display: flex !important;
        align-items: center !important;
        order: 6 !important; /* Luôn nằm cuối cùng */
        outline: none !important;
        border: none !important;
    }

    .payment-block {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        background: transparent !important;
        padding: 0 0 0 0 !important;
        margin: 0 !important;
        outline: none !important;
    }

    .col-2 #payment_heading, 
    .col-2 .coupon-block, 
    .col-2 .item-block:not(.fmc-summary-bar) {
        display: none !important;
    }

    .fmc-summary-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        cursor: default !important;
        flex: 1;
    }

    .fmc-summary-bar .total-price-label {
        font-size: 16px !important;
        color: #000000 !important;
        font-weight: 800 !important;
    }

    .fmc-summary-bar .total-price {
        font-size: 18px !important;
        color: #4564ED !important;
        font-weight: 700 !important;
    }

    .fmc-summary-bar .fmc-toggle-icon {
        display: none !important;
    }

    .woocommerce .col-2 .checkout-block #place_order,
    .woocommerce .col-2 .checkout-block #fmc_contact_messenger_btn {
        height: 46px !important;
        margin: 0 !important;
        padding: 0 16px !important;
        border-radius: 999px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        background: #4564ED !important;
        text-transform: none !important;
        white-space: nowrap !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .woocommerce .col-2 .checkout-block #place_order {
        flex: 0 0 130px !important;
    }

    .woocommerce .col-2 .checkout-block #fmc_contact_messenger_btn {
        flex: 0 0 180px !important;
    }

    .woocommerce .col-2 .checkout-block #fmc_contact_messenger_btn:hover {
        background: #4564ED !important;
    }

    /* 4. KHỐI QUYẾT ĐỊNH KHOẢNG HỞ CUỐI TRANG */
    .woocommerce-checkout {
        padding-bottom: 5px !important; 
    }

    .woocommerce-checkout #customer_details > .col-2 .checkout-block {
        border-radius: 0 !important;
        background-color: #fff !important;
        box-shadow: none !important;
    }

    .woocommerce-checkout #customer_details > .col-2 {
        border-radius: 0 !important;
    }

    .woocommerce-checkout #customer_details > .col-2 h3.heading {
        display: none !important;
    }

    /* Khống chế tên sản phẩm: Size 13px, tối đa 2 hàng, hiện dấu ... */
    .order-content-product-name {
        font-size: 12px !important;
        line-height: 1.4 !important;
        font-weight: 500 !important;
        color: #333 !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: break-word !important;
    }

    /* Chỉnh lại cụm giá tiền cho cân đối với tên 13px */
    .product-price-display .sale-price {
        font-size: 14px !important;
    }
    .product-price-display .regular-price {
        font-size: 11px !important;
    }

    /* Ép size 13px cho thẻ span có chứa style inline */
    span.value[style*="font-size: 18px"], 
    span.value {
        font-size: 13px !important;
    }

    /* Đảm bảo con số bên trong cũng bị hạ size */
    span.value .woocommerce-Price-amount,
    span.value bdi {
        font-size: 13px !important;
    }
}