/* =========================================================================
   USOLAB — Trang danh sach san pham (shop / danh muc)

   1. Khung + tieu de
   2. Bo loc (sidebar)
   3. Thanh tim kiem / sap xep
   4. Luoi + the san pham
   5. Phan trang + trang thai rong
   6. Responsive (tablet, mobile: bo loc dang ngan keo)
   ====================================================================== */

/* -------------------------------------------------------------------------
   1. Khung + tieu de
   ---------------------------------------------------------------------- */
.us-archive-page .woocommerce-notices-wrapper:empty {
	display: none;
}

.us-shop {
	--us-s-ink: #111;
	--us-s-line: #eee;
	--us-s-line-strong: #ddd;
	--us-s-muted: #888;

	width: 100%;
	padding-block: 30px;
	color: var(--us-s-ink);
	font-family: "Manrope", var(--us-font);
	text-align: left;
}

.us-shop *,
.us-shop *::before,
.us-shop *::after {
	font-family: inherit;
}

.us-shop a {
	color: inherit;
	font-size: 15px;
	text-decoration: none;
}

.us-shop button {
	border-radius: 0;
	box-shadow: none;
	letter-spacing: 0;
	text-transform: none;
}

.us-shop [hidden] {
	display: none !important;
}

.us-shop :is(a, button, [tabindex]):focus-visible {
	outline: 2px solid #333;
	outline-offset: 3px;
}

.us-shop__title {
	margin: 0 0 24px;
	color: #000;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
}

.us-shop__layout {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.us-shop__main {
	width: 100%;
	min-width: 0;
}

/* -------------------------------------------------------------------------
   2. Bo loc (sidebar)
   ---------------------------------------------------------------------- */
.us-shop__sidebar {
	position: sticky;
	top: calc(var(--us-header-h, 78px) + 22px);
	min-width: 0;
	padding: 22px;
	border: 1px solid var(--us-s-line);
	background: #fff;
}

.us-shop__filter-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.4;
}

.us-shop__filter-close,
.us-shop__filter-open,
.us-shop__overlay {
	display: none;
}

.us-shop__group {
	margin: 0 0 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--us-s-line);
}

.us-shop__group-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 0 0 12px;
	border: 0;
	background: transparent;
	color: var(--us-s-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	text-align: left;
	cursor: pointer;
}

.us-shop__group-toggle:hover {
	background: transparent;
	color: var(--us-s-ink);
}

.us-shop__group-icon {
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
}

/* Chi an nhom da dong khi JS san sang (khong JS thi mo het). */
.us-shop.is-ready .us-shop__group:not(.is-open) .us-shop__group-content {
	display: none;
}

.us-shop__group-content label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 10px;
	color: #222;
	font-size: 13px;
	line-height: 1.6;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.us-shop__group-content input {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin: 4px 0 0;
	accent-color: #222;
}

.us-shop__filter-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.us-shop__filter-actions button,
.us-shop__filter-actions a {
	display: block;
	width: 100%;
	padding: 12px 10px;
	border: 1px solid var(--us-s-ink);
	background: var(--us-s-ink);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
}

.us-shop__filter-actions a {
	background: #fff;
	color: var(--us-s-ink);
}

/* -------------------------------------------------------------------------
   3. Thanh tim kiem / sap xep
   ---------------------------------------------------------------------- */
.us-shop__topbar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(175px, 220px) auto;
	gap: 12px;
	align-items: center;
	margin-bottom: 18px;
}

.us-shop__search,
.us-shop__sort {
	min-width: 0;
}

.us-shop__search input,
.us-shop__sort select {
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--us-s-line-strong);
	border-radius: 0;
	background: #fff;
	color: var(--us-s-ink);
	font-size: 13px;
	line-height: 1.4;
}

.us-shop__sort select {
	padding-right: 28px;
}

.us-shop__search-submit {
	height: 46px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid var(--us-s-ink);
	background: var(--us-s-ink);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}

.us-shop__results {
	margin: 0 0 24px;
	color: var(--us-s-muted);
	font-size: 12px;
	line-height: 1.6;
}

/* -------------------------------------------------------------------------
   4. Luoi + the san pham
   ---------------------------------------------------------------------- */
.us-shop__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 38px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.us-shop-card {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.us-shop-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	margin-bottom: 26px;
	overflow: hidden;
	background: #fff;
}

.us-shop-card__image {
	display: block;
	width: 100%;
	height: 100%;
}

.us-shop-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: contain;
	transition: transform .35s ease;
}

.us-shop-card:hover .us-shop-card__media img {
	transform: scale(1.025);
}

.us-shop-card__action {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: stretch;
	min-height: 44px;
	background: #818181;
	opacity: 0;
	transform: translateY(100%);
	transition: opacity .2s, transform .2s;
}

.us-shop-card__buy,
.us-shop-card__cart {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 8px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: .35px;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
}

.us-shop .us-shop-card__buy {
	font-size: 12px;
}

.us-shop-card__buy:hover,
.us-shop-card__cart:hover {
	background: #555;
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 5px;
}

.us-shop-card__buy[aria-disabled="true"] {
	opacity: .65;
	cursor: wait;
}

.us-shop-card__cart {
	border-left: 1px solid #aaa;
}

