/* ============================================================
   Vua Mắm — Trang danh sách sản phẩm
   ============================================================ */

/* (.vm-pagehero chuyển sang components.css — dùng chung mọi trang) */

/* Layout 2 cột */
.vm-shop {
	display: grid;
	grid-template-columns: 244px 1fr;
	gap: 36px;
	align-items: start;
	padding-top: 34px;
	padding-bottom: 60px;
}

.vm-shop__aside {
	position: sticky;
	top: 108px;
	display: flex;
	flex-direction: column;
	gap: 26px;
}

/* Filter box */
.vm-fbox {
	background: #fff;
	border: 1px solid var(--vm-line);
	border-radius: 16px;
	padding: 20px;
}

.vm-fbox__head {
	font-weight: 700;
	font-size: 15px;
	color: var(--vm-ink);
	margin-bottom: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.vm-fbox__head .gem { color: var(--vm-gold); font-size: 11px; }

.vm-fbox__list { display: flex; flex-direction: column; gap: 4px; }

.vm-fcat, .vm-fprice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 500;
	color: var(--vm-ink-2);
	transition: background 0.15s, color 0.15s;
}

.vm-fcat span { opacity: 0.55; font-weight: 500; }
.vm-fcat:hover, .vm-fprice:hover { background: var(--vm-cream); }

.vm-fcat.is-active { background: var(--vm-red); color: #fff; font-weight: 700; }
.vm-fcat.is-active:hover { background: var(--vm-red); }

.vm-fprice { padding: 9px 12px; font-size: 13.5px; }
.vm-fprice.is-active { background: var(--vm-cream); color: var(--vm-red); font-weight: 700; }

/* CTA hotline */
.vm-fcta {
	background: linear-gradient(135deg, #8a1e1b, #641210);
	border-radius: 16px;
	padding: 22px;
	color: #fff;
}

.vm-fcta__title { font-family: var(--vm-font-head); font-weight: 700; font-size: 18px; line-height: 1.3; }
.vm-fcta p { font-size: 13px; color: #f2d0c6; margin: 8px 0 14px; line-height: 1.6; }

.vm-fcta a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	color: var(--vm-red);
	border-radius: 10px;
	padding: 10px 16px;
	font-weight: 700;
	font-size: 13px;
}

/* Toolbar */
.vm-shop__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: #fff;
	border: 1px solid var(--vm-line);
	border-radius: 14px;
	padding: 12px 18px;
	margin-bottom: 22px;
	flex-wrap: wrap;
}

.vm-shop__bar-left { display: flex; align-items: center; gap: 12px; }

.vm-filterbtn {
	display: none;
	align-items: center;
	gap: 7px;
	height: 40px;
	padding: 0 15px;
	border: 1px solid var(--vm-red);
	border-radius: 10px;
	background: #fff;
	color: var(--vm-red);
	font-weight: 700;
	font-size: 13.5px;
}

.vm-filterbtn__badge {
	background: var(--vm-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 10px;
	min-width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
	margin-left: 2px;
}

.vm-filterbtn__badge[hidden] { display: none; }

.vm-shop__count { font-size: 14px; color: var(--vm-ink-2); }
.vm-shop__count strong { color: var(--vm-ink); }
.vm-shop__count .lbl-short { display: none; }

.vm-shop__sort { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--vm-ink-3); }
.vm-shop__sort .vm-select { min-width: 190px; }
.vm-shop__sort .vm-select__btn { height: 40px; border-radius: 9px; background: var(--vm-bg); font-size: 13.5px; }

.vm-pgrid--3 { gap: 22px; }

/* Loading state khi filter AJAX */
.vm-shop__main.is-loading .vm-pgrid { opacity: 0.45; pointer-events: none; }

.vm-shop__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	background: #fff;
	border: 1px dashed var(--vm-line-2);
	border-radius: 16px;
	color: var(--vm-ink-3);
}

