/* =============================================================================================================
   Shop / category archives. Values measured from the legacy design (1440 desktop).
   ============================================================================================================= */
.dm-sr-only { position: absolute !important; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }

/* ------------------------------------------------------------------ page title banner */
.dm-archive-head { margin-block-start: 20px; }
/* the banner is exactly as wide as the content below it (legacy custom CSS gave it side margins) */
.dm-archive-head .wd-page-title { margin: 0 !important; inline-size: 100%; box-sizing: border-box; }
.wd-page-title { position: relative; min-block-size: 300px; border-radius: var(--dm-r-lg, 20px); overflow: hidden; background: #fff; }
.wd-page-title-bg { position: absolute; inset: 0; }
.wd-page-title-bg img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.dm-archive-title { margin: 20px 0 0; color: #242424; font-size: 30px; font-weight: 700; }

/* ------------------------------------------------------------------ two-column layout */
.wd-content-layout { display: grid; gap: 30px; align-items: start; }
.wd-content-layout.dm-has-sidebar { grid-template-columns: minmax(0, calc(25% - 22.5px)) minmax(0, 1fr); }
.wd-content-layout.dm-no-sidebar { grid-template-columns: minmax(0, 1fr); }
.wd-content-area { min-inline-size: 0; }
.dm-filter-toggle, .dm-sidebar-close { display: none; }

/* sidebar */
.wd-sidebar .widget-area { padding: 22px 20px; border-radius: var(--dm-r-lg, 20px); background: #fcfcfc; }
.wd-sidebar .widget { margin: 0 0 26px; padding: 0 0 26px; border-block-end: 1px solid rgba(0, 0, 0, .106); }
.wd-sidebar .widget:last-child { margin-block-end: 0; padding-block-end: 0; border-block-end: 0; }
.wd-sidebar .widget-title, .wd-sidebar .widget h5.widget-title, .wd-sidebar .widgettitle { margin: 0 0 20px; padding: 0; color: #333; font-family: var(--dm-font-strong); font-size: 16px; font-weight: 700; line-height: 1.4; }
.wd-sidebar .widget ul { margin: 0; padding: 0; list-style: none; }

.wd-scroll { max-block-size: 230px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d9d9d9 transparent; }
.wd-filter-list li { display: flex; align-items: center; gap: 5px; margin: 0 0 5px 5px; padding-block: 5px; }
.wd-filter-list li .layered-nav-link { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-inline-size: 0; color: #767676; font-size: 16px; line-height: 1.4; transition: color .2s ease; }
.wd-filter-list li:hover .layered-nav-link, .wd-filter-list li.chosen .layered-nav-link { color: var(--dm-orange); }
.wd-filter-list .wd-swatch { flex: 0 0 35px; inline-size: 35px; block-size: 35px; border-radius: 5px; overflow: hidden; background: #f1f1f1; }
.wd-filter-list .wd-swatch img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.wd-filter-list .count {
	flex: 0 0 auto; min-inline-size: 30px; block-size: 20px; padding: 0 6px; display: grid; place-items: center;
	border: 1px solid rgba(0, 0, 0, .106); border-radius: 35px; color: #767676; font-size: 12px; line-height: 1;
}
.wd-filter-list li.chosen .count { border-color: var(--dm-orange); background: var(--dm-orange); color: #fff; }

/* price filter (core widget + jQuery UI slider) */
.widget_price_filter .price_slider { position: relative; block-size: 20px; margin: 0 14px 20px; }
.widget_price_filter .price_slider::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 9px; block-size: 2px; border-radius: 2px; background: #e5e5e5; }
.widget_price_filter .ui-slider-range { position: absolute; inset-block-start: 9px; block-size: 2px; background: var(--dm-orange); }
.widget_price_filter .ui-slider-handle { position: absolute; inset-block-start: -5px; z-index: 2; display: flex; align-items: center; justify-content: center; inline-size: 30px; block-size: 30px; margin-inline-start: -15px; outline: 0; cursor: pointer; }
.widget_price_filter .ui-slider-handle::after { content: ""; inline-size: 4px; block-size: 22px; border-radius: 2px; background: var(--dm-orange); }
.widget_price_filter .price_slider_amount { block-size: 68px; align-content: flex-start; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.widget_price_filter .price_slider_amount .button { order: 2; min-block-size: 36px; padding: 5px 16px; border-radius: 35px; background: var(--dm-orange); color: #fff; font-size: 12px; }
.widget_price_filter .price_label { order: 1; color: #242424; font-size: 16px; font-weight: 600; }
.widget_price_filter .price_slider_amount input[type="text"] { display: none; }

/* stock status checkboxes */
.wd-checkboxes-on li { margin: 0 0 15px; }
.wd-checkboxes-on li:last-child { margin-block-end: 0; }
.wd-checkboxes-on a { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #767676; font-size: 16px; line-height: 1.4; }
.wd-checkboxes-on a:hover, .wd-checkboxes-on a.chosen { color: var(--dm-orange); }
.wd-checkbox { order: 2; flex: 0 0 18px; inline-size: 18px; block-size: 18px; border: 1px solid #d0d0d0; border-radius: 3px; background: #fff; position: relative; }
.wd-checkbox.is-checked { border-color: var(--dm-orange); background: var(--dm-orange); }
.wd-checkbox.is-checked::after { content: ""; position: absolute; inset-inline-start: 5px; inset-block-start: 1px; inline-size: 5px; block-size: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* product categories widget: same row design as the attribute filters (name + count pill), animated sub-lists */
.widget_product_categories ul.product-categories { margin: 0; padding: 0; list-style: none; }
.widget_product_categories ul.product-categories li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; padding-block: 5px; color: #767676; font-size: 16px; line-height: 1.4; }
.widget_product_categories ul.product-categories li > a { flex: 1 1 0; min-inline-size: 0; padding-block: 3px; color: #767676; transition: color .2s ease; }
.widget_product_categories ul.product-categories li > a:hover, .widget_product_categories .current-cat > a, .widget_product_categories .current-cat-parent > a { color: var(--dm-orange); }
.widget_product_categories .count {
	flex: 0 0 auto; min-inline-size: 30px; block-size: 20px; padding: 0 6px; display: grid; place-items: center;
	border: 1px solid rgba(0, 0, 0, .106); border-radius: 35px; color: #767676; font-size: 12px; line-height: 1;
}
.widget_product_categories .current-cat > .count { border-color: var(--dm-orange); background: var(--dm-orange); color: #fff; }
.widget_product_categories ul.children { flex: 1 1 100%; display: none; margin: 4px 0 0; padding-inline-start: 14px; overflow: hidden; border-inline-start: 2px solid rgba(0, 0, 0, .06); transition: height .32s cubic-bezier(.4, 0, .2, 1), opacity .25s ease, margin .32s ease; }
.widget_product_categories li.is-open > ul.children, .widget_product_categories li.current-cat > ul.children, .widget_product_categories li.current-cat-parent > ul.children { display: block; }
.dm-cat-toggle { flex: 0 0 26px; inline-size: 26px; block-size: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #767676; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.dm-cat-toggle:hover { background: #f3f3f3; color: var(--dm-orange); }
.dm-cat-toggle::before { content: ""; inline-size: 7px; block-size: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; }
li.is-open > .dm-cat-toggle::before, li.current-cat-parent > .dm-cat-toggle::before { transform: rotate(-135deg) translateY(-2px); }

/* ------------------------------------------------------------------ toolbar */
.shop-loop-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-block-end: 30px; min-block-size: 30px; }
.wd-shop-tools { display: flex; align-items: center; gap: 30px; }
.wd-breadcrumbs, .wd-breadcrumbs a, .yoast-breadcrumb { color: #767676; font-size: 14px; line-height: 1.6; }
.wd-breadcrumbs a:hover { color: var(--dm-orange); }
.wd-breadcrumbs .breadcrumb_last, .wd-breadcrumbs strong { color: #242424; }
.wd-products-per-page { display: flex; align-items: center; gap: 0; font-size: 16px; line-height: 26px; }
.per-page-title { margin-inline-end: 4px; color: #333; font-weight: 600; }
.per-page-title::after { content: " :"; }
.per-page-variation { padding: 0 6px; color: #767676; transition: color .2s ease; }
.per-page-variation:hover, .per-page-variation.current-variation { color: #333; font-weight: 600; }
.per-page-border { color: #bbb; }
.wd-products-shop-view { display: flex; align-items: center; gap: 12px; }
.shop-view { display: grid; place-items: center; inline-size: 24px; block-size: 30px; color: #bbb; transition: color .2s ease; }
.shop-view:hover, .shop-view.current-variation { color: #333; }
.dm-view-icon { display: block; inline-size: 20px; block-size: 20px; background-color: currentColor; -webkit-mask: var(--dm-view-mask) center / contain no-repeat; mask: var(--dm-view-mask) center / contain no-repeat; }
.dm-view-icon--4 { --dm-view-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><g fill='black'><rect x='0' y='0' width='4' height='4'/><rect x='5.3' y='0' width='4' height='4'/><rect x='10.6' y='0' width='4' height='4'/><rect x='16' y='0' width='4' height='4'/><rect x='0' y='5.3' width='4' height='4'/><rect x='5.3' y='5.3' width='4' height='4'/><rect x='10.6' y='5.3' width='4' height='4'/><rect x='16' y='5.3' width='4' height='4'/><rect x='0' y='10.6' width='4' height='4'/><rect x='5.3' y='10.6' width='4' height='4'/><rect x='10.6' y='10.6' width='4' height='4'/><rect x='16' y='10.6' width='4' height='4'/><rect x='0' y='16' width='4' height='4'/><rect x='5.3' y='16' width='4' height='4'/><rect x='10.6' y='16' width='4' height='4'/><rect x='16' y='16' width='4' height='4'/></g></svg>"); }
.dm-view-icon--3 { --dm-view-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><g fill='black'><rect x='0' y='0' width='5.5' height='5.5'/><rect x='7.2' y='0' width='5.5' height='5.5'/><rect x='14.5' y='0' width='5.5' height='5.5'/><rect x='0' y='7.2' width='5.5' height='5.5'/><rect x='7.2' y='7.2' width='5.5' height='5.5'/><rect x='14.5' y='7.2' width='5.5' height='5.5'/><rect x='0' y='14.5' width='5.5' height='5.5'/><rect x='7.2' y='14.5' width='5.5' height='5.5'/><rect x='14.5' y='14.5' width='5.5' height='5.5'/></g></svg>"); }
.dm-view-icon--list { --dm-view-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><g fill='black'><rect x='0' y='2' width='20' height='3'/><rect x='0' y='8.500' width='20' height='3'/><rect x='0' y='15' width='20' height='3'/></g></svg>"); }

.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select {
	inline-size: 197px; min-inline-size: 0; block-size: 30px; padding: 0 0 0 18px; border: 0; border-block-end: 1px solid rgba(0, 0, 0, .1); border-radius: 0;
	background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.500'/></svg>") no-repeat left center;
	color: #242424; font-size: 16px; font-weight: 600; appearance: none; cursor: pointer;
}

/* ------------------------------------------------------------------ grid */
.wd-products { display: grid; grid-template-columns: repeat(var(--dm-cols, 4), minmax(0, 1fr)); gap: 20px; }
.wd-products.dm-list-view { grid-template-columns: 1fr; }
.wd-products.dm-list-view .dm-product__wrap { flex-direction: row; }
.wd-products.dm-list-view .dm-product__thumb { flex: 0 0 240px; aspect-ratio: 1/1; }
.wd-loop-footer { margin-block-start: 30px; }
.wd-loop-footer .woocommerce-pagination { margin: 0; }
.woocommerce-pagination .page-numbers a, .woocommerce-pagination .page-numbers span { inline-size: 34px; min-inline-size: 34px; block-size: 34px; padding: 0; border-radius: 12px; background: transparent; color: #242424; font-size: 14px; font-weight: 600; }
.woocommerce-pagination .page-numbers a:hover { background: #f3f3f3; }
.woocommerce-pagination .page-numbers .current { background: var(--dm-orange); color: #fff; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1024px) {
	.wd-page-title { min-block-size: 180px; }
	.wd-content-layout.dm-has-sidebar { grid-template-columns: minmax(0, 1fr); }
	.dm-filter-toggle {
		display: inline-flex; align-items: center; justify-content: center; min-block-size: 30px; padding: 0;
		border: 0; background: transparent; color: #333; font: 400 16px/1.2 var(--dm-font-body); cursor: pointer;
	}
	/* off-canvas filters: slides in from the inline-start edge (right in RTL), backdrop fades */
	.wd-sidebar {
		position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 410; inline-size: min(350px, 88vw); padding: 56px 14px 24px;
		overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: -10px 0 40px rgba(0, 0, 0, .12);
		transform: translateX(105%); visibility: hidden;
		transition: transform .34s cubic-bezier(.22, .72, .2, 1), visibility 0s linear .34s;
	}
	html[dir="ltr"] .wd-sidebar { transform: translateX(-105%); }
	.wd-sidebar.is-open, html[dir="rtl"] .wd-sidebar.is-open, html[dir="ltr"] .wd-sidebar.is-open { transform: none; visibility: visible; transition-delay: 0s; }
	.wd-sidebar .widget-area { padding: 6px 4px; background: transparent; border-radius: 0; }
	.dm-sidebar-close { display: grid; place-items: center; position: absolute; inset-block-start: 8px; inset-inline-end: 12px; inline-size: 40px; block-size: 40px; border: 0; border-radius: 50%; background: #f4f4f4; font-size: 24px; line-height: 1; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
	.dm-sidebar-close:hover { background: var(--dm-orange); color: #fff; }
	.dm-filter-overlay { position: fixed; inset: 0; z-index: 405; background: rgba(20, 20, 20, .5); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
	.dm-filter-overlay.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
	.dm-filters-open { overflow: hidden; }
}
@media (max-width: 768px) {
	.wd-products { --dm-cols: 2 !important; gap: 10px; }
	.wd-shop-tools { gap: 16px; flex-wrap: wrap; }
	.wd-products-per-page, .wd-products-shop-view { display: none; }
	.woocommerce-ordering select { inline-size: 160px; }
}

/* mobile toolbar: crumbs on top, then the filters button (start side) and the sorting (end side) */
.shop-loop-head .woocommerce-result-count { display: none; }
@media (max-width: 768px) {
	.wd-page-title { min-block-size: 130px; border-radius: var(--dm-r-lg, 20px); }
	.dm-archive-head { margin-block-start: 15px; }
	.shop-loop-head { display: grid; grid-template-columns: 1fr; gap: 12px 10px; margin-block-end: 16px; padding-block-end: 12px; border-block-end: 1px solid var(--dm-line); }
	.shop-loop-head .dm-shop-crumbs { display: flex; justify-content: space-between; align-items: center; }
	.shop-loop-head .woocommerce-result-count { display: block; margin: 0; color: #767676; font-size: 15px; }
	.shop-loop-head .dm-shop-controls { display: flex; justify-content: space-between; align-items: center; }
	.dm-filter-toggle { background: transparent; padding: 0; min-block-size: 30px; font-size: 16px; font-weight: 400; color: #333; text-transform: none; }
	.dm-filter-toggle::before { content: ""; inline-size: 18px; block-size: 12px; margin-inline-end: 8px; border-block: 2px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
	.woocommerce-ordering select {
		inline-size: 40px; padding: 0; color: transparent; background-position: center; background-size: 20px;
		background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.600' stroke-linecap='round' stroke-linejoin='round'><path d='M7 4v16m0 0-3-3m3 3 3-3M17 20V4m0 0-3 3m3-3 3 3'/></svg>");
		border-block-end: 0;
	}
	/* the category text comes after the products on small screens */
	#dm-shop-content { display: flex; flex-direction: column; }
	#dm-shop-content > .woocommerce-notices-wrapper { order: 0; }
	#dm-shop-content > .shop-loop-head { order: 1; }
	#dm-shop-content > .wd-products-element { order: 2; }
	#dm-shop-content > .dm-archive-description { order: 3; margin-block-start: 28px; }
	#dm-shop-content > .woocommerce-no-products-found { order: 2; }
}
