/* KSI Datasheet Library — fully custom styles, not dependent on
   Elementor's Loop Grid CSS. Every selector is scoped under
   #ksi-datasheet-sidebar or the .ksi-datasheet-* prefix so nothing
   here collides with (or gets overridden by) Elementor's defaults. */

#ksi-datasheet-sidebar,
.ksi-datasheet-grid-wrap {
	--ksi-ds-maroon: #701f2e;
	--ksi-ds-maroon-dark: #591724;
	--ksi-ds-border: #ebebeb;
	--ksi-ds-card-border: #dfdfdf;
	--ksi-ds-text: #4c4c4c;
	--ksi-ds-panel-default: #f7e8ea;
	--ksi-ds-panel-hover: #fef7e1;
	font-family: inherit;
	box-sizing: border-box;
}

#ksi-datasheet-sidebar *,
.ksi-datasheet-grid-wrap * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------
 * Sidebar
 * ----------------------------------------------------------------*/

#ksi-datasheet-sidebar .ksi-datasheet-sidebar-card {
	background: #fdfdfd;
	border: 1px solid var(--ksi-ds-border);
	border-radius: 16px;
	padding: 30px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 20px;
}

#ksi-datasheet-sidebar .ksi-datasheet-sidebar-heading-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

#ksi-datasheet-sidebar .ksi-datasheet-filter-icon {
	color: #000;
	flex-shrink: 0;
}

#ksi-datasheet-sidebar .ksi-datasheet-sidebar-heading {
	font-size: 32px;
	font-weight: 600;
	color: #000;
	margin: 0;
}

/* Desktop "clear all filters" icon, next to the Filters heading */

#ksi-datasheet-sidebar .ksi-datasheet-clear-filters {
	margin-left: auto;
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	border: 1px solid var(--ksi-ds-border);
	background: #fdfdfd;
	color: var(--ksi-ds-maroon);
	cursor: pointer;
	flex-shrink: 0;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

#ksi-datasheet-sidebar .ksi-datasheet-clear-filters.is-visible {
	display: flex;
}

#ksi-datasheet-sidebar .ksi-datasheet-clear-filters:hover {
	background: var(--ksi-ds-maroon);
	color: #fff;
}

#ksi-datasheet-sidebar .ksi-datasheet-divider {
	height: 1px;
	background: var(--ksi-ds-border);
	width: 100%;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-header {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	border: none;
	background: none;
	padding: 0;
	cursor: pointer;
	text-align: left;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-chevron {
	flex-shrink: 0;
	color: var(--ksi-ds-maroon);
	transform: rotate(-90deg);
	transition: transform 0.2s ease;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item.is-open > .ksi-datasheet-accordion-header .ksi-datasheet-accordion-chevron {
	transform: rotate(0deg);
	color: var(--ksi-ds-maroon);
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item:not(.is-open) .ksi-datasheet-accordion-chevron {
	color: #000;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item.is-open .ksi-datasheet-accordion-header img {
	transform: rotate(-60deg);
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-title {
	font-size: 22px;
	font-weight: 600;
	color: var(--ksi-ds-maroon);
	line-height: 1.3;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item:not(.is-open) .ksi-datasheet-accordion-title {
	color: #000;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item .ksi-datasheet-accordion-body {
	display: none;
	gap: 18px;
	margin-top: 20px;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-item.is-open .ksi-datasheet-accordion-body {
	display: flex;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-connector {
	width: 1px;
	background: var(--ksi-ds-border);
	flex-shrink: 0;
	margin-left: 7px;
}

#ksi-datasheet-sidebar .ksi-datasheet-accordion-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
	flex: 1;
	min-width: 0;
}

#ksi-datasheet-sidebar .ksi-datasheet-checkbox-label {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1.4;
	color: var(--ksi-ds-text);
}

#ksi-datasheet-sidebar input.ksi-datasheet-checkbox {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	border: 1px solid #c1c1c1;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	position: relative;
	margin: 0;
	transition: background 0.12s ease, border-color 0.12s ease;
}

#ksi-datasheet-sidebar input.ksi-datasheet-checkbox:hover {
	border-color: var(--ksi-ds-maroon);
}

#ksi-datasheet-sidebar input.ksi-datasheet-checkbox:checked {
	background: var(--ksi-ds-maroon);
	border-color: var(--ksi-ds-maroon);
}

#ksi-datasheet-sidebar input.ksi-datasheet-checkbox:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 4px;
	width: 8px;
	height: 5px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-45deg);
}

