body {
	min-height: 100vh;
}

.sm-topbar {
	background-color: var(--sm-topbar-bg) !important;
	color: var(--sm-topbar-text) !important;
}

.sm-topbar a,
.sm-topbar .sm-topbar-link {
	color: var(--sm-topbar-text) !important;
}

.sm-topbar a:hover {
	text-decoration: underline;
}

.sm-topbar-link {
	color: inherit;
}

.sm-topbar-link:hover {
	text-decoration: underline;
}

.sm-minicart-toggle {
	color: var(--sm-mainheader-text) !important;
}

.sm-minicart-toggle:hover,
.sm-minicart-toggle:focus {
	text-decoration: none;
}

.sm-minicart-toggle:focus-visible {
	outline: 2px solid rgba(13, 110, 253, 0.35);
	outline-offset: 2px;
	border-radius: 6px;
}

.sm-logo {
	height: 34px;
	width: auto;
	max-width: 180px;
}

.sm-mainheader {
	background-color: var(--sm-mainheader-bg) !important;
	color: var(--sm-mainheader-text) !important;
}

.sm-mainheader a {
	color: var(--sm-mainheader-text) !important;
}

.sm-catnav {
	background-color: var(--sm-catnav-bg) !important;
	color: var(--sm-catnav-text) !important;
	/* Also override Bootstrap navbar CSS variables */
	--bs-navbar-color: var(--sm-catnav-text);
	--bs-navbar-hover-color: var(--sm-catnav-text);
	--bs-navbar-active-color: var(--sm-catnav-text);
	--bs-navbar-disabled-color: rgba(0, 0, 0, 0.3);
	--bs-navbar-toggler-border-color: transparent;
}

.sm-catnav .nav-link {
	color: var(--sm-catnav-text) !important;
}

.sm-catnav .nav-link:hover,
.sm-catnav .nav-link:focus {
	text-decoration: underline;
}

.sm-catnav .navbar-toggler {
	border: 0;
	padding-left: 0;
	padding-right: 0;
}

.sm-catnav .navbar-toggler:focus {
	box-shadow: none;
}

@media (min-width: 992px) {
	.sm-products-filters {
		flex: 0 0 25%;
		max-width: 25%;
	}
	.sm-products-grid {
		flex: 0 0 75%;
		max-width: 75%;
	}
}

/* Product tiles */
.sm-product-card-img {
	height: 180px;
	width: 100%;
	object-fit: contain;
	object-position: center;
	background: #fff;
}

.sm-product-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 1.25rem;
	min-height: calc(1.25rem * 2);
}

.navbar.bg-dark {
	background-color: var(--sm-header-bg) !important;
}

footer.bg-dark,
.bg-dark.sm-footer {
	background-color: var(--sm-footer-bg) !important;
}

.btn,
.form-control,
.form-select,
.card {
	border-radius: var(--sm-btn-radius) !important;
}

/* Password toggle (eye icon) should look integrated */
.input-group .form-control {
	border-right: 0;
	border-top-right-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
}

.input-group [data-toggle-password] {
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-left: 0;
	border-color: var(--bs-border-color);
	border-top-left-radius: 0 !important;
	border-bottom-left-radius: 0 !important;
}

.input-group .form-control:focus + [data-toggle-password] {
	border-color: var(--bs-border-color);
}

.input-group [data-toggle-password]:hover {
	background: #f8f9fa;
	color: #212529;
}

.input-group [data-toggle-password]:focus {
	box-shadow: none;
}

.input-group .form-control:focus {
	box-shadow: none;
}

/* Product detail carousel: prevent layout jumping */
.product-carousel-frame {
	height: 360px;
	background: #fff;
}

.product-carousel-frame .carousel-item {
	height: 100%;
}

.product-carousel-frame .carousel-item img {
	display: block;
	height: 100%;
	max-height: 100%;
	width: 100%;
	object-fit: contain;
}

@media (max-width: 576px) {
	.product-carousel-frame,
	.product-carousel-frame .carousel-item,
	.product-carousel-frame .carousel-item img {
		height: 260px;
	}
}

