/* SEARCH FILTER */
.jm-search-wrap {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 20px;
    background: var(--color-white);
    border-radius: 18px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 2px solid rgba(29, 78, 216, .45);
    box-shadow:
        0 0 8px rgba(29, 78, 216, .45),
        0 0 18px rgba(29, 78, 216, .35),
        0 0 35px rgba(29, 78, 216, .18);
}

/* Lớp nền giữ nguyên */
.jm-search-wrap::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 17px;
    background: var(--color-white);
    z-index: -1;
}

/* Hiệu ứng viền chạy */
.jm-search-wrap::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background:
        conic-gradient(from 0deg,
            transparent 0deg,
            transparent 300deg,
            #1d4ed8 330deg,
            #5ea0ff 345deg,
            #1d4ed8 360deg);
    animation: jmBorderRotate 7s linear infinite;
    filter:
        drop-shadow(0 0 8px rgba(29, 78, 216, .7)) drop-shadow(0 0 16px rgba(29, 78, 216, .35));
    z-index: -2;
}

@keyframes jmBorderRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg) scale(8);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) scale(8);
    }
}

.jm-search-item {
	position: relative;
	flex: 1;
	min-width: 220px;
}

.jm-keyword {
	flex: 1.5;
}

.jm-search-item label {
	position: absolute;
	top: -11px;
	left: 14px;
	background: var(--color-white);
	padding: 0 10px;
	font-size: 13px;
	color: var(--color-main);
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
	z-index: 5;
}

.jm-search-item label i {
	color: var(--color-main);
	font-size: 13px;
}

.jm-search-item select,
.jm-search-item input {
	width: 100%;
	height: 45px !important;
	border-radius: 12px !important;
	border: 1px solid #3a3a3a !important;
	background: var(--color-white) !important;
	color: var(--color-main) !important;
	padding: 0 18px;
	font-size: 15px;
	transition: .3s;
	outline: none;
	margin-bottom: 0;
}

.jm-search-item input::placeholder {
	color: #8d8d8d;
}

.jm-search-item select:focus,
.jm-search-item input:focus {
	border-color: var(--color-main);
	box-shadow: 0 0 0 3px rgb(0 131 224 / 15%);
}

.jm-search-btn {
	flex: 0 0 auto;
}

.jm-search-btn button {
	height: 45px;
	padding: 0 34px;
	border: none;
	border-radius: 12px;
	background: var(--color-phu);
	color: var(--color-white);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	transition: .3s;
	margin-bottom: 0;
}

.jm-search-btn button:hover {
	transform: translateY(-2px);
}

.jm-search-btn i {
	font-size: 15px;
}

/* Tablet */
@media(max-width:991px) {
	.jm-search-wrap {
		gap: 15px;
	}

	.jm-search-item {
		min-width: calc(50% - 8px);
	}

	.jm-keyword {
		flex: 100%;
	}

	.jm-search-btn {
		width: 100%;
	}

	.jm-search-btn button {
		width: 100%;
		justify-content: center;
	}
}

/* Mobile */
@media(max-width:767px) {
	.jm-search-wrap {
		padding: 16px;
		border-radius: 14px;
	}

	.jm-search-item {
		min-width: 100%;
	}

	.jm-search-btn {
		width: 100%;
	}
}

/* Khung chứa danh sách sản phẩm */
.jm-products-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin-top: 30px;
	width: 100%;
	box-sizing: border-box;
}

/* Đảm bảo các box sản phẩm bên trong không bị vỡ khung */
.jm-products-grid .product-small.box {
	width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/* Trên máy tính bảng: hiển thị 2 sản phẩm mỗi hàng */
@media (max-width: 768px) {
	.jm-products-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 15px;
	}
}

/* Trên điện thoại di động: hiển thị 1 sản phẩm mỗi hàng */
@media (max-width: 480px) {
	.jm-products-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}

/* 1. Thiết lập khung thẻ sản phẩm (Card) */
.jm-products-grid .product-small.box {
	background-color: var(--color-white);
	border: 1px solid #1c1c1c;
	border-radius: 20px;
	padding: 0 !important;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hiệu ứng Hover */
.jm-products-grid .product-small.box:hover {
	border: 1px solid var(--color-main);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(29, 78, 216, 0.5);
}

/* 2. Định dạng hình ảnh dính sát viền */
.jm-products-grid .box-image {
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
}

.jm-products-grid .box-image img {
	width: 100%;
	height: 280px;
	object-fit: cover;
	display: block;
	border-radius: 0 !important;
}

/* 3. Phần văn bản (Thêm padding ở đây để tạo khoảng cách với viền) */
.jm-products-grid .box-text-products {
	padding: 10px 10px 15px 15px !important;
	display: flex;
	flex-direction: column;
}

/* Tiêu đề sản phẩm */
.jm-products-grid .product-title {
	margin: 4px 0 !important;
	line-height: 1.4;
}

.jm-products-grid .product-title a {
	color: var(--color-main) !important;
	font-size: 18px;
	font-weight: 700;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	min-height: 2.6em;
}

.products_info .location_text {
	color: #6092d0c2;
	font-size: 12px;
}

/* Khung bao ngoài để căn lề cho tag */
.specialty-wrapper {
	margin: 8px 0;
	display: flex;
	flex-wrap: wrap;
}

/* Định dạng nhãn Specialty dạng viên thuốc viền đồng */
.specialty-tag {
	display: inline-block;
	background-color: var(--color-main);
	color: var(--color-white);
	border-radius: 50px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
	width: fit-content;
	box-sizing: border-box;
}

/* 5. Nút Xem thông tin (View Profile) */
.jm-products-grid .button_bottom {
	margin-top: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.jm-products-grid .btn-view-profile {
	background: var(--color-white);
	color: var(--color-main) !important;
	border: 1px solid var(--color-main);
	border-radius: 20px;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	display: inline-block;
	transition: background-color 0.2s, color 0.2s;
}

.jm-products-grid .btn-view-profile:hover {
	background: var(--color-phu);
	color: var(--color-white) !important;
}

/* Ẩn bớt các phần giá gốc/khuyến mãi mặc định */
.jm-products-grid .price-wrapper {
	display: none; 
}

/* ==================== LOAD MORE BUTTON ==================== */
.jm-load-more-wrapper {
	text-align: center;
	margin-top: 40px;
}

.jm-load-more-btn {
	background: var(--color-phu);
	color: var(--color-white);
	border: 1px solid var(--color-main);
	border-radius: 50px;
	padding: 25px 20px;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	letter-spacing: 0.5px;
	outline: none;
	margin-right: 0;
	line-height: 0;
}

.jm-load-more-btn:hover {
	border-color: var(--color-main);
	box-shadow: 0 0 12px rgba(140, 113, 78, 0.25);
}

.jm-load-more-btn .btn-counter {
	font-weight: 600;
	color: var(--color-white);
}

/* Ẩn bộ đếm khi hiển thị nút COLLAPSE */
.jm-load-more-btn.is-collapsed .btn-counter {
	display: none;
}