.vm-shop__empty .t { font-weight: 700; font-size: 17px; color: var(--vm-ink); margin: 14px 0 6px; }

/* ---------- Bottom sheet lọc mobile ---------- */
@keyframes vmsheet { from { transform: translateY(100%); } to { transform: translateY(0); } }

.vm-sheet[hidden] { display: none; }

.vm-sheet__backdrop {
	position: fixed;
	inset: 0;
	z-index: 320;
	background: rgba(30, 12, 10, 0.5);
	backdrop-filter: blur(2px);
	animation: vmfade 0.25s ease;
}

.vm-sheet__panel {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 330;
	background: var(--vm-bg);
	border-radius: 20px 20px 0 0;
	max-height: 82vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.24);
	animation: vmsheet 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vm-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--vm-line);
	background: #fff;
	border-radius: 20px 20px 0 0;
}

.vm-sheet__head span { font-family: var(--vm-font-head); font-weight: 700; font-size: 19px; color: var(--vm-ink); }

.vm-sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 22px; }
.vm-sheet__body .vm-fbox { padding: 0; border: 0; background: none; border-radius: 0; }

.vm-sheet__foot {
	padding: 16px 22px;
	border-top: 1px solid var(--vm-line);
	background: #fff;
	display: flex;
	gap: 12px;
}

.vm-sheet__foot .vm-btn { height: 50px; }
.vm-sheet__apply { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.vm-shop { grid-template-columns: 1fr; }
	.vm-shop__aside { display: none; }
	.vm-filterbtn { display: inline-flex; }
}

@media (max-width: 640px) {
	.vm-pgrid--3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }

	/* Toolbar 1 hàng kiểu pill: [N kết quả] … [Phổ biến ⌄] [Bộ lọc ☰] */
	.vm-shop__bar { flex-wrap: nowrap; padding: 10px 12px; gap: 8px; }
	.vm-shop__bar-left { display: contents; }
	.vm-shop__count { order: 0; font-size: 13.5px; white-space: nowrap; }
	.vm-shop__count .lbl-pre, .vm-shop__count .lbl-full { display: none; }
	.vm-shop__count .lbl-short { display: inline; }
	.vm-shop__sort { order: 1; margin-left: auto; }
	.vm-shop__sort-lbl { display: none; }
	.vm-shop__sort .vm-select { min-width: 0; }
	.vm-shop__sort .vm-select__btn { height: 38px; border-radius: 999px; background: #fff; padding: 0 14px; gap: 7px; }
	.vm-shop__sort .vm-select__panel { left: auto; right: 0; min-width: 190px; }
	.vm-filterbtn {
		order: 2;
		flex-direction: row-reverse;
		height: 38px;
		padding: 0 14px;
		border-radius: 999px;
		border-color: var(--vm-line-2);
		color: var(--vm-ink);
		font-weight: 600;
	}
}

@media (max-width: 420px) {
	/* Giữ 2 sản phẩm/hàng trên điện thoại nhỏ — thu gọn card cho vừa (scope riêng lưới cửa hàng) */
	.vm-pgrid--3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.vm-pgrid--3 .vm-pcard { padding: 10px; }
	.vm-pgrid--3 .vm-pcard__img { height: 130px; }
	.vm-pgrid--3 .vm-pcard__name { font-size: 13.5px; margin-top: 10px; }
	.vm-pgrid--3 .vm-pcard__weight { font-size: 11.5px; }
	.vm-pgrid--3 .vm-pcard__rate { margin-top: 8px; }
	.vm-pgrid--3 .vm-pcard__foot { padding-top: 10px; }
	.vm-pgrid--3 .vm-pcard__price { font-size: 15.5px; }
	.vm-pgrid--3 .vm-pcard__add { width: 38px; height: 38px; }
	.vm-pgrid--3 .vm-pcard__tier { min-width: 0; padding: 0 9px; height: 26px; font-size: 10px; }
}
