/* CSS riêng cho WooCommerce: chỉ nạp khi website có cài WooCommerce VÀ trang đang xem có dùng (inc/woocommerce.php).
   Website không cài WooCommerce không tải file này. Đổi kiểu theo dự án: CSS bổ sung, xem AI-GUIDE.txt mục 6. */
/* ---------- WooCommerce: lưới sản phẩm theo Cài đặt giao diện web (máy tính 4, điện thoại 2, ảnh 1:1) ---------- */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(var(--c, 4), minmax(0, 1fr)); gap: 28px 24px; margin: 0 0 32px; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; display: flex; flex-direction: column; }
.woocommerce ul.products.columns-1 { --c: 1; } .woocommerce ul.products.columns-2 { --c: 2; } .woocommerce ul.products.columns-3 { --c: 3; }
.woocommerce ul.products.columns-4 { --c: 4; } .woocommerce ul.products.columns-5 { --c: 5; } .woocommerce ul.products.columns-6 { --c: 6; }
.woocommerce ul.products li.product a img { width: 100%; height: auto; aspect-ratio: var(--mab-shop-ratio, 1 / 1); object-fit: cover; margin: 0 0 12px; border-radius: 6px; }
.woocommerce ul.products li.product .button { max-width: 100%; margin-top: auto; align-self: flex-start; padding: 7px 12px; overflow: hidden; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
/* Khung sản phẩm: viền nhẹ, rê chuột thì nổi lên */
.woocommerce ul.products li.product { box-sizing: border-box; padding: 12px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.woocommerce ul.products li.product:hover { border-color: #d3d7dc; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
/* Giá: giá bán to, đậm, không gạch chân; giá gốc nhỏ và nhạt. Dùng chung màu --mab-sale với nhãn giảm giá */
.woocommerce ul.products li.product span.price { color: var(--mab-sale, #e11d48); font-size: 17px; font-weight: 800; line-height: 1.3; }
.woocommerce div.product .summary p.price, .woocommerce div.product .summary span.price { color: var(--mab-sale, #e11d48); font-size: 26px; font-weight: 800; line-height: 1.3; }
.woocommerce ul.products li.product span.price ins, .woocommerce div.product .summary .price ins { background: none; color: inherit; font-weight: inherit; text-decoration: none; }
.woocommerce ul.products li.product span.price del, .woocommerce div.product .summary .price del { margin-right: 4px; color: #8a8f98; font-size: .76em; font-weight: 400; opacity: 1; }
.woocommerce .price .mab-price-from { color: #555; font-size: .62em; font-weight: 600; }
/* Phân trang cửa hàng: các nút tách rời, giống phân trang bài viết */
.woocommerce nav.woocommerce-pagination { margin-top: 8px; }
.woocommerce nav.woocommerce-pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; border-radius: 0; }
.woocommerce nav.woocommerce-pagination ul.page-numbers li { float: none; margin: 0; border: 0; overflow: visible; }
.woocommerce nav.woocommerce-pagination ul.page-numbers li .page-numbers { min-width: 38px; padding: 7px 10px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; line-height: 1.4; text-align: center; }
.woocommerce nav.woocommerce-pagination ul.page-numbers li a.page-numbers:hover { background: #f6f7f7; color: inherit; }
.woocommerce nav.woocommerce-pagination ul.page-numbers li .page-numbers.current { background: var(--mab-accent, #2271b1); border-color: var(--mab-accent, #2271b1); color: #fff; }
/* Nhãn giảm giá: mỗi website đổi màu bằng biến --mab-sale trong CSS bổ sung */
.woocommerce ul.products li.product span.onsale, .woocommerce div.product span.onsale { position: absolute; top: 10px; right: auto; bottom: auto; left: 10px; z-index: 2; width: auto; min-width: 0; height: auto; min-height: 0; margin: 0; padding: 5px 10px; background: var(--mab-sale, #e11d48); color: #fff; font-size: 14px; font-weight: 800; line-height: 1.2; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.woocommerce ul.products li.product span.onsale { top: 20px; left: 20px; }

/* ---------- WooCommerce: trang chi tiết sản phẩm. Màu nút, tab, viền ảnh nhỏ theo --mab-accent ---------- */
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; align-items: start; }
.woocommerce div.product::before, .woocommerce div.product::after { display: none; }
.woocommerce div.product div.images.woocommerce-product-gallery, .woocommerce div.product div.summary.entry-summary { float: none; width: 100%; margin: 0; }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product section.related, .woocommerce div.product section.upsells { grid-column: 1 / -1; min-width: 0; }
/* Ảnh chính giữ đúng tỉ lệ thật của ảnh, không khung cố định */
.woocommerce div.product .woocommerce-product-gallery__image { overflow: hidden; border-radius: 12px; }
.woocommerce div.product .flex-viewport { clip-path: inset(0 1px 0 0); } /* che mép ảnh kế tiếp khi khung rơi vào nửa điểm ảnh */
.woocommerce div.product div.images ol.flex-control-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; overflow: visible; }
.woocommerce div.product div.images ol.flex-control-thumbs li { float: none; width: auto; margin: 0; list-style: none; }
.woocommerce div.product div.images ol.flex-control-thumbs li img { box-sizing: border-box; aspect-ratio: 1 / 1; object-fit: cover; border: 2px solid transparent; border-radius: 8px; opacity: .65; transition: opacity .15s, border-color .15s; }
.woocommerce div.product div.images ol.flex-control-thumbs li img:hover, .woocommerce div.product div.images ol.flex-control-thumbs li img.flex-active { border-color: var(--mab-accent, #2271b1); opacity: 1; }
/* Cột thông tin */
.woocommerce div.product .summary .app-breadcrumbs { margin: 0 0 10px; font-size: 13px; }
#site-content div.summary .product_title { margin: 0 0 14px; padding: 12px 16px; background: #f7f8fa; border-radius: 10px; font-size: clamp(24px, calc(1.6vw + 10px), 30px); line-height: 1.3; }
.woocommerce div.product .summary p.price { margin: 0 0 16px; }
.woocommerce div.product .woocommerce-product-details__short-description { margin: 0 0 20px; color: #444; line-height: 1.6; }
.woocommerce div.product .summary p.stock { display: inline-block; margin: 0 0 16px; padding: 4px 10px; background: #f0fdf4; border-radius: 6px; font-size: 14px; font-weight: 600; }
.woocommerce div.product .summary p.stock.out-of-stock { background: #fef2f2; color: #b91c1c; }
.woocommerce div.product .product_meta { padding-top: 16px; border-top: 1px solid #eceef1; color: #666; font-size: 14px; line-height: 1.7; }
.woocommerce div.product .product_meta > span { display: block; }
/* Ô số lượng + nút mua */
.woocommerce div.product .summary form.cart { margin: 0 0 20px; }
.woocommerce div.product form.cart:not(.variations_form), .woocommerce div.product .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.woocommerce div.product form.cart::before, .woocommerce div.product form.cart::after { display: none; }
.woocommerce div.product form.cart div.quantity { float: none; margin: 0; }
.woocommerce div.product form.cart div.quantity input.qty { box-sizing: border-box; width: 72px; height: 48px; padding: 0 6px; border: 1px solid #d3d7dc; border-radius: 8px; font-size: 16px; text-align: center; }
.woocommerce div.product form.cart div.quantity.mab-qty { display: inline-flex; flex: none; align-items: stretch; height: 48px; overflow: hidden; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; }
.woocommerce div.product form.cart div.quantity.mab-qty input.qty { width: 48px; height: 100%; padding: 0; border: 0; border-right: 1px solid #e6e8eb; border-left: 1px solid #e6e8eb; border-radius: 0; color: #1e1e1e; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.woocommerce div.product form.cart div.quantity.mab-qty input.qty::-webkit-outer-spin-button, .woocommerce div.product form.cart div.quantity.mab-qty input.qty::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.woocommerce div.product form.cart div.quantity.mab-qty .mab-qty-btn { width: 42px; padding: 0; background: #f7f8fa; border: 0; color: #333; font-size: 20px; line-height: 1; cursor: pointer; }
.woocommerce div.product form.cart div.quantity.mab-qty .mab-qty-btn:hover { background: #eceef1; }
.woocommerce div.product form.cart .button.single_add_to_cart_button { flex: 1 1 120px; float: none; min-height: 48px; padding: 10px 20px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 16px; font-weight: 700; }
.woocommerce div.product form.cart .button.single_add_to_cart_button:hover { background: var(--mab-accent, #2271b1); color: #fff; filter: brightness(.92); }
/* Sản phẩm có biến thể */
.woocommerce div.product form.cart table.variations, .woocommerce div.product form.cart table.variations tbody, .woocommerce div.product form.cart table.variations tr, .woocommerce div.product form.cart table.variations th, .woocommerce div.product form.cart table.variations td { display: block; width: 100%; padding: 0; text-align: left; }
.woocommerce div.product form.cart table.variations { margin: 0 0 6px; border: 0; }
.woocommerce div.product form.cart table.variations tr { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; }
.woocommerce div.product form.cart table.variations th { flex: none; width: auto; min-width: 48px; padding-top: 5px; }
.woocommerce div.product form.cart table.variations td { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 8px; width: auto; min-width: 0; line-height: 1.3; }
.woocommerce div.product form.cart table.variations th label { display: block; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.woocommerce div.product form.cart table.variations th label::after { content: ":"; }
.woocommerce div.product form.cart table.variations .mab-swatches + select { display: none; }
.woocommerce div.product .mab-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.woocommerce div.product .mab-swatches .mab-swatch { min-width: 34px; padding: 3px 8px; background: #fff; border: 1px solid #d3d7dc; border-radius: 6px; color: #333; font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; transition: border-color .15s, color .15s; }
.woocommerce div.product .mab-swatches .mab-swatch:hover { border-color: var(--mab-accent, #2271b1); }
.woocommerce div.product .mab-swatches .mab-swatch.is-active { border-color: var(--mab-accent, #2271b1); box-shadow: inset 0 0 0 1px var(--mab-accent, #2271b1); color: var(--mab-accent, #2271b1); }
/* Hết hàng: dấu X phủ chéo nút */
.woocommerce div.product .mab-swatches .mab-swatch.is-out, .woocommerce div.product .mab-swatches .mab-swatch:disabled { border-color: #d3d7dc; color: #a7aaad; cursor: not-allowed; background-image: linear-gradient(to top right, transparent calc(50% - .6px), #c3c8ce calc(50% - .6px), #c3c8ce calc(50% + .6px), transparent calc(50% + .6px)), linear-gradient(to bottom right, transparent calc(50% - .6px), #c3c8ce calc(50% - .6px), #c3c8ce calc(50% + .6px), transparent calc(50% + .6px)); }
/* Nút Xóa lựa chọn: vòng tròn đỏ dấu ×, nằm cùng hàng với nút biến thể cuối */
.woocommerce div.product form.cart table.variations .reset_variations { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0; background: var(--mab-sale, #e11d48); border-radius: 50%; color: #fff; font-size: 0; line-height: 1; text-decoration: none; }
.woocommerce div.product form.cart table.variations .reset_variations::before { content: "×"; font-size: 15px; font-weight: 700; }
.woocommerce div.product form.cart table.variations .reset_variations:hover { filter: brightness(.9); }
/* Giá biến thể hiện ở dòng giá trên cùng (site-script.js), không hiện lại phía trên nút mua */
.woocommerce div.product .single_variation_wrap .woocommerce-variation-price { display: none; }
.woocommerce div.product .single_variation_wrap .single_variation { margin: 0; }
.woocommerce div.product .single_variation_wrap .woocommerce-variation-description p, .woocommerce div.product .single_variation_wrap .woocommerce-variation-availability p { margin: 0 0 12px; }
/* Tab mô tả, đánh giá */
.woocommerce div.product .woocommerce-tabs { margin: 48px 0 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs { display: flex; gap: 4px; margin: 0 0 20px; padding: 0; overflow-x: auto; border-bottom: 1px solid #e6e8eb; scrollbar-width: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before, .woocommerce div.product .woocommerce-tabs ul.tabs::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li, .woocommerce div.product .woocommerce-tabs ul.tabs li.active { flex: none; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { display: block; padding: 10px 16px; border-bottom: 2px solid transparent; color: #555; font-weight: 600; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { border-bottom-color: var(--mab-accent, #2271b1); color: var(--mab-accent, #2271b1); }
.woocommerce div.product .woocommerce-tabs .panel { margin: 0; }
.woocommerce div.product .woocommerce-tabs .panel table { width: 100%; border-collapse: collapse; }
.woocommerce div.product .woocommerce-tabs .panel th, .woocommerce div.product .woocommerce-tabs .panel td { padding: 10px 12px; border: 1px solid #e6e8eb; text-align: left; }
.woocommerce div.product .woocommerce-tabs .panel th { width: 30%; background: #f7f8fa; }
/* Sản phẩm liên quan */
.woocommerce div.product section.related, .woocommerce div.product section.upsells { margin-top: 48px; }
#site-content section.related > h2, #site-content section.upsells > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; font-size: 22px; }
#site-content section.related > h2::before, #site-content section.upsells > h2::before { content: ""; flex: 0 0 4px; height: 1.1em; background: var(--mab-accent, #2271b1); border-radius: 4px; }

/* ---------- WooCommerce: giỏ hàng cổ điển. Giá theo --mab-sale, nút theo --mab-accent ---------- */
.woocommerce-cart .woocommerce { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px 32px; align-items: start; }
.woocommerce-cart .woocommerce::before, .woocommerce-cart .woocommerce::after { display: none; }
.woocommerce-cart .woocommerce > :not(.woocommerce-cart-form, .cart-collaterals) { grid-column: 1 / -1; }
.woocommerce-cart .woocommerce .woocommerce-cart-form { min-width: 0; margin: 0; }
/* Cột trái: bảng sản phẩm */
.woocommerce-cart .woocommerce table.shop_table.cart { margin: 0; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; border-collapse: separate; border-spacing: 0; }
.woocommerce-cart .woocommerce table.shop_table.cart th { padding: 12px; border: 0; border-bottom: 1px solid #e6e8eb; color: #555; font-size: 13px; font-weight: 600; }
.woocommerce-cart .woocommerce table.shop_table.cart td { padding: 14px 12px; border: 0; border-bottom: 1px solid #eceef1; vertical-align: middle; }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail img { display: block; width: 72px; height: auto; border-radius: 8px; }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name a { color: #1e1e1e; font-size: 17px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name a:hover { color: var(--mab-accent, #2271b1); }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation { margin: 4px 0 0; color: #666; font-size: 13px; }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-price { color: #444; font-size: 14px; }
.woocommerce-cart .woocommerce table.shop_table.cart td.product-subtotal { color: var(--mab-sale, #e11d48); font-size: 17px; font-weight: 800; white-space: nowrap; }
.woocommerce-cart .woocommerce table.shop_table.cart a.remove { width: 24px; height: 24px; background: #fff1f2; border-radius: 50%; color: var(--mab-sale, #e11d48) !important; font-size: 18px; font-weight: 700; line-height: 24px; }
.woocommerce-cart .woocommerce table.shop_table.cart a.remove:hover { background: var(--mab-sale, #e11d48); color: #fff !important; }
.woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty { display: inline-flex; float: none; align-items: stretch; height: 36px; overflow: hidden; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; }
.woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty input.qty { box-sizing: border-box; width: 40px; height: 100%; padding: 0; background: #fff; border: 0; border-right: 1px solid #e6e8eb; border-left: 1px solid #e6e8eb; border-radius: 0; color: #1e1e1e; font-size: 15px; font-weight: 700; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty input.qty::-webkit-outer-spin-button, .woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty input.qty::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty .mab-qty-btn { width: 30px; padding: 0; background: #f7f8fa; border: 0; color: #333; font-size: 18px; line-height: 1; cursor: pointer; }
.woocommerce-cart .woocommerce-cart-form div.quantity.mab-qty .mab-qty-btn:hover { background: #eceef1; }
/* Hàng nút Cập nhật giỏ hàng; mã giảm giá chỉ nhập ở trang thanh toán nên ô mã gốc được ẩn */
.woocommerce-cart .woocommerce table.shop_table.cart td.actions { padding: 12px; border-bottom: 0; text-align: right; }
.woocommerce-cart .woocommerce table.shop_table.cart td.actions .coupon { display: none; }
.woocommerce-cart .woocommerce table.shop_table.cart td.actions .button[name="update_cart"] { float: none; padding: 10px 16px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; }
.woocommerce-cart .woocommerce table.shop_table.cart td.actions .button[name="update_cart"]:disabled { background: #eceef1; color: #8a8f98; opacity: 1; }
/* Cột phải: tổng đơn trong một khung */
.woocommerce-cart .woocommerce .cart-collaterals { width: 100%; min-width: 0; }
.woocommerce-cart .woocommerce .cart-collaterals .cart_totals { box-sizing: border-box; float: none; width: 100%; padding: 16px 20px 20px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-cart .woocommerce .cart_totals h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.woocommerce-cart .woocommerce .cart_totals table.shop_table { margin: 0; border: 0; border-collapse: collapse; }
.woocommerce-cart .woocommerce .cart_totals table.shop_table th, .woocommerce-cart .woocommerce .cart_totals table.shop_table td { padding: 10px 0; background: none; border: 0; border-top: 1px solid #eceef1; font-size: 14px; }
.woocommerce-cart .woocommerce .cart_totals table.shop_table td { text-align: right; }
.woocommerce-cart .woocommerce .cart_totals table.shop_table tr.order-total th { font-size: 16px; font-weight: 700; vertical-align: middle; }
.woocommerce-cart .woocommerce .cart_totals table.shop_table tr.order-total td, .woocommerce-cart .woocommerce .cart_totals table.shop_table tr.order-total td strong { color: var(--mab-sale, #e11d48); font-size: 24px; font-weight: 800; }
.mab-checkout-simple.woocommerce-cart .woocommerce-shipping-destination { display: none; }
.woocommerce-cart .woocommerce .wc-proceed-to-checkout { margin: 8px 0 0; padding: 0; }
.woocommerce-cart .woocommerce .wc-proceed-to-checkout a.checkout-button { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; padding: 10px 16px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 16px; font-weight: 700; }
.woocommerce-cart .woocommerce .wc-proceed-to-checkout a.checkout-button:hover { background: var(--mab-accent, #2271b1); color: #fff; filter: brightness(.92); }
@media (max-width: 1023px) {
    .woocommerce-cart .woocommerce { grid-template-columns: minmax(0, 1fr); }
}
/* Từ 768px trở xuống WooCommerce đổi bảng thành danh sách nhãn: dựng lại thành thẻ có ảnh, gọn hơn */
@media (max-width: 768px) {
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 12px; border-bottom: 1px solid #eceef1; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td { display: block; padding: 0; background: none; border: 0; text-align: left !important; } /* WooCommerce ép căn phải bằng !important */
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td::before { content: none; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-thumbnail { grid-column: 1; grid-row: 1 / 4; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-name { grid-column: 2 / 4; grid-row: 1; padding-right: 30px; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-name a { font-size: 16px; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-remove { position: absolute; top: 14px; right: 12px; width: auto; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-price { grid-column: 2; grid-row: 2; align-self: center; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-subtotal { grid-column: 3; grid-row: 2; align-self: center; font-size: 16px; text-align: right !important; }
    .woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-quantity { grid-column: 2 / 4; grid-row: 3; }
    .woocommerce-cart .woocommerce table.shop_table.cart td.actions .button[name="update_cart"] { width: 100%; }
    .woocommerce-cart .woocommerce .cart_totals table.shop_table tr.order-total td::before { color: #1e1e1e; font-size: 16px; font-weight: 700; }
}

/* ---------- WooCommerce: trang thanh toán cổ điển, đồng bộ với giỏ hàng ---------- */
.woocommerce-checkout .woocommerce form.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px 32px; align-items: start; margin: 0; }
.woocommerce-checkout .woocommerce form.checkout::before, .woocommerce-checkout .woocommerce form.checkout::after { display: none; }
.woocommerce-checkout .woocommerce form.checkout > :not(#customer_details, .mab-checkout-side) { grid-column: 1 / -1; }
/* Cột trái: thông tin khách */
.woocommerce-checkout .woocommerce #customer_details { box-sizing: border-box; float: none; width: 100%; min-width: 0; margin: 0; padding: 20px 24px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-checkout .woocommerce #customer_details::before, .woocommerce-checkout .woocommerce #customer_details::after { display: none; }
.woocommerce-checkout .woocommerce #customer_details .col-1, .woocommerce-checkout .woocommerce #customer_details .col-2 { float: none; width: 100%; }
.woocommerce-checkout .woocommerce #customer_details h3 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.woocommerce-checkout .woocommerce #customer_details .woocommerce-additional-fields > h3 { display: none; }
.woocommerce-checkout .woocommerce #customer_details .form-row { float: none; width: 100%; margin: 0 0 14px; padding: 0; }
.woocommerce-checkout .woocommerce #customer_details .form-row label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.woocommerce-checkout .woocommerce #customer_details .form-row input.input-text, .woocommerce-checkout .woocommerce #customer_details .form-row textarea { box-sizing: border-box; width: 100%; padding: 0 12px; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; font-size: 15px; }
.woocommerce-checkout .woocommerce #customer_details .form-row input.input-text { height: 44px; }
.woocommerce-checkout .woocommerce #customer_details .form-row textarea { min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.woocommerce-checkout .woocommerce #customer_details .form-row.woocommerce-invalid input.input-text { border-color: var(--mab-sale, #e11d48); }
.mab-field-hidden { display: none; }
/* Cột phải: mã giảm giá, đơn hàng, phương thức thanh toán, nút đặt hàng */
.woocommerce-checkout .woocommerce .mab-checkout-side { box-sizing: border-box; min-width: 0; padding: 20px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-checkout .woocommerce .mab-coupon { display: flex; gap: 8px; margin: 0; }
.woocommerce-checkout .woocommerce .mab-coupon input { box-sizing: border-box; flex: 1; min-width: 0; height: 44px; padding: 0 12px; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; font-size: 15px; }
.woocommerce-checkout .woocommerce .mab-coupon .button { flex: none; height: 44px; padding: 0 14px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; }
.woocommerce-checkout .woocommerce .mab-coupon .button:disabled { opacity: .6; }
.woocommerce-checkout .woocommerce .mab-coupon-msg { margin: 8px 0 0; font-size: 13px; }
.woocommerce-checkout .woocommerce .mab-coupon-msg > * { margin: 0; padding: 8px 10px; font-size: 13px; }
.woocommerce-checkout .woocommerce .mab-coupon-msg > *::before { display: none; }
.woocommerce-checkout .woocommerce #order_review_heading { float: none; width: 100%; margin: 16px 0 8px; padding: 16px 0 0; border-top: 1px solid #eceef1; font-size: 18px; font-weight: 700; }
.woocommerce-checkout .woocommerce #order_review { float: none; width: 100%; }
.woocommerce-checkout .woocommerce #order_review table.shop_table { margin: 0 0 14px; border: 0; border-collapse: collapse; }
.woocommerce-checkout .woocommerce #order_review table.shop_table thead, .woocommerce-checkout .woocommerce #order_review table.shop_table tr.cart-subtotal { display: none; }
.woocommerce-checkout .woocommerce #order_review table.shop_table th, .woocommerce-checkout .woocommerce #order_review table.shop_table td { padding: 10px 0; background: none; border: 0; border-top: 1px solid #eceef1; font-size: 14px; }
.woocommerce-checkout .woocommerce #order_review table.shop_table tbody tr:first-child td { border-top: 0; }
.woocommerce-checkout .woocommerce #order_review table.shop_table td.product-name { padding-right: 12px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.woocommerce-checkout .woocommerce #order_review table.shop_table td.product-name .product-quantity { color: #555; font-weight: 700; white-space: nowrap; }
.woocommerce-checkout .woocommerce #order_review table.shop_table td.product-name dl.variation { margin: 4px 0 0; color: #666; font-size: 13px; font-weight: 400; }
.woocommerce-checkout .woocommerce #order_review table.shop_table td.product-total { color: var(--mab-sale, #e11d48); font-size: 15px; font-weight: 700; text-align: right; white-space: nowrap; }
.woocommerce-checkout .woocommerce #order_review table.shop_table tfoot td { text-align: right; }
.woocommerce-checkout .woocommerce #order_review table.shop_table tr.order-total th { font-size: 16px; font-weight: 700; vertical-align: middle; }
.woocommerce-checkout .woocommerce #order_review table.shop_table tr.order-total td, .woocommerce-checkout .woocommerce #order_review table.shop_table tr.order-total td strong { color: var(--mab-sale, #e11d48); font-size: 24px; font-weight: 800; }
.woocommerce-checkout .woocommerce #payment { background: none; border-radius: 0; }
.woocommerce-checkout .woocommerce #payment ul.payment_methods { margin: 0 0 12px; padding: 0; border: 0; }
.woocommerce-checkout .woocommerce #payment div.payment_box { margin: 8px 0 0; padding: 10px 12px; background: #f7f8fa; border-radius: 8px; color: #555; font-size: 13px; }
.woocommerce-checkout .woocommerce #payment div.payment_box::before { display: none; }
.woocommerce-checkout .woocommerce #payment div.payment_box p { margin: 0; }
.woocommerce-checkout .woocommerce .woocommerce-privacy-policy-text p { margin: 0 0 12px; color: #666; font-size: 13px; line-height: 1.5; }
.woocommerce-checkout .woocommerce #payment div.form-row.place-order { margin: 0; padding: 0; }
.woocommerce-checkout .woocommerce #payment #place_order { float: none; width: 100%; min-height: 48px; margin: 0; padding: 10px 16px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 16px; font-weight: 700; }
.woocommerce-checkout .woocommerce #payment #place_order:hover { background: var(--mab-accent, #2271b1); color: #fff; filter: brightness(.92); }
@media (max-width: 1023px) {
    .woocommerce-checkout .woocommerce form.checkout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .woocommerce-checkout .woocommerce #customer_details { padding: 16px; }
    .woocommerce-checkout .woocommerce .mab-checkout-side { padding: 16px; }
}

@media (max-width: 1023px) {
    .woocommerce div.product { gap: 0 28px; }
}
@media (max-width: 1023px) { .woocommerce ul.products.columns-4, .woocommerce ul.products.columns-5, .woocommerce ul.products.columns-6 { --c: 3; } }
@media (max-width: 767px) {
    .woocommerce div.product { grid-template-columns: minmax(0, 1fr); }
    .woocommerce div.product div.summary.entry-summary { margin-top: 20px; }
    .woocommerce div.product .woocommerce-tabs ul.tabs { gap: 0; }
    .woocommerce div.product .woocommerce-tabs ul.tabs li a { padding: 10px; font-size: 14px; }
    .woocommerce div.product form.cart div.quantity.mab-qty input.qty { width: 40px; }
    .woocommerce div.product form.cart div.quantity.mab-qty .mab-qty-btn { width: 36px; }
    .woocommerce div.product form.cart .button.single_add_to_cart_button { padding: 10px 8px; font-size: 15px; }
    .woocommerce div.product .woocommerce-tabs, .woocommerce div.product section.related, .woocommerce div.product section.upsells { margin-top: 32px; }
    .woocommerce ul.products[class] { grid-template-columns: repeat(var(--mab-shop-m, 2), minmax(0, 1fr)); gap: 20px 14px; }
    .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14px; }
    .woocommerce ul.products li.product { padding: 8px; }
    .woocommerce ul.products li.product span.onsale { top: 14px; left: 14px; padding: 4px 8px; font-size: 13px; }
    .woocommerce ul.products li.product .button { align-self: stretch; padding: 6px 4px; font-size: 12px; text-align: center; }
    .woocommerce ul.products li.product span.price { font-size: 15px; }
    .woocommerce div.product .summary p.price, .woocommerce div.product .summary span.price { font-size: 22px; }
}

/* ---------- Cửa hàng, danh mục: tiêu đề, số sản phẩm, ô sắp xếp ---------- */
#site-content h1.page-title { margin: 0 0 16px; font-size: clamp(26px, calc(2.2vw + 8px), 36px); line-height: 1.25; }
.woocommerce .term-description { margin: 0 0 16px; color: #444; }
.woocommerce .woocommerce-result-count { float: left; margin: 0 0 20px; color: #666; font-size: 14px; line-height: 40px; }
.woocommerce .woocommerce-ordering { float: right; margin: 0 0 20px; }
.woocommerce .woocommerce-ordering select.orderby { box-sizing: border-box; height: 40px; padding: 0 10px; background-color: #fff; border: 1px solid #c3c8ce; border-radius: 8px; color: #333; font-size: 14px; }
.woocommerce ul.products { clear: both; }

/* ---------- Thông báo: dùng chung cho mọi trang cửa hàng ---------- */
.woocommerce .woocommerce-message, .woocommerce .woocommerce-info, .woocommerce .woocommerce-error { margin: 0 0 16px; background: #f7f8fa; border: 0; border-left: 4px solid var(--mab-accent, #2271b1); border-radius: 8px; color: #333; font-size: 14px; }
.woocommerce .woocommerce-message { border-left-color: #16a34a; }
.woocommerce .woocommerce-error { border-left-color: var(--mab-sale, #e11d48); }
.woocommerce .woocommerce-message .button, .woocommerce .woocommerce-info .button { padding: 6px 12px; background: var(--mab-accent, #2271b1); border-radius: 6px; color: #fff; font-size: 13px; font-weight: 700; }
.woocommerce-cart .woocommerce .return-to-shop .button { padding: 10px 18px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; }

/* ---------- Đánh giá sản phẩm ---------- */
.woocommerce div.product #reviews #comments h2, .woocommerce div.product #reviews #reply-title { display: block; margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.woocommerce div.product #reviews #commentform input[type="text"], .woocommerce div.product #reviews #commentform input[type="email"], .woocommerce div.product #reviews #commentform textarea { box-sizing: border-box; width: 100%; padding: 10px 12px; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; font-size: 15px; }
.woocommerce div.product #reviews #commentform #submit { padding: 10px 18px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; }
.woocommerce .star-rating, .woocommerce p.stars a { color: #f59e0b; }

/* ---------- Tài khoản: đăng nhập ---------- */
.woocommerce-account:not(.logged-in) .woocommerce { max-width: 440px; margin-inline: auto; }
.woocommerce-account:not(.logged-in) .woocommerce:has(#customer_login) { max-width: 880px; }
.woocommerce-account:not(.logged-in) #site-content .mab-entry-title { text-align: center; }
.woocommerce-account #customer_login { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.woocommerce-account #customer_login::before, .woocommerce-account #customer_login::after { display: none; }
.woocommerce-account #customer_login .u-column1, .woocommerce-account #customer_login .u-column2 { float: none; width: auto; }
.woocommerce-account:not(.logged-in) .woocommerce h2 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
.woocommerce-account .woocommerce form.login, .woocommerce-account .woocommerce form.register, .woocommerce-account .woocommerce form.lost_reset_password { margin: 0; padding: 24px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-account .woocommerce .woocommerce-form-login__rememberme { display: block; margin: 0 0 12px; font-size: 14px; }
.woocommerce-account .woocommerce .woocommerce-form-login__submit { float: none; width: 100%; margin: 0; }
.woocommerce-account .woocommerce .lost_password { margin: 12px 0 0; font-size: 14px; text-align: center; }

/* ---------- Tài khoản: menu bên trái, nội dung bên phải ---------- */
.woocommerce-account.logged-in .woocommerce { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px 28px; align-items: start; }
.woocommerce-account.logged-in .woocommerce::before, .woocommerce-account.logged-in .woocommerce::after { display: none; }
.woocommerce-account.logged-in .woocommerce > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation { box-sizing: border-box; float: none; width: auto; padding: 8px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; }
.woocommerce-account .woocommerce-MyAccount-navigation a { display: block; padding: 10px 12px; border-radius: 8px; color: #333; font-size: 14px; font-weight: 600; text-decoration: none; }
.woocommerce-account .woocommerce-MyAccount-navigation a:hover { background: #f7f8fa; }
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { background: #f7f8fa; box-shadow: inset 3px 0 0 var(--mab-accent, #2271b1); color: var(--mab-accent, #2271b1); }
.woocommerce-account .woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--mab-sale, #e11d48); }
.woocommerce-account .woocommerce .woocommerce-MyAccount-content { box-sizing: border-box; float: none; width: auto; min-width: 0; padding: 24px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; }
.woocommerce-account .woocommerce-MyAccount-content h2, .woocommerce-account .woocommerce-MyAccount-content h3, .woocommerce-account .woocommerce-MyAccount-content legend { font-size: 18px; font-weight: 700; }
/* Ô nhập, nút trong trang tài khoản */
.woocommerce-account .woocommerce form .form-row { margin: 0 0 14px; padding: 0; }
.woocommerce-account .woocommerce form .form-row label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.woocommerce-account .woocommerce form .form-row label.woocommerce-form__label-for-checkbox { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.woocommerce-account .woocommerce form .form-row input.input-text, .woocommerce-account .woocommerce form .form-row select, .woocommerce-account .woocommerce form .form-row textarea { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; background: #fff; border: 1px solid #c3c8ce; border-radius: 8px; font-size: 15px; }
.woocommerce-account .woocommerce form .password-input { display: block; }
.woocommerce-account .woocommerce form fieldset { margin: 0 0 16px; padding: 16px; border: 1px solid #eceef1; border-radius: 10px; }
.woocommerce-account .woocommerce .button { padding: 10px 18px; background: var(--mab-accent, #2271b1); border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; }
.woocommerce-account .woocommerce .button:hover { background: var(--mab-accent, #2271b1); color: #fff; filter: brightness(.92); }
.woocommerce-account .woocommerce .woocommerce-orders-table .button { padding: 6px 12px; font-size: 13px; }
.mab-checkout-simple .woocommerce-EditAccountForm .form-row-last { display: none; }
.mab-checkout-simple .woocommerce-EditAccountForm .form-row-first { float: none; width: 100%; }
/* Địa chỉ */
.woocommerce-account .woocommerce .woocommerce-Addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.woocommerce-account .woocommerce .woocommerce-Addresses::before, .woocommerce-account .woocommerce .woocommerce-Addresses::after { display: none; }
.woocommerce-account .woocommerce .woocommerce-Address { float: none; width: auto; padding: 16px; background: #f7f8fa; border-radius: 10px; }
.woocommerce-account .woocommerce .woocommerce-Address-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 8px; }
.woocommerce-account .woocommerce .woocommerce-Address-title::before, .woocommerce-account .woocommerce .woocommerce-Address-title::after { display: none; }
.woocommerce-account .woocommerce .woocommerce-Address-title h2 { margin: 0; font-size: 16px; }
.woocommerce-account .woocommerce .woocommerce-Address-title a.edit { float: none; font-size: 13px; }
.woocommerce-account .woocommerce .woocommerce-Address address { font-style: normal; line-height: 1.6; }

/* ---------- Bảng đơn hàng: tài khoản, trang cảm ơn ---------- */
.woocommerce-account .woocommerce table.shop_table, .woocommerce .woocommerce-order table.shop_table { margin: 0 0 20px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; border-collapse: separate; border-spacing: 0; }
.woocommerce-account .woocommerce table.shop_table th, .woocommerce-account .woocommerce table.shop_table td, .woocommerce .woocommerce-order table.shop_table th, .woocommerce .woocommerce-order table.shop_table td { padding: 12px 14px; border: 0; border-top: 1px solid #eceef1; font-size: 14px; }
.woocommerce-account .woocommerce table.shop_table thead th, .woocommerce .woocommerce-order table.shop_table thead th { border-top: 0; color: #555; font-size: 13px; font-weight: 600; }
.woocommerce-order-details__title, .woocommerce-column__title { font-size: 18px; font-weight: 700; }
/* Trang cảm ơn */
.woocommerce .woocommerce-order .woocommerce-thankyou-order-received { margin: 0 0 16px; padding: 14px 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; color: #166534; font-size: 16px; font-weight: 600; }
.woocommerce .woocommerce-order ul.woocommerce-order-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 0; margin: 0 0 20px; padding: 14px 0; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; list-style: none; }
.woocommerce .woocommerce-order ul.woocommerce-order-overview::before, .woocommerce .woocommerce-order ul.woocommerce-order-overview::after { display: none; }
.woocommerce .woocommerce-order ul.woocommerce-order-overview li { float: none; margin: 0; padding: 0 16px; border: 0; color: #666; font-size: 12px; text-transform: none; }
.woocommerce .woocommerce-order ul.woocommerce-order-overview li strong { display: block; margin-top: 4px; color: #1e1e1e; font-size: 15px; overflow-wrap: anywhere; }
.woocommerce .woocommerce-order ul.woocommerce-order-overview li.total strong { color: var(--mab-sale, #e11d48); font-size: 18px; font-weight: 800; }
.woocommerce .woocommerce-customer-details address { padding: 14px 16px; background: #f7f8fa; border: 0; border-radius: 10px; font-style: normal; line-height: 1.6; }
/* Form rút gọn chỉ có một địa chỉ */
.mab-checkout-simple .woocommerce-customer-details .woocommerce-column--shipping-address { display: none; }
.mab-checkout-simple .woocommerce-customer-details .woocommerce-column--billing-address { float: none; width: 100%; }
@media (max-width: 767px) {
    .woocommerce .woocommerce-result-count { float: none; margin: 0 0 8px; line-height: 1.4; }
    .woocommerce .woocommerce-ordering { float: none; }
    .woocommerce .woocommerce-ordering select.orderby { width: 100%; }
    .woocommerce-account #customer_login { grid-template-columns: minmax(0, 1fr); }
    .woocommerce-account.logged-in .woocommerce { grid-template-columns: minmax(0, 1fr); }
    .woocommerce-account .woocommerce-MyAccount-navigation ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .woocommerce-account .woocommerce-MyAccount-navigation a { padding: 8px 10px; font-size: 13px; }
    .woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { box-shadow: inset 0 -2px 0 var(--mab-accent, #2271b1); }
    .woocommerce-account .woocommerce .woocommerce-MyAccount-content { padding: 16px; }
    .woocommerce-account .woocommerce form.login, .woocommerce-account .woocommerce form.register, .woocommerce-account .woocommerce form.lost_reset_password { padding: 16px; }
}
