/* ImPowerd Vendor Filter — layout modelled on the marketplace demo:
   left filter sidebar + responsive 4-column card grid. */

.ivf-wrap {
	display: flex;
	gap: 28px;
	align-items: flex-start;
	margin: 20px 0;
}

.ivf-wrap.ivf-no-sidebar {
	display: block;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.ivf-sidebar {
	flex: 0 0 250px;
	max-width: 250px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 18px 16px;
	position: sticky;
	top: 20px;
}

.ivf-filter-group {
	border-bottom: 1px solid #f0f0f1;
	padding: 10px 0;
	margin: 0;
}

.ivf-filter-group:last-child {
	border-bottom: 0;
}

.ivf-filter-title {
	font-weight: 600;
	font-size: 14px;
	color: #1f2937;
	cursor: pointer;
	display: block;
	margin-bottom: 4px;
}

details.ivf-filter-group > summary.ivf-filter-title {
	list-style: none;
	position: relative;
	padding-right: 18px;
}

details.ivf-filter-group > summary.ivf-filter-title::-webkit-details-marker {
	display: none;
}

details.ivf-filter-group > summary.ivf-filter-title::after {
	content: "▾";
	position: absolute;
	right: 0;
	color: #9ca3af;
	transition: transform 0.15s ease;
}

details.ivf-filter-group[open] > summary.ivf-filter-title::after {
	transform: rotate(180deg);
}

.ivf-filter-body {
	max-height: 230px;
	overflow-y: auto;
	margin-top: 6px;
}

.ivf-filter-tree {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ivf-filter-tree .ivf-filter-tree {
	margin-left: 18px;
}

.ivf-filter-tree li {
	margin: 3px 0;
}

.ivf-filter-tree label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: #374151;
	cursor: pointer;
	font-weight: 400;
}

.ivf-depth-0 > li > label {
	font-weight: 500;
}

.ivf-filter-tree input[type="checkbox"],
.ivf-filter-tree input[type="radio"] {
	margin: 0;
	flex-shrink: 0;
}

.ivf-search-input,
.ivf-sort-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	box-sizing: border-box;
}

.ivf-featured-toggle {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	cursor: pointer;
}

.ivf-filter-actions {
	display: flex;
	gap: 8px;
	padding-top: 14px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.ivf-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: 0;
	text-align: center;
	text-decoration: none;
	transition: filter 0.15s ease;
	line-height: 1.4;
}

.ivf-btn:hover {
	filter: brightness(0.93);
	text-decoration: none;
}

.ivf-btn-apply {
	background: #31baa6;
	color: #fff;
	flex: 1;
}

.ivf-btn-apply:hover,
.ivf-btn-apply:focus {
	background: #2aa794;
	color: #fff;
	filter: none;
}

.ivf-btn-reset {
	background: #eef0f3;
	color: #374151;
}

.ivf-btn-shop {
	background: #f0b849;
	color: #1f2937;
	width: 100%;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.4px;
}

.ivf-btn-shop:hover,
.ivf-btn-shop:focus {
	color: #1f2937;
}

/* ── Mobile filters toggle (hidden on desktop) ───────────────────────── */

.ivf-filters-toggle {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	background: #fff;
	border: 1px solid #31baa6;
	border-radius: 8px;
	color: #1f2937;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ivf-active-count {
	background: #31baa6;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 20px;
	height: 20px;
	line-height: 20px;
	border-radius: 99px;
	padding: 0 6px;
	text-align: center;
}

.ivf-filters-toggle-chevron {
	color: #31baa6;
	transition: transform 0.15s ease;
}

.ivf-sidebar.ivf-open .ivf-filters-toggle-chevron {
	transform: rotate(180deg);
}

/* ── Main / top bar ──────────────────────────────────────────────────── */

.ivf-main {
	flex: 1;
	min-width: 0;
}

.ivf-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.ivf-count {
	font-size: 14px;
	color: #6b7280;
}

.ivf-results {
	position: relative;
}

.ivf-results.ivf-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.ivf-no-results {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
	padding: 40px 20px;
	text-align: center;
	color: #6b7280;
}

/* ── Grid & cards ────────────────────────────────────────────────────── */

.ivf-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ivf-grid.ivf-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ivf-grid.ivf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ivf-grid.ivf-cols-1 { grid-template-columns: 1fr; }

