.product-shop {
	display: flex;
	gap: 28px;
}

.category-sidebar {
	flex: 0 0 300px;
	position: sticky;
}

@media (max-width: 1199px) {
	.category-sidebar {
		position: fixed;
		left: 0;
		top: 0 !important;
		background: hsl(var(--white));
		padding: 42px 16px 16px 16px;
		z-index: 99999;
		width: 100%;
		max-width: 324px;
		height: 100vh;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: all 0.3s ease-in;
	}

	.category-sidebar.active {
		transform: translateX(0);
	}
}

.product-filter-form {
	position: sticky;
	top: 130px;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	padding-right: 8px;
	/* The sidebar lives inside a CSS grid (.category-sidebar + .products-container).
	   Without `align-self: start` the grid stretches the row to the tallest
	   sibling and `position: sticky` never engages because the row itself
	   fills the viewport. */
	align-self: start;
}

/* Scrollbar tuned to match the brand palette — same idea as
   .filter-overflow but applied to the whole sidebar so the user can
   reach every filter group without scrolling the page itself. */
.product-filter-form::-webkit-scrollbar {
	width: 6px;
}

.product-filter-form::-webkit-scrollbar-thumb {
	background-color: hsl(var(--base) / 0.35);
	border-radius: 4px;
}

.product-filter-form::-webkit-scrollbar-track {
	background-color: hsl(var(--base) / 0.08);
	border-radius: 4px;
}

/* On mobile (<1200px) the sidebar is a fixed drawer, not sticky. The
   viewport-height cap and the scroll live on .category-sidebar
   itself in the existing media query, so this rule is a no-op there. */
@media (max-width: 1199px) {
	.product-filter-form {
		max-height: none;
		overflow: visible;
		padding-right: 0;
	}
}

/* Collapsible filter groups — every .widget in the sidebar is an accordion
   row. The header (.iw-filter-head) is the click target; the body is
   revealed by adding .iw-open to the widget.

   The body is collapsed with max-height (NOT display:none) on purpose: the
   jQuery UI price slider measures its element's width when it initialises,
   and a display:none parent would report width 0 and render a zero-width
   slider. Clipping keeps the element measurable, so the slider is correct
   the moment the group is expanded. The transition makes the toggle smooth. */
.category-sidebar .widget.iw-filter-collapsible > .title.iw-filter-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 0;
	padding-bottom: 0;
	cursor: pointer;
	user-select: none;
	transition: padding-bottom 0.25s ease;
}

.category-sidebar .widget.iw-filter-collapsible.iw-open > .title.iw-filter-head {
	padding-bottom: 1.2rem;
}

.category-sidebar .iw-filter-chevron {
	flex-shrink: 0;
	font-size: 1.15rem;
	color: hsl(var(--base));
	transition: transform 0.25s ease;
}

.category-sidebar .widget.iw-filter-collapsible.iw-open > .title .iw-filter-chevron {
	transform: rotate(180deg);
}

.category-sidebar .widget.iw-filter-collapsible > .widget-body {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transition: max-height 0.28s ease, opacity 0.2s ease, visibility 0s linear 0.28s;
}

.category-sidebar .widget.iw-filter-collapsible.iw-open > .widget-body {
	max-height: 420px;
	opacity: 1;
	visibility: visible;
	transition: max-height 0.28s ease, opacity 0.2s ease, visibility 0s;
}

/* Long option lists scroll inside the group instead of stretching it. */
.category-sidebar .widget.iw-filter-collapsible.iw-open > .widget-body.iw-filter-scroll {
	max-height: 240px;
	overflow-y: auto;
}

.category-sidebar .iw-filter-scroll {
	scrollbar-width: thin;
	scrollbar-color: hsl(var(--base) / 0.35) hsl(var(--base) / 0.08);
}

.category-sidebar .iw-filter-scroll::-webkit-scrollbar {
	width: 5px;
}

.category-sidebar .iw-filter-scroll::-webkit-scrollbar-thumb {
	background-color: hsl(var(--base) / 0.35);
	border-radius: 4px;
}

.category-sidebar .iw-filter-scroll::-webkit-scrollbar-track {
	background-color: hsl(var(--base) / 0.08);
	border-radius: 4px;
}

/* Categories widget — parents only, each with its own sub-category toggle.
   Toggles are independent: opening one parent leaves the others alone. */
.category-sidebar .iw-cat-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 2px 0 6px;
	padding: 0;
	background: transparent;
	border: 0;
	font-size: 12px;
	font-weight: 600;
	color: hsl(var(--base));
	cursor: pointer;
}

.category-sidebar .iw-cat-toggle:hover {
	text-decoration: underline;
}

.category-sidebar .iw-cat-toggle:focus-visible {
	outline: 2px solid hsl(var(--base));
	outline-offset: 2px;
}

