/**
 * Mực In Sài Gòn - Master Stylesheet: Giỏ Hàng & Thanh Toán Chuẩn Hiện Đại
 * Phiên bản: 3.0 (Tối ưu UI/UX E-Commerce 2026)
 * 
 * NGUYÊN TẮC:
 * 1. Phạm vi cách ly tuyệt đối: Chỉ tác động bên trong body.woocommerce-cart và body.woocommerce-checkout
 * 2. Bảo vệ tuyệt đối Header (.site-header, .site-header-modern) và Footer (.site-footer, .site-footer-modern)
 * 3. Đồng bộ thương hiệu: Xanh Navy #253989, Đỏ tươi #ed1c24, Xanh lá #16a34a (thông báo thành công)
 * 4. Không khoảng trống thừa, căn chỉnh chuẩn xác, Mobile First
 */

/* ==========================================================================
   0. HỆ THỐNG BIẾN MÀU & PHẠM VI
   ========================================================================== */
:root {
    --ms-blue-primary: #253989;
    --ms-blue-hover: #1c2b66;
    --ms-blue-light: #eff6ff;
    --ms-red-primary: #ed1c24;
    --ms-red-hover: #c9141b;
    --ms-green-primary: #16a34a;
    --ms-bg-light: #f8fafc;
    --ms-border-color: #e2e8f0;
    --ms-border-light: #f1f5f9;
    --ms-text-dark: #0f172a;
    --ms-text-normal: #334155;
    --ms-text-muted: #64748b;
    --ms-radius: 10px;
    --ms-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --ms-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   1. BẢO VỆ TUYỆT ĐỐI HEADER & FOOTER
   ========================================================================== */
/* Đảm bảo Header không bao giờ bị biến dạng trên trang Giỏ hàng & Thanh toán */
body.woocommerce-cart .site-header,
body.woocommerce-cart .site-header-modern,
body.woocommerce-checkout .site-header,
body.woocommerce-checkout .site-header-modern {
    box-sizing: border-box !important;
}

body.woocommerce-cart .site-header-modern .main-header-row .container,
body.woocommerce-checkout .site-header-modern .main-header-row .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body.woocommerce-cart .site-header-modern .after-header .container,
body.woocommerce-checkout .site-header-modern .after-header .container {
    padding: 0 !important;
}

/* Ẩn Trust Badges ở chân trang giỏ hàng theo yêu cầu người dùng */
body.woocommerce-cart .footer-usp-bar,
body.woocommerce-checkout .footer-usp-bar {
    display: none !important;
}

/* ==========================================================================
   KIẾN TRÚC STICKY FOOTER HIỆN ĐẠI: TRIỆT TIÊU TOÀN DIỆN KHOẢNG TRẮNG DƯ THỪA DƯỚI FOOTER
   - Footer luôn bám sát đáy màn hình (100vh) ngay cả khi giỏ hàng có 1 sản phẩm / giỏ trống
   - Khi nội dung dài, trang cuộn tự nhiên và thanh bản quyền luôn là phần tử cuối cùng (0px gap)
   - Scope cách ly tuyệt đối chỉ trong body.woocommerce-cart và body.woocommerce-checkout
   ========================================================================== */
@media (min-width: 992px) {
    html:has(body.woocommerce-cart),
    html:has(body.woocommerce-checkout) {
        height: 100% !important;
    }

    body.woocommerce-cart,
    body.woocommerce-checkout {
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        background-color: #f8fafc !important;
    }

    body.woocommerce-cart #site-content,
    body.woocommerce-checkout #site-content {
        flex: 1 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    body.woocommerce-cart #site-content .site-content,
    body.woocommerce-checkout #site-content .site-content {
        flex: 1 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    body.woocommerce-cart #site-content .site-main,
    body.woocommerce-checkout #site-content .site-main {
        flex: 1 0 auto !important;
        width: 100% !important;
    }

    body.woocommerce-cart #site-footer,
    body.woocommerce-checkout #site-footer {
        display: block !important;
        position: relative !important;
        clear: both !important;
        z-index: 10 !important;
        flex-shrink: 0 !important;
        margin-top: auto !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        width: 100% !important;
    }

    body.woocommerce-cart .copy-right-modern,
    body.woocommerce-checkout .copy-right-modern {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 991px) {
    body.woocommerce-cart,
    body.woocommerce-checkout {
        min-height: auto !important;
        display: block !important;
        background-color: #f8fafc !important;
    }

    body.woocommerce-cart #site-content,
    body.woocommerce-checkout #site-content,
    body.woocommerce-cart #site-content .site-content,
    body.woocommerce-checkout #site-content .site-content,
    body.woocommerce-cart #site-content .site-main,
    body.woocommerce-checkout #site-content .site-main {
        flex: none !important;
        min-height: auto !important;
        display: block !important;
    }

    body.woocommerce-cart #site-footer,
    body.woocommerce-checkout #site-footer {
        margin-top: 0 !important;
        display: block !important;
    }
}

@media (min-width: 769px) {
    body.woocommerce-cart,
    body.woocommerce-checkout {
        padding-bottom: 0 !important;
    }
}

/* Triệt tiêu triệt để màu xanh ngọc cũ (#50b092) */
body.woocommerce-cart .amount,
body.woocommerce-cart .amount bdi,
body.woocommerce-cart .amount span,
body.woocommerce-checkout .amount,
body.woocommerce-checkout .amount bdi {
    color: inherit;
}

/* ==========================================================================
   2. THÔNG BÁO ALERT (DẤU TÍCH CHỈN CHU, SÁT VIỀN, KHÔNG NÚT XEM THỪA)
   ========================================================================== */
body.woocommerce-cart .woocommerce-notices-wrapper,
body.woocommerce-checkout .woocommerce-notices-wrapper {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin: 10px 0 16px 0 !important;
    box-sizing: border-box !important;
}

body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-info,
body.woocommerce-checkout .woocommerce-error {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    margin: 0 0 12px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    position: relative !important;
    word-break: break-word !important;
}

/* THÀNH CÔNG: Dấu tích xanh tròn chỉn chu tuyệt đối đầu dòng */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-checkout .woocommerce-message {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 4px solid #16a34a !important;
    color: #166534 !important;
}

body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-checkout .woocommerce-message::before {
    content: "✓" !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    background: #16a34a !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 12px 0 0 !important;
    float: none !important;
    flex-shrink: 0 !important;
    order: -1 !important;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25) !important;
}

/* THÔNG TIN */
body.woocommerce-cart .woocommerce-info,
body.woocommerce-checkout .woocommerce-info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 4px solid var(--ms-blue-primary) !important;
    color: #1e40af !important;
}

body.woocommerce-cart .woocommerce-info::before,
body.woocommerce-checkout .woocommerce-info::before {
    content: "ℹ" !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    background: var(--ms-blue-primary) !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    margin: 0 12px 0 0 !important;
    flex-shrink: 0 !important;
    order: -1 !important;
}