.ivf-card {
	position: relative;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ivf-card:hover {
	box-shadow: 0 8px 24px rgba(17, 24, 39, 0.1);
	transform: translateY(-2px);
}

.ivf-card-featured {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	background: #1f2c52;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 99px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.ivf-card-image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 150px;
	background: #f9fafb;
	padding: 16px;
	text-decoration: none;
}

.ivf-card-image img {
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
}

.ivf-card-placeholder {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: #1f2c52;
	color: #fff;
	font-size: 34px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ivf-card-body {
	padding: 14px 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
	text-align: center;
}

.ivf-card-name {
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
}

.ivf-card-name a {
	color: #1f2937;
	text-decoration: none;
}

.ivf-card-name a:hover {
	color: #1f2c52;
	text-decoration: underline;
}

.ivf-card-orgtype {
	font-size: 11px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ivf-card-phone {
	font-size: 13px;
}

.ivf-card-phone a {
	color: #4b5563;
	text-decoration: none;
}

.ivf-card-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 5px;
	margin-top: 2px;
}

.ivf-chip {
	background: #eef2ff;
	color: #3730a3;
	font-size: 11px;
	padding: 2px 9px;
	border-radius: 99px;
	white-space: nowrap;
}

.ivf-card-actions {
	margin-top: auto;
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ivf-card-actions .dokan-follow-store-button {
	width: 100%;
	border-radius: 6px;
	font-size: 12px;
}

/* ── Pagination ──────────────────────────────────────────────────────── */

.ivf-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 26px;
	flex-wrap: wrap;
}

.ivf-page {
	min-width: 36px;
	padding: 7px 11px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	font-size: 13px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.ivf-page:hover {
	border-color: #1f2c52;
	text-decoration: none;
}

.ivf-page-current {
	background: #1f2c52;
	border-color: #1f2c52;
	color: #fff;
	pointer-events: none;
}

.ivf-page-dots {
	color: #9ca3af;
	padding: 0 2px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
	.ivf-grid,
	.ivf-grid.ivf-cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.ivf-grid,
	.ivf-grid.ivf-cols-3,
	.ivf-grid.ivf-cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.ivf-wrap {
		flex-direction: column;
		gap: 16px;
	}

	.ivf-sidebar {
		position: static;
		flex: 1 1 auto;
		max-width: none;
		width: 100%;
		box-sizing: border-box;
		padding: 10px;
		border: 0;
		background: transparent;
	}

	/* Sidebar collapses into a "Filters" toggle panel. */
	.ivf-filters-toggle {
		display: flex;
	}

	.ivf-sidebar-inner {
		display: none;
	}

	.ivf-sidebar.ivf-open .ivf-sidebar-inner {
		display: block;
		margin-top: 12px;
		background: #fff;
		border: 1px solid #e5e7eb;
		border-radius: 10px;
		padding: 14px 16px;
		box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
	}

	/* Bigger touch targets. */
	.ivf-filter-tree label {
		padding: 6px 0;
		font-size: 15px;
	}

	.ivf-filter-tree input[type="checkbox"],
	.ivf-filter-tree input[type="radio"] {
		width: 18px;
		height: 18px;
	}

	.ivf-filter-title {
		font-size: 15px;
		padding-top: 2px;
		padding-bottom: 2px;
	}

	.ivf-filter-body {
		max-height: 45vh;
	}

	.ivf-search-input,
	.ivf-sort-select {
		font-size: 15px;
		padding: 10px 12px;
	}

	.ivf-featured-toggle {
		font-size: 15px;
		padding: 6px 0;
	}

	/* Sticky action bar inside the open panel so Apply is always reachable. */
	.ivf-filter-actions {
		position: sticky;
		bottom: 0;
		background: #fff;
		margin: 0 -16px -14px;
		padding: 12px 16px 14px;
		border-top: 1px solid #f0f0f1;
	}

	.ivf-filter-actions .ivf-btn {
		padding: 12px 16px;
		font-size: 14px;
	}
}

@media (max-width: 520px) {
	.ivf-grid,
	.ivf-grid.ivf-cols-3,
	.ivf-grid.ivf-cols-2 {
		grid-template-columns: 1fr;
	}
}
