/* ============================================================
   XGO Care — giao diện GỌN cho điện thoại (nạp với media="(max-width: 767px)", xem inc/enqueue.php).
   Mục tiêu: bớt rối cho người dùng Việt trên điện thoại — ít thứ ghim trên đầu, điều hướng ở đáy (ngón cái với tới),
   thẻ sản phẩm gọn, trang chủ ngắn hơn, trang sản phẩm bớt lặp.
   Tệp này chỉ áp dụng ≤767px nên không thể ảnh hưởng máy tính. Gỡ tệp này (và dòng enqueue) là trở về như cũ.
   Nạp SAU ux.css / blog.css nên thắng khi cùng độ ưu tiên; các luật dùng tiền tố `body` cho chắc.
   ============================================================ */

/* ---------- 1. Thanh khuyến mãi: 1 dòng ---------- */
body .promo-bar__inner { min-height: 0; padding-top: 0; padding-bottom: 0; }
body .promo-bar__tag, body .promo-bar__note, body .promo-bar__cta { display: none; }
body .promo-bar__msg { max-width: 100%; padding: 6px 0; font-size: 12px; line-height: 1.3; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }

/* ---------- 2. Header: 1 hàng = logo + ô tìm kiếm + giỏ hàng (trước đây 169px, 2 hàng + hàng chip) ---------- */
body .site-header .header-main { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 8px 0; }
body .header-main .brand-box { order: 0; flex: none; }
body .header-main .brand-box img { height: 30px; }
body .header-main form.search { order: 1; flex: 1 1 0; width: auto; min-width: 0; padding: 3px 4px 3px 12px; }
body .header-main form.search button { min-height: 36px; min-width: 40px; padding: 6px 10px; }
/* Trang Tài khoản: luật `.woocommerce-account form input` (shop.css) áp viền + đệm lên cả ô tìm kiếm ở header, làm header cao 66px thay vì 58px. */
body.woocommerce-account .header-main form.search input[type=search] { border: 0; border-radius: 0; padding: 1px 2px; min-height: 0; }
body .header-main .header-actions { order: 2; margin-left: 0; flex: none; }
/* Điểm bán · tài khoản · yêu thích đã chuyển xuống thanh đáy / ngăn kéo "Danh mục"; giỏ hàng (.h-cart-wrap) ở lại. */
body .header-actions > .h-action { display: none; }
/* Hàng chip danh mục (chỉ thấy 2 chip, phải vuốt ngang) → thay bằng mục "Danh mục" ở thanh đáy. */
body .cat-bar { display: none; }
/* Cụm ghim ngắn lại nên khoảng đệm cho neo/focus cũng ngắn lại (shop.css đặt 176px cho header cũ). */
html:not(:has(.article-main)) { scroll-padding-top: 76px; }

/* ---------- 3. Thanh điều hướng đáy ---------- */
body .xgo-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(20, 40, 80, .08); padding-bottom: env(safe-area-inset-bottom); }
.xgo-tabbar__item { flex: 1 1 0; min-width: 0; min-height: 56px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.xgo-tabbar__item svg { width: 24px; height: 24px; flex: none; }
.xgo-tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xgo-tabbar__item[aria-current="page"], .xgo-tabbar__item.is-current, .xgo-tabbar__item.is-open { color: var(--blue); }
.xgo-tabbar__item:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; border-radius: 10px; }
/* Chừa chỗ cho thanh đáy; ẩn ở trang sản phẩm (có thanh "Mua ngay"), thanh toán (tập trung đặt hàng) và khi đang gõ (bàn phím). */
body:not(.single-product):not(.woocommerce-checkout):has(.xgo-tabbar) { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
body.single-product .xgo-tabbar, body.woocommerce-checkout .xgo-tabbar, body.is-typing .xgo-tabbar, body.xgo-modal-open .xgo-tabbar, html.is-cat-drawer-open .xgo-tabbar { display: none; }

/* Nút liên hệ nổi → tờ "Liên hệ" mở từ mục "Liên hệ" ở thanh đáy (3 ô: Zalo, Messenger, Gọi điện). Trang sản phẩm giữ nút tròn cũ. */
body:not(.single-product) .xgo-contact { left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); }
body:not(.single-product) .xgo-contact > summary { display: none; }
body:not(.single-product) .xgo-contact[open] .xgo-float { position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: 0 8px 30px rgba(14, 27, 58, .22); }
body:not(.single-product) .xgo-contact[open] .xgo-float__btn { width: auto; height: auto; padding: 12px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-decoration: none; }
body:not(.single-product) .xgo-contact[open] .xgo-float__btn::after { content: attr(aria-label); font-size: 12px; font-weight: 700; line-height: 1.2; }
body:not(.single-product) .xgo-contact[open] .xgo-float__ring { display: none; }

