/* ════════════════════════════════════════════════════════════════════════════
   JITS Shop Filter — Editorial sidebar (Mockup A)
   Selektorer matcher faktisk DOM fra render_sidebar() i jits-shop-filter.php
   ════════════════════════════════════════════════════════════════════════════ */

/* CSS-variabler — JITS design system */
.jits-sf-layout,
.jits-sf-sidebar,
.jits-sf-main {
	--jits-primary: #1E3A8A;
	--jits-secondary: #3B82F6;
	--jits-accent: #60A5FA;
	--jits-text: #0F172A;
	--jits-text-muted: #64748B;
	--jits-text-light: #94A3B8;
	--jits-bg-soft: #F0F7FF;
	--jits-bg-page: #F8FAFC;
	--jits-border: #E2E8F0;
	--jits-border-soft: #EFF4FA;
	--jits-success: #16A34A;
	--jits-amber: #F59E0B;
}

/* ─── Layout grid ──────────────────────────────────────────────────────── */

.jits-sf-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 48px;
	max-width: 1280px;
	margin: 0 auto 48px;
	padding: 0 24px;
	box-sizing: border-box;
	font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.jits-sf-sidebar {
	color: var(--jits-text);
	font-size: 14px;
	line-height: 1.5;
}

.jits-sf-main {
	min-width: 0; /* Forhindr grid-overflow */
}

@media (max-width: 900px) {
	.jits-sf-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

/* ─── Søgefelt ─────────────────────────────────────────────────────────── */

.jits-sf-search {
	position: relative;
	margin: 0 0 28px;
	display: block;
}

.jits-sf-search input[type="search"] {
	width: 100%;
	padding: 12px 16px 12px 40px;
	font-family: inherit;
	font-size: 14px;
	color: var(--jits-text);
	background: #FFFFFF;
	border: 1px solid var(--jits-border);
	border-radius: 8px;
	box-sizing: border-box;
	transition: border-color 0.15s, background 0.15s;
}

.jits-sf-search input[type="search"]:focus {
	outline: none;
	border-color: var(--jits-primary);
	background: #FFFFFF;
}

.jits-sf-search input[type="search"]::placeholder {
	color: var(--jits-text-light);
}

.jits-sf-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--jits-text-light);
	pointer-events: none;
}

.jits-sf-search-clear {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: var(--jits-text-light);
	background: var(--jits-bg-soft);
	border-radius: 50%;
	text-decoration: none;
	line-height: 1;
}

.jits-sf-search-clear:hover {
	color: var(--jits-primary);
	background: var(--jits-bg-soft);
}

/* ─── Sektion-kontainer ────────────────────────────────────────────────── */

.jits-sf-section {
	margin: 0 0 28px;
}

.jits-sf-section-head,
.jits-sf-yith .yith-wcan-filter .filter-title {
	font-family: 'IBM Plex Sans', sans-serif;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.14em;
	color: var(--jits-primary) !important;
	text-transform: uppercase;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--jits-border-soft);
	margin: 0 0 14px !important;
	display: block;
	cursor: default !important;
	background: transparent !important;
}

/* ════════════════════════════════════════════════════════════════════════
   YITH override — strip default styling, apply editorial look
   YITH's struktur: .jits-sf-yith → .yith-wcan-filters → .filters-container
                    → form → multiple .yith-wcan-filter (Kategori/Mærke/Pris)
   ════════════════════════════════════════════════════════════════════════ */

/* Base reset for YITH wrapper */
.jits-sf-yith,
.jits-sf-yith .yith-wcan-filters,
.jits-sf-yith .yith-wcan-filters.no-title,
.jits-sf-yith .yith-wcan-filters.enhanced,
.jits-sf-yith .filters-container,
.jits-sf-yith form {
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
}

.jits-sf-yith .yith-wcan-filters h3.mobile-only,
.jits-sf-yith .yith-wcan-filters > h3 {
	display: none !important;
}

/* Hver filter-blok = sektion */
.jits-sf-yith .yith-wcan-filter {
	margin: 0 0 28px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	display: block !important;
}

.jits-sf-yith .yith-wcan-filter .filter-content {
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	border: 0 !important;
	display: block !important;
}

/* Filter-items list */
.jits-sf-yith .filter-items {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 8px !important;
}

.jits-sf-yith .filter-items .filter-item {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	font-size: 13px !important;
	color: var(--jits-text) !important;
	list-style: none !important;
	min-height: 22px !important;
}