/* Admin auth page */
.sm-admin-auth-body {
	min-height: 100vh;
	background-color: #0f172a;
	background-image:
		linear-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px),
		linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
		radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.18), transparent 36%),
		radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.16), transparent 40%);
	background-size: 36px 36px, 36px 36px, auto, auto;
}

.sm-admin-auth-row {
	min-height: calc(100vh - 3rem);
}

.sm-admin-auth-card {
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(2px);
}

.sm-admin-auth-logo {
	width: 78px;
	height: 78px;
}

/* Admin sidebar (compact + flyout) */
.admin-sidebar {
	background-color: #16304b;
	width: 112px;
	flex: 0 0 112px;
	min-width: 112px;
	max-width: 112px;
	flex-shrink: 0;
	padding: 12px 10px;
	position: relative;
	z-index: 1030;
}

.admin-sidebar__brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 4px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-sidebar__brand-icon {
	width: 42px;
	height: 42px;
	display: block;
}

.admin-sidebar__brand-title {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.1;
}

.admin-sidebar__brand-subtitle {
	font-size: 0.68rem;
	color: rgba(255, 255, 255, 0.72);
	line-height: 1.25;
	max-width: 86px;
}

.admin-sidebar__nav {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.admin-sidebar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 72px;
	padding: 8px 6px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #fff;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.admin-sidebar__item i {
	font-size: 1.6rem;
	line-height: 1;
	margin-bottom: 7px;
}

.admin-sidebar__item span {
	font-size: 0.72rem;
	line-height: 1.2;
	text-align: center;
}

.admin-sidebar__item:hover,
.admin-sidebar__item:focus,
.admin-sidebar__item[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	text-decoration: none;
}

.admin-sidebar__item:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: 1px;
}

.admin-flyout {
	position: absolute;
	top: 0;
	left: 100%;
	height: auto;
	min-height: 100%;
	width: auto;
	min-width: 250px;
	background: #0f2539;
	border-left: 1px solid rgba(255, 255, 255, 0.12);
	padding: 16px 12px;
	display: none;
	overflow: visible;
	z-index: 1031;
}

.admin-flyout.is-open {
	display: block;
}

.admin-flyout__panel {
	display: none;
}

.admin-flyout__panel.is-active {
	display: block;
}

.admin-flyout__title {
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 10px;
}

.admin-flyout__links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.admin-flyout__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.admin-flyout__section {
	padding: 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-flyout__section-title {
	font-size: 0.75rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
	margin-bottom: 8px;
	font-weight: 700;
}

.admin-flyout__section-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.admin-flyout__link {
	display: block;
	padding: 8px 10px;
	border-radius: 8px;
	color: rgba(255, 255, 255, 0.9);
	text-decoration: none;
	font-size: 0.86rem;
}

.admin-flyout__link:hover,
.admin-flyout__link:focus {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	text-decoration: none;
}

.admin-flyout__panel--wide {
	min-width: 700px;
}

.admin-flyout__panel--wide .admin-flyout__grid {
	grid-template-columns: 1fr 1fr;
}

/* Dashboard charts */
.sm-chart {
	display: block;
}

.sm-chart__grid line {
	stroke: #e9ecef;
	stroke-width: 1;
	shape-rendering: crispEdges;
}

.sm-chart__axis text {
	fill: #6c757d;
	font-size: 11px;
}

.sm-chart__area {
	opacity: 0;
	animation: smChartFade 450ms ease-out forwards;
}

.sm-chart__line {
	stroke-dasharray: 1200;
	stroke-dashoffset: 1200;
	animation: smChartDraw 650ms ease-out forwards;
}

.sm-chart__dot {
	opacity: 0;
	animation: smChartFade 450ms ease-out 350ms forwards;
}

@keyframes smChartDraw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes smChartFade {
	to {
		opacity: 1;
	}
}

@media (max-width: 991.98px) {
	.admin-sidebar {
		width: 88px;
		flex-basis: 88px;
		min-width: 88px;
		max-width: 88px;
	}

	.admin-flyout {
		min-width: 220px;
	}

	.admin-flyout__panel--wide {
		min-width: 520px;
	}

	.admin-flyout__panel--wide .admin-flyout__grid {
		grid-template-columns: 1fr 1fr;
	}
}