.category-sidebar .iw-cat-toggle__icon {
	font-size: 0.95rem;
	transition: transform 0.25s ease;
}

.category-sidebar li.iw-cat-open > .iw-cat-toggle .iw-cat-toggle__icon {
	transform: rotate(180deg);
}

.category-sidebar .filter-category .sub-category {
	display: none;
}

.category-sidebar .filter-category li.iw-cat-open > .sub-category {
	display: block;
}

.filter-in {
	font-size: 0.875rem;
	text-align: center;
	color: hsl(var(--white));
	border-radius: 3px;
	margin: 1px;
	cursor: pointer;
	background-color: hsl(var(--base));
	padding: 5px 10px;
}

.close-sidebar {
	color: hsl(var(--black) / 0.5) !important;
	position: absolute;
	background: transparent;
	right: 8px;
	top: 9px;
	font-size: 1.25rem;
}

.filter-overflow {
	max-height: 400px;
	overflow-y: auto;
}

.filter-overflow::-webkit-scrollbar {
	width: 4px;
	height: 4px;
}

.filter-overflow::-webkit-scrollbar-button {
	width: 0px;
	height: 0px;
}

.filter-overflow::-webkit-scrollbar-thumb {
	background-color: hsl(var(--border));
	border: 0px solid transparent;
	border-radius: 5px;
	background-color: #ebebeb;
	height: 10px !important;
}

.filter-overflow::-webkit-scrollbar-track {
	background-color: hsl(var(--base) / 0.1) !important;
	border-radius: 5px;
	display: none !important;
}

.widget {
	background: hsl(var(--white));
	padding: 20px;
	border-radius: 5px;
	margin-bottom: 20px;
	border: 1px solid hsl(var(--border));
}

.widget .title {
	padding-bottom: 1.2rem;
	font-size: 1.12rem;
}

.widget:last-child {
	margin-bottom: 0;
}

.widget .ui-state-default {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: block;
	border: none;
	border-radius: 50%;
	background-color: hsl(var(--base));
	box-shadow: 0 9px 20px 0 rgba(22, 26, 57, 0.36);
	outline: none;
	cursor: pointer;
	top: -9px;
	position: absolute;
	z-index: 1;
}

.widget .ui-state-default::after {
	position: absolute;
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: hsl(var(--white));
	top: 3px;
	left: 3px;
	display: block;
}

.widget .ui-widget.ui-widget-content {
	position: relative;
	height: 3px;
	border: none;
	margin-right: 20px;
	margin-bottom: 25px;
}

.widget .ui-widget.ui-widget-content::after {
	position: absolute;
	content: "";
	top: 0;
	left: 0;
	height: 3px;
	background: hsl(var(--base) / 0.2);
	width: calc(100% + 20px);
}

.widget .ui-slider-range {
	height: 3px;
	background: hsl(var(--base));
	position: relative;
	z-index: 1;
}

.widget-check-group {
	align-items: center;
	margin-bottom: 10px;
	display: flex;
	flex-wrap: wrap;
}

.widget-check-group:last-child {
	margin-bottom: 0;
}

.widget-check-group input {
	width: 14px;
	height: 14px;
	position: relative;
	border: none;
}

.widget-check-group input::after {
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	content: "\f00c";
	position: absolute;
	background: hsl(var(--white));
	color: hsl(var(--white));
	font-weight: 600;
	z-index: 1;
	font-family: "Line Awesome Free";
	border: 1px solid #a2a2a2;
	font-size: 10px;
	line-height: 12px;
	text-align: center;
	border-radius: 3px;
}

.widget-check-group input:checked::after {
	background: hsl(var(--base));
	border-color: hsl(var(--base));
}

.widget-check-group .form-check-input {
	margin-top: 0px !important;
}

.widget-check-group label {
	margin: 0;
	width: calc(100% - 14px);
	padding-left: 8px;
	font-size: 14px;
	color: hsl(var(--black) / 0.7);
	font-weight: 400;
}

.price-range {
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
}

.price-range .input-group .form-control:disabled,
.price-range .input-group .form-control {
	background-color: #f7f7f7;
	opacity: 1;
	border: 1px solid hsl(var(--border));
	font-weight: 400;
	padding: 0.375rem 0.75rem;
	color: hsl(var(--black) / 0.7);
}

.price-range label {
	margin: 0;
	font-weight: 400;
	color: hsl(var(--black) / 0.7);
}

.select-color {
	flex-shrink: 0;
	display: inline-block;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	position: relative;
	isolation: isolate;
	background: hsl(var(--light-3));
	outline: 1px solid hsl(var(--border));
	outline-offset: 2px;
	cursor: pointer;
}