.jits-sf-yith .filter-items .filter-item label {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	cursor: pointer !important;
	color: inherit !important;
	font-weight: 400 !important;
	background: transparent !important;
}

.jits-sf-yith .filter-items .filter-item label:hover {
	color: var(--jits-primary) !important;
}

.jits-sf-yith .filter-items .filter-item.active label,
.jits-sf-yith .filter-items .filter-item.active .term-label {
	color: var(--jits-primary) !important;
	font-weight: 500 !important;
}

/* Custom checkbox */
.jits-sf-yith .filter-items .filter-item input[type="checkbox"],
.jits-sf-yith .filter-items .filter-item input[type="radio"] {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	width: 16px !important;
	height: 16px !important;
	border: 1.5px solid var(--jits-border) !important;
	border-radius: 4px !important;
	background: #FFFFFF !important;
	margin: 0 !important;
	padding: 0 !important;
	flex-shrink: 0 !important;
	cursor: pointer !important;
	position: relative !important;
	transition: all 0.15s !important;
	box-shadow: none !important;
	min-width: 16px !important;
	min-height: 16px !important;
}

.jits-sf-yith .filter-items .filter-item input[type="checkbox"]:checked,
.jits-sf-yith .filter-items .filter-item input[type="radio"]:checked {
	background: var(--jits-primary) !important;
	border-color: var(--jits-primary) !important;
}

.jits-sf-yith .filter-items .filter-item input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 1px;
	left: 4px;
	width: 4px;
	height: 8px;
	border: solid #FFFFFF;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Term-label (selve mærke/kategori-navnet) */
.jits-sf-yith .filter-items .filter-item .term-label,
.jits-sf-yith .filter-items .filter-item label > a {
	flex: 1 !important;
	color: inherit !important;
	text-decoration: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 8px !important;
	background: transparent !important;
	padding: 0 !important;
	border: 0 !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
}

.jits-sf-yith .filter-items .filter-item .term-label:hover {
	color: var(--jits-primary) !important;
}

/* Antal i parentes */
.jits-sf-yith .filter-items .filter-item .item-count,
.jits-sf-yith .filter-items .filter-item small.item-count {
	font-size: 11px !important;
	color: var(--jits-text-light) !important;
	margin-left: auto !important;
	background: transparent !important;
	padding: 0 !important;
}

/* Søgefelt inde i filter (mærke-søgning) */
.jits-sf-yith .filter-search {
	position: relative !important;
	margin: 0 0 12px !important;
	padding: 0 !important;
}

.jits-sf-yith .filter-search input {
	width: 100% !important;
	padding: 8px 12px !important;
	font-size: 13px !important;
	font-family: inherit !important;
	border: 1px solid var(--jits-border) !important;
	border-radius: 6px !important;
	background: var(--jits-bg-page) !important;
	color: var(--jits-text) !important;
	box-sizing: border-box !important;
}

.jits-sf-yith .filter-search input:focus {
	outline: none !important;
	border-color: var(--jits-primary) !important;
	background: #FFFFFF !important;
}

/* ─── Pris-slider (ion-rangeslider) ─────────────────────────────────────── */

.jits-sf-yith .filter-price-slider {
	padding-bottom: 6px !important;
}

.jits-sf-yith .price-slider {
	margin: 12px 0 14px !important;
}

.jits-sf-yith .irs--round .irs-line {
	background: var(--jits-border) !important;
	height: 4px !important;
	top: 26px !important;
}

.jits-sf-yith .irs--round .irs-bar {
	background: var(--jits-primary) !important;
	height: 4px !important;
	top: 26px !important;
}

.jits-sf-yith .irs--round .irs-handle {
	width: 14px !important;
	height: 14px !important;
	top: 21px !important;
	border: 2px solid var(--jits-primary) !important;
	background: #FFFFFF !important;
	box-shadow: none !important;
	cursor: pointer !important;
}

.jits-sf-yith .irs--round .irs-handle.state_hover,
.jits-sf-yith .irs--round .irs-handle:hover {
	background: var(--jits-bg-soft) !important;
}

.jits-sf-yith .irs--round .irs-min,
.jits-sf-yith .irs--round .irs-max {
	font-size: 11px !important;
	color: var(--jits-text-light) !important;
	background: transparent !important;
	padding: 0 !important;
	top: auto !important;
	bottom: 0 !important;
}

.jits-sf-yith .irs--round .irs-from,
.jits-sf-yith .irs--round .irs-to,
.jits-sf-yith .irs--round .irs-single {
	font-size: 11px !important;
	font-weight: 500 !important;
	color: var(--jits-primary) !important;
	background: transparent !important;
	padding: 0 4px !important;
	top: 0 !important;
}

