/* BEGIN HACADO PRODUCT UI — file do Hacado quản lý, đừng sửa tay. Mẫu: square_bordered */
/* Lưới: ép số cột + khoảng cách theo thiết bị (đè lưới Flatsome), áp cả preview lẫn web thật. */
body.hpui-square_bordered .products, body.hpui-square_bordered .row:not(.slider):has(> .product-small.col) { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px !important; margin: 0 !important; }
body.hpui-square_bordered .products > .col, body.hpui-square_bordered .products > .product-small.col, body.hpui-square_bordered .row:not(.slider):has(> .product-small.col) > .product-small.col { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
body.hpui-square_bordered .products .col-inner, body.hpui-square_bordered .row:not(.slider):has(> .product-small.col) .col-inner { padding: 0 !important; }
/* Thẻ: nền trắng, góc vuông, viền xám bao quanh */
body.hpui-square_bordered .product-small .box, body.hpui-square_bordered .product-small.box { height: 100%; overflow: hidden; border: 1px solid #d1d5db; border-radius: 0; background: #fff; box-shadow: none; transition: border-color .2s, box-shadow .2s; }
body.hpui-square_bordered .product-small .box:hover, body.hpui-square_bordered .product-small.box:hover { border-color: #9ca3af; box-shadow: 0 6px 16px rgba(17,24,39,.08); }
/* Ảnh 1:1 + badge GIẢM% góc trên-trái */
body.hpui-square_bordered .product-small .box-image { position: relative; overflow: hidden; border-radius: 0; background: #f3f4f6; }
body.hpui-square_bordered .product-small .box-image img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0; }
body.hpui-square_bordered .product-small .hpui-badge { position: absolute; top: 0; left: 0; z-index: 3; background: var(--hcd-color-sale-badge, #dc2626); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 0; }
/* Nội dung */
body.hpui-square_bordered .product-small .box-text { container-type: inline-size; display: flex; min-height: 168px; flex-direction: column; padding: 12px; text-align: left; background: #fff; }
body.hpui-square_bordered .product-small .category, body.hpui-square_bordered .product-small .star-rating, body.hpui-square_bordered .product-small .box-text > .price { display: none; }
/* Ẩn badge sale mặc định của theme (mẫu dùng badge -% riêng) */
body.hpui-square_bordered .product-small .badge-container { display: none !important; }
/* Flatsome bọc loop trong .title-wrapper/.price-wrapper (price-wrapper bị căn giữa ~29px) -> reset sát lề trái, full width */
body.hpui-square_bordered .product-small .title-wrapper, body.hpui-square_bordered .product-small .price-wrapper { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; text-align: left !important; }
/* Tên 2 dòng */
body.hpui-square_bordered .product-small .product-title, body.hpui-square_bordered .product-small .name { height: 40px; min-height: 40px; max-height: 40px; margin: 0 0 8px; color: var(--hcd-color-text, #111827); font-size: var(--hcd-fs-sm, 14px); font-weight: 700; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
body.hpui-square_bordered .product-small .product-title a, body.hpui-square_bordered .product-small .name a { display: -webkit-box; overflow: hidden; color: inherit; text-decoration: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Giá: giá gốc gạch (trái) + giá sale đỏ (phải) */
body.hpui-square_bordered .product-small .hpui-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; font-weight: 700; }
body.hpui-square_bordered .product-small .hpui-price del, body.hpui-square_bordered .product-small .hpui-price del .woocommerce-Price-amount { order: 1; color: #9ca3af; font-size: var(--hcd-fs-xs, 13px); font-weight: 500; text-decoration: line-through; }
body.hpui-square_bordered .product-small .hpui-price ins, body.hpui-square_bordered .product-small .hpui-price ins .woocommerce-Price-amount { order: 2; color: var(--hcd-color-sale, #dc2626); font-size: var(--hcd-fs-lg, 18px); font-weight: 800; text-decoration: none; }
body.hpui-square_bordered .product-small .hpui-price > .woocommerce-Price-amount { color: var(--hcd-color-sale, #dc2626); font-size: var(--hcd-fs-lg, 18px); font-weight: 800; }
/* Sao + số đánh giá */
body.hpui-square_bordered .product-small .hpui-review-row { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #4b5563; font-size: 12.5px; line-height: 1.25; }
body.hpui-square_bordered .product-small .hpui-stars { position: relative; display: inline-block; flex: 0 0 auto; color: var(--hcd-color-accent, #f59e0b); font-size: 14px; line-height: 1; }
body.hpui-square_bordered .product-small .hpui-stars::before { content: "★★★★★"; }
body.hpui-square_bordered .product-small .hpui-stars i { display: none; }
body.hpui-square_bordered .product-small .hpui-review-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Footer: Đã bán (trái) | Xem chi tiết → (nút bo tròn, phải) */
body.hpui-square_bordered .product-small .hpui-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #374151; font-size: 13px; font-weight: 600; }
body.hpui-square_bordered .product-small .hpui-sold { display: inline-flex; min-width: 0; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.hpui-square_bordered .product-small .hpui-sold::before { content: "🔥"; flex: 0 0 auto; font-size: 13px; line-height: 1; }
body.hpui-square_bordered .product-small .hpui-detail { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-height: 32px; margin: 0; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--hcd-color-text, #111827); font-size: 13px; font-weight: 700; line-height: 1; text-decoration: none; text-transform: none; white-space: nowrap; }
body.hpui-square_bordered .product-small .hpui-detail::after { content: "→"; font-size: 14px; line-height: 1; }
body.hpui-square_bordered .product-small .hpui-detail:hover { background: var(--hcd-color-text, #111827); color: #fff; border-color: var(--hcd-color-text, #111827); box-shadow: none; }
/* Thẻ hẹp (carousel/related): xếp dọc footer để nút không bị cắt */
@container (max-width: 210px) {
  body.hpui-square_bordered .product-small .hpui-card-footer { flex-direction: column; align-items: stretch; gap: 8px; }
  body.hpui-square_bordered .product-small .hpui-detail { width: 100%; }
}
/* Số cột theo thiết bị: tablet 3, mobile 2; khoảng cách 5px / 5px / 3px */
@media (max-width: 849px) {
  body.hpui-square_bordered .products, body.hpui-square_bordered .row:not(.slider):has(> .product-small.col) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
}
@media (max-width: 549px) {
  body.hpui-square_bordered .products, body.hpui-square_bordered .row:not(.slider):has(> .product-small.col) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px !important; }
  body.hpui-square_bordered .product-small .box-text { min-height: 160px; padding: 10px; }
  body.hpui-square_bordered .product-small .product-title, body.hpui-square_bordered .product-small .name { height: 38px; min-height: 38px; max-height: 38px; font-size: 13px; line-height: 19px; }
  body.hpui-square_bordered .product-small .hpui-price ins, body.hpui-square_bordered .product-small .hpui-price ins .woocommerce-Price-amount, body.hpui-square_bordered .product-small .hpui-price > .woocommerce-Price-amount { font-size: 16px; }
  body.hpui-square_bordered .product-small .hpui-card-footer { flex-direction: column; align-items: stretch; gap: 8px; }
  body.hpui-square_bordered .product-small .hpui-detail { width: 100%; }
}
/* END HACADO PRODUCT UI */

