@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&display=swap");

.rl-categories-page {
	--rlcat-pad: 16px;
	--rlcat-text: #333333;
	--rlcat-title: #1f2937;
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 8px 0 20px;
	background: #fff;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	overflow-x: clip;
}

.rl-categories-page *,
.rl-categories-page *::before,
.rl-categories-page *::after {
	box-sizing: border-box;
}

.rl-categories-shell {
	max-width: 680px;
	margin: 0 auto;
}

.rl-categories-header {
	padding: 8px var(--rlcat-pad) 4px;
}

.rl-categories-title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: -0.2px;
	color: var(--rlcat-title);
}

.rl-categories-track {
	display: flex;
	gap: 20px;
	padding: 12px var(--rlcat-pad) 4px;
	overflow-x: auto;
	scrollbar-width: none;
}

.rl-categories-page.is-grid .rl-categories-track {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px 8px;
	overflow: visible;
}

.rl-categories-track::-webkit-scrollbar {
	display: none;
}

.rl-categories-loading,
.rl-categories-empty,
.rl-categories-error {
	width: 100%;
	text-align: center;
	padding: 24px 12px;
	color: #64748b;
}

.rl-categories-spinner {
	width: 34px;
	height: 34px;
	margin: 0 auto 12px;
	border: 2px solid #e2e8f0;
	border-top-color: #111827;
	border-radius: 50%;
	animation: rlcat-spin 0.9s linear infinite;
}

@keyframes rlcat-spin {
	to {
		transform: rotate(360deg);
	}
}

.rl-category-item {
	flex: 0 0 auto;
	width: 80px;
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	text-align: center;
	color: inherit;
	text-decoration: none;
}

.rl-categories-page.is-grid .rl-category-item {
	width: auto;
}

.rl-category-thumb {
	width: 66px;
	height: 66px;
	margin: 0 auto;
	border-radius: 50%;
	border: 1px solid #f3f4f6;
	background: #f3f4f6;
	overflow: hidden;
	display: block;
}

.rl-categories-page.is-grid .rl-category-thumb {
	width: min(80px, 100%);
	height: auto;
	aspect-ratio: 1;
}

.rl-category-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rl-category-name {
	display: block;
	margin-top: 8px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--rlcat-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rl-category-view-all {
	margin-right: 0;
}

.rl-category-view-all-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f77057;
	border-color: #fed7aa;
	color: #fffbeb;
}

.rl-category-view-all-thumb svg {
	display: block;
}

.rl-categories-page.is-grid .rl-category-name {
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rl-categories-footer {
	padding: 8px var(--rlcat-pad) 0;
	text-align: center;
}

.rl-categories-load-more,
.rl-categories-retry {
	border: 0;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	padding: 10px 18px;
	cursor: pointer;
}

@media (max-width: 480px) {
	.rl-categories-page.is-grid .rl-categories-track {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.rl-categories-page {
		--rlcat-pad: 20px;
	}
}

@media (min-width: 900px) {
	.rl-categories-page.is-grid .rl-categories-track {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}