.jits-sf-yith .irs--round .irs-from::before,
.jits-sf-yith .irs--round .irs-to::before,
.jits-sf-yith .irs--round .irs-single::before {
	display: none !important;
}

.jits-sf-yith .irs--round .irs-shadow {
	display: none !important;
}

/* Pris-input fields under slideren */
.jits-sf-yith .price-slider-min,
.jits-sf-yith .price-slider-max {
	font-size: 12px !important;
	padding: 4px 8px !important;
	border: 1px solid var(--jits-border) !important;
	border-radius: 4px !important;
	background: var(--jits-bg-page) !important;
	color: var(--jits-text) !important;
}

/* Reset-knap inde i YITH (skjul — vi har vores egen) */
.jits-sf-yith .yith-wcan-reset-filters,
.jits-sf-yith .reset-filters,
.jits-sf-yith .yith-wcan-filters-opener {
	display: none !important;
}

/* ─── Toggle (På lager / På tilbud) ─────────────────────────────────────── */

.jits-sf-toggle {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 8px 0 !important;
	font-size: 13px !important;
	color: var(--jits-text) !important;
	text-decoration: none !important;
	cursor: pointer !important;
	background: transparent !important;
	border: 0 !important;
}

.jits-sf-toggle:hover {
	color: var(--jits-primary) !important;
}

.jits-sf-toggle.is-on {
	color: var(--jits-primary) !important;
	font-weight: 500 !important;
}

.jits-sf-toggle-label {
	flex: 1;
}

.jits-sf-toggle-switch {
	width: 32px;
	height: 18px;
	background: var(--jits-border);
	border-radius: 999px;
	position: relative;
	transition: background 0.15s;
	flex-shrink: 0;
}

.jits-sf-toggle-switch::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	background: #FFFFFF;
	border-radius: 50%;
	transition: left 0.15s;
}

.jits-sf-toggle.is-on .jits-sf-toggle-switch {
	background: var(--jits-primary);
}

.jits-sf-toggle.is-on .jits-sf-toggle-switch::after {
	left: 16px;
}

/* ─── Vurdering (rating) ───────────────────────────────────────────────── */

.jits-sf-ratings {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.jits-sf-rate {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 6px 0 !important;
	font-size: 13px !important;
	color: var(--jits-text-muted) !important;
	text-decoration: none !important;
	cursor: pointer !important;
}

.jits-sf-rate:hover {
	color: var(--jits-primary) !important;
}

.jits-sf-rate.is-on {
	color: var(--jits-primary) !important;
	font-weight: 500 !important;
}

.jits-sf-stars {
	display: inline-flex;
	gap: 2px;
}

.jits-sf-stars svg.is-full {
	color: var(--jits-amber);
}

.jits-sf-stars svg.is-empty {
	color: var(--jits-border);
}

.jits-sf-rate-label {
	font-size: 11px;
	color: var(--jits-text-light);
}

.jits-sf-rate.is-on .jits-sf-rate-label {
	color: var(--jits-primary);
}

/* ─── Empty/error state ────────────────────────────────────────────────── */

.jits-sf-empty {
	padding: 12px;
	border: 1px dashed var(--jits-border);
	border-radius: 6px;
	font-size: 12px;
	color: var(--jits-text-muted);
	background: var(--jits-bg-page);
}

/* ════════════════════════════════════════════════════════════════════════
   Main content tweaks — fjern eventuel Hello Elementor side-padding
   ════════════════════════════════════════════════════════════════════════ */

/* Nuke any Hello Elementor woocommerce-page wrapper-konflikter */
body.woocommerce-shop .jits-sf-layout,
body.woocommerce-page .jits-sf-layout,
body.post-type-archive-product .jits-sf-layout,
body.tax-product_cat .jits-sf-layout,
body.tax-product_brand .jits-sf-layout {
	display: grid !important;
	grid-template-columns: 240px 1fr !important;
}

@media (max-width: 900px) {
	body.woocommerce-shop .jits-sf-layout,
	body.woocommerce-page .jits-sf-layout,
	body.post-type-archive-product .jits-sf-layout,
	body.tax-product_cat .jits-sf-layout,
	body.tax-product_brand .jits-sf-layout {
		grid-template-columns: 1fr !important;
	}
}

/* Sørg for at WC's eget breadcrumb/notices ligger udenfor grid (de er før woocommerce_before_main_content) — vi gør intet, det virker pr default */
