/**
 * Royal Computers — left category navigation sidebar (v1.0.26)
 */

.rc-cat-sidebar {
	--rc-cat-sidebar-red: #a91b2e;
	--rc-cat-sidebar-red-hover: #8b1625;
	--rc-cat-sidebar-bg: #ffffff;
	--rc-cat-sidebar-border: #e4e8ef;
	--rc-cat-sidebar-text: #1a1f2b;
	--rc-cat-sidebar-muted: #5c6578;
	--rc-cat-sidebar-rail-w: 56px;
	--rc-cat-sidebar-panel-w: min(300px, 86vw);
	--rc-cat-sidebar-top: 120px;
	--rc-cat-sidebar-z: 950;

	position: fixed;
	top: var(--rc-cat-sidebar-top);
	left: 0;
	bottom: 0;
	z-index: var(--rc-cat-sidebar-z);
	width: var(--rc-cat-sidebar-rail-w);
	pointer-events: none;
}

.rc-cat-sidebar__panel[hidden],
.rc-cat-sidebar__backdrop[hidden] {
	display: none !important;
}

.rc-cat-sidebar__rail,
.rc-cat-sidebar__toggle,
.rc-cat-sidebar__icon-link,
.rc-cat-sidebar__panel,
.rc-cat-sidebar__backdrop {
	pointer-events: auto;
}

.rc-cat-sidebar__rail {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: var(--rc-cat-sidebar-rail-w);
	height: 100%;
	padding: 0.5rem 0;
	border-right: 1px solid var(--rc-cat-sidebar-border);
	background: var(--rc-cat-sidebar-bg);
	box-shadow: 2px 0 12px rgba(26, 26, 26, 0.06);
}

.rc-cat-sidebar__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 0 0.5rem;
	padding: 0;
	border: 1px solid var(--rc-cat-sidebar-border);
	border-radius: 8px;
	background: var(--rc-cat-sidebar-bg);
	color: var(--rc-cat-sidebar-text);
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.rc-cat-sidebar__toggle:hover,
.rc-cat-sidebar__toggle:focus {
	border-color: rgba(169, 27, 46, 0.35);
	color: var(--rc-cat-sidebar-red);
	background: #faf5f5;
	outline: none;
}

.rc-cat-sidebar__toggle-bars,
.rc-cat-sidebar__toggle-bars::before,
.rc-cat-sidebar__toggle-bars::after {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 999px;
	background: currentColor;
}

.rc-cat-sidebar__toggle-bars {
	position: relative;
}

.rc-cat-sidebar__toggle-bars::before,
.rc-cat-sidebar__toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.rc-cat-sidebar__toggle-bars::before {
	top: -6px;
}

.rc-cat-sidebar__toggle-bars::after {
	top: 6px;
}

.rc-cat-sidebar.is-expanded .rc-cat-sidebar__toggle-bars {
	background: transparent;
}

.rc-cat-sidebar.is-expanded .rc-cat-sidebar__toggle-bars::before {
	top: 0;
	transform: rotate(45deg);
}

.rc-cat-sidebar.is-expanded .rc-cat-sidebar__toggle-bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.rc-cat-sidebar__icons {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	width: 100%;
	padding: 0.25rem 0;
	overflow-y: auto;
	scrollbar-width: thin;
}

.rc-cat-sidebar__icon-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.rc-cat-sidebar__icon-link:hover,
.rc-cat-sidebar__icon-link:focus {
	background: #f6f7f9;
}

.rc-cat-sidebar__icon,
.rc-cat-sidebar__row-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
}

.rc-cat-sidebar__icon img,
.rc-cat-sidebar__row-icon img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.rc-cat-sidebar__icon-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: #f6f7f9;
	color: var(--rc-cat-sidebar-red);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
}

.rc-cat-sidebar__panel {
	position: fixed;
	top: var(--rc-cat-sidebar-top);
	left: var(--rc-cat-sidebar-rail-w);
	bottom: 0;
	width: var(--rc-cat-sidebar-panel-w);
	border-right: 1px solid var(--rc-cat-sidebar-border);
	background: var(--rc-cat-sidebar-bg);
	box-shadow: 8px 0 24px rgba(26, 26, 26, 0.1);
	transform: translateX(-8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.rc-cat-sidebar.is-expanded .rc-cat-sidebar__panel {
	transform: translateX(0);
	opacity: 1;
	visibility: visible;
}

.rc-cat-sidebar__panel-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0.85rem;
	border-bottom: 1px solid var(--rc-cat-sidebar-border);
}

.rc-cat-sidebar__panel-title {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--rc-cat-sidebar-text);
}

.rc-cat-sidebar__list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: calc(100% - 64px);
	overflow-y: auto;
}

.rc-cat-sidebar__item {
	margin: 0;
	border-bottom: 1px solid var(--rc-cat-sidebar-border);
}

.rc-cat-sidebar__row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 52px;
	padding: 0.65rem 0.85rem;
	color: var(--rc-cat-sidebar-text);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rc-cat-sidebar__row:hover,
.rc-cat-sidebar__row:focus {
	background: #faf5f5;
	color: var(--rc-cat-sidebar-red);
	text-decoration: none;
}

.rc-cat-sidebar__row-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

.rc-cat-sidebar__row-arrow {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-top: 2px solid var(--rc-cat-sidebar-muted);
	border-right: 2px solid var(--rc-cat-sidebar-muted);
	transform: rotate(45deg);
}

.rc-cat-sidebar__row:hover .rc-cat-sidebar__row-arrow,
.rc-cat-sidebar__row:focus .rc-cat-sidebar__row-arrow {
	border-color: var(--rc-cat-sidebar-red);
}

.rc-cat-sidebar__backdrop {
	position: fixed;
	inset: 0;
	z-index: calc(var(--rc-cat-sidebar-z) - 1);
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(26, 26, 26, 0.35);
	cursor: pointer;
}

body.rc-cat-sidebar-open {
	touch-action: none;
}

@media (min-width: 992px) {
	.rc-cat-sidebar__panel {
		z-index: calc(var(--rc-cat-sidebar-z) + 1);
	}
}

@media (max-width: 991px) {
	.rc-cat-sidebar {
		--rc-cat-sidebar-rail-w: 0px;
		width: auto;
		top: auto;
		bottom: 0;
		height: auto;
	}

	.rc-cat-sidebar__rail {
		position: fixed;
		top: auto;
		bottom: 1rem;
		left: 1rem;
		width: auto;
		height: auto;
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.rc-cat-sidebar__icons {
		display: none;
	}

	.rc-cat-sidebar__toggle {
		width: 48px;
		height: 48px;
		margin: 0;
		border-radius: 999px;
		box-shadow: 0 4px 16px rgba(26, 26, 26, 0.15);
	}

	.rc-cat-sidebar__panel {
		left: 0;
		width: min(300px, 88vw);
		transform: translateX(-100%);
		z-index: calc(var(--rc-cat-sidebar-z) + 2);
	}

	.rc-cat-sidebar.is-expanded .rc-cat-sidebar__panel {
		transform: translateX(0);
	}

	.rc-cat-sidebar__backdrop {
		z-index: calc(var(--rc-cat-sidebar-z) + 1);
	}
}

@media (max-width: 390px) {
	.rc-cat-sidebar__rail {
		left: 0.75rem;
		bottom: 0.75rem;
	}
}