.us-shop-card:hover .us-shop-card__action,
.us-shop-card:focus-within .us-shop-card__action,
.us-shop-card.is-added .us-shop-card__action {
	opacity: 1;
	transform: translateY(0);
}

.us-shop-card__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	min-height: 36px;
	margin: 0 0 8px;
	padding: 0;
	overflow: hidden;
	font-size: 13px;
	font-weight: 400;
	line-height: 18px;
	letter-spacing: 0;
	text-transform: none;
}

.us-shop-card__name a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.us-shop-card__price {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: baseline;
	margin: 0 0 12px;
	color: #171717;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.6;
}

.us-shop-card__price del {
	color: #999;
	font-size: 12px;
	font-weight: 400;
}

.us-shop-card__price ins {
	background: none;
	color: inherit;
	text-decoration: none;
}

.us-shop-card__badge {
	display: inline-block;
	padding: 1px 5px;
	border: 1px solid #d8d8d8;
	color: #333;
	font-size: 8px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: .5px;
}

/* -------------------------------------------------------------------------
   5. Phan trang + trang thai rong
   ---------------------------------------------------------------------- */
.us-shop__pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 40px;
}

.us-shop__pagination a,
.us-shop__pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--us-s-line-strong);
	font-size: 12px;
	line-height: 1;
}

.us-shop__pagination [aria-current="page"] {
	border-color: var(--us-s-ink);
	background: var(--us-s-ink);
	color: #fff;
}

.us-shop__pagination a:hover {
	border-color: var(--us-s-ink);
}

.us-shop__pagination .us-shop__dots {
	min-width: 16px;
	padding: 0;
	border: 0;
}

.us-shop__empty {
	padding: 24px;
	border: 1px solid var(--us-s-line);
	background: #fafafa;
	font-size: 14px;
	line-height: 1.7;
}

.us-shop__empty p {
	margin: 0;
}

.us-shop__empty a {
	display: inline-block;
	margin-top: 10px;
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
   6. Responsive
   ---------------------------------------------------------------------- */
@media (hover: none), (pointer: coarse) {
	.us-shop-card__action {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 1100px) {
	.us-shop__layout {
		grid-template-columns: 220px minmax(0, 1fr);
		gap: 24px;
	}

	.us-shop__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px 22px;
	}
}

@media (max-width: 767px) {
	body.us-shop-lock {
		overflow: hidden;
	}

	.us-shop {
		padding-block: 20px;
	}

	.us-shop__title {
		margin-bottom: 18px;
		font-size: 26px;
	}

	.us-shop__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.us-shop__sidebar {
		position: static;
	}

	/* Bo loc thanh ngan keo tu trai (chi khi JS san sang). */
	.us-shop.is-ready .us-shop__sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100002;
		width: min(86vw, 340px);
		height: 100vh;
		height: 100dvh;
		padding: 20px;
		border: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		box-shadow: 10px 0 30px rgba(0, 0, 0, .13);
		visibility: hidden;
		pointer-events: none;
		transform: translateX(-105%);
		transition: transform .25s ease, visibility 0s linear .25s;
	}

	.us-shop.is-ready .us-shop__sidebar.is-open {
		visibility: visible;
		pointer-events: auto;
		transform: translateX(0);
		transition-delay: 0s;
	}

	.us-shop.is-ready .us-shop__filter-title {
		position: sticky;
		top: -20px;
		z-index: 2;
		margin: -20px -20px 20px;
		padding: 18px 20px;
		border-bottom: 1px solid var(--us-s-line);
		background: #fff;
	}

	.us-shop.is-ready .us-shop__filter-close {
		display: inline-flex;
		flex: 0 0 36px;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--us-s-line-strong);
		background: #fff;
		color: var(--us-s-ink);
		font-size: 25px;
		line-height: 1;
		cursor: pointer;
	}

	.us-shop.is-ready .us-shop__overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 100001;
		background: rgba(0, 0, 0, .4);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity .25s ease, visibility 0s linear .25s;
	}

	.us-shop.is-ready .us-shop__overlay.is-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transition-delay: 0s;
	}

	.us-shop__topbar {
		grid-template-columns: minmax(0, 1fr) 90px;
		grid-template-areas:
			"search searchbutton"
			"sort filter";
		gap: 10px;
	}

	.us-shop__search {
		grid-area: search;
	}

	.us-shop__sort {
		grid-area: sort;
	}

	.us-shop__search-submit {
		grid-area: searchbutton;
		padding: 0 10px;
	}

	.us-shop.is-ready .us-shop__filter-open {
		grid-area: filter;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
		height: 46px;
		margin: 0;
		padding: 0 8px;
		border: 1px solid var(--us-s-ink);
		background: #fff;
		color: var(--us-s-ink);
		font-size: 13px;
		cursor: pointer;
	}

	.us-shop__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 16px;
	}

	.us-shop-card__media {
		margin-bottom: 18px;
	}

	.us-shop-card__action {
		opacity: 1;
		transform: none;
	}

	.us-shop-card__price {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.us-shop-card__media img,
	.us-shop-card__action,
	.us-shop__sidebar,
	.us-shop__overlay {
		transition: none !important;
	}
}
