/* ==========================================================================
   Listing kategorije / prodavnice (Faza 5): zaglavlje, filteri, sortiranje, "Učitaj još".
   Kartica proizvoda je u cards.css.
   ========================================================================== */

/* --- Zaglavlje --------------------------------------------------------------------- */

.sem-shop-head {
	margin-bottom: var(--sem-space-4);
}

/* Zaglavlje je prvi element u mreži sadržaja (prije sidebara, inc/shop.php) — preko cijele širine. */
.wd-content-layout > .sem-shop-head {
	grid-column: 1 / -1;
	margin-bottom: var(--sem-space-2);
}

.sem-shop-head .woocommerce-breadcrumb {
	margin-bottom: var(--sem-space-2);
	font-size: 13px;
	color: var(--sem-muted);
}

.sem-shop-head__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sem-space-3) var(--sem-space-5);
}

.sem-shop-head__h1 {
	margin: 0;
	font-family: var(--sem-font-head);
	font-size: clamp(30px, 2.4vw + 18px, 46px);
	font-weight: 700;
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--sem-ink);
}

.sem-shop-head__meta {
	margin: 4px 0 0;
	font-size: 15px;
	color: var(--sem-muted);
}

.sem-quick-filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sem-space-2);
}

.sem-quick-filter {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid #CFCFCA;
	border-radius: var(--sem-radius-pill);
	background: var(--sem-bg);
	color: var(--sem-ink);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.sem-quick-filter:hover {
	border-color: var(--sem-ink);
	color: var(--sem-ink);
}

.sem-quick-filter.is-active {
	border-color: var(--sem-ink);
	background: var(--sem-ink);
	color: #fff;
}

/* Broj proizvoda je u zaglavlju — WoodMart red sa brojem ostaje samo za sortiranje. */
.shop-loop-head .woocommerce-result-count {
	display: none;
}

.shop-loop-head {
	margin-bottom: var(--sem-space-4);
}

/* Desktop: "Sortiraj [izbor]" desno, u istoj liniji sa "Filteri" na vrhu sidebara (mockup). */
@media (min-width: 1025px) {
	.shop-loop-head {
		display: flex;
		justify-content: flex-end;
		min-height: 48px;
		align-items: center;
	}

	.shop-loop-head .woocommerce-ordering {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.shop-loop-head .woocommerce-ordering::before {
		content: "Sortiraj";
		color: var(--sem-ink);
		font-size: 15px;
		font-weight: 500;
	}
}

/* Vrh sidebara: "FILTERI" + "Očisti sve", deblja linija ispod (mockup). */
.sem-filters-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	margin-bottom: var(--sem-space-4);
	padding-bottom: var(--sem-space-3);
	border-bottom: 2px solid var(--sem-ink);
}

.sem-filters-head__title {
	font-family: var(--sem-font-head);
	font-size: 24px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--sem-ink);
}