#ksi-datasheet-sidebar .ksi-datasheet-empty {
	font-size: 14px;
	color: #999;
	margin: 0;
}

/* ------------------------------------------------------------------
 * Grid + cards
 * ----------------------------------------------------------------*/

.ksi-datasheet-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	position: relative;
}

.ksi-datasheet-grid-wrap.is-loading .ksi-datasheet-grid {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.ksi-datasheet-grid-wrap {
	position: relative;
}

.ksi-datasheet-grid-loader {
	position: absolute;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.ksi-datasheet-grid-loader.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.ksi-datasheet-grid-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid #f0dede;
	border-top-color: var(--ksi-ds-maroon, #701f2e);
	animation: ksi-datasheet-spin 0.7s linear infinite;
}

@keyframes ksi-datasheet-spin {
	to { transform: rotate(360deg); }
}

.ksi-datasheet-card {
	border: 1px solid var(--ksi-ds-card-border, #dfdfdf);
	border-radius: 16px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.ksi-datasheet-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.ksi-datasheet-card-media {
	background: var(--ksi-ds-panel-default, #f7e8ea);
	padding: 50px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	transition: background 0.25s ease;
}

.ksi-datasheet-card:hover .ksi-datasheet-card-media {
	background: var(--ksi-ds-panel-hover, #fef7e1);
}

.ksi-datasheet-card-images {
	position: relative;
	width: 100%;
	max-width: 220px;
	aspect-ratio: 220 / 267;
	box-shadow: 0 4px 60px rgba(0, 0, 0, 0.08);
}

.ksi-datasheet-card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.ksi-datasheet-card-image.is-active {
	opacity: 1;
	border: 8px solid #fff;
}

.ksi-datasheet-card-image-placeholder {
	position: absolute;
	inset: 0;
	background: #e9e9e9;
}

.ksi-datasheet-card-dots {
	display: flex;
	gap: 8px;
}

.ksi-datasheet-card-dots .ksi-datasheet-dot {
	width: 10px;
	height: 10px;
	border-radius: 2px;
	border: none;
	background: rgba(0, 0, 0, 0.12);
	cursor: pointer;
	padding: 0;
}

.ksi-datasheet-card-dots .ksi-datasheet-dot.is-active {
	background: var(--ksi-ds-maroon, #701f2e);
}

.ksi-datasheet-card-body {
	padding: 20px 30px 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

.ksi-datasheet-card-eyebrow {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ksi-ds-maroon, #701f2e);
}

#ksi-datasheet-grid .ksi-datasheet-card-title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	color: #000;
	line-break: anywhere;
}

.ksi-datasheet-card-footer {
	padding: 22px 30px 30px;
	border-top: 1px solid var(--ksi-ds-border, #ebebeb);
	margin-top: 20px;
}

.ksi-datasheet-card-download {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 20px;
	border-radius: 64px;
	border: 1px solid var(--ksi-ds-maroon, #701f2e);
	background: transparent;
	color: var(--ksi-ds-maroon, #701f2e);
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.ksi-datasheet-card-download:hover {
	background: var(--ksi-ds-maroon, #701f2e);
	color: #fff;
}

.ksi-datasheet-card-download.is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

.ksi-datasheet-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 0;
	color: #777;
}

/* ------------------------------------------------------------------
 * Pagination
 * ----------------------------------------------------------------*/

.ksi-datasheet-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
	margin-top: 40px;
}

.ksi-datasheet-pagination .ksi-datasheet-page-link {
	width: 40px !important;
	height: 40px !important;
	border-radius: 6px !important;
	border: 1px solid #dfe4ea !important;
	background: #fff !important;
	color: var(--ksi-ds-text, #4c4c4c) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: unset !important;
}

.ksi-datasheet-pagination .ksi-datasheet-page-link.is-active {
	background: var(--ksi-ds-maroon, #701f2e) !important;
	border-color: var(--ksi-ds-maroon, #701f2e) !important;
	color: #fff !important;
}

.ksi-datasheet-pagination .ksi-datasheet-page-link:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.ksi-datasheet-pagination .ksi-datasheet-page-ellipsis {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ksi-ds-text, #4c4c4c);
}

/* ==================================================================
   Mobile / tablet: consolidated "Filters" sheet (<=880px)
   Same pattern as Solutions: the sidebar block (#ksi-datasheet-sidebar,
   with its 3 accordion groups) gets moved into a bottom sheet, opened
   by a non-sticky trigger bar placed above the grid.
   ================================================================== */

.ksi-datasheet-sec .ksi-datasheet-mobile-trigger {
	display: none !important;
}

@media (max-width: 880px) {
	.ksi-datasheet-sec .ksi-datasheet-mobile-trigger {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 10px !important;
		position: static !important;
		width: 100%;
		background: var(--ksi-ds-maroon, #701f2e) !important;
		color: #fff !important;
		border: none !important;
		border-radius: 8px !important;
		padding: 14px 20px !important;
		font-size: 16px !important;
		font-weight: 600 !important;
		cursor: pointer;
		margin-bottom: 16px !important;
	}

	.ksi-datasheet-sec .ksi-datasheet-mobile-trigger svg {
		flex-shrink: 0;
	}

	.ksi-datasheet-sec .ksi-datasheet-mobile-trigger-count {
		background: #fff;
		color: var(--ksi-ds-maroon, #701f2e);
		border-radius: 999px;
		font-size: 12px;
		font-weight: 700;
		padding: 2px 9px;
		line-height: 1.5;
	}

	body.ksi-datasheet-sheet-open {
		overflow: hidden;
	}

	.ksi-datasheet-sheet-overlay {
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: rgba(0, 0, 0, 0.45);
		display: flex;
		align-items: flex-end;
	}

	.ksi-datasheet-sheet-overlay[hidden] {
		display: none;
	}

	.ksi-datasheet-sheet-panel {
		width: 100%;
		max-height: 88vh;
		background: #fff;
		border-radius: 16px 16px 0 0;
		display: flex;
		flex-direction: column;
		transform: translateY(100%);
		transition: transform 0.25s ease;
	}

	.ksi-datasheet-sheet-overlay.is-open .ksi-datasheet-sheet-panel {
		transform: translateY(0);
	}

	.ksi-datasheet-sheet-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px;
		border-bottom: 1px solid var(--ksi-ds-border, #ebebeb);
		flex-shrink: 0;
	}

	.ksi-datasheet-sheet-title {
		font-size: 18px;
		font-weight: 600;
		color: #000;
	}

	.ksi-datasheet-sheet-close {
		border: none !important;
		background: none !important;
		font-size: 24px !important;
		line-height: 1 !important;
		cursor: pointer !important;
		color: var(--ksi-ds-text, #4c4c4c) !important;
		padding: 4px 8px !important;
	}

	.ksi-datasheet-sheet-body {
		overflow-y: auto;
		padding: 20px;
		flex: 1;
	}

	.ksi-datasheet-sheet-body #ksi-datasheet-sidebar .ksi-datasheet-sidebar-card {
		border: none;
		padding: 0;
		position: static;
	}

	.ksi-datasheet-sheet-body #ksi-datasheet-sidebar .ksi-datasheet-sidebar-heading-row {
		display: none;
	}

	.ksi-datasheet-sheet-footer {
		display: flex;
		gap: 12px;
		padding: 16px 20px;
		border-top: 1px solid var(--ksi-ds-border, #ebebeb);
		flex-shrink: 0;
	}

	.ksi-datasheet-sheet-clear {
		flex: 1 !important;
		background: #fff !important;
		border: 1px solid var(--ksi-ds-maroon, #701f2e) !important;
		color: var(--ksi-ds-maroon, #701f2e) !important;
		border-radius: 999px !important;
		padding: 12px !important;
		font-size: 15px !important;
		font-weight: 600 !important;
		cursor: pointer !important;
	}

	.ksi-datasheet-sheet-apply {
		flex: 1;
		background: var(--ksi-ds-maroon, #701f2e) !important;
		border: none !important;
		color: #fff !important;
		border-radius: 999px !important;
		padding: 12px !important;
		font-size: 15px !important;
		font-weight: 600 !important;
		cursor: pointer !important;
	}

	/* The desktop clear icon has its own dedicated "Clear all" button
	   in the sheet footer instead, so hide the icon itself here. */
	#ksi-datasheet-sidebar .ksi-datasheet-clear-filters {
		display: none !important;
	}
}

/* ------------------------------------------------------------------
 * Responsive grid
 * Default (>1200px): 3 columns. 768px-1200px AND 767px and slightly
 * below: 2 columns, per your instruction. Below 767px: 1 column.
 * ----------------------------------------------------------------*/

@media (max-width: 1200px) {
	.ksi-datasheet-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.ksi-datasheet-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 880px) {
	#ksi-datasheet-sidebar .ksi-datasheet-sidebar-card {
		position: static;
	}
	#ksi-datasheet-sidebar .ksi-datasheet-sidebar-heading {
		font-size: 24px;
	}
}