/* LSH Shop Layout – mọi selector nằm trong .lsh-banner / .lsh-shop */

/* Ẩn thanh tiêu đề shop mặc định của Flatsome (dự phòng nếu hook không gỡ được).
   !important để thắng style inline/độ ưu tiên của theme; chỉ áp dụng trên trang của plugin. */
.lsh-shop-page .shop-page-title.category-page-title,
.lsh-shop-page .shop-page-title.featured-title {
	display: none !important;
}

/* ---------- Banner ---------- */
.lsh-banner {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--lsh-banner-h, 320px);
	background: var(--lsh-primary, #1e2a5a);
	color: #fff;
	overflow: hidden;
}
.lsh-banner__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}
.lsh-banner.has-img::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(10, 20, 50, calc(var(--lsh-overlay, .45) + .2)), rgba(10, 20, 50, var(--lsh-overlay, .45)));
	z-index: 1;
}
.lsh-banner__inner { position: relative; z-index: 2; width: 100%; padding-top: 40px; padding-bottom: 40px; }
.lsh-banner__crumb { font-size: 14px; margin-bottom: 12px; opacity: .85; }
.lsh-banner__crumb a { color: #fff; }
.lsh-banner__crumb .sep { margin: 0 8px; opacity: .6; }
.lsh-banner__title { color: #fff; font-size: clamp(28px, 4vw, 44px); line-height: 1.2; margin: 0 0 10px; }
.lsh-banner__sub { max-width: 640px; font-size: 16px; line-height: 1.6; margin: 0 0 18px; opacity: .92; }
.lsh-banner__btn {
	display: inline-block; padding: 11px 26px; border-radius: 999px;
	background: var(--lsh-accent, #2563eb); color: #fff; font-weight: 600; line-height: 1.4;
}
.lsh-banner__btn:hover { color: #fff; filter: brightness(1.08); }

/* ---------- Khung ---------- */
.lsh-shop-wrap { background: #f7f9fc; padding: 32px 0 56px; }
.lsh-shop { color: #4a5578; font-size: 15px; }
.lsh-shop *, .lsh-shop *::before, .lsh-shop *::after { box-sizing: border-box; }

/* Toolbar */
.lsh-toolbar { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.lsh-search {
	flex: 1; display: flex; align-items: center; gap: 12px; margin: 0;
	height: 52px; padding: 0 20px; background: #fff;
	border: 1px solid #e3e8f0; border-radius: 14px; color: var(--lsh-primary);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .03); font-weight: normal;
}
.lsh-search:focus-within { border-color: var(--lsh-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lsh-accent) 15%, transparent); }
.lsh-shop .lsh-search input[type="search"] {
	flex: 1; height: 100%; margin: 0; padding: 0; border: 0; background: transparent;
	box-shadow: none; font-size: 15px; color: var(--lsh-primary);
}
.lsh-sort { display: flex; flex-direction: column; gap: 4px; padding-left: 24px; border-left: 2px solid #c9d1e0; min-width: 200px; }
.lsh-sort label { font-size: 12px; color: #8a94ad; margin: 0; font-weight: normal; }
.lsh-shop .lsh-sort select {
	height: 46px; margin: 0; padding: 0 36px 0 16px; border: 1px solid #e3e8f0; border-radius: 12px;
	background-color: #fff; font-weight: 600; color: var(--lsh-primary); box-shadow: none;
}

/* Layout */
.lsh-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }

/* Sidebar */
.lsh-side { position: sticky; top: 100px; }
.lsh-side__head, .lsh-side__apply, .lsh-filter-toggle, .lsh-nojs-submit { display: none; }
.lsh-shop:not(.lsh-js) .lsh-nojs-submit { display: inline-block; margin-top: 12px; }
.lsh-group { margin: 0 0 32px; padding: 0 0 24px; border: 0; border-bottom: 1px solid #e3e8f0; }
.lsh-group:last-of-type { border-bottom: 0; }
.lsh-group legend {
	margin: 0 0 16px; padding: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--lsh-primary);
}
.lsh-check { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; cursor: pointer; font-weight: normal; color: #4a5578; line-height: 1.4; }
.lsh-shop .lsh-check input {
	appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0;
	border: 1.5px solid #c9d1e0; border-radius: 5px; background: #fff; cursor: pointer; position: relative;
}
.lsh-shop .lsh-check input:checked { background: var(--lsh-primary); border-color: var(--lsh-primary); }
.lsh-shop .lsh-check input:checked::after {
	content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lsh-shop .lsh-check input:focus-visible { outline: 2px solid var(--lsh-accent); outline-offset: 2px; }
.lsh-check:hover span { color: var(--lsh-primary); }

/* Thanh trên lưới */
.lsh-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.lsh-count { flex: 1; margin: 0; font-size: 14px; color: #6b7593; }
.lsh-count strong { color: var(--lsh-primary); }
.lsh-view { display: flex; gap: 8px; }
.lsh-shop .lsh-view button {
	display: flex; align-items: center; justify-content: center; width: 46px; height: 38px; margin: 0; padding: 0;
	border: 1px solid #e3e8f0; border-radius: 8px; background: #fff; color: #8a94ad; min-height: 0; line-height: 1;
}
.lsh-shop .lsh-view button.is-active { background: #eef2fb; color: var(--lsh-primary); border-color: #dbe2f2; }

/* Lưới sản phẩm */
.lsh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; transition: opacity .2s; }
.lsh-shop.is-loading .lsh-grid { opacity: .45; pointer-events: none; }

.lsh-card {
	display: flex; flex-direction: column; background: #fff; border: 1px solid #e8ecf3; border-radius: 10px;
	overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.lsh-card:hover { box-shadow: 0 10px 24px rgba(16, 24, 40, .08); transform: translateY(-2px); }
.lsh-card__img { display: block; aspect-ratio: 16 / 9; background: #f2f4f8; overflow: hidden; }
.lsh-card__photo { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.lsh-card:hover .lsh-card__photo { transform: scale(1.04); }
.lsh-card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.lsh-shop .lsh-card__title { margin: 0 0 6px; font-size: 17px; line-height: 1.3; font-weight: 700; word-break: break-word; }
.lsh-card__title a { color: var(--lsh-primary); }
.lsh-card__title a:hover { color: var(--lsh-accent); }
.lsh-card__cat { font-size: 14px; color: #6b7593; margin-bottom: 4px; }
.lsh-shop .lsh-card__spec { display: flex; flex-wrap: wrap; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; color: #6b7593; }
.lsh-shop .lsh-card__spec li { margin: 0; padding: 0; }
.lsh-card__spec li + li::before { content: "·"; margin: 0 8px; color: #a3abc2; }
.lsh-card__more { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--lsh-primary); }
.lsh-card__more span { display: inline-block; margin-left: 4px; transition: transform .2s; }
.lsh-card__more:hover { color: var(--lsh-accent); }
.lsh-card__more:hover span { transform: translateX(3px); }

/* Khung ảnh theo cài đặt */
.lsh-ratio-1-1 .lsh-card__img { aspect-ratio: 1 / 1; }
.lsh-ratio-16-9 .lsh-card__img { aspect-ratio: 16 / 9; }
.lsh-ratio-auto .lsh-card__img { aspect-ratio: auto; }
.lsh-ratio-auto .lsh-card__photo { height: auto; }
.lsh-ratio-auto .lsh-grid { align-items: start; }
.lsh-fit-contain .lsh-card__photo { object-fit: contain; padding: 8px; background: #fff; }
.lsh-fit-contain .lsh-card:hover .lsh-card__photo { transform: scale(1.02); }

/* Dạng danh sách */
.lsh-view-list .lsh-grid { grid-template-columns: minmax(0, 1fr); }
.lsh-view-list .lsh-card { flex-direction: row; }
.lsh-view-list .lsh-card__img { flex: 0 0 260px; aspect-ratio: auto; min-height: 150px; }
.lsh-view-list .lsh-card__body { justify-content: center; }

/* Xem thêm */
.lsh-more { text-align: center; margin-top: 32px; }
.lsh-more[hidden] { display: none; }
.lsh-more__btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 14px 44px; border-radius: 12px;
	border: 1.5px solid var(--lsh-accent); color: var(--lsh-accent); background: #fff; font-weight: 600; line-height: 1.3;
}
.lsh-more__btn:hover { background: var(--lsh-accent); color: #fff; }
.lsh-more__btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* Không có kết quả */
.lsh-empty { grid-column: 1 / -1; padding: 48px 16px; text-align: center; background: #fff; border: 1px dashed #d5dcea; border-radius: 10px; }
.lsh-shop .lsh-reset { margin: 8px 0 0; border: 1px solid var(--lsh-accent); color: var(--lsh-accent); background: #fff; border-radius: 8px; }

/* ---------- Responsive (Flatsome: 849px / 549px) ---------- */
@media (max-width: 1199px) {
	.lsh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 849px) {
	.lsh-banner { min-height: var(--lsh-banner-hm, 200px); }
	.lsh-banner__inner { padding-top: 28px; padding-bottom: 28px; }
	.lsh-banner__sub { font-size: 15px; }
	.lsh-shop-wrap { padding: 20px 0 40px; }
	.lsh-toolbar { gap: 12px; margin-bottom: 18px; }
	.lsh-sort { min-width: 0; padding-left: 0; border-left: 0; }
	.lsh-sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.lsh-shop .lsh-sort select { height: 52px; }

	.lsh-layout { grid-template-columns: minmax(0, 1fr); }
	.lsh-shop.lsh-js .lsh-filter-toggle {
		display: inline-flex; align-items: center; gap: 6px; height: 38px; margin: 0; padding: 0 14px;
		border: 1px solid #e3e8f0; border-radius: 8px; background: #fff; color: var(--lsh-primary);
		font-weight: 600; min-height: 0; line-height: 1; text-transform: none; letter-spacing: 0;
	}
	.lsh-shop.lsh-js .lsh-side {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 100001; width: min(320px, 86vw);
		padding: 0 20px 90px; background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
		transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 30px rgba(0, 0, 0, .15);
	}
	.lsh-shop.lsh-js .lsh-side.is-open { transform: none; }
	.lsh-shop.lsh-js .lsh-side__head {
		display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
		margin: 0 -20px 16px; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e3e8f0; z-index: 1;
		color: var(--lsh-primary); font-size: 16px;
	}
	.lsh-shop .lsh-side__close { margin: 0; padding: 0 8px; min-height: 0; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--lsh-primary); }
	.lsh-shop.lsh-js .lsh-side__apply {
		display: block; position: fixed; left: 20px; bottom: 16px; width: calc(min(320px, 86vw) - 40px); margin: 0;
		border: 0; border-radius: 10px; background: var(--lsh-primary); color: #fff; height: 48px; text-transform: none;
	}
	.lsh-side:not(.is-open) .lsh-side__apply { visibility: hidden; }
	.lsh-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(10, 20, 50, .45); }
	.lsh-overlay[hidden] { display: none; }
	html.lsh-lock, html.lsh-lock body { overflow: hidden; }

	.lsh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.lsh-view-list .lsh-card__img { flex-basis: 40%; }
}
@media (max-width: 549px) {
	.lsh-toolbar { flex-direction: column; align-items: stretch; }
	.lsh-search { height: 48px; padding: 0 14px; }
	.lsh-shop .lsh-sort select { height: 46px; width: 100%; }
	.lsh-grid { gap: 10px; }
	.lsh-card__body { padding: 12px; }
	.lsh-shop .lsh-card__title { font-size: 15px; }
	.lsh-card__cat, .lsh-shop .lsh-card__spec, .lsh-card__more { font-size: 13px; }
	.lsh-card__spec li + li::before { margin: 0 5px; }
	.lsh-view-list .lsh-card { flex-direction: column; }
	.lsh-view-list .lsh-card__img { flex-basis: auto; aspect-ratio: 16 / 9; min-height: 0; }
	.lsh-more__btn { width: 100%; justify-content: center; padding: 14px 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.lsh-card, .lsh-card__photo, .lsh-side { transition: none !important; }
}