/* BÁO LỖI */
body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-error {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-left: 4px solid #ef4444 !important;
    color: #991b1b !important;
}

body.woocommerce-cart .woocommerce-error::before,
body.woocommerce-checkout .woocommerce-error::before {
    content: "✕" !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    background: #ef4444 !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    margin: 0 12px 0 0 !important;
    flex-shrink: 0 !important;
    order: -1 !important;
}

/* Triệt tiêu triệt để các icon rác thừa */
body.woocommerce-cart .woocommerce-message::after,
body.woocommerce-cart .woocommerce-info::after,
body.woocommerce-cart .woocommerce-error::after,
body.woocommerce-checkout .woocommerce-message::after,
body.woocommerce-checkout .woocommerce-info::after,
body.woocommerce-checkout .woocommerce-error::after {
    display: none !important;
}

body.woocommerce-cart .woocommerce-message li,
body.woocommerce-cart .woocommerce-info li,
body.woocommerce-cart .woocommerce-error li,
body.woocommerce-checkout .woocommerce-message li,
body.woocommerce-checkout .woocommerce-info li,
body.woocommerce-checkout .woocommerce-error li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ẩn nút "Xem giỏ hàng" thừa thãi khi khách ĐÃ Ở TRÊN TRANG GIỎ HÀNG */
body.woocommerce-cart .woocommerce-message a.button,
body.woocommerce-cart .woocommerce-message .button.wc-forward {
    display: none !important;
}

/* ==========================================================================
   3. TRANG GIỎ HÀNG (DESKTOP >= 992px) - 2 CỘT HIỆN ĐẠI, THỜI THƯỢNG
   ========================================================================== */
body.woocommerce-cart .site-content {
    padding-top: 10px !important;
    padding-bottom: 24px !important;
}

