/* Homepage category entrance bar (Klook-style) */

.mangden-category-entrance {
	background: #fff;
	border-bottom: 1px solid #eee;
}

.mangden-category-entrance--embedded {
	background: transparent;
	border-bottom: none;
	margin-bottom: 8px;
}

.mangden-category-entrance--embedded .entrance-item {
	min-height: 80px;
}

.entrance-item.is-active {
	border-color: #ff5b00;
	background: #fff8f4;
}

.category-list-box-l0 .entrance-l0 {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.entrance-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 88px;
	padding: 12px 8px;
	border: 1px solid #eee;
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: #212121;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

button.entrance-item {
	appearance: none;
	font: inherit;
	width: 100%;
}

.entrance-item:hover,
.entrance-item:focus-visible {
	border-color: #ff5b00;
	box-shadow: 0 4px 16px rgba(255, 91, 0, 0.12);
	transform: translateY(-2px);
	outline: none;
}

.entrance-item .icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.entrance-item .icon img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.entrance-item p {
	margin: 0;
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	text-align: center;
	color: #212121;
}

/* Drawer */

.mangden-category-drawer {
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
}

.mangden-category-drawer.is-open {
	pointer-events: auto;
}

.mangden-category-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.mangden-category-drawer.is-open .mangden-category-drawer__overlay {
	opacity: 1;
}

.mangden-category-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: 100%;
	height: 100%;
	background: #fff;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

@media (min-width: 768px) {
	.mangden-category-drawer__panel {
		width: 50%;
	}
}

.mangden-category-drawer.is-open .mangden-category-drawer__panel {
	transform: translateX(0);
}

.klk-drawer-content,
.all-categories {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.all-categories .header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.all-categories .close-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
}

.all-categories .close-icon:hover {
	background: #f5f5f5;
}

.all-categories .title {
	flex: 1;
	font-size: 18px;
	font-weight: 700;
	color: #212121;
	text-align: center;
}

.all-categories .layout-switcher {
	position: relative;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	width: 64px;
	height: 32px;
	padding: 2px;
	border-radius: 16px;
	background: #eee;
}

.layout-switcher__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 28px;
	height: 28px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.layout-switcher.is-list .layout-switcher__thumb {
	transform: translateX(32px);
}

.layout-switcher__btn {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 28px;
	padding: 0;
	border: none;
	background: transparent;
	color: #8a8a8a;
	cursor: pointer;
	border-radius: 14px;
	transition: color 0.2s ease;
}

.layout-switcher__btn.is-active {
	color: #ff5b00;
}

.layout-switcher__btn:hover {
	color: #ff5b00;
}

.layout-switcher__btn svg {
	display: block;
}

.categories-lists {
	flex: 1;
	overflow-y: auto;
	padding: 8px 20px 32px;
}

.single-l0-category {
	padding: 20px 0 8px;
	border-bottom: 1px solid #f0f0f0;
}

.single-l0-category:last-child {
	border-bottom: none;
}

.l0-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	font-size: 16px;
	font-weight: 700;
	color: #212121;
	text-decoration: none;
}

a.l0-title:hover {
	color: #ff5b00;
}

.l0-title-icon {
	display: inline-flex;
}

.l1-container.is-horizontal {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px 8px;
}

.l1-item-link {
	text-decoration: none;
	color: inherit;
}

.sigle-l1-category.is-vertical {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 6px 4px;
	border-radius: 8px;
	transition: background 0.2s ease;
}

.l1-item-link:hover .sigle-l1-category.is-vertical {
	background: #fafafa;
}

.category-icon {
	width: 36px;
	height: 36px;
	object-fit: contain;
}

.category-name {
	margin: 0;
	font-size: 11px;
	line-height: 1.25;
	font-weight: 500;
	text-align: center;
	color: #424242;
}

/* Drawer list layout */

.categories-lists.is-list .l1-container.is-horizontal {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.categories-lists.is-list .l1-item-link {
	display: block;
	border-bottom: 1px solid #f5f5f5;
}

.categories-lists.is-list .l1-item-link:last-child {
	border-bottom: none;
}

.categories-lists.is-list .sigle-l1-category.is-vertical {
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	padding: 12px 4px;
	border-radius: 0;
}

.categories-lists.is-list .l1-item-link:hover .sigle-l1-category.is-vertical {
	background: #fafafa;
}

.categories-lists.is-list .category-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
}

.categories-lists.is-list .category-name {
	font-size: 14px;
	line-height: 1.4;
	font-weight: 400;
	text-align: left;
	color: #212121;
}

.categories-lists.is-list .single-l0-category {
	padding-bottom: 4px;
}

.categories-lists.is-list .l0-title {
	margin-bottom: 8px;
}

body.mangden-drawer-open {
	overflow: hidden;
}

@media (max-width: 1023px) {
	.category-list-box-l0 .entrance-l0 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 639px) {
	.category-list-box-l0 .entrance-l0 {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		gap: 10px;
		padding-bottom: 4px;
	}

	.entrance-item {
		flex: 0 0 108px;
		scroll-snap-align: start;
		min-height: 96px;
	}

	.l1-container.is-horizontal {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