.sem-filters-head__clear {
	color: var(--sem-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Sortiranje. */
.shop-loop-head .woocommerce-ordering select {
	min-height: 44px;
	padding: 0 36px 0 14px;
	border: 1px solid var(--sem-line);
	border-radius: var(--sem-radius);
	background-color: var(--sem-bg);
	background-position: right 12px top 50%;
	font-size: 15px;
	font-weight: 600;
	color: var(--sem-ink);
}

/* --- Sidebar (filteri) -------------------------------------------------------------- */

.sidebar-container .widget-title,
.wd-sidebar .widget-title {
	margin-bottom: var(--sem-space-3);
	font-family: var(--sem-font-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--sem-ink);
}

.wd-sidebar .widget {
	padding-bottom: var(--sem-space-4);
	margin-bottom: var(--sem-space-4);
	border-bottom: 1px solid var(--sem-line);
}

.wd-sidebar .widget:last-child {
	border-bottom: 0;
}

/* Checkbox redovi (Ponuda, Brend): 40px visine, broj desno. */
.wd-sidebar :is(.wd-widget-stock-status, .wd-filter-list) li a,
.wd-sidebar .wd-widget-stock-status a {
	display: flex;
	align-items: center;
	min-height: 40px;
	font-size: 15px;
	color: var(--sem-text);
}

.wd-sidebar .wd-filter-list .count {
	margin-inline-start: auto;
	border: 0;
	background: none;
	color: var(--sem-muted);
	font-size: 13px;
}

/* Brend: samo naziv, bez logotipa (logotipi su različitih dimenzija). */
.wd-sidebar .wd-filter-list .wd-swatch {
	display: none;
}

/* Cijena. */
.wd-sidebar .price_slider_amount .button {
	min-height: 40px;
	border-radius: var(--sem-radius);
	background: var(--sem-ink);
	color: #fff;
	text-transform: none;
}

.wd-sidebar .price_slider_amount .button:hover {
	background: var(--sem-ink-2);
	color: #fff;
}

.wd-sidebar .ui-slider .ui-slider-range,
.wd-sidebar .ui-slider .ui-slider-handle {
	background-color: var(--sem-ink);
}

/* Kutija "Ne znate šta vam treba?" (HTML blok u sidebaru). */
.sem-shop-help {
	padding: var(--sem-space-4);
	border-radius: var(--sem-radius);
	background: var(--sem-bg-soft);
	font-size: 14px;
	color: var(--sem-muted);
}

.sem-shop-help p {
	margin: 0 0 var(--sem-space-2);
}

.sem-shop-help__title {
	font-weight: 700;
	color: var(--sem-ink);
}

.sem-shop-help__call {
	font-weight: 700;
	color: var(--sem-ink);
	text-decoration: underline;
}

/* Aktivni filteri ("Očisti"). */
.wd-active-filters {
	margin-bottom: var(--sem-space-3);
}

/* --- "Učitaj još" -------------------------------------------------------------------- */

.wd-products-load-more,
.wd-load-more {
	min-height: 48px;
	min-width: 240px;
	border: 2px solid var(--sem-ink);
	border-radius: var(--sem-radius);
	background: var(--sem-bg);
	color: var(--sem-ink);
	font-weight: 700;
	text-transform: none;
}

.wd-load-more:hover {
	background: var(--sem-ink);
	color: #fff;
}

/* Opis kategorije ispod proizvoda (SEO tekst). */
.term-description,
.page-description {
	max-width: 820px;
	margin-top: var(--sem-space-7);
	padding-top: var(--sem-space-5);
	border-top: 1px solid var(--sem-line);
	font-size: 15px;
	color: var(--sem-text);
}

/* Veći checkboxi (20 px), naziv i broj u istom redu — mockup. */
/* ul + li u selektoru: WoodMart CSS widgeta se učitava kasnije u body. */
.wd-sidebar ul:is(.wd-checkboxes-on, .wd-filter-list) > li > a::before {
	width: 20px;
	height: 20px;
	border: 1.5px solid #9A9AA0;
	border-radius: 4px;
}

.wd-sidebar ul:is(.wd-checkboxes-on, .wd-filter-list) > li {
	margin-bottom: 4px;
}

.wd-sidebar ul:is(.wd-checkboxes-on, .wd-filter-list) > li > a {
	min-height: 36px;
	color: var(--sem-text);
	font-size: 15px;
}

/* --- Mobitel: "Filteri" + sortiranje u jednom redu, filteri kao sheet odozdo --------------------- */

@media (max-width: 1024px) {
	.shop-loop-head {
		display: grid;
		grid-template-columns: 1fr;
		width: calc(100% + 2 * var(--wd-container-pd, 15px));
		margin-inline: calc(-1 * var(--wd-container-pd, 15px));
		border-block: 1px solid var(--sem-line);
	}

	.wd-sidebar.wd-side-hidden .wd-heading {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.wd-sidebar.wd-side-hidden .wd-heading::after {
		content: "Filteri";
		order: -1;
		font-family: var(--sem-font-head);
		font-size: 24px;
		font-weight: 700;
		text-transform: uppercase;
		color: var(--sem-ink);
	}

	.shop-loop-head > .wd-shop-tools:first-child {
		display: none;
	}

	.shop-loop-head > .wd-shop-tools:last-child {
		display: flex;
		flex-wrap: nowrap;
		gap: 0;
	}

	.shop-loop-head > .wd-shop-tools:last-child > :is(.wd-show-sidebar-btn, .woocommerce-ordering) {
		flex: 1 1 50%;
	}

	.shop-loop-head .wd-show-sidebar-btn {
		display: flex !important;
		justify-content: center;
		border-inline-end: 1px solid var(--sem-line);
	}

	.shop-loop-head .wd-show-sidebar-btn > a,
	.shop-loop-head .woocommerce-ordering {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 52px;
		width: 100%;
		font-size: 16px;
		font-weight: 600;
	}

	/* WoodMart na mobitelu sortiranje svodi na ikonu — ovdje se vidi i odabrana opcija. */
	.shop-loop-head .woocommerce-ordering.wd-ordering-mb-icon {
		position: relative;
		height: auto;
	}

	.shop-loop-head .woocommerce-ordering.wd-ordering-mb-icon::after {
		display: none;
	}

	.shop-loop-head .woocommerce-ordering select,
	.shop-loop-head .woocommerce-ordering.wd-ordering-mb-icon select {
		position: static;
		width: 100%;
		max-width: none;
		min-height: 52px;
		padding: 0 32px 0 12px;
		border: 0;
		background-color: transparent;
		background-position: right 16px top 50%;
		color: var(--sem-ink) !important;
		font-size: 16px;
		font-weight: 600;
		text-align: center;
		text-align-last: center;
	}

	.shop-loop-head .wd-show-sidebar-btn > a {
		gap: 8px;
	}

	/* Sidebar sa filterima kao sheet odozdo (WoodMart ga otvara klasom wd-opened). */
	.wd-sidebar.wd-side-hidden {
		inset: auto 0 0 0;
		width: 100%;
		max-width: none;
		height: 88vh;
		height: 88dvh;
		border-radius: 16px 16px 0 0;
		transform: translate3d(0, 100%, 0);
	}

	.wd-sidebar.wd-side-hidden.wd-opened {
		transform: none;
	}

	.wd-sidebar.wd-side-hidden:not(.wd-opened) {
		visibility: hidden;
		transition: transform .3s, visibility 0s .3s;
	}

	.wd-sidebar.wd-side-hidden .wd-heading {
		position: relative;
		padding-top: 22px;
	}

	.wd-sidebar.wd-side-hidden .wd-heading::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 2px;
		background: var(--sem-line);
	}

	.sem-shop-head__row {
		display: block;
	}

	.sem-quick-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin: var(--sem-space-3) calc(-1 * var(--wd-container-pd, 15px)) 0;
		padding: 0 var(--wd-container-pd, 15px) 4px;
		scrollbar-width: none;
	}
}

/* Mobitel: traka "Filteri | sortiranje" od ruba do ruba ekrana (mockup). 100vw samo ovdje — na mobitelu
   nema trake za skrol. Jače od WoodMart width: 100%. */
@media (max-width: 768px) {
	.wd-content-area > .shop-loop-head {
		width: 100vw;
		max-width: none;
		margin-inline: calc(50% - 50vw);
	}
}
