/* Thẻ sản phẩm dạng CARD + khối FLASH-SALE nổi bật — 17/10/2026.
   Nguồn quyết định: /ui-ux-pro-max (1 điểm nhấn động duy nhất = icon tia sét · số tabular · tương phản ≥ 4.5:1 · tôn trọng reduced-motion · ảnh không cắt).
   Chỉ dùng biến :root của cxd.css. Nạp SAU cxd-refine (ưu tiên 45). Plugin flash-sale in CSS ở chân trang → mọi luật khối dùng tiền tố body.cxd để thắng độ ưu tiên.
   Tương phản đã tính: chữ trắng / --night 18:1 · --ink / --brand-yellow 15:1 · --on-night-2 / --night 10:1 · --danger / trắng 5,9:1. */

/* ═══ 1. THẺ SẢN PHẨM (lưới danh mục, trang chủ, SP liên quan…) ═══ */
body.cxd .product-small>.col-inner{background:var(--surface);border-radius:16px;padding:10px 10px 14px;box-shadow:0 1px 2px rgba(35,31,32,.06),0 4px 14px rgba(35,31,32,.06);height:100%;display:flex;flex-direction:column;transition:transform var(--t-base) var(--ease),box-shadow var(--t-base) var(--ease)}
body.cxd .product-small>.col-inner>.product-small.box{flex:1}
body.cxd .product-small .box-image{border-radius:12px;background:var(--tile);aspect-ratio:4/3}
/* Ảnh: khung 4:3. Ảnh KHÔNG rộng hơn khung → lấp đầy (chỉ cắt nền trắng trên/dưới, xe to rõ);
   ảnh RỘNG hơn khung (data-cxd-ngang, cxd-shop.php: tỉ lệ > 4:3) → hiện trọn, không cắt bánh/đầu xe. */