.select-color:has(.select-color__input:checked)::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 11px;
	background: white;
	width: 2px;
	height: 2px;
	box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white,
		4px -6px 0 white, 4px -8px 0 white;
	transform: rotate(45deg);
}

.select-color__input {
	height: 0px;
}

.select-color__input {
	visibility: hidden;
	opacity: 0;
}

@supports not (gap: 1rem) {
	.select {
		margin: -0.5rem;
	}

	.select>* {
		margin: 0.5rem;
	}
}

.breadcrumb a {
	color: hsl(var(--heading-color) / 0.5);
	transition: all 0.3s ease;
}

.breadcrumb a:hover {
	color: hsl(var(--heading-color));
}

.breadcrumb-item+.breadcrumb-item::before {
	font-family: "Line Awesome Free";
	font-weight: 600;
	content: "\f105";
}

.breadcrumb li:last-child {
	color: hsl(var(--heading-color));
}

.list-view-active {
	flex: 0 0 100%;
	max-width: 100%;
}

.list-view-active .product-card {
	display: flex;
	flex-wrap: wrap;
}

.list-view-active .product-card .product-thumb {
	width: 240px;
	position: relative;
	display: flex;
}

@media (max-width: 767px) {
	.list-view-active .product-card .product-thumb {
		width: 200px;
	}
}

.list-view-active .product-card .product-thumb a {
	height: 100%;
}

.list-view-active .product-card .product-thumb img {
	height: 100%;
	object-fit: cover;
}

.list-view-active .product-card .product-thumb .product-card-buttons {
	opacity: 1;
	transform: translate(0);
}

.list-view-active .product-card .product-thumb .product-card-buttons li {
	transform: translate(0);
}

.list-view-active .product-card .product-content {
	width: calc(100% - 240px);
	padding-left: 24px;
}

@media (max-width: 767px) {
	.list-view-active .product-card .product-content {
		padding-left: 12px;
		width: calc(100% - 200px);
	}
}

@media screen and (max-width: 575px) {

	.list-view-active .product-card .product-thumb,
	.list-view-active .product-card .product-content {
		width: 100%;
		padding: 0;
	}
}

.list-view-active .product-card:hover .product-before-content {
	transform: translateY(0);
}

.list-view-active .single_content {
	padding-top: 20px;
	padding-bottom: 0;
	display: block;
}

.list-view-active .product-card .product-content .product-after-content {
	position: relative;
	opacity: 1;
	transform: scale(1);
	text-align: left;
}

.list-view-active .product-card .product-content .product-after-content .price {
	display: none;
}

.list-view-active .single_content__info {
	flex-direction: column-reverse;
}