/* ---------- 4. Dải tiêu đề trang gọn (breadcrumb + H1) ---------- */
body .breadcrumb .container { padding: 8px 0; }
body .page-head .container { padding: 12px 0 10px; }
body .page-head h1 { font-size: 1.3rem; margin: 0 0 4px; line-height: 1.3; }
body .page-head p { font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 5. Thẻ sản phẩm gọn: bỏ nút chữ rộng, giỏ hàng thành nút tròn ở góc ---------- */
body .pcard__flag, body .xgo-quickview-btn { display: none; }
body .pcard__media { padding: 8px; }
body .pcard__body { padding: 2px 10px 12px; gap: 5px; }
body .pcard__name { font-size: .88rem; min-height: 2.6em; }
body .pcard__price { min-height: 40px; align-items: center; padding-right: 46px; }
body .pcard__actions { position: absolute; right: 8px; bottom: 8px; width: auto; margin: 0; display: block; }
body .pcard__actions .pcard__detail { display: none; }
body .pcard__actions .added_to_cart { display: none; }
/* Các lưới WooCommerce (cửa hàng, danh mục, liên quan) có luật nút riêng ở ux.css với độ ưu tiên cao hơn: lặp lại bộ chọn tương đương. */
body .pcard__actions .button, body .prod-rail:not(.is-grid) .pcard__actions .button,
body.woocommerce ul.products li.product .pcard__actions .button:not(.xgo-view-detail) { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 0; gap: 0; }
body .pcard__actions .button::before, body .prod-rail:not(.is-grid) .pcard__actions .button::before,
body.woocommerce ul.products li.product .pcard__actions .button:not(.xgo-view-detail)::before { display: block; width: 20px; height: 20px; }

/* ---------- 6. Trang chủ ngắn hơn ---------- */
body .section { padding-top: 16px; padding-bottom: 16px; }
body .home-stage + .section { padding-top: 14px; padding-bottom: 0; }
body .block { padding: 14px; }
/* Thẻ "Ưu đãi Giáng Sinh cho cả nhà": mã MEBE10 đã có ở thanh trên cùng và ngay trong banner. */
body .xgo-mobile-promo { display: none; }
/* 4 ưu điểm: lưới 2x2 gọn hơn (~80px thay vì ~115px), vẫn thấy đủ 4 mục, không cần vuốt ngang. */
body .service-strip { display: grid; grid-template-columns: 1fr 1fr; }
body .service-strip .item { padding: 8px 10px; gap: 8px; border-right: 0; }
body .service-strip .item:nth-child(odd) { border-right: 1px solid var(--line); }
body .service-strip .item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
body .service-strip .ic { width: 26px; height: 26px; flex: 0 0 26px; }
body .service-strip .item b { font-size: 12px; line-height: 1.3; }
/* Nút "Xem chứng nhận & công bố sản phẩm" (trang chủ) dài hơn khung chứa: trên màn 360px làm trang rộng thêm 8px, lắc ngang. Cho xuống dòng. */
body .home-certs .btn { white-space: normal; text-align: center; max-width: 100%; box-sizing: border-box; }
/* "Danh mục nổi bật": lưới 4 biểu tượng nhỏ thay vì thẻ to xếp 2 cột (đã có ngăn kéo Danh mục). */
body .featcat-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
body .featcat { padding: 10px 4px; border-radius: 12px; }
body .featcat .ic { width: 40px; height: 40px; margin: 0 auto 6px; }
body .featcat .ic svg { width: 20px; height: 20px; }
body .featcat b { font-size: .74rem; line-height: 1.25; }
body .featcat span { display: none; }

/* ---------- 7. Trang sản phẩm: bớt lặp ---------- */
/* 4 viên cam kết lặp lại danh sách .pdp-trust ngay phía trên (chính hãng, đổi trả, freeship). */
body.single-product .pdp-guarantee { display: none !important; } /* !important: ux.css đặt display:grid với độ ưu tiên cao hơn */
/* Tiêu đề "Đánh giá" lồng trong khối đã có tiêu đề "Đánh giá sản phẩm". */
body .woocommerce-Reviews-title { display: none; }
/* Mô tả dài (~2.000px): gập lại, nút "Xem thêm" do main.js thêm. */
body .pdp-section.xgo-clamp { max-height: 560px; overflow: hidden; position: relative; }
body .pdp-section.xgo-clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 130px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 72%); pointer-events: none; }
body .xgo-clamp__btn { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; min-height: 44px; padding: 10px 22px; border: 1.5px solid var(--blue); border-radius: 999px; background: #fff; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- 8. Thanh toán (chỉ trình bày, không đụng trường/logic) ---------- */
/* Đầu trang tập trung: bỏ ô tìm kiếm + giỏ hàng, thêm dòng "Thanh toán an toàn". */
body.woocommerce-checkout .header-main form.search, body.woocommerce-checkout .h-cart-wrap { display: none; }
body.woocommerce-checkout .header-main::after { content: "Thanh toán an toàn"; margin-left: auto; color: #fff; font-size: 13px; font-weight: 700; }
/* Thứ tự hiển thị Họ → Tên đúng với thứ tự trong form (trước đây: Tên bên trái, Họ bên phải, còn phím Tab đi Họ trước). */
body #billing_last_name_field { float: left; }
body #billing_first_name_field { float: right; }

/* ---------- 9. Chân trang ---------- */
body .foot-top .container { padding-top: 24px; padding-bottom: 24px; }