body.cxd .product-small .box-image img{object-fit:cover;padding:4% 5%;mix-blend-mode:multiply;transition:transform var(--t-base) var(--ease),opacity .35s var(--ease)}
body.cxd .product-small .box-image img[data-cxd-ngang]{object-fit:contain;padding:2%;background:transparent}
/* Ảnh thứ 2 (PNG trong suốt): phủ kín, không nhân với ảnh chính */
body.cxd .product-small .box-image img.show-on-hover{mix-blend-mode:normal;background:var(--tile)}
body.cxd .product-small .box-text{padding:12px 4px 0}
body.cxd .product-small .name a,body.cxd .product-small .name.product-title a{font-family:var(--font-head);font-weight:600;font-size:var(--fs-16);line-height:22px;min-height:44px;color:var(--ink);letter-spacing:-.005em}
body.cxd .product-small .name a:hover{color:var(--cyan-700)}
/* Giá: giá cũ nhỏ gạch phía trên, giá bán to đậm phía dưới (giống thẻ flash-sale) */
body.cxd .product-small .price-wrapper{margin-top:auto;padding-top:var(--s-2)}
body.cxd .product-small .price{display:flex;flex-direction:column;align-items:flex-start;gap:2px;line-height:1.2}
body.cxd .product-small .price del,body.cxd .product-small .price del .amount{font-family:var(--font-body);font-weight:500;font-size:13px;color:var(--ink-3);opacity:1}
body.cxd .product-small .price>.amount,body.cxd .product-small .price ins .amount{font-family:var(--font-head);font-weight:700;font-size:var(--fs-20);color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
body.cxd .product-small .price ins .amount{color:var(--danger)}
body.cxd .product-small .price .woocommerce-Price-currencySymbol{font-size:.8em;margin-left:1px}
/* Nhãn giảm giá: viên thuốc vàng, chữ đậm, bóng nhẹ */
body.cxd .product-small .badge-container{margin:20px 0 0 20px}   /* nằm trong .col-inner (lề 10px) → cách mép ô ảnh 10px */
@media (max-width:549px){body.cxd .product-small .badge-container{margin:16px 0 0 16px}}
body.cxd .product-small .badge{width:auto;height:auto;min-width:0;min-height:0;margin:0}
body.cxd .product-small .badge .badge-inner{display:inline-flex;align-items:center;height:26px;padding:0 10px;border-radius:var(--r-pill);background:var(--brand-yellow);color:var(--ink);font-family:var(--font-head);font-weight:800;font-size:13px;letter-spacing:.01em;box-shadow:0 2px 6px rgba(35,31,32,.14);white-space:nowrap}
@media (hover:hover){
  body.cxd .product-small:hover>.col-inner{transform:translateY(-4px);box-shadow:0 2px 4px rgba(35,31,32,.06),0 16px 32px rgba(35,31,32,.12)}
  body.cxd .product-small:hover .box-image{box-shadow:none}
  body.cxd .product-small:hover .box-image img{transform:scale(1.04)}
  body.cxd .product-small:hover .box-image img.show-on-hover{transform:scale(1.04)!important;opacity:1}
  body.cxd .product-small:hover .box-image .image-fade_in_back:has(img.show-on-hover)>a>img:not(.show-on-hover){opacity:0}
}
/* Lưới: khe giữa các card đủ để bóng không dính nhau */
body.cxd .products>.product-small.col,body.cxd .row>.product-small.col{padding-bottom:var(--s-4)}
@media (max-width:549px){
  body.cxd .product-small>.col-inner{padding:8px 8px 12px;border-radius:14px}
  body.cxd .product-small .name a,body.cxd .product-small .name.product-title a{font-size:14px;line-height:20px;min-height:40px}
  body.cxd .product-small .price>.amount,body.cxd .product-small .price ins .amount{font-size:17px}
  body.cxd .product-small .badge .badge-inner{height:22px;padding:0 8px;font-size:12px}
}
/* Thẻ nhỏ ở cột bên (blog) giữ kiểu danh sách gọn cũ */
body.cxd #secondary .product-small>.col-inner{background:transparent;box-shadow:none;padding:0;border-radius:0}
body.cxd #secondary .product-small .price{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:0 var(--s-2)}

/* ═══ 2. KHỐI FLASH-SALE (template ghi đè cxd-flash-sale/block.php, lớp .cxd-fs--noi) ═══ */
body.cxd .cxd-fs.cxd-fs--noi{position:relative;margin:var(--s-8) 0;padding:28px 28px 24px;border-radius:20px;color:#fff;
  background:radial-gradient(120% 140% at 100% 0%,rgba(255,242,0,.16) 0,rgba(255,242,0,0) 45%),radial-gradient(90% 120% at 0% 100%,rgba(0,174,239,.14) 0,rgba(0,174,239,0) 50%),var(--night)}
body.cxd .cxd-fs--noi .cxd-fs__head{align-items:flex-end;gap:16px 32px;margin-bottom:var(--s-4)}
body.cxd .cxd-fs--noi .cxd-fs__ten{min-width:0}
body.cxd .cxd-fs--noi .cxd-fs__nhan{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 12px 0 10px;border-radius:var(--r-pill);background:var(--brand-yellow);color:var(--ink);font-family:var(--font-head);font-weight:800;font-size:12px;letter-spacing:.08em;text-transform:uppercase}
body.cxd .cxd-fs--noi .cxd-fs__set{display:block;transform-origin:50% 60%;animation:cxd-set 2.6s var(--ease) infinite}
body.cxd .cxd-fs.cxd-fs--noi .cxd-fs__head .cxd-fs__title{margin:12px 0 4px;color:#fff;font-size:var(--fs-31);font-weight:700;line-height:1.15;letter-spacing:-.02em}
body.cxd .cxd-fs--noi .cxd-fs__khau{margin:0;color:var(--on-night-2);font-size:var(--fs-14);line-height:1.5}
/* Đồng hồ: ô số vàng, nhãn nhỏ dưới, số tabular không nhảy */
body.cxd .cxd-fs--noi .cxd-fs__timer{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
body.cxd .cxd-fs--noi .cxd-fs__lbl{color:var(--on-night-2);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
body.cxd .cxd-fs--noi .cxd-fs__t{display:flex;align-items:flex-start;gap:6px;font-size:inherit;color:inherit}
body.cxd .cxd-fs--noi .cxd-fs__o{display:flex;flex-direction:column;align-items:center;gap:4px;margin:0;font-size:inherit;color:inherit}
body.cxd .cxd-fs--noi .cxd-fs__o[hidden]{display:none}
body.cxd .cxd-fs--noi .cxd-fs__o b{display:grid;place-items:center;min-width:52px;height:52px;padding:0 6px;border-radius:12px;background:var(--brand-yellow);color:var(--ink);font-family:var(--font-head);font-size:26px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;box-shadow:inset 0 -3px 0 rgba(35,31,32,.12)}
body.cxd .cxd-fs--noi .cxd-fs__o small{color:var(--on-night-2);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
body.cxd .cxd-fs--noi .cxd-fs__t>i{font-style:normal;color:var(--brand-yellow);font-family:var(--font-head);font-weight:800;font-size:22px;line-height:52px}
/* Thanh đã bán */
body.cxd .cxd-fs--noi .cxd-fs__sold{max-width:420px;margin:0 0 var(--s-6)}
body.cxd .cxd-fs--noi .cxd-fs__bar{height:10px;background:rgba(255,255,255,.14)}
body.cxd .cxd-fs--noi .cxd-fs__bar>span{background:var(--brand-yellow);min-width:10px}
body.cxd .cxd-fs--noi .cxd-fs__sold-t{color:var(--on-night-2)}
body.cxd .cxd-fs--noi .cxd-fs__sold-t b{color:#fff}
/* Card trong khối: cùng kiểu thẻ sản phẩm toàn site */
body.cxd .cxd-fs--noi .cxd-fs__card{gap:10px;padding:10px 10px 14px;border-radius:16px;background:var(--surface);box-shadow:none;color:var(--ink)}
body.cxd .cxd-fs--noi .cxd-fs__card:hover{transform:translateY(-4px);box-shadow:0 16px 32px rgba(0,0,0,.35)}
body.cxd .cxd-fs--noi .cxd-fs__card:focus-visible{outline:3px solid var(--brand-yellow);outline-offset:3px}
body.cxd .cxd-fs--noi .cxd-fs__img{aspect-ratio:4/3;border-radius:12px;background:var(--tile)}
body.cxd .cxd-fs--noi .cxd-fs__img img{object-fit:cover;padding:4% 5%;mix-blend-mode:multiply}
body.cxd .cxd-fs--noi .cxd-fs__img img[data-cxd-ngang]{object-fit:contain;padding:2%}
body.cxd .cxd-fs--noi .cxd-fs__badge{top:10px;left:10px;height:26px;display:inline-flex;align-items:center;padding:0 10px;font-family:var(--font-head);font-weight:800;font-size:13px;line-height:1;box-shadow:0 2px 6px rgba(35,31,32,.14)}
body.cxd .cxd-fs--noi .cxd-fs__name{font-family:var(--font-head);font-weight:600;font-size:15px;line-height:21px;min-height:42px;color:var(--ink)}
body.cxd .cxd-fs--noi .cxd-fs__price{display:flex;flex-direction:column;gap:2px}
body.cxd .cxd-fs--noi .cxd-fs__price del,body.cxd .cxd-fs--noi .cxd-fs__price del .amount{font-family:var(--font-body);font-weight:500;font-size:13px;color:var(--ink-3)}
body.cxd .cxd-fs--noi .cxd-fs__price ins .amount,body.cxd .cxd-fs--noi .cxd-fs__price>.amount{font-family:var(--font-head);font-weight:700;font-size:var(--fs-20);color:var(--danger);letter-spacing:-.01em}
body.cxd .cxd-fs--noi .cxd-fs__price .woocommerce-Price-currencySymbol{font-size:.8em}
body.cxd .cxd-fs--noi .cxd-fs__track .cxd-fs__item{flex-basis:clamp(168px,44vw,236px)}
/* Tia sét: chớp ngắn rồi nghỉ — điểm động DUY NHẤT của khối */
@keyframes cxd-set{0%,62%,100%{transform:none;opacity:1}68%{transform:scale(1.35) rotate(-10deg);opacity:.55}74%{transform:scale(1.15) rotate(6deg);opacity:1}80%{transform:scale(1);opacity:.7}86%{opacity:1}}
@media (prefers-reduced-motion:reduce){
  body.cxd .cxd-fs--noi .cxd-fs__set{animation:none}
  body.cxd .cxd-fs--noi .cxd-fs__card:hover,body.cxd .product-small:hover>.col-inner{transform:none}
}
@media (max-width:849px){
  body.cxd .cxd-fs--noi .cxd-fs__timer{align-items:flex-start}
}
@media (max-width:549px){
  body.cxd .cxd-fs.cxd-fs--noi{margin:var(--s-6) 0;padding:20px 16px 16px;border-radius:16px}
  body.cxd .cxd-fs.cxd-fs--noi .cxd-fs__head .cxd-fs__title{font-size:var(--fs-25)}
  body.cxd .cxd-fs--noi .cxd-fs__o b{min-width:44px;height:44px;font-size:21px;border-radius:10px}
  body.cxd .cxd-fs--noi .cxd-fs__t>i{line-height:44px;font-size:18px}
  body.cxd .cxd-fs--noi .cxd-fs__name{font-size:14px;line-height:20px;min-height:40px}
  body.cxd .cxd-fs--noi .cxd-fs__price ins .amount,body.cxd .cxd-fs--noi .cxd-fs__price>.amount{font-size:17px}
}