.list-view-active .add-to-cart-btn {
	width: unset;
}
/* Compact filter cards, scoped to the shop sidebar. */
.category-sidebar .widget.iw-filter-collapsible {
    padding: 0;
    margin-bottom: 10px;
    border: 1px solid #e4e8ef;
    border-radius: 9px;
    overflow: hidden;
}
.category-sidebar .widget.iw-filter-collapsible > .title.iw-filter-head,
.category-sidebar .widget.iw-filter-collapsible.iw-open > .title.iw-filter-head {
    min-height: 48px;
    padding: 13px 15px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #344054;
}
.category-sidebar .widget.iw-filter-collapsible.iw-open > .title.iw-filter-head,
.category-sidebar .iw-filter-head:hover { background: #f8fafc; }
.category-sidebar .iw-filter-head:focus-visible { outline: 2px solid #bd9300; outline-offset: -2px; }
.category-sidebar .iw-filter-chevron { font-size: 16px; color: #8c96a7; }
.category-sidebar .widget.iw-filter-collapsible.iw-open > .widget-body {
    padding: 12px 15px 15px;
    border-top: 1px solid #eef1f5;
}
.category-sidebar .widget-body label,
.category-sidebar .filter-category a { font-size: 13px; line-height: 1.6; }
.product-filter-form { scrollbar-width: thin; scrollbar-color: #d4dae3 transparent; }
.product-filter-form::-webkit-scrollbar { width: 4px; }
.product-filter-form::-webkit-scrollbar-thumb { background: #d4dae3; border-radius: 4px; }
.product-filter-form::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
    .category-sidebar .iw-filter-chevron,
    .category-sidebar .widget.iw-filter-collapsible > .widget-body { transition: none; }
}

/* Category links and their independent expand arrows share one row. */
.category-sidebar .filter-category > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: start;
    gap: 0 6px;
    margin: 0 0 3px;
    padding: 3px 0;
}
.category-sidebar .filter-category > li > a {
    grid-column: 1;
    padding: 7px 0;
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.category-sidebar .filter-category > li > a > i { display: none; }
.category-sidebar .filter-category > li > .iw-cat-toggle {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 34px;
    margin: 0;
    padding: 0;
    color: #738096;
    border-radius: 6px;
}
.category-sidebar .filter-category > li > .iw-cat-toggle:hover { background: #eef2f7; text-decoration: none; }
.category-sidebar .filter-category > li > .sub-category {
    grid-column: 1 / -1;
    margin: 4px 0 0 3px;
    padding: 4px 0 4px 14px;
    border-left: 1px solid #e5e9f0;
}
.category-sidebar .filter-category .sub-category li { margin: 0; padding: 0; }
.category-sidebar .filter-category .sub-category a { display: block; padding: 6px 0; font-size: 12px; }

/* Balanced catalog toolbar with equal-height controls. */
.product-shop .filter-category-header {
    padding: 10px 14px;
    margin-bottom: 22px;
    min-height: 58px;
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    background: #fafbfd;
    gap: 12px!important;
}
.product-shop .filter-category-header > div:first-child > span { font-size: 12px; color: #758195!important; }
.product-shop .filter-category-header .totalProducts { color: #344054; }
.product-shop .filter-select-right { flex-grow: 0!important; gap: 12px!important; }
.product-shop .filter-category-header .filter-select-item { flex-direction: row; align-items: center!important; gap: 7px!important; }
.product-shop .filter-category-header .filter-select-item p { font-size: 12px; color: #667085; white-space: nowrap; }
.product-shop .filter-category-header .form--select {
    height: 38px;
    min-height: 38px;
    border: 1px solid #dfe4ec;
    border-radius: 7px;
    background-color: #fff;
    padding: 7px 30px 7px 10px;
    font-size: 13px;
    color: #344054;
}
.product-shop .filter-category-header [name="sort_by"] { width: 170px; }
.product-shop .filter-category-header [name="per_page"] { width: 70px; min-width: 70px; }
.product-shop .filter-category-header .view-style { margin: 0; gap: 5px!important; }
.product-shop .filter-category-header .view-style a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; line-height: 1; border-radius: 7px; background: #fff; font-size: 18px; }
.product-shop .filter-category-header .view-style a.active { color: #a97c00; background: #fff8e3; border-color: #edd797; }
.product-shop .filter-category-header :is(select,a,button):focus-visible { outline: 2px solid #b88c00; outline-offset: 2px; }
@media(min-width:1200px) { .product-shop .filter-category-header { flex-wrap: nowrap!important; } }
@media(max-width:767.98px) {
    .product-shop .filter-select-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .product-shop .filter-category-header { padding: 10px; }
    .product-shop .filter-category-header [name="sort_by"] { width: 130px; }
}
@media(max-width:399.98px) { .product-shop .filter-select-right > div:first-child { flex-wrap: wrap; } }

/* Native selects with one arrow and enough room for the selected value. */
.product-shop .filter-category-header .filter-select-item label {
    font-size: 12px;
    font-weight: 500;
    color: #667085;
    white-space: nowrap;
}
.product-shop .filter-category-header .form--select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding: 8px 34px 8px 12px;
    height: 40px;
    min-height: 40px;
    line-height: 22px;
    cursor: pointer;
    box-sizing: border-box;
}
.product-shop .filter-category-header [name="sort_by"] { width: 180px; }
.product-shop .filter-category-header [name="per_page"] { width: 82px; min-width: 82px; }
.product-shop .filter-category-header .form--select option { background: #fff; color: #344054; }
@media(max-width:575.98px) {
    .product-shop .filter-select-right > div:first-child { flex: 1; flex-wrap: wrap; gap: 12px!important; }
    .product-shop .filter-category-header [name="sort_by"] { width: 160px; }
}

/* Compact mobile toolbar: summary, then aligned sort/count/view controls. */
@media (max-width: 575.98px) {
    .product-shop .filter-category-header { gap: 12px !important; padding: 12px; }
    .product-shop .filter-category-header > div:first-child { width: 100%; min-width: 0; }
    .product-shop .filter-category-header > div:first-child > span { white-space: normal; text-align: right; }
    .product-shop .filter-select-right {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end !important;
        gap: 10px !important;
        min-width: 0;
    }
    .product-shop .filter-select-right > div:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 70px;
        gap: 10px !important;
        min-width: 0;
    }
    .product-shop .filter-select-right > div:first-child .filter-select-item {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        min-width: 0;
        padding: 0;
        gap: 5px !important;
    }
    .product-shop .filter-select-right .select-item { width: 100%; min-width: 0; }
    .product-shop .filter-category-header [name="sort_by"],
    .product-shop .filter-category-header [name="per_page"] { width: 100%; min-width: 0; }
    .product-shop .filter-select-right > .filter-select-item { padding: 0; }
    .product-shop .filter-category-header .view-style a { width: 36px; height: 40px; }
}
