/*
 * Shop v2 — giỏ hàng + thanh toán: bố cục theo pgfasia, màu + điểm nhấn Tru-Life (bảng màu --tl-*).
 * Chỉ áp khi body.tlv2-on. Markup + logic WooCommerce của theme giữ nguyên.
 */

body.tlv2-on {
  --tlv2-border: #e6e6e3;
  --tlv2-line: #d9d9d6;
  --tlv2-muted: #6b6b6b;
  --tlv2-radius: 12px;
}

/* ================= Thanh bước ================= */
.tlv2-steps { display: flex; max-width: 620px; margin: 8px auto 28px; padding: 0; list-style: none; }
.tlv2-steps__item { position: relative; flex: 1 1 0; color: var(--tlv2-muted); font-size: 14px; font-weight: 600; text-align: center; }
.tlv2-steps__item a { color: inherit; text-decoration: none; }
.tlv2-steps__item::before {
  content: "";
  position: absolute;
  top: 16px;
  left: calc(-50% + 22px);
  right: calc(50% + 22px);
  height: 2px;
  background: var(--tlv2-border);
}
.tlv2-steps__item:first-child::before { display: none; }
.tlv2-steps__item.is-done::before,
.tlv2-steps__item.is-current::before { background: var(--tl-primary, #dc4d28); }
.tlv2-steps__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border: 2px solid var(--tlv2-border);
  border-radius: 50%;
  background: #fff;
  font-weight: 700;
}
.tlv2-steps__item.is-current { color: var(--tl-heading, #1f2937); }
.tlv2-steps__item.is-current .tlv2-steps__dot { border-color: var(--tl-primary, #dc4d28); background: var(--tl-primary, #dc4d28); color: #fff; }
.tlv2-steps__item.is-done { color: var(--tl-primary, #dc4d28); }
.tlv2-steps__item.is-done .tlv2-steps__dot { border-color: var(--tl-primary, #dc4d28); color: var(--tl-primary, #dc4d28); }

/* Biến thể breadcrumb (trang thanh toán): Giỏ hàng › Thông tin giao hàng › Hoàn tất */
.tlv2-steps--crumb { flex-wrap: wrap; justify-content: flex-start; gap: 4px 0; max-width: none; margin: 0 0 24px; }
.tlv2-steps--crumb .tlv2-steps__item { display: flex; flex: 0 0 auto; align-items: center; font-size: 14px; text-align: left; }
.tlv2-steps--crumb .tlv2-steps__item::before { display: none; }
.tlv2-steps--crumb .tlv2-steps__item:not(:last-child)::after { content: "›"; margin: 0 10px; color: var(--tlv2-muted); font-size: 18px; line-height: 1; }
.tlv2-steps--crumb .tlv2-steps__dot { display: none; }
.tlv2-steps--crumb .tlv2-steps__item.is-done a:hover { text-decoration: underline; }

/* ================= GIỎ HÀNG — số đo lấy từ CSS trang mẫu pgfasia (style-themes.scss.css), màu Tru-Life ================= */
body.tlv2-on .cart-page {
  --pg-text: #252a2b;
  --pg-border: #e7e7e7;
  --pg-line: #f1f1f1;
  --pg-price: #8f9bb3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 33.333%;
  gap: 0 15px;
  align-items: start;
  padding: 15px 0 48px;
  background: transparent;
  color: var(--pg-text);
  font-size: 14px;
  line-height: 1.45;
}

/* Khung trái: tiêu đề 20px + kẻ ngăn, nội dung đệm 15px */
body.tlv2-on .cart-page__header {
  grid-column: 1;
  margin: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: #fff;
  text-align: left;
}
body.tlv2-on .cart-page__title {
  margin: 0 -15px 15px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--pg-border);
  color: var(--tl-primary-dark, #b83d1f);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
body.tlv2-on .cart-page__subtitle { margin: 0 0 15px; color: var(--pg-text); font-size: 16px; font-weight: 400; }
body.tlv2-on .cart-page__subtitle strong { font-weight: 700; }
body.tlv2-on .woocommerce-cart-form {
  grid-column: 1;
  min-width: 0;
  padding: 0 15px 15px;
  border: 0;
  border-radius: 0;
  background: #fff;
}
body.tlv2-on .cart-table-wrapper { margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }

/* Danh sách: 1 khung chung viền 2px bo 8px, các dòng ngăn bằng kẻ mảnh */
body.tlv2-on .cart-table { display: block; width: 100%; }
body.tlv2-on .cart-table thead { display: none; }
body.tlv2-on .cart-table tbody { display: block; padding: 8px 10px; border: 2px solid var(--pg-border); border-radius: 8px; background: #fff; }
body.tlv2-on .cart-table__row {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  grid-template-areas:
    "img name subtotal"
    "img unit qty"
    "img vat  qty";
  align-items: start;
  gap: 2px 18px;
  margin: 0;
  padding: 15px 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.tlv2-on .cart-table__row + .cart-table__row { border-top: 1px solid var(--pg-line); }
body.tlv2-on .cart-table__row:hover { background: transparent; }
body.tlv2-on .cart-table__td { display: block; padding: 0; border: 0; text-align: left; }
body.tlv2-on .cart-table__td::before { display: none; }
body.tlv2-on .cart-table__td--product,
body.tlv2-on .cart-table__td--product .cart-product { display: contents; }
body.tlv2-on .cart-table__td--price { display: none; }
body.tlv2-on .cart-product__image { grid-area: img; width: 80px; height: 80px; border: 1px solid #ededed; border-radius: 0; overflow: hidden; background: #fff; }
body.tlv2-on .cart-product__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.tlv2-on .cart-product__info { grid-area: name; padding: 0; }
body.tlv2-on .cart-product__name {
  display: -webkit-box;
  margin: 0 0 2px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  color: var(--pg-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
body.tlv2-on .cart-product__name:hover { color: var(--tl-primary, #dc4d28); }
body.tlv2-on .cart-table__td--final-price { grid-area: unit; }
body.tlv2-on .cart-final-price { display: block; color: var(--pg-price); font-size: 14px; font-weight: 600; text-align: left; }
body.tlv2-on .cart-table__td--vat { grid-area: vat; }
body.tlv2-on .cart-vat { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
body.tlv2-on .cart-vat__percentage { padding: 0 5px; border-radius: 3px; font-size: 11px; font-weight: 700; }
body.tlv2-on .cart-vat__amount { color: #777; font-size: 12px; font-weight: 500; }
body.tlv2-on .cart-table__td--subtotal { grid-area: subtotal; text-align: right; }
body.tlv2-on .cart-subtotal { color: var(--pg-text); font-size: 15px; font-weight: 600; white-space: nowrap; }
body.tlv2-on .cart-table__td--quantity { grid-area: qty; grid-row: 2 / span 2; align-self: end; justify-self: end; }
body.tlv2-on .cart-table__td--quantity .quantity { margin: 8px 0 3px; }

/* Nút xoá: vị trí lệch góc ảnh như mẫu, đậm + viền trắng cho dễ nhìn trên ảnh nền tối */
body.tlv2-on .cart-table__td--remove { position: absolute; top: 8px; left: 0; z-index: 2; }
body.tlv2-on .cart-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4b5563;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  color: #fff;
  transition: background-color .2s ease, transform .2s ease;
}
/* SVG ×: theme đặt stroke xám #9ca3af + WooCommerce tô a.remove đỏ → ép nét trắng, đậm, căn giữa */
body.tlv2-on .cart-table__td--remove a.cart-remove,
body.tlv2-on .cart-table__td--remove a.cart-remove:hover { color: #fff !important; font-size: 0 !important; line-height: 0 !important; text-decoration: none !important; }
body.tlv2-on .cart-table__td--remove a.cart-remove svg {
  display: block;
  width: 10px !important;
  height: 10px !important;
  stroke: #fff !important;
  stroke-width: 3.2 !important;
  stroke-linecap: round;
}
body.tlv2-on .cart-table__td--remove a.cart-remove:hover { background: var(--tl-primary, #dc4d28) !important; transform: scale(1.08); }

/* – 1 + : nút 28×28, ô số 36×28 */
.tlv2-qty { display: inline-flex; align-items: center; gap: 0; }
.tlv2-qty__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #f3f4f4;
  border-radius: 4px;
  background: #fff;
  color: var(--tl-heading, #1f2937);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.tlv2-qty__btn:hover { border-color: var(--tl-primary, #dc4d28); color: var(--tl-primary, #dc4d28); }
body.tlv2-on .cart-table__td--quantity .qty {
  width: 36px;
  height: 28px;
  margin: 0 3px;
  padding: 0;
  border: 1px solid #f3f4f4;
  border-radius: 4px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  -moz-appearance: textfield;
}
body.tlv2-on .tlv2-qty input.qty::-webkit-outer-spin-button,
body.tlv2-on .tlv2-qty input.qty::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

/* Hàng dưới danh sách: "Tiếp tục mua hàng"; có JS → ẩn nút "Cập nhật giỏ hàng" (vẫn giữ trong DOM để gửi form) */
body.tlv2-on .cart-table__actions { display: block; padding: 0; border: 0; background: transparent; }
body.tlv2-on .cart-table__actions td { display: block; padding: 12px 0 0; }
body.tlv2-on .cart-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
body.tlv2-on .cart-actions__continue { padding: 0; border: 0; background: none; color: var(--tl-primary, #dc4d28); font-size: 14px; font-weight: 500; }
body.tlv2-on .cart-actions__continue:hover { background: none; color: var(--tl-primary-dark, #b83d1f); }
body.tlv2-on .cart-actions__update { height: 36px; padding: 0 14px; border: 1px solid var(--tl-primary, #dc4d28); border-radius: 4px; background: #fff; color: var(--tl-primary, #dc4d28); box-shadow: none; font-size: 14px; }
html.js body.tlv2-on .cart-actions__update { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.tlv2-on .cart-table__actions { padding: 0 10px 7px; border-top: 1px solid var(--pg-line); }

/* Mã giảm giá + ưu đãi (không có ở mẫu — giữ chức năng Tru-Life, cùng kiểu khung) */
body.tlv2-on .cart-coupon-section { grid-column: 1; display: grid; gap: 15px; margin: 15px 0 0; }
body.tlv2-on .custom-coupon-form,
body.tlv2-on .available-coupons-section { margin: 0; padding: 15px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
body.tlv2-on .custom-coupon-form__title,
body.tlv2-on .available-coupons__title { font-size: 14px; font-weight: 600; }
body.tlv2-on .custom-coupon-form__input { height: 40px; border: 1px solid var(--pg-border); border-radius: 4px; font-size: 14px; }
body.tlv2-on .custom-coupon-form__button { height: 40px; border-radius: 4px; background: var(--tl-primary, #dc4d28); font-size: 14px; }
/* cart.css cũ ép ô nhập min-height 48px + viền 2px + bo 8px (!important) → ô cao hơn nút, lệch mép dưới; bóng cam khi rê chuột. */
body.tlv2-on .cart-coupon-section .woocommerce-form-coupon .custom-coupon-form__input { min-height: 0 !important; height: 40px; border: 1px solid var(--pg-border) !important; border-radius: 4px !important; font-size: 14px !important; }
body.tlv2-on .custom-coupon-form__input-group { align-items: stretch; }
body.tlv2-on .custom-coupon-form__button { flex-shrink: 0; }
body.tlv2-on .cart-coupon-section .woocommerce-form-coupon:hover { box-shadow: none; }
@media (max-width: 640px) {
  /* ô + nút xếp dọc: ô giữ đủ 40px, không bị flex:1 co lại */
  body.tlv2-on .cart-coupon-section .woocommerce-form-coupon .custom-coupon-form__input { flex: 0 0 auto; }
}

/* Cột phải: Thông tin đơn hàng */
body.tlv2-on .cart-collaterals-wrapper { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 100px; margin: 0; }
body.tlv2-on .cart-collaterals { display: block; }
body.tlv2-on .cart-totals {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0 0 15px;
  padding: 15px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
body.tlv2-on .cart-totals__title { margin: 10px 0 15px; padding: 0; border: 0; color: var(--tl-primary-dark, #b83d1f); font-size: 20px; font-weight: 700; line-height: 1.2; }
body.tlv2-on .cart-totals__row,
body.tlv2-on .cart-totals__row--vat { margin: 0; padding: 4px 0; border: 0; border-radius: 0; background: none; color: #555; font-size: 14px; }
body.tlv2-on .cart-totals__value { color: var(--pg-text); font-size: 14px; font-weight: 600; }
/* "Tổng cộng:" trước giảm giá trùng tổng cuối khi không có mã/phí → ẩn cho khỏi lặp. */
body.tlv2-on .cart-totals__wrapper:not(:has(.cart-totals__row--coupon, .cart-totals__row--fee)) .cart-totals__row--subtotal { display: none; }
body.tlv2-on .cart-totals__row--total {
  align-items: center;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px dotted #dfe0e1;
  border-bottom: 1px dotted #dfe0e1;
}
body.tlv2-on .cart-totals__row--total .cart-totals__label { color: var(--pg-text); font-size: 16px; font-weight: 700; }
body.tlv2-on .cart-totals__value--total { color: var(--tl-primary, #dc4d28); font-size: 24px; font-weight: 700; }
body.tlv2-on .cart-totals__checkout { display: flex; flex-direction: column; margin: 0; padding-top: 5px; }
body.tlv2-on .tlv2-cart-note { order: -1; margin: 0; padding: 0; list-style: none; text-align: left; }
body.tlv2-on .tlv2-cart-note li { position: relative; margin: 0 0 4px; padding-left: 15px; color: var(--pg-text); font-size: 14px; font-weight: 400; line-height: 1.45; }
body.tlv2-on .tlv2-cart-note li::before { content: ""; position: absolute; top: 8px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #999; }
body.tlv2-on .cart-totals__checkout .checkout-button {
  display: block;
  width: 100%;
  min-height: 0;
  margin-top: 12px;
  padding: 10px 5px;
  border-radius: 4px;
  background: var(--tl-primary, #dc4d28);
  box-shadow: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}
/* cart.css/checkout.css cũ ép .checkout-button bằng !important (17px, đệm 18px, đổ bóng) */
body.tlv2-on .cart-totals__checkout .checkout-button {
  padding: 10px 5px !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  transform: none !important;
}
body.tlv2-on .cart-totals__checkout .checkout-button:hover { background: var(--tl-primary-dark, #b83d1f) !important; box-shadow: none !important; transform: none !important; }

.tlv2-policy { margin: 0; padding: 12px 15px; border: 1px solid color-mix(in srgb, var(--tl-accent, #bcc647) 45%, #fff); border-radius: 4px; background: color-mix(in srgb, var(--tl-accent, #bcc647) 12%, #fff); }
.tlv2-policy__title { margin: 0 0 5px; color: var(--tl-heading, #1f2937); font-size: 14px; font-weight: 700; }
.tlv2-policy__body { color: #252a2b; font-size: 14px; line-height: 1.45; }
.tlv2-policy__body p { margin: 0 0 5px; }
.tlv2-policy__body p:last-child { margin-bottom: 0; }

@media (max-width: 991px) {
  body.tlv2-on .cart-page { grid-template-columns: minmax(0, 1fr); }
  body.tlv2-on .cart-collaterals-wrapper { grid-column: 1; grid-row: auto; position: static; margin-top: 15px; }
}
@media (max-width: 640px) {
  body.tlv2-on .cart-page__header,
  body.tlv2-on .woocommerce-cart-form { padding-left: 10px; padding-right: 10px; }
  body.tlv2-on .cart-page__title { margin: 0 -10px 15px; padding: 10px; }
  body.tlv2-on .cart-table tbody { padding: 5px; }
  body.tlv2-on .cart-table__row {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    grid-template-areas:
      "img      name     name"
      "img      unit     unit"
      "img      vat      vat"
      "subtotal subtotal qty";
    gap: 2px 8px;
    padding: 15px 5px;
  }
  body.tlv2-on .cart-product__image { width: 60px; height: 60px; }
  body.tlv2-on .cart-product__name { font-size: 14px; }
  body.tlv2-on .cart-table__td--quantity { grid-row: auto; }
  body.tlv2-on .cart-table__td--subtotal { align-self: center; text-align: left; }
}

/* ================= THANH TOÁN — theo checkout Shopify của pgfasia (màu chủ đạo Tru-Life) ================= */
body.tlv2-checkout-focus {
  --sh-text: #545454;
  --sh-strong: #333;
  --sh-label: #737373;
  --sh-border: #d9d9d9;
  --sh-side: #fafafa;
  --sh-side-line: #e1e1e1;
  --sh-divider: rgba(175, 175, 175, .34);
  --sh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
/* Ẩn header/footer/breadcrumb site → trang thanh toán tập trung như Shopify */
body.tlv2-checkout-focus #tru-header,
body.tlv2-checkout-focus .tru-drill-container,
body.tlv2-checkout-focus footer.footer,
body.tlv2-checkout-focus .woocommerce-breadcrumb-section { display: none !important; }
body.tlv2-checkout-focus,
body.tlv2-checkout-focus .tru-main-content,
body.tlv2-checkout-focus .woocommerce-page-wrapper,
body.tlv2-checkout-focus .checkout-page { background: #fff; }
body.tlv2-checkout-focus .tru-main-content { padding-top: 0 !important; margin-top: 0 !important; }
body.tlv2-checkout-focus .woocommerce-page-content .container { max-width: 1140px !important; }
body.tlv2-checkout-focus .checkout-page {
  min-height: 100vh;
  padding: 0;
  font-family: var(--sh-font);
  font-size: 14px;
  line-height: 1.3;
  color: var(--sh-text);
}
body.tlv2-checkout-focus .checkout-page *:not(svg):not(path) { font-family: inherit; }
body.tlv2-checkout-focus .checkout-page__header { display: none; }
body.tlv2-checkout-focus form.checkout { min-height: 100vh; }
body.tlv2-checkout-focus .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 44%; gap: 0; align-items: stretch; min-height: 100vh; }

/* ---- Cột trái ---- */
body.tlv2-checkout-focus .checkout-layout__main { display: block; padding: 56px 6% 56px 0; }
.tlv2-checkout-brand { display: inline-block; margin: 0 0 20px; color: var(--sh-strong, #333); font-size: 28px; line-height: 1.2; text-decoration: none; }
.tlv2-checkout-brand img { display: block; width: auto; height: 52px; }
body.tlv2-checkout-focus .tlv2-steps--crumb { margin: 0 0 32px; }
body.tlv2-checkout-focus .tlv2-steps--crumb .tlv2-steps__item { color: var(--sh-label); font-size: 12px; font-weight: 400; }
body.tlv2-checkout-focus .tlv2-steps--crumb .tlv2-steps__item.is-done { color: var(--tl-primary, #dc4d28); }
body.tlv2-checkout-focus .tlv2-steps--crumb .tlv2-steps__item.is-current { color: var(--sh-strong); font-weight: 500; }
body.tlv2-checkout-focus .tlv2-steps--crumb .tlv2-steps__item:not(:last-child)::after { margin: 0 8px; color: var(--sh-label); font-size: 14px; }

body.tlv2-checkout-focus .checkout-customer-details { display: block; }
body.tlv2-checkout-focus .checkout-section { margin: 0 0 40px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.tlv2-checkout-focus .checkout-section__title {
  display: block;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  color: var(--sh-strong);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
body.tlv2-checkout-focus .checkout-section__title::after,
body.tlv2-checkout-focus .checkout-section__number { display: none; }
body.tlv2-checkout-focus .checkout-section__content { padding: 0; }

/* Lưới trường: Họ | Tên — Email (2/3) | Điện thoại (1/3) — Địa chỉ — Tỉnh | Quận */
body.tlv2-checkout-focus .custom-checkout-fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row-group { display: contents; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row { grid-column: span 6; width: auto; margin: 0; padding: 0; float: none; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row-first,
body.tlv2-checkout-focus .custom-checkout-fields .form-row-last { grid-column: span 3; order: 0; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_email) { grid-column: span 4; order: 1; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_phone) { grid-column: span 2; order: 2; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_address_1) { order: 3; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_city),
body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_state) { grid-column: span 3; order: 4; }

/* Ô nhập Shopify + nhãn nổi */
body.tlv2-checkout-focus .checkout-section .form-row { position: relative; margin-bottom: 12px; }
body.tlv2-checkout-focus .custom-checkout-fields .form-row { margin-bottom: 0; }
body.tlv2-checkout-focus .checkout-section .input-text,
body.tlv2-checkout-focus .checkout-section select,
body.tlv2-checkout-focus .checkout-section textarea {
  display: block;
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 13px 11px;
  border: 1px solid var(--sh-border);
  border-radius: 5px;
  background-color: #fff;
  box-shadow: none;
  color: var(--sh-strong);
  font-size: 14px;
  line-height: 1.3;
  transition: border-color .2s ease, box-shadow .2s ease, padding .2s ease;
}
body.tlv2-checkout-focus .checkout-section textarea { min-height: 96px; }
body.tlv2-checkout-focus .checkout-section ::placeholder { color: var(--sh-label); opacity: 1; }
body.tlv2-checkout-focus .checkout-section .input-text:focus,
body.tlv2-checkout-focus .checkout-section select:focus,
body.tlv2-checkout-focus .checkout-section textarea:focus {
  border-color: var(--tl-primary, #dc4d28);
  box-shadow: 0 0 0 1px var(--tl-primary, #dc4d28);
  outline: none;
}
body.tlv2-checkout-focus .checkout-section select {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23737373'%3E%3Cpath d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 14px center;
}
body.tlv2-checkout-focus .checkout-section select:disabled { background-color: #fafafa; color: var(--sh-label); }

body.tlv2-checkout-focus .tlv2-field > label {
  position: absolute;
  top: 0;
  left: 1px;
  z-index: 1;
  margin: 0;
  padding: 7px 11px 0;
  color: var(--sh-label);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
body.tlv2-checkout-focus .tlv2-field > label .required { display: none; }
body.tlv2-checkout-focus .tlv2-field.is-filled > label { opacity: 1; transform: none; }
body.tlv2-checkout-focus .tlv2-field.is-filled .input-text,
body.tlv2-checkout-focus .tlv2-field.is-filled select,
body.tlv2-checkout-focus .tlv2-field.is-filled textarea { padding-top: 21px; padding-bottom: 5px; }
/* Không có JS → nhãn hiện bình thường phía trên ô */
html:not(.js) body.tlv2-checkout-focus .checkout-section .form-row > label { position: static; opacity: 1; transform: none; padding: 0 0 6px; }

/* Ô tick (Xuất hoá đơn VAT) */
body.tlv2-checkout-focus .checkout-section input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--tl-primary, #dc4d28); vertical-align: -3px; }
body.tlv2-checkout-focus .checkout-section .checkbox,
body.tlv2-checkout-focus .vat-checkbox-wrapper label { color: var(--sh-text); font-size: 14px; font-weight: 400; }
/* Mã số thuế + nút tra cứu: cùng hàng khi đủ chỗ, mobile xuống dòng (theme cũ ép nút min-width 200px → tràn trang). */
body.tlv2-checkout-focus .tax-code-input-group { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: stretch !important; gap: 10px !important; width: 100%; min-width: 0; }
body.tlv2-checkout-focus .tax-code-input-group .input-text { flex: 1 1 220px !important; width: auto !important; min-width: 0 !important; }
body.tlv2-checkout-focus .tax-code-input-group .tax-lookup-btn { flex: 0 0 auto !important; align-self: stretch !important; min-width: 0 !important; height: auto !important; min-height: 46px; padding: 0 20px !important; }
@media (max-width: 575px) {
  body.tlv2-checkout-focus .tax-code-input-group .tax-lookup-btn { flex: 1 1 100% !important; }
}
body.tlv2-checkout-focus .tax-lookup-btn {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 0;
  border-radius: 5px;
  background: var(--tl-primary, #dc4d28);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* ---- Cột phải: tóm tắt đơn ---- */
body.tlv2-checkout-focus .checkout-layout__sidebar {
  position: relative;
  top: auto; /* CSS cũ: sticky top:100px */
  padding: 56px 0 56px 4%;
  border-left: 1px solid var(--sh-side-line);
  background: var(--sh-side);
  box-shadow: 0 0 0 100vmax var(--sh-side);
  clip-path: inset(0 -100vmax 0 0);
}
body.tlv2-checkout-focus .checkout-order-review {
  position: sticky;
  top: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.tlv2-checkout-focus .checkout-order-review__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.tlv2-checkout-focus .order-items { margin: 0; padding: 0 0 20px; border-bottom: 1px solid var(--sh-divider); }
body.tlv2-checkout-focus .order-item { display: flex; align-items: center; gap: 14px; margin: 0; padding: 0 0 14px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.tlv2-checkout-focus .order-item:last-child { padding-bottom: 0; }
body.tlv2-checkout-focus .tlv2-order-thumb { position: relative; flex: 0 0 64px; width: 64px; height: 64px; }
body.tlv2-checkout-focus .tlv2-order-thumb img { width: 64px; height: 64px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; background: #fff; object-fit: cover; }
body.tlv2-checkout-focus .tlv2-order-thumb__qty {
  position: absolute;
  top: -.75em;
  right: -.75em;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 .58em;
  border: 2px solid #fff;
  border-radius: 1.75em;
  background: var(--tl-heading, #1f2937);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  line-height: calc(1.75em - 4px);
  box-sizing: border-box;
}
body.tlv2-checkout-focus .order-item__name { color: #323232; font-size: 14px; font-weight: 500; line-height: 1.35; }
body.tlv2-checkout-focus .order-item__vat-badge { margin-left: 4px; color: var(--sh-label); font-size: 12px; font-weight: 400; background: none; padding: 0; }
body.tlv2-checkout-focus .order-item__quantity { display: none; }
body.tlv2-checkout-focus .order-item__price { color: #323232; font-size: 14px; font-weight: 500; white-space: nowrap; }

/* Mã giảm giá */
.tlv2-coupon { padding: 20px 0; border-bottom: 1px solid var(--sh-divider, rgba(175,175,175,.34)); }
.tlv2-coupon__row { display: flex; gap: 10px; }
.tlv2-coupon__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 11px;
  border: 1px solid var(--sh-border, #d9d9d9);
  border-radius: 5px;
  background: #fff;
  color: var(--sh-strong, #333);
  font-size: 14px;
}
.tlv2-coupon__input:focus { border-color: var(--tl-primary, #dc4d28); box-shadow: 0 0 0 1px var(--tl-primary, #dc4d28); outline: none; }
.tlv2-coupon__btn {
  flex: 0 0 auto;
  padding: 0 22px;
  border: 0;
  border-radius: 5px;
  background: #c8c8c8;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease;
}
.tlv2-coupon.has-value .tlv2-coupon__btn { background: var(--tl-primary, #dc4d28); }
.tlv2-coupon.is-loading .tlv2-coupon__btn { opacity: .6; cursor: progress; }
.tlv2-coupon__msg:empty { display: none; }
.tlv2-coupon__msg { margin-top: 10px; font-size: 13px; }
.tlv2-coupon__msg ul { margin: 0; padding: 0; list-style: none; border: 0; background: none; }
.tlv2-coupon__msg .woocommerce-error { color: #e32c2b; }
.tlv2-coupon__msg .woocommerce-message { color: #2e7d32; }
.tlv2-no-coupon .tlv2-coupon { display: none; }

/* Dòng tổng */
body.tlv2-checkout-focus .order-totals { padding: 16px 0 0; border: 0; background: transparent; }
body.tlv2-checkout-focus .order-total-row,
body.tlv2-checkout-focus .order-total-row--vat {
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #535353;
  font-size: 14px;
}
body.tlv2-checkout-focus .order-total-row__value { color: #323232; font-weight: 500; }
body.tlv2-checkout-focus .order-total-row--final { margin-top: 14px; padding: 18px 0 0; border-top: 1px solid var(--sh-divider); align-items: center; }
body.tlv2-checkout-focus .order-total-row--final::before,
body.tlv2-checkout-focus .order-total-row--final::after { display: none; }
body.tlv2-checkout-focus .order-total-row--final .order-total-row__label { color: #323232; font-size: 16px; font-weight: 400; }
body.tlv2-checkout-focus .order-total-row--final .order-total-row__value { color: #323232; font-size: 24px; font-weight: 500; letter-spacing: -.04em; }
body.tlv2-checkout-focus .order-total-row--final .order-total-row__value::before {
  content: "VND";
  margin-right: .6em;
  color: #717171;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  vertical-align: .2em;
}

/* Phương thức thanh toán (khung radio kiểu Shopify) + nút đặt hàng */
body.tlv2-checkout-focus #payment { margin-top: 28px; padding: 0; border-radius: 0; background: transparent; }
body.tlv2-checkout-focus #payment ul.payment_methods { margin: 0 0 20px; padding: 0; border: 1px solid var(--sh-border); border-radius: 5px; background: #fff; overflow: hidden; }
body.tlv2-checkout-focus #payment ul.payment_methods li { margin: 0; padding: 16px; border: 0; border-top: 1px solid var(--sh-border); border-radius: 0; background: #fff; box-shadow: none; }
body.tlv2-checkout-focus #payment ul.payment_methods li:first-child { border-top: 0; }
body.tlv2-checkout-focus #payment ul.payment_methods li label { color: var(--sh-text); font-size: 14px; font-weight: 400; }
body.tlv2-checkout-focus #payment ul.payment_methods li input[type="radio"] { accent-color: var(--tl-primary, #dc4d28); }
body.tlv2-checkout-focus #payment .payment_box { margin: 14px -16px -16px; padding: 14px 16px; border: 0; border-top: 1px solid var(--sh-border); border-radius: 0; background: var(--sh-side); color: var(--sh-text); font-size: 14px; }
body.tlv2-checkout-focus #payment .payment_box::before { display: none; }
body.tlv2-checkout-focus #payment .place-order { margin: 0; padding: 0; border: 0; background: transparent; }
body.tlv2-checkout-focus #place_order {
  width: 100%;
  min-height: 0;
  padding: 19px 24px;
  border: 0;
  border-radius: 5px;
  background: var(--tl-primary, #dc4d28);
  box-shadow: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}
body.tlv2-checkout-focus #place_order:hover { background: var(--tl-primary-dark, #b83d1f); }
body.tlv2-checkout-focus .woocommerce-privacy-policy-text,
body.tlv2-checkout-focus .woocommerce-terms-and-conditions-wrapper { color: var(--sh-label); font-size: 12px; }

/* ---- Lớp ghi đè: checkout.css cũ của theme dùng rất nhiều !important (kể cả selector #id) ---- */
body.tlv2-checkout-focus .custom-checkout-fields .form-row-group { display: contents !important; }
body.tlv2-checkout-focus .checkout-section :is(.form-row, .form-row-wide, .form-row-first, .form-row-last, .vat-tax-code-row) {
  width: auto !important;
  margin-bottom: 12px !important;
  float: none !important;
}
body.tlv2-checkout-focus .custom-checkout-fields :is(.form-row, .form-row-wide, .form-row-first, .form-row-last) { margin-bottom: 0 !important; }
body.tlv2-checkout-focus .checkout-section .tlv2-field > label {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  color: var(--sh-label) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
body.tlv2-checkout-focus .checkout-section :is(input.input-text, select.select, select, textarea, #vat_company_name, #vat_tax_code, #vat_invoice_email, #vat_company_address, #billing_city, #billing_state) {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 13px 11px !important;
  border: 1px solid var(--sh-border) !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: var(--sh-strong) !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  text-transform: none !important;
  opacity: 1 !important;
  transition: border-color .2s ease, box-shadow .2s ease, padding .2s ease !important;
}
body.tlv2-checkout-focus .checkout-section :is(input, textarea)::placeholder { text-transform: none !important; color: var(--sh-label) !important; }
body.tlv2-checkout-focus .checkout-section :is(textarea, textarea.input-text) { min-height: 96px !important; resize: vertical !important; }
body.tlv2-checkout-focus .checkout-section :is(select.select, select, #billing_city, #billing_state) {
  padding-right: 36px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23737373'%3E%3Cpath d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 14px center !important;
  cursor: pointer !important;
}
body.tlv2-checkout-focus .checkout-section :is(select:disabled, #billing_state:disabled) { background-color: #fafafa !important; color: var(--sh-label) !important; cursor: not-allowed !important; }
body.tlv2-checkout-focus .checkout-section .tlv2-field.is-filled :is(input.input-text, select, textarea, #vat_company_name, #vat_tax_code, #vat_invoice_email, #vat_company_address, #billing_city, #billing_state) {
  padding-top: 21px !important;
  padding-bottom: 5px !important;
}
body.tlv2-checkout-focus .checkout-section :is(input.input-text, select, textarea, #vat_company_name, #vat_tax_code, #vat_invoice_email, #vat_company_address, #billing_city, #billing_state):focus {
  border-color: var(--tl-primary, #dc4d28) !important;
  box-shadow: 0 0 0 1px var(--tl-primary, #dc4d28) !important;
  outline: none !important;
}
body.tlv2-checkout-focus .vat-checkbox-wrapper label,
body.tlv2-checkout-focus .checkout-section label.checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  color: var(--sh-text) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}
body.tlv2-checkout-focus .tax-code-input-group { flex-direction: row !important; gap: 10px !important; align-items: stretch !important; width: 100% !important; }
body.tlv2-checkout-focus .tax-code-input-group #vat_tax_code { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; }
body.tlv2-checkout-focus .tax-code-input-group .tax-lookup-btn { flex: 0 0 auto !important; align-self: stretch !important; min-height: 46px; }
body.tlv2-checkout-focus :is(.tax-lookup-btn, button.tax-lookup-btn) {
  height: auto !important;
  padding: 0 20px !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transform: none !important;
}
body.tlv2-checkout-focus .order-total-row :is(.order-total-row__label, .order-total-row__value) { color: inherit !important; }
body.tlv2-checkout-focus .order-total-row .order-total-row__value { color: #323232 !important; }
body.tlv2-checkout-focus .order-total-row--final .order-total-row__label { color: #323232 !important; }
body.tlv2-checkout-focus .order-total-row__value--discount { color: #2e7d32 !important; font-weight: 500 !important; }
body.tlv2-checkout-focus .wc_payment_method .payment_box {
  width: auto !important;
  margin: 14px -16px -16px !important;
  padding: 14px 16px !important;
  border: 0 !important;
  border-top: 1px solid var(--sh-border) !important;
  border-radius: 0 !important;
  background: var(--sh-side) !important;
  box-shadow: none !important;
  color: var(--sh-text) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
body.tlv2-checkout-focus :is(#place_order, button#place_order) {
  padding: 19px 24px !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transform: none !important;
}
body.tlv2-checkout-focus :is(#place_order, button#place_order):hover { background: var(--tl-primary-dark, #b83d1f) !important; box-shadow: none !important; transform: none !important; }

body.tlv2-checkout-focus .tlv2-pay-title { margin: 32px 0 14px; color: var(--sh-strong); font-size: 18px; font-weight: 600; line-height: 1.3; }
body.tlv2-checkout-focus .tlv2-pay-title + #payment { margin-top: 0; }
body.tlv2-checkout-focus #payment ul.payment_methods { display: block !important; }
body.tlv2-checkout-focus #payment li.wc_payment_method > label {
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--sh-text) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

/* ================= Responsive ================= */
@media (max-width: 991px) {
  body.tlv2-checkout-focus .checkout-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  body.tlv2-checkout-focus form.checkout { min-height: 0; }
  body.tlv2-checkout-focus .checkout-layout__main { padding: 28px 0 8px; }
  body.tlv2-checkout-focus .checkout-layout__sidebar {
    margin: 0 -15px;
    padding: 24px 15px 32px;
    border-top: 1px solid var(--sh-side-line);
    border-left: 0;
    box-shadow: none;
    clip-path: none;
  }
  body.tlv2-checkout-focus .checkout-order-review { position: static; }
}
@media (max-width: 640px) {
  .tlv2-steps { margin-bottom: 20px; }
  .tlv2-steps__item { font-size: 12px; }
  body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_email),
  body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_phone),
  body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_city),
  body.tlv2-checkout-focus .custom-checkout-fields .form-row:has(#billing_state) { grid-column: span 6; }
  .tlv2-checkout-brand img { height: 44px; }
}

/* ---------- Giỏ hàng trống (templates/cart-empty.php) ---------- */
body.tlv2-on .woocommerce-cart .cart-empty.woocommerce-info,
body.tlv2-on .cart-empty.woocommerce-info { display: none; }
.tlv2-empty-cart { padding: 8px 0 48px; color: #252a2b; }
.tlv2-empty-cart__box {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 32px 32px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  text-align: center;
}
.tlv2-empty-cart__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--tl-primary-soft, #fff5f2);
  color: var(--tl-primary, #dc4d28);
  box-shadow: inset 0 0 0 1px var(--tl-primary-light, #fde9e3);
}
.tlv2-empty-cart__title { margin: 0 0 8px; font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--tl-heading, #1f2937); }
.tlv2-empty-cart__text { max-width: 440px; margin: 0 auto 24px; font-size: 15px; line-height: 1.6; color: #6b7280; }
.tlv2-empty-cart__actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tlv2-empty-cart__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 8px;
  background: var(--tl-primary, #dc4d28);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease;
}
.tlv2-empty-cart__btn:hover,
.tlv2-empty-cart__btn:focus-visible { background: var(--tl-primary-dark, #b83d1f); color: #fff; text-decoration: none; }
.tlv2-empty-cart__link { color: #6b7280; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.tlv2-empty-cart__link:hover { color: var(--tl-primary, #dc4d28); }
.tlv2-empty-cart__cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px dashed #e7e7e7; list-style: none; }
.tlv2-empty-cart__cats .tlv2-pill { padding: 7px 16px; font-size: 13px; letter-spacing: .04em; }

.tlv2.tlv2-empty-cart__suggest { margin-top: 40px; padding: 0; background: none; }
.tlv2-empty-cart__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tlv2-empty-cart__subtitle { margin: 0; font-size: 20px; font-weight: 700; color: var(--tl-heading, #1f2937); }
.tlv2-empty-cart__all { flex-shrink: 0; color: var(--tl-primary, #dc4d28); font-size: 14px; font-weight: 600; text-decoration: none; }
.tlv2-empty-cart__all:hover { text-decoration: underline; }

@media (max-width: 575px) {
  .tlv2-empty-cart { padding-bottom: 32px; }
  .tlv2-empty-cart__box { padding: 32px 18px 24px; }
  .tlv2-empty-cart__icon { width: 64px; height: 64px; margin-bottom: 14px; }
  .tlv2-empty-cart__title { font-size: 19px; }
  .tlv2-empty-cart__text { font-size: 14px; margin-bottom: 20px; }
  .tlv2-empty-cart__btn { width: 100%; min-width: 0; }
  .tlv2-empty-cart__suggest { margin-top: 28px; }
  .tlv2-empty-cart__subtitle { font-size: 18px; }
}