body.woocommerce-cart .site-main.container {
    max-width: 1240px !important;
    padding: 0 15px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* TIÊU ĐỀ TRANG GIỎ HÀNG CHUẨN UI/UX KÈM VIỀN GẠCH ĐỎ */
body.woocommerce-cart .ms-cart-page-header {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin: 8px 0 16px 0 !important;
    padding: 0 0 10px 0 !important;
    position: relative !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
}

body.woocommerce-cart .ms-cart-page-header::after {
    content: "" !important;
    position: absolute !important;
    bottom: -1.5px !important;
    left: 0 !important;
    width: 90px !important;
    height: 3px !important;
    background: var(--ms-red-primary, #ed1c24) !important;
    border-radius: 2px !important;
}

body.woocommerce-cart .ms-cart-page-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark, #0f172a) !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

body.woocommerce-cart .ms-cart-page-title i {
    color: var(--ms-red-primary, #ed1c24) !important;
    font-size: 19px !important;
}

body.woocommerce-cart .ms-cart-page-count {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--ms-text-muted, #64748b) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

body.woocommerce-cart .site-main > .woocommerce {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

@media (min-width: 992px) {
    body.woocommerce-cart .site-main > .woocommerce {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 24px !important;
    }

    body.woocommerce-cart .woocommerce-notices-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    body.woocommerce-cart form.woocommerce-cart-form {
        flex: 1 1 calc(68% - 24px) !important;
        width: calc(68% - 24px) !important;
        max-width: calc(68% - 24px) !important;
    }

    body.woocommerce-cart .cart-collaterals {
        flex: 0 0 32% !important;
        width: 32% !important;
        max-width: 32% !important;
        position: sticky !important;
        top: 85px !important;
    }
}

/* BẢNG SẢN PHẨM DESKTOP: Sạch sẽ, góc bo 12px, không kẻ dọc Excel */
body.woocommerce-cart table.shop_table.cart {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: var(--ms-shadow-sm) !important;
    overflow: hidden !important;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
}

body.woocommerce-cart table.shop_table.cart thead {
    background-color: var(--ms-bg-light) !important;
}

body.woocommerce-cart table.shop_table.cart thead th {
    padding: 14px 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--ms-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    border-bottom: 1.5px solid var(--ms-border-color) !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-remove {
    width: 44px !important;
    font-size: 0 !important;
    text-align: center !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-thumbnail {
    width: 80px !important;
    font-size: 0 !important;
    text-align: center !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-name {
    text-align: left !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-price {
    text-align: right !important;
    width: 120px !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-quantity {
    text-align: center !important;
    width: 140px !important;
}

body.woocommerce-cart table.shop_table.cart thead th.product-subtotal {
    text-align: right !important;
    width: 130px !important;
    padding-right: 20px !important;
}

/* Các ô tbody: Không viền dọc, căn giữa thanh lịch */
body.woocommerce-cart table.shop_table.cart tbody td {
    padding: 16px 14px !important;
    vertical-align: middle !important;
    border: none !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
    background: #ffffff !important;
}

body.woocommerce-cart table.shop_table.cart tbody tr:last-child td {
    border-bottom: none !important;
}

/* Triệt tiêu hoàn toàn pseudo data-title của WooCommerce */
body.woocommerce-cart table.shop_table.cart tbody td::before,
body.woocommerce-cart table.shop_table.cart tbody td::after,
body.woocommerce-cart table.shop_table_responsive tbody td::before,
body.woocommerce-cart table.shop_table_responsive tbody td::after {
    display: none !important;
    content: "" !important;
}

/* Nút xóa sản phẩm */
body.woocommerce-cart table.cart a.remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    font-size: 18px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

body.woocommerce-cart table.cart a.remove:hover {
    color: #ffffff !important;
    background: var(--ms-red-primary) !important;
}

/* Thumbnail sản phẩm */
body.woocommerce-cart table.cart .product-thumbnail {
    width: 80px !important;
    text-align: center !important;
}

body.woocommerce-cart table.cart .product-thumbnail img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    border: 1px solid var(--ms-border-light) !important;
    background: #ffffff !important;
    padding: 2px !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Tên sản phẩm & phân loại */
body.woocommerce-cart table.cart .product-name a {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    line-height: 1.45 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

body.woocommerce-cart table.cart .product-name a:hover {
    color: var(--ms-red-primary) !important;
}

body.woocommerce-cart table.cart .product-name dl.variation {
    margin: 4px 0 0 0 !important;
    font-size: 12px !important;
    color: var(--ms-text-muted) !important;
}

body.woocommerce-cart table.cart .product-name dl.variation dt,
body.woocommerce-cart table.cart .product-name dl.variation dd {
    display: inline !important;
    margin: 0 !important;
    float: none !important;
}

body.woocommerce-cart table.cart .product-name dl.variation dd p {
    display: inline !important;
}

/* Đơn giá */
body.woocommerce-cart table.cart .product-price,
body.woocommerce-cart table.cart .product-price .amount,
body.woocommerce-cart table.cart .product-price .amount bdi {
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-normal) !important;
}

/* Bộ nút tăng giảm số lượng [-] [qty] [+] */
.ms-quantity-wrap {
    display: inline-flex !important;
    align-items: center !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

.ms-quantity-wrap label,
.screen-reader-text,
label.screen-reader-text {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
}

.ms-quantity-wrap .ms-qty-btn {
    width: 32px !important;
    height: 34px !important;
    background: #f8fafc !important;
    border: none !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    padding: 0 !important;
    flex: 0 0 32px !important;
    outline: none !important;
    box-shadow: none !important;
}

.ms-quantity-wrap .ms-qty-btn:hover {
    background: #e2e8f0 !important;
    color: var(--ms-blue-primary) !important;
}

.ms-quantity-wrap input.qty {
    width: 44px !important;
    height: 34px !important;
    border: none !important;
    border-left: 1px solid var(--ms-border-light) !important;
    border-right: 1px solid var(--ms-border-light) !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    padding: 0 !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
    box-shadow: none !important;
    outline: none !important;
}

.ms-quantity-wrap input.qty::-webkit-outer-spin-button,
.ms-quantity-wrap input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Thành tiền */
body.woocommerce-cart table.cart .product-subtotal,
body.woocommerce-cart table.cart .product-subtotal .amount,
body.woocommerce-cart table.cart .product-subtotal .amount bdi {
    text-align: right !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: var(--ms-red-primary) !important;
    padding-right: 20px !important;
}

/* Hàng Coupon (Dưới bảng Desktop) */
body.woocommerce-cart table.cart td.actions {
    padding: 16px 20px !important;
    background: var(--ms-bg-light) !important;
    border-top: 1px solid var(--ms-border-color) !important;
    /* GIỮ display: table-cell để colspan="6" có hiệu lực - KHÔNG dùng flex trên td */
}

body.woocommerce-cart table.cart td.actions .coupon {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    float: none !important;
}

body.woocommerce-cart table.cart td.actions .coupon input#coupon_code {
    height: 40px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 0 14px !important;
    font-size: 13.5px !important;
    width: 180px !important;
    outline: none !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

body.woocommerce-cart table.cart td.actions .coupon input#coupon_code:focus {
    border-color: var(--ms-blue-primary) !important;
}

body.woocommerce-cart table.cart td.actions .coupon button {
    height: 40px !important;
    background: var(--ms-blue-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0 18px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    box-sizing: border-box !important;
}

body.woocommerce-cart table.cart td.actions .coupon button:hover {
    background: var(--ms-blue-hover) !important;
}

/* Ẩn nút Cập nhật giỏ hàng thủ công */
body.woocommerce-cart table.cart td.actions button[name="update_cart"] {
    display: none !important;
}

/* KHỐI TỔNG CỘNG GIỎ HÀNG (CỘT PHẢI DESKTOP) */
body.woocommerce-cart .cart_totals {
    background: #ffffff !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 12px !important;
    padding: 22px !important;
    box-shadow: var(--ms-shadow-sm) !important;
}

body.woocommerce-cart .cart_totals h2 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    margin: 0 0 16px 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 1.5px solid var(--ms-border-light) !important;
    letter-spacing: 0.5px !important;
}

body.woocommerce-cart .cart_totals table.shop_table {
    width: 100% !important;
    margin-bottom: 18px !important;
    border-collapse: collapse !important;
    border: none !important;
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
    padding: 12px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
}

body.woocommerce-cart .cart_totals table.shop_table th {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--ms-text-muted) !important;
    text-align: left !important;
}

body.woocommerce-cart .cart_totals table.shop_table td {
    text-align: right !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total th {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong .amount,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong .amount bdi {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--ms-red-primary) !important;
}

/* Nút Tiến hành thanh toán Desktop */
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    height: 48px !important;
    background: var(--ms-red-primary) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(237, 28, 36, 0.32) !important;
    transition: all 0.25s ease !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: var(--ms-red-hover) !important;
    box-shadow: 0 6px 18px rgba(237, 28, 36, 0.42) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   4. GIỎ HÀNG TRÊN MOBILE (< 768px): CHÈN SÁT MÀN HÌNH, THẺ CARD CHUẨN ĐẸP
   ========================================================================== */
@media (max-width: 768px) {
    /* CHÈN RA GẦN MÀN HÌNH - BẢO VỆ TUYỆT ĐỐI HEADER */
    body.woocommerce-cart .site-content,
    body.woocommerce-checkout .site-content {
        padding-top: 8px !important;
        padding-bottom: 0px !important;
    }

    body.woocommerce-cart .site-content .container,
    body.woocommerce-cart .site-main.container,
    body.woocommerce-cart .site-main,
    body.woocommerce-checkout .site-content .container,
    body.woocommerce-checkout .site-main.container,
    body.woocommerce-checkout .site-main {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* TIÊU ĐỀ TRANG GIỎ HÀNG MOBILE KÈM VIỀN GẠCH ĐỎ */
    body.woocommerce-cart .ms-cart-page-header {
        margin: 6px 0 12px 0 !important;
        padding: 0 0 8px 0 !important;
        border-bottom: 1.5px solid #e2e8f0 !important;
        position: relative !important;
    }

    body.woocommerce-cart .ms-cart-page-header::after {
        content: "" !important;
        position: absolute !important;
        bottom: -1.5px !important;
        left: 0 !important;
        width: 65px !important;
        height: 2.5px !important;
        background: var(--ms-red-primary, #ed1c24) !important;
        border-radius: 2px !important;
    }

    body.woocommerce-cart .ms-cart-page-title {
        font-size: 16.5px !important;
        font-weight: 700 !important;
        color: var(--ms-text-dark, #0f172a) !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }

    body.woocommerce-cart .ms-cart-page-title i {
        color: var(--ms-red-primary, #ed1c24) !important;
        font-size: 15px !important;
    }

    body.woocommerce-cart .ms-cart-page-count {
        font-size: 12.5px !important;
        font-weight: 500 !important;
        color: var(--ms-text-muted, #64748b) !important;
        text-transform: none !important;
        letter-spacing: normal !important;
    }

    body.woocommerce-cart .site-main > .woocommerce,
    body.woocommerce-checkout .site-main > .woocommerce {
        padding: 0 !important;
        margin: 0 0 16px 0 !important; /* Dọn sạch khoảng trống thừa, đáy đã có body padding-bottom */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tối ưu đệm trên chân trang trên Mobile */
    body.woocommerce-cart .main-footer-body,
    body.woocommerce-checkout .main-footer-body {
        padding-top: 18px !important;
        padding-bottom: 24px !important;
    }

    /* Bảng chuyển thành danh sách Card */
    body.woocommerce-cart table.shop_table.cart {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        margin: 0 0 6px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.woocommerce-cart table.shop_table.cart thead {
        display: none !important;
    }

    body.woocommerce-cart table.shop_table.cart tbody {
        display: block !important;
        width: 100% !important;
    }

    body.woocommerce-cart table.shop_table.cart tbody tr {
        display: block !important;
        width: 100% !important;
    }

    /* THẺ SẢN PHẨM MOBILE: CSS GRID CHUẨN ĐẸP 2 HÀNG CÂN ĐỐI - KHÔNG KHOẢNG TRỐNG THỪA */
    body.woocommerce-cart table.shop_table.cart tr.cart_item {
        display: grid !important;
        grid-template-columns: 72px 1fr 26px !important;
        grid-template-rows: auto auto !important;
        column-gap: 10px !important;
        row-gap: 8px !important;
        align-items: center !important;
        background: #ffffff !important;
        border: 1px solid var(--ms-border-color) !important;
        border-radius: 10px !important;
        padding: 10px !important;
        margin-bottom: 8px !important;
        position: relative !important;
        box-shadow: var(--ms-shadow-sm) !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* TRIỆT TIÊU TOÀN BỘ VIỀN / OUTLINE Ở TỪNG Ô TD */
    body.woocommerce-cart table.shop_table.cart tbody tr.cart_item td {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        outline: none !important;
        box-shadow: none !important;
    }

    /* Thumbnail: Cột 1 (Spans hàng 1 & 2) */
    body.woocommerce-cart table.shop_table.cart td.product-thumbnail {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 3 !important;
        display: block !important;
        width: 72px !important;
        height: 72px !important;
        align-self: start !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-thumbnail img {
        width: 72px !important;
        height: 72px !important;
        object-fit: contain !important;
        border-radius: 6px !important;
        border: 1px solid var(--ms-border-light) !important;
        background: #ffffff !important;
        display: block !important;
    }

    /* TÊN SẢN PHẨM: HÀNG 1, CỘT 2 - CHIẾM TRỌN 100% KHÔNG GIAN, KHÔNG BỎ TRỐNG */
    body.woocommerce-cart table.shop_table.cart tbody tr.cart_item td.product-name,
    body.woocommerce-cart table.shop_table.cart td.product-name {
        grid-column: 2 / 3 !important;
        grid-row: 1 !important;
        display: block !important;
        align-self: start !important;
        margin: 0 !important;
        padding: 0 4px 0 0 !important;
        min-width: 0 !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.woocommerce-cart table.shop_table.cart tbody tr.cart_item td.product-name a,
    body.woocommerce-cart table.shop_table.cart td.product-name a {
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        color: var(--ms-text-dark, #0f172a) !important;
        line-height: 1.4 !important;
        text-decoration: none !important;
        border: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        word-break: break-word !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-name dl.variation {
        display: block !important;
        margin: 4px 0 0 0 !important;
        font-size: 11.5px !important;
        color: var(--ms-text-muted) !important;
        line-height: 1.35 !important;
    }

    /* Nút xóa: Hàng 1, Cột 3 (Góc trên phải) */
    body.woocommerce-cart table.shop_table.cart td.product-remove {
        grid-column: 3 / 4 !important;
        grid-row: 1 !important;
        align-self: start !important;
        justify-self: end !important;
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-remove a.remove {
        width: 24px !important;
        height: 24px !important;
        font-size: 16px !important;
        background: #f1f5f9 !important;
        color: #94a3b8 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        text-decoration: none !important;
    }

    /* Ẩn đơn giá phụ trên Mobile */
    body.woocommerce-cart table.shop_table.cart td.product-price {
        display: none !important;
    }

    /* Bộ tăng giảm số lượng: Hàng 2, Cột 2 (Căn dưới cùng bên trái) */
    body.woocommerce-cart table.shop_table.cart td.product-quantity {
        grid-column: 2 / 3 !important;
        grid-row: 2 !important;
        align-self: end !important;
        justify-self: start !important;
        margin: 6px 0 0 0 !important;
        padding: 0 !important;
        width: auto !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-quantity .ms-quantity-wrap {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        height: 30px !important;
        width: 88px !important;
        border: 1px solid var(--ms-border-color) !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        background: #ffffff !important;
        white-space: nowrap !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-quantity .ms-quantity-wrap .ms-qty-btn {
        width: 27px !important;
        height: 30px !important;
        background: #f8fafc !important;
        border: none !important;
        color: #334155 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 27px !important;
        line-height: 1 !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-quantity .ms-quantity-wrap input.qty {
        width: 34px !important;
        height: 30px !important;
        border: none !important;
        border-left: 1px solid var(--ms-border-light) !important;
        border-right: 1px solid var(--ms-border-light) !important;
        text-align: center !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        color: var(--ms-text-dark) !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        -moz-appearance: textfield !important;
        appearance: textfield !important;
        box-shadow: none !important;
    }

    /* Thành tiền: Hàng 2, Cột 2 & 3 (Căn dưới cùng bên phải) */
    body.woocommerce-cart table.shop_table.cart td.product-subtotal {
        grid-column: 2 / 4 !important;
        grid-row: 2 !important;
        align-self: end !important;
        justify-self: end !important;
        margin: 6px 0 0 0 !important;
        padding: 0 !important;
        width: auto !important;
        text-align: right !important;
        white-space: nowrap !important;
        border: none !important;
    }

    body.woocommerce-cart table.shop_table.cart td.product-subtotal .amount,
    body.woocommerce-cart table.shop_table.cart td.product-subtotal .amount bdi {
        font-size: 16px !important;
        font-weight: 800 !important;
        color: var(--ms-red-primary) !important;
    }

    /* Ô NHẬP MÃ GIẢM GIÁ TRÊN MOBILE: GỌN GÀNG, ĐỒNG ĐỀU, KHÔNG KHOẢNG TRỐNG THỪA */
    body.woocommerce-cart table.shop_table.cart td.actions {
        display: block !important;
        background: transparent !important;
        padding: 0 !important;
        border: none !important;
        margin: 8px 0 14px 0 !important;
        width: 100% !important;
    }

    body.woocommerce-cart table.shop_table.cart td.actions .coupon {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: auto !important;
        height: 38px !important;
        border: 1.5px solid var(--ms-border-color) !important;
        border-radius: 6px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
        outline: none !important;
    }

    body.woocommerce-cart table.shop_table.cart td.actions .coupon button {
        flex: 0 0 auto !important;
        height: 38px !important;
        padding: 0 16px !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        background: var(--ms-blue-primary) !important;
        color: #ffffff !important;
        border: none !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        cursor: pointer !important;
    }

    /* KHUNG TỔNG CỘNG TRÊN MOBILE: GỌN GÀNG, GIẢM KHOẢNG TRỐNG THỪA */
    body.woocommerce-cart .cart_totals {
        padding: 14px !important;
        border-radius: 12px !important;
        margin-top: 0 !important;
        background: #ffffff !important;
        border: 1px solid var(--ms-border-color) !important;
        box-shadow: var(--ms-shadow-sm) !important;
    }

    body.woocommerce-cart .cart_totals h2 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }

    body.woocommerce-cart .cart_totals table.shop_table {
        margin-bottom: 12px !important;
    }

    body.woocommerce-cart .cart_totals table.shop_table th,
    body.woocommerce-cart .cart_totals table.shop_table td {
        padding: 8px 0 !important;
    }

    body.woocommerce-cart .wc-proceed-to-checkout {
        padding: 0 !important;
    }

    body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        height: 48px !important;
        font-size: 15px !important;
    }
}

/* ==========================================================================
   5. GIAO DIỆN GIỎ HÀNG TRỐNG (EMPTY CART): DUY NHẤT 1 CARD, NÚT ĐỎ CHUẨN
   ========================================================================== */
/* TRIỆT TIÊU TOÀN BỘ KHUNG XANH LỒNG NGOÀI CỦA WOOCOMMERCE & ICON LỖI [ ] */
body.woocommerce-cart .cart-empty,
body.woocommerce-cart p.cart-empty,
body.woocommerce-cart .woocommerce-info.cart-empty,
p.cart-empty.woocommerce-info {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: none !important;
}

body.woocommerce-cart .cart-empty::before,
body.woocommerce-cart .cart-empty::after,
body.woocommerce-cart .woocommerce-info.cart-empty::before,
body.woocommerce-cart .woocommerce-info.cart-empty::after {
    display: none !important;
}

body.woocommerce-cart .wc-empty-cart-message > p.return-to-shop {
    display: none !important;
}

/* THẺ TRẮNG DUY NHẤT CHUYÊN NGHIỆP */
.ms-empty-cart-container {
    background: #ffffff !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 14px !important;
    padding: 35px 20px !important;
    text-align: center !important;
    max-width: 620px !important;
    margin: 15px auto 40px auto !important;
    box-shadow: var(--ms-shadow-md) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ms-empty-cart-icon {
    width: 68px !important;
    height: 68px !important;
    background: var(--ms-blue-light) !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 14px !important;
    color: var(--ms-blue-primary) !important;
    font-size: 26px !important;
}

.ms-empty-cart-title {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    margin: 0 0 8px 0 !important;
}

.ms-empty-cart-sub {
    font-size: 13.5px !important;
    color: var(--ms-text-muted) !important;
    line-height: 1.5 !important;
    max-width: 440px !important;
    margin: 0 auto 20px auto !important;
}

.ms-empty-cart-actions a.ms-btn-explore {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: var(--ms-red-primary) !important;
    color: #ffffff !important;
    padding: 12px 28px !important;
    border-radius: 8px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(237, 28, 36, 0.28) !important;
    transition: all 0.25s ease !important;
}

.ms-empty-cart-actions a.ms-btn-explore:hover {
    background: var(--ms-red-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(237, 28, 36, 0.38) !important;
}

/* Gợi ý danh mục nhanh trong Giỏ trống */
.ms-empty-cart-suggestions {
    margin-top: 25px !important;
    padding-top: 18px !important;
    border-top: 1px dashed var(--ms-border-color) !important;
}

.ms-sug-label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--ms-text-muted) !important;
    margin-bottom: 10px !important;
}

.ms-sug-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
}

.ms-sug-pill {
    padding: 6px 14px !important;
    background: var(--ms-bg-light) !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 20px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: var(--ms-text-normal) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.ms-sug-pill:hover {
    background: var(--ms-blue-light) !important;
    border-color: var(--ms-blue-primary) !important;
    color: var(--ms-blue-primary) !important;
}

/* ==========================================================================
   6. TRANG THANH TOÁN (CHECKOUT) - MẪU CHUẨN LÊ VĂN TOẢN & VIETQR
   ========================================================================== */
body.woocommerce-checkout .site-content {
    padding-top: 15px !important;
    padding-bottom: 30px !important;
}

body.woocommerce-checkout .site-main.container {
    max-width: 1240px !important;
    padding: 0 15px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

body.woocommerce-checkout form.checkout.woocommerce-checkout {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 24px !important;
    align-items: flex-start !important;
}

/* Đảm bảo toàn bộ thông báo lỗi / NoticeGroup chèn vào đầu form checkout luôn chiếm trọn 100% dòng đầu tiên */
body.woocommerce-checkout .woocommerce-NoticeGroup,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
body.woocommerce-checkout form.checkout.woocommerce-checkout > .woocommerce-NoticeGroup,
body.woocommerce-checkout form.checkout.woocommerce-checkout > .woocommerce-NoticeGroup-checkout,
body.woocommerce-checkout form.checkout.woocommerce-checkout > .woocommerce-notices-wrapper {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 0 4px 0 !important;
    order: -1 !important;
    box-sizing: border-box !important;
    clear: both !important;
}

body.woocommerce-checkout .woocommerce-NoticeGroup .woocommerce-error,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-NoticeGroup ul.woocommerce-error,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout ul.woocommerce-error {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 12px 0 !important;
}

@media (min-width: 992px) {
    body.woocommerce-checkout #customer_details {
        flex: 1 1 calc(60% - 24px) !important;
        width: calc(60% - 24px) !important;
        max-width: calc(60% - 24px) !important;
    }

    body.woocommerce-checkout #order_review_heading,
    body.woocommerce-checkout #order_review {
        flex: 0 0 40% !important;
        width: 40% !important;
        max-width: 40% !important;
    }
}

@media (max-width: 991px) {
    body.woocommerce-checkout #customer_details,
    body.woocommerce-checkout #order_review_heading,
    body.woocommerce-checkout #order_review {
        width: 100% !important;
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Thẻ form thông tin khách hàng */
body.woocommerce-checkout #customer_details {
    background: #ffffff !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 12px !important;
    padding: 22px !important;
    box-shadow: var(--ms-shadow-sm) !important;
    box-sizing: border-box !important;
}

body.woocommerce-checkout .woocommerce-billing-fields h3,
body.woocommerce-checkout .woocommerce-shipping-fields h3,
body.woocommerce-checkout #ship-to-different-address span,
body.woocommerce-checkout .woocommerce-additional-fields h3 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 16px 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 1.5px solid var(--ms-border-light) !important;
}

/* Lưới 2 cột cho các trường họ tên, sđt, email */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

body.woocommerce-checkout p.form-row,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p,
body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper > p,
body.woocommerce-checkout #order_comments_field {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 576px) {
    body.woocommerce-checkout #billing_first_name_field,
    body.woocommerce-checkout #shipping_first_name_field {
        width: 100% !important;
    }

    body.woocommerce-checkout #billing_phone_field,
    body.woocommerce-checkout #billing_email_field,
    body.woocommerce-checkout #shipping_phone_field,
    body.woocommerce-checkout #shipping_email_field,
    body.woocommerce-checkout #billing_state_field,
    body.woocommerce-checkout #billing_city_field,
    body.woocommerce-checkout #billing_address_2_field,
    body.woocommerce-checkout #billing_address_1_field,
    body.woocommerce-checkout #shipping_state_field,
    body.woocommerce-checkout #shipping_city_field,
    body.woocommerce-checkout #shipping_address_2_field,
    body.woocommerce-checkout #shipping_address_1_field {
        width: calc(50% - 6px) !important;
    }
}

html body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p label,
html body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper > p label,
html body.woocommerce-checkout #order_comments_field label,
html body.woocommerce-checkout p#order_comments_field > label,
html body.woocommerce-checkout p.form-row label {
    display: block !important;
    width: 100% !important;
    flex: none !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--ms-text-normal) !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

html body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p span.woocommerce-input-wrapper,
html body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper > p span.woocommerce-input-wrapper,
html body.woocommerce-checkout #order_comments_field span.woocommerce-input-wrapper,
html body.woocommerce-checkout p#order_comments_field span.woocommerce-input-wrapper,
html body.woocommerce-checkout #order_comments_field .woocommerce-input-wrapper,
html body.woocommerce-checkout p.form-row span.woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body.woocommerce-checkout .woocommerce-additional-fields {
    margin-top: 16px !important;
    width: 100% !important;
}

html body.woocommerce-checkout .woocommerce-additional-fields h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    margin: 0 0 12px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1.5px solid var(--ms-border-light) !important;
}

html body.woocommerce-checkout p.form-row label .required {
    color: var(--ms-red-primary) !important;
    text-decoration: none !important;
}

html body.woocommerce-checkout p.form-row label .optional,
html body.woocommerce-checkout label .optional {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-size: 12.5px !important;
    margin-left: 4px !important;
}

html body.woocommerce-checkout p.form-row input.input-text,
html body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input.input-text,
html body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper input.input-text,
html body.woocommerce-checkout span.woocommerce-input-wrapper input {
    width: 100% !important;
    height: 42px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    font-size: 13.5px !important;
    color: var(--ms-text-dark) !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
}

html body.woocommerce-checkout #order_comments_field,
html body.woocommerce-checkout p#order_comments_field {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    clear: both !important;
}

html body.woocommerce-checkout #order_comments_field textarea,
html body.woocommerce-checkout p#order_comments_field textarea,
html body.woocommerce-checkout #order_comments_field .woocommerce-input-wrapper textarea,
html body.woocommerce-checkout p#order_comments_field span.woocommerce-input-wrapper textarea,
html body.woocommerce-checkout p.form-row textarea,
html body.woocommerce-checkout span.woocommerce-input-wrapper textarea {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 80px !important;
    min-height: 80px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    color: var(--ms-text-dark) !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    display: block !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
}

html body.woocommerce-checkout p.form-row input.input-text:focus,
html body.woocommerce-checkout p.form-row textarea:focus,
html body.woocommerce-checkout #order_comments_field textarea:focus,
html body.woocommerce-checkout p#order_comments_field span.woocommerce-input-wrapper textarea:focus {
    border-color: var(--ms-blue-primary) !important;
}

/* Select2 / SelectWoo cho Tỉnh/Quận/Xã */
body.woocommerce-checkout .select2-container .select2-selection--single {
    height: 42px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    outline: none !important;
}

body.woocommerce-checkout .select2-container--open .select2-selection--single {
    border-color: var(--ms-blue-primary) !important;
}

body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px !important;
    padding-left: 12px !important;
    font-size: 13.5px !important;
    color: var(--ms-text-dark) !important;
}

body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

/* Ẩn triệt để dấu x (clear button) của dropdown địa chỉ */
body.woocommerce-checkout .select2-selection__clear,
body.woocommerce-checkout .select2-container .select2-selection__clear {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Card Đơn hàng của bạn (Cột phải Checkout) - Canh lề chuẩn xác 100% */
body.woocommerce-checkout #order_review_heading {
    display: none !important;
}

body.woocommerce-checkout #order_review {
    background: #ffffff !important;
    border: 1px solid var(--ms-border-color) !important;
    border-radius: 12px !important;
    padding: 22px !important;
    box-shadow: var(--ms-shadow-sm) !important;
    box-sizing: border-box !important;
    position: relative !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review::before {
    content: "ĐƠN HÀNG CỦA BẠN" !important;
    display: block !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1.5px solid var(--ms-border-light) !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review table.shop_table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    margin-bottom: 16px !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review table.shop_table th,
body.woocommerce-checkout #order_review table.shop_table td {
    padding: 10px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review table.shop_table thead th {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--ms-text-muted) !important;
    text-transform: uppercase !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review table.shop_table thead th.product-total {
    text-align: right !important;
}

/* Hiển thị sản phẩm kèm hình ảnh Thumbnail chuẩn TMĐT */
body.woocommerce-checkout #order_review table.shop_table td.product-name {
    font-size: 13.5px !important;
    color: var(--ms-text-dark) !important;
    text-align: left !important;
    vertical-align: middle !important;
}

body.woocommerce-checkout #order_review .ms-checkout-item-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review .ms-checkout-item-thumb {
    flex: 0 0 54px !important;
    width: 54px !important;
    height: 54px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px !important;
    box-sizing: border-box !important;
}

body.woocommerce-checkout #order_review .ms-checkout-item-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

body.woocommerce-checkout #order_review .ms-checkout-item-content {
    flex: 1 1 auto !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review .ms-checkout-item-name {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--ms-text-dark) !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review strong.product-quantity {
    display: inline-block !important;
    color: #64748b !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
}

body.woocommerce-checkout #order_review table.shop_table td.product-total {
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* Các dòng tổng cộng tfoot: Tạm tính, Phí vận chuyển, Tổng đơn hàng */
body.woocommerce-checkout #order_review table.shop_table tfoot th {
    text-align: left !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-normal) !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout #order_review table.shop_table tfoot td {
    text-align: right !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.cart-subtotal th {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-normal) !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.cart-subtotal td {
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.order-total th {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-align: left !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    width: auto !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.order-total td {
    text-align: right !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    width: auto !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong,
body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount,
body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount bdi {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--ms-red-primary) !important;
    white-space: nowrap !important;
    display: inline-block !important;
    line-height: 1.2 !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount .woocommerce-Price-currencySymbol {
    display: inline !important;
    white-space: nowrap !important;
    font-size: 17px !important;
    margin-left: 2px !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.shipping th,
body.woocommerce-checkout #order_review table.shop_table tr.ms-shipping-row th,
body.woocommerce-cart .cart_totals table.shop_table tr.ms-shipping-row th {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-normal) !important;
    vertical-align: middle !important;
    padding: 12px 0 !important;
    text-align: left !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout #order_review table.shop_table tr.shipping td,
body.woocommerce-checkout #order_review table.shop_table tr.ms-shipping-row td,
body.woocommerce-cart .cart_totals table.shop_table tr.ms-shipping-row td {
    padding: 12px 0 !important;
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout #shipping_method {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    text-align: left !important;
}

body.woocommerce-checkout #shipping_method li {
    display: flex !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: left !important;
}

body.woocommerce-checkout #shipping_method li:hover {
    border-color: var(--ms-blue-primary) !important;
    background: #f0f7ff !important;
}

body.woocommerce-checkout #shipping_method li input[type="radio"] {
    margin: 0 8px 0 0 !important;
    accent-color: var(--ms-blue-primary) !important;
    cursor: pointer !important;
}

body.woocommerce-checkout #shipping_method li label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    text-align: left !important;
}

body.woocommerce-checkout #shipping_method li label .amount {
    color: var(--ms-red-primary) !important;
    font-weight: 700 !important;
}

/* Phương thức thanh toán - Canh sát mép trái 100% */
body.woocommerce-checkout #payment {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
}

body.woocommerce-checkout #payment ul.payment_methods {
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    text-align: left !important;
}

body.woocommerce-checkout #payment ul.payment_methods li {
    background: var(--ms-bg-light) !important;
    border: 1.5px solid var(--ms-border-color) !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
    text-align: left !important;
    display: block !important;
}

body.woocommerce-checkout #payment ul.payment_methods li:hover {
    border-color: var(--ms-blue-primary) !important;
}

body.woocommerce-checkout #payment ul.payment_methods li input[type="radio"] {
    margin: 0 8px 0 0 !important;
    accent-color: var(--ms-blue-primary) !important;
    vertical-align: middle !important;
    float: none !important;
}

body.woocommerce-checkout #payment ul.payment_methods li label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
    text-align: left !important;
    float: none !important;
}

body.woocommerce-checkout #payment div.payment_box,
body.woocommerce-checkout #payment div.payment_box.payment_method_bacs,
body.woocommerce-checkout #payment div.payment_box.payment_method_cod {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    margin: 10px 0 0 0 !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    color: var(--ms-text-normal) !important;
    text-align: left !important;
}

body.woocommerce-checkout #payment div.payment_box p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    color: var(--ms-text-normal) !important;
}

body.woocommerce-checkout #payment div.payment_box strong {
    color: var(--ms-text-dark) !important;
    font-weight: 700 !important;
}

body.woocommerce-checkout #payment div.payment_box::before {
    display: none !important;
}

/* NÚT ĐẶT HÀNG */
body.woocommerce-checkout #place_order {
    width: 100% !important;
    height: 48px !important;
    background: var(--ms-red-primary) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(237, 28, 36, 0.32) !important;
    transition: all 0.25s ease !important;
}

body.woocommerce-checkout #place_order:hover {
    background: var(--ms-red-hover) !important;
    box-shadow: 0 6px 18px rgba(237, 28, 36, 0.42) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   TỐI ƯU TRANG CẢM ƠN & CHI TIẾT ĐƠN HÀNG (THANK YOU / ORDER RECEIVED)
   ========================================================================== */

/* Ẩn hoàn toàn trường địa chỉ giao hàng riêng trên checkout (chỉ dùng 1 địa chỉ đặt hàng duy nhất) */
body.woocommerce-checkout #ship-to-different-address,
body.woocommerce-checkout .woocommerce-shipping-fields {
    display: none !important;
}

/* 1. Thẻ xác nhận đơn hàng (Thay thế viền đỏ thô cũ) */
body.woocommerce-checkout .woocommerce-order ul.order_details,
body.woocommerce-order-received .woocommerce-order ul.order_details {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 20px 0 24px 0 !important;
    padding: 16px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    list-style: none !important;
}

body.woocommerce-checkout .woocommerce-order ul.order_details li,
body.woocommerce-order-received .woocommerce-order ul.order_details li {
    flex: 1 1 calc(50% - 6px) !important;
    float: none !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: none !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    body.woocommerce-checkout .woocommerce-order ul.order_details li,
    body.woocommerce-order-received .woocommerce-order ul.order_details li {
        flex: 1 1 calc(25% - 9px) !important;
    }
}

body.woocommerce-checkout .woocommerce-order ul.order_details li strong,
body.woocommerce-order-received .woocommerce-order ul.order_details li strong {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
}

body.woocommerce-checkout .woocommerce-order ul.order_details li.total strong,
body.woocommerce-order-received .woocommerce-order ul.order_details li.total strong {
    color: var(--ms-red-primary) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

/* 2. Bảng Chi tiết đơn hàng hiển thị đầy đủ và sắc nét */
body.woocommerce-checkout .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-order-details {
    margin-top: 24px !important;
}

body.woocommerce-checkout .woocommerce-order-details h2.woocommerce-order-details__title,
body.woocommerce-order-received .woocommerce-order-details h2.woocommerce-order-details__title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    margin: 0 0 14px 0 !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details,
body.woocommerce-order-received table.woocommerce-table--order-details {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    margin-bottom: 24px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details thead th,
body.woocommerce-order-received table.woocommerce-table--order-details thead th {
    background: #f8fafc !important;
    color: var(--ms-text-dark) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    padding: 12px 14px !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details thead th.product-name,
body.woocommerce-order-received table.woocommerce-table--order-details thead th.product-name {
    text-align: left !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details thead th.product-total,
body.woocommerce-order-received table.woocommerce-table--order-details thead th.product-total {
    text-align: right !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tbody td,
body.woocommerce-order-received table.woocommerce-table--order-details tbody td {
    padding: 12px 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tbody td.product-name,
body.woocommerce-order-received table.woocommerce-table--order-details tbody td.product-name {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: left !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tbody td.product-name a,
body.woocommerce-order-received table.woocommerce-table--order-details tbody td.product-name a {
    color: var(--ms-text-dark) !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    display: inline !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tbody td.product-name .product-quantity,
body.woocommerce-order-received table.woocommerce-table--order-details tbody td.product-name .product-quantity {
    color: var(--ms-red-primary) !important;
    font-weight: 700 !important;
    margin-left: 6px !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tbody td.product-total,
body.woocommerce-order-received table.woocommerce-table--order-details tbody td.product-total {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    white-space: nowrap !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tfoot th,
body.woocommerce-order-received table.woocommerce-table--order-details tfoot th {
    text-align: left !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tfoot td,
body.woocommerce-order-received table.woocommerce-table--order-details tfoot td {
    text-align: right !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ms-text-dark) !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.woocommerce-checkout table.woocommerce-table--order-details tfoot tr:last-child th,
body.woocommerce-checkout table.woocommerce-table--order-details tfoot tr:last-child td,
body.woocommerce-order-received table.woocommerce-table--order-details tfoot tr:last-child th,
body.woocommerce-order-received table.woocommerce-table--order-details tfoot tr:last-child td {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--ms-red-primary) !important;
    border-bottom: none !important;
}

/* 3. Thẻ Card Địa chỉ nhận hàng */
body.woocommerce-checkout .woocommerce-customer-details,
body.woocommerce-order-received .woocommerce-customer-details {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    margin-top: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

body.woocommerce-checkout .woocommerce-customer-details h2,
body.woocommerce-order-received .woocommerce-customer-details h2 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    margin: 0 0 12px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1.5px solid var(--ms-border-light) !important;
}

body.woocommerce-checkout .woocommerce-customer-details address,
body.woocommerce-order-received .woocommerce-customer-details address {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #334155 !important;
    font-style: normal !important;
    border: none !important;
    padding: 0 !important;
}

/* 4. Khối Card Hỗ trợ đặt hàng & thanh toán chuyên nghiệp */
body.woocommerce-checkout .ms-checkout-support-card {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 18px !important;
    margin-top: 20px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    clear: both !important;
}

body.woocommerce-checkout .ms-support-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
    text-align: left !important;
}

body.woocommerce-checkout .ms-support-icon {
    flex: 0 0 38px !important;
    width: 38px !important;
    height: 38px !important;
    background: #eff6ff !important;
    color: var(--ms-blue-primary) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
}

body.woocommerce-checkout .ms-support-title-wrap {
    flex: 1 1 auto !important;
    text-align: left !important;
}

body.woocommerce-checkout .ms-support-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--ms-text-dark) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    line-height: 1.3 !important;
}

body.woocommerce-checkout .ms-support-subtitle {
    font-size: 12px !important;
    color: var(--ms-text-muted) !important;
    margin-top: 2px !important;
}

body.woocommerce-checkout .ms-support-actions {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
}

body.woocommerce-checkout .ms-support-btn {
    flex: 1 1 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

body.woocommerce-checkout .ms-support-btn.ms-btn-phone {
    background: #ffffff !important;
    color: var(--ms-red-primary) !important;
    border: 1.5px solid #fecaca !important;
}

body.woocommerce-checkout .ms-support-btn.ms-btn-phone:hover {
    background: #fef2f2 !important;
    border-color: var(--ms-red-primary) !important;
    color: var(--ms-red-primary) !important;
}

body.woocommerce-checkout .ms-support-btn.ms-btn-zalo {
    background: #0068ff !important;
    color: #ffffff !important;
    border: 1.5px solid #0068ff !important;
}

body.woocommerce-checkout .ms-support-btn.ms-btn-zalo:hover {
    background: #0053cc !important;
    border-color: #0053cc !important;
    color: #ffffff !important;
}

body.woocommerce-checkout .ms-support-badges {
    list-style: none !important;
    margin: 0 !important;
    padding: 12px 0 0 0 !important;
    border-top: 1px dashed #cbd5e1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    text-align: left !important;
}

body.woocommerce-checkout .ms-support-badges li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12.5px !important;
    color: var(--ms-text-normal) !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

body.woocommerce-checkout .ms-support-badges li i {
    color: #16a34a !important;
    font-size: 13.5px !important;
    flex: none !important;
}

@media (max-width: 576px) {
    body.woocommerce-checkout .ms-support-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }
    body.woocommerce-checkout .ms-support-btn {
        width: 100% !important;
        flex: none !important;
    }
}



/* Giao diện Thông báo trang Thank You (Không lộ STK) */
.ms-thankyou-vietqr-box.ms-thankyou-no-stk {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 20px 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

.ms-thankyou-vietqr-box.ms-thankyou-no-stk .ms-ty-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #16a34a !important;
    margin: 0 0 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ms-thankyou-vietqr-box.ms-thankyou-no-stk .ms-ty-desc {
    font-size: 14.5px !important;
    line-height: 1.6 !important;
    color: #334155 !important;
    margin: 0 !important;
}

.ms-thankyou-vietqr-box.ms-thankyou-no-stk .ms-ty-support {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    color: #1e40af !important;
    font-weight: 500 !important;
}

.ms-thankyou-vietqr-box.ms-thankyou-no-stk .ms-ty-support a {
    color: var(--ms-red-primary) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   TỐI ƯU FORM NHẬP MÃ ƯU ĐÃI (CHECKOUT COUPON)
   ========================================================================== */
body.woocommerce-checkout .woocommerce-form-coupon-toggle {
    margin: 14px 0 0 0 !important;
}

body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
    margin-bottom: 0 !important;
}

body.woocommerce-checkout .woocommerce-form-coupon-toggle a.showcoupon {
    color: var(--ms-blue-primary) !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    margin-left: 4px !important;
}

body.woocommerce-checkout .woocommerce-form-coupon-toggle a.showcoupon:hover {
    color: #0052a3 !important;
}

body.woocommerce-checkout form.checkout_coupon,
body.woocommerce-checkout form.woocommerce-form-coupon {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    margin: 12px 0 20px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

body.woocommerce-checkout form.checkout_coupon::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

body.woocommerce-checkout form.checkout_coupon p {
    margin: 0 0 10px 0 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    line-height: 1.5 !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-first {
    float: left !important;
    width: calc(100% - 130px) !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-first input#coupon_code {
    width: 100% !important;
    height: 44px !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px 0 0 8px !important;
    border-right: none !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    color: var(--ms-text-dark) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-first input#coupon_code:focus {
    background: #ffffff !important;
    border-color: var(--ms-blue-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12) !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-last {
    float: left !important;
    width: 130px !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-last button[name="apply_coupon"] {
    width: 100% !important;
    height: 44px !important;
    background: var(--ms-blue-primary) !important;
    color: #ffffff !important;
    border: 1.5px solid var(--ms-blue-primary) !important;
    border-radius: 0 8px 8px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
}

body.woocommerce-checkout form.checkout_coupon p.form-row-last button[name="apply_coupon"]:hover {
    background: #0052a3 !important;
    border-color: #0052a3 !important;
}

@media (max-width: 576px) {
    body.woocommerce-checkout form.checkout_coupon p.form-row-first {
        width: calc(100% - 110px) !important;
    }
    body.woocommerce-checkout form.checkout_coupon p.form-row-last {
        width: 110px !important;
    }
    body.woocommerce-checkout form.checkout_coupon p.form-row-first input#coupon_code {
        font-size: 13.5px !important;
        padding: 0 12px !important;
    }
    body.woocommerce-checkout form.checkout_coupon p.form-row-last button[name="apply_coupon"] {
        font-size: 13px !important;
        padding: 0 10px !important;
    }

    /* Đảm bảo dòng Tổng tiền nằm gọn trên 1 hàng duy nhất trên Mobile */
    body.woocommerce-checkout #order_review table.shop_table tr.order-total th,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total th {
        font-size: 14.5px !important;
        white-space: nowrap !important;
    }

    body.woocommerce-checkout #order_review table.shop_table tr.order-total td,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
        white-space: nowrap !important;
    }

    body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong,
    body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount,
    body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount bdi,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong .amount,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong .amount bdi {
        font-size: 18px !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    body.woocommerce-checkout #order_review table.shop_table tr.order-total td strong .amount .woocommerce-Price-currencySymbol,
    body.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong .amount .woocommerce-Price-currencySymbol {
        font-size: 15px !important;
        white-space: nowrap !important;
    }
}
