/* ==========================================================================
   Giao diện điện thoại cho danh sách sản phẩm (trang chủ, danh mục, tìm kiếm).
   Chỉ chỉnh phần hiển thị, không đụng vào mã PHP của theme cha.
   ========================================================================== */

@media (max-width: 767px) {

	/* --- Khung thẻ: gọn lại để một màn hình thấy được nhiều sản phẩm hơn --- */
	.products .product-small.col {
		padding: 0 5px 10px;
	}
	.products .product-small .col-inner {
		height: 100%;
		border: 1px solid #eceef1;
		border-radius: 10px;
		background: #fff;
		overflow: hidden;
	}
	.products .product-small.box,
	.products .product-small .box-text {
		padding: 0;
	}
	.products .product-small .box-text {
		padding: 8px 9px 10px;
		text-align: left;
	}

	/* --- Nhãn giảm giá: nhỏ lại, nằm gọn một góc thay vì che ngang ảnh --- */
	.products .badge-container.absolute {
		top: 6px;
		left: 6px;
		margin: 0;
	}
	.products .badge-container .badge,
	.products .badge-container .badge-inner {
		width: auto;
		height: auto;
		min-height: 0;
		border-radius: 5px;
	}
	.products .badge-container .badge-inner.on-sale {
		padding: 2px 7px;
		background: #e51f3b;
		color: #fff;
		line-height: 1.5;
	}
	.products .badge-container span.onsale {
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0;
	}

	/* Ẩn nút yêu thích trên điện thoại - bấm nhầm nhiều hơn là dùng */
	.products .product-small .image-tools .wishlist-icon {
		display: none;
	}

	/* --- Tên sản phẩm: luôn 2 dòng, cắt bằng dấu ... chứ không cụt giữa chữ --- */
	.products .product-small .title-wrapper {
		margin: 0 0 6px;
	}
	.products .product-small .name.product-title {
		margin: 0;
		min-height: 36px;
	}
	.products .product-small .name.product-title a {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		color: #171a21;
		font-size: 13px;
		font-weight: 500;
		line-height: 1.4;
		text-transform: none;
	}

	/* --- Giá: gộp còn 2 dòng, bỏ dòng "tiết kiệm" cho đỡ rối --- */
	.products .product-small .row-gia {
		margin: 0;
	}
	.products .product-small .sku-div {
		display: none;
	}
	.products .product-small .div-gia {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 4px 7px;
		margin: 0;
	}
	.products .product-small .div-gia p {
		margin: 0;
		line-height: 1.3;
	}
	.products .product-small .gia-khuyen-mai .tien-giam {
		color: #e51f3b;
		font-size: 16px;
		font-weight: 800;
	}
	.products .product-small .gia-giam .tien-goc {
		color: #98a2b3;
		font-size: 12px;
		font-weight: 400;
		text-decoration: line-through;
	}
	.products .product-small .p-tiet-kiem,
	.products .product-small .p-re {
		display: none;
	}

	/* --- Nút mua: một dòng, cao vừa ngón tay, màu đỏ cho nổi trên nền trắng --- */
	.products .product-small .add-to-cart-button {
		margin-top: 9px;
	}
	.products .product-small .add-to-cart-button .button {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 5px;
		width: 100%;
		min-height: 36px;
		margin: 0;
		padding: 0 8px;
		border: 0;
		border-radius: 7px;
		background: #e51f3b;
		color: #fff;
		font-size: 12.5px;
		font-weight: 700;
		line-height: 1.2;
		letter-spacing: 0;
		text-transform: none;
		white-space: nowrap;
	}
	.products .product-small .add-to-cart-button .button i,
	.products .product-small .add-to-cart-button .button svg {
		margin: 0;
	}
	/* Hàng đã hết: nút chuyển thành viền xám, không mời gọi bấm mua */
	.products .product-small.outofstock .add-to-cart-button .button,
	.products .product-small .add-to-cart-button .product_type_external {
		background: #fff;
		border: 1px solid #d6d9de;
		color: #667085;
	}

	/* --- Chữ "HẾT HÀNG": thu thành nhãn nhỏ, không chiếm một dòng riêng --- */
	.products .product-small .out-of-stock-label {
		position: absolute;
		z-index: 2;
		top: 6px;
		right: 6px;
		padding: 2px 7px;
		border-radius: 5px;
		background: rgba(23, 26, 33, .72);
		color: #fff;
		font-size: 10.5px;
		font-weight: 600;
		line-height: 1.5;
	}

	/* --- Đầu trang danh mục: nén lại để khách thấy hàng ngay, khỏi cuộn --- */
	.category-page-title .page-title-inner {
		min-height: 0;
		padding: 8px 15px 2px;
	}
	/* Tên danh mục, đường dẫn và ô sắp xếp xếp thẳng lề trái cho dễ đọc */
	.category-page-title .page-title-inner > div,
	.category-page-title .flex-col {
		text-align: left !important;
	}
	.category-page-title h1.shop-page-title {
		margin: 0;
		font-size: 19px;
		line-height: 1.3;
		text-align: left;
	}
	.category-page-title .woocommerce-breadcrumb {
		margin: 2px 0 0;
		font-size: 11px;
	}
	.category-page-title .woocommerce-ordering {
		margin: 6px 0 0;
	}
	.category-page-title .woocommerce-ordering select {
		height: 34px;
		min-height: 34px;
		width: auto;
		max-width: 100%;
		padding: 0 30px 0 10px;
		font-size: 12.5px;
	}
	.category-page-row {
		padding-top: 6px;
	}
	.shop-container {
		padding-top: 2px;
	}
	/* Mô tả danh mục dài dòng đẩy hàng xuống dưới - thu gọn còn 3 dòng */
	.tax-product_cat .term-description {
		max-height: 66px;
		overflow: hidden;
		font-size: 13px;
		line-height: 1.5;
	}

	/* --- Tiêu đề khối sản phẩm trên trang chủ --- */
	.section-title-container {
		margin-bottom: 10px;
		padding: 0 5px;
	}
	.section-title b {
		display: none;
	}
	.section-title-main {
		font-size: 15px;
	}
}
