/* FDT Downloads – toggles (product pages) and download center. Colours follow the existing service area. */

.fdt-dl {
	--fdt-dl-blue: #0061a1;
	--fdt-dl-blue-hover: #379cd6;
	--fdt-dl-border: #e1e1e1;
	--fdt-dl-muted: #6b7280;
	--fdt-dl-surface: #f5f7f9;
	--fdt-dl-radius: 4px;
}

/* ---------- buttons (shared) ---------- */

.fdt-dl .fdt-dl-files {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
}

.fdt-dl .avia-button.fdt-dl-btn {
	display: inline-flex;
	align-items: center;
	gap: 0;
	margin: 0;
	background-color: var(--fdt-dl-blue);
	border-color: var(--fdt-dl-blue);
	color: #fff;
	text-decoration: none;
}

.fdt-dl .avia-button.fdt-dl-btn:hover,
.fdt-dl .avia-button.fdt-dl-btn:focus-visible {
	background-color: var(--fdt-dl-blue-hover);
	border-color: var(--fdt-dl-blue-hover);
	color: #fff;
}

.fdt-dl .avia-button.fdt-dl-btn:focus-visible {
	outline: 2px solid var(--fdt-dl-blue);
	outline-offset: 2px;
}

.fdt-dl .fdt-dl-btn__meta {
	margin-left: .6em;
	font-size: .85em;
	opacity: .8;
	white-space: nowrap;
}

.fdt-dl .fdt-dl-soon {
	margin: 8px 0 0;
	color: var(--fdt-dl-muted);
}

/* ---------- toggles ---------- */

.fdt-dl--toggles .fdt-dl-intro {
	margin-bottom: 1.2em;
}

.fdt-dl--toggles .fdt-dl-item + .fdt-dl-item {
	margin-top: 1.6em;
	padding-top: 1.6em;
	border-top: 1px solid var(--fdt-dl-border);
}

/* Preview thumbnail next to the text (auto-generated first page of the PDF). */
.fdt-dl--toggles .fdt-dl-item.has-thumb {
	display: flex;
	align-items: flex-start;
	gap: 22px;
}

.fdt-dl--toggles .fdt-dl-item__thumb {
	flex: 0 0 110px;
}

.fdt-dl--toggles .fdt-dl-item__thumb img {
	display: block;
	width: 100%;
	height: auto;
	background: #fff;
	border: 1px solid var(--fdt-dl-border);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
	transition: box-shadow .15s;
}

.fdt-dl--toggles .fdt-dl-preview--popup {
	cursor: zoom-in;
}

.fdt-dl--toggles .fdt-dl-item__thumb a:hover img {
	box-shadow: 0 4px 14px rgba(0, 40, 80, .18);
}

.fdt-dl--toggles .fdt-dl-item__body {
	flex: 1;
	min-width: 0;
}

@media (max-width: 479px) {
	.fdt-dl--toggles .fdt-dl-item.has-thumb {
		gap: 14px;
	}

	.fdt-dl--toggles .fdt-dl-item__thumb {
		flex-basis: 72px;
	}
}

.fdt-dl--toggles .fdt-dl-item__title {
	margin: 0 0 .4em;
	font-size: 1.05em;
}

.fdt-dl--toggles .fdt-dl-item__desc > :last-child {
	margin-bottom: 0;
}

.fdt-dl--toggles .fdt-dl-item__meta {
	margin: .4em 0 0;
	font-size: .9em;
	color: var(--fdt-dl-muted);
}

.fdt-dl--toggles .fdt-dl-subgroup {
	margin: 2em 0 1em;
	padding-bottom: .4em;
	border-bottom: 2px solid var(--fdt-dl-blue);
	color: var(--fdt-dl-blue);
}

.fdt-dl--toggles .fdt-dl-subgroup:first-child {
	margin-top: 0;
}

.fdt-dl-video {
	position: relative;
	margin: .5em 0 1.5em;
	aspect-ratio: 16 / 9;
}

.fdt-dl-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.fdt-dl--fallback details {
	border: 1px solid #969696;
	margin-bottom: 4px;
	padding: 12px 16px;
}

.fdt-dl--fallback summary {
	cursor: pointer;
	font-weight: 600;
}

/* ---------- download center ---------- */

.fdt-dl-center .fdt-dl-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 0 0 18px;
	padding: 14px;
	background: var(--fdt-dl-surface);
	border-radius: var(--fdt-dl-radius);
}

.fdt-dl-center .fdt-dl-filters__search {
	flex: 2 1 280px;
}

.fdt-dl-center .fdt-dl-filters__search input {
	width: 100%;
	height: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	font-size: 15px;
	border: 1px solid var(--fdt-dl-border);
	border-radius: var(--fdt-dl-radius);
	background: #fff;
	box-sizing: border-box;
}

.fdt-dl-center .fdt-dl-filter {
	position: relative;
	flex: 1 1 180px;
}

.fdt-dl-center .fdt-dl-filter summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	list-style: none;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--fdt-dl-border);
	border-radius: var(--fdt-dl-radius);
	user-select: none;
}

.fdt-dl-center .fdt-dl-filter summary::-webkit-details-marker {
	display: none;
}

.fdt-dl-center .fdt-dl-filter summary::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-left: auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform .15s;
}

.fdt-dl-center .fdt-dl-filter[open] summary::after {
	transform: translateY(2px) rotate(-135deg);
}

.fdt-dl-center .fdt-dl-filter__count:not(:empty) {
	min-width: 22px;
	padding: 1px 7px;
	font-size: 12px;
	line-height: 20px;
	text-align: center;
	color: #fff;
	background: var(--fdt-dl-blue);
	border-radius: 11px;
}

.fdt-dl-center .fdt-dl-filter__options {
	position: absolute;
	z-index: 50;
	top: calc(100% + 4px);
	left: 0;
	min-width: 100%;
	max-width: min(360px, 90vw);
	max-height: 360px;
	overflow: auto;
	margin: 0;
	padding: 8px 0;
	background: #fff;
	border: 1px solid var(--fdt-dl-border);
	border-radius: var(--fdt-dl-radius);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.fdt-dl-center .fdt-dl-option {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 14px;
	cursor: pointer;
	white-space: nowrap;
}

.fdt-dl-center .fdt-dl-option:hover {
	background: var(--fdt-dl-surface);
}

.fdt-dl-center .fdt-dl-option input {
	margin: 0;
}

.fdt-dl-center .fdt-dl-option--depth-1 { padding-left: 34px; }
.fdt-dl-center .fdt-dl-option--depth-2 { padding-left: 54px; }
.fdt-dl-center .fdt-dl-option--depth-3 { padding-left: 74px; }

.fdt-dl-center .fdt-dl-option__count {
	margin-left: auto;
	padding-left: 12px;
	font-size: 12px;
	color: var(--fdt-dl-muted);
}

.fdt-dl-center .fdt-dl-option.is-empty {
	opacity: .45;
}

.fdt-dl-center .fdt-dl-filters__actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.fdt-dl-center.is-enhanced .fdt-dl-filters__submit {
	display: none;
}

.fdt-dl-center .fdt-dl-filters__reset {
	font-size: 14px;
	white-space: nowrap;
}

.fdt-dl-center .fdt-dl-center__status {
	margin: 0 0 12px;
	font-size: 14px;
	color: var(--fdt-dl-muted);
}

.fdt-dl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.fdt-dl-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--fdt-dl-border);
	border-radius: var(--fdt-dl-radius);
	overflow: hidden;
	transition: box-shadow .15s, border-color .15s;
}

.fdt-dl-card:hover {
	border-color: #c9d3dc;
	box-shadow: 0 6px 18px rgba(0, 40, 80, .08);
}

.fdt-dl-card[hidden] {
	display: none;
}

.fdt-dl-card__thumb {
	aspect-ratio: 4 / 3;
	background: var(--fdt-dl-surface);
	border-bottom: 1px solid var(--fdt-dl-border);
	overflow: hidden;
}

.fdt-dl-card__thumb a {
	display: block;
	height: 100%;
	cursor: zoom-in;
}

.fdt-dl-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.fdt-dl-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--fdt-dl-blue);
	opacity: .55;
}

.fdt-dl-card__body {
	flex: 1;
	padding: 14px 16px 6px;
}

.fdt-dl-card__type {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--fdt-dl-blue);
}

.fdt-dl-card__title {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.fdt-dl-card__products,
.fdt-dl-card__meta {
	margin: 0 0 4px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--fdt-dl-muted);
}

.fdt-dl-card__files {
	padding: 6px 16px 16px;
}

.fdt-dl-card__files .fdt-dl-files {
	gap: 6px;
	margin: 0;
}

.fdt-dl-card__files .avia-button.fdt-dl-btn {
	padding: 7px 10px;
	font-size: 12px;
}

.fdt-dl-card.is-soon .fdt-dl-card__thumb,
.fdt-dl-card.is-soon .fdt-dl-card__title {
	opacity: .6;
}

/* Placeholders have no preview: keep their header slim instead of an empty 4:3 box. */
.fdt-dl-card.is-soon .fdt-dl-card__thumb:not(:has(img)) {
	aspect-ratio: auto;
	height: 48px;
}

.fdt-dl-center .fdt-dl-center__empty {
	padding: 40px 0;
	text-align: center;
	color: var(--fdt-dl-muted);
}

.fdt-dl-center .fdt-dl-center__more {
	margin-top: 24px;
	text-align: center;
}

.fdt-dl-center .fdt-dl-more {
	background-color: var(--fdt-dl-blue);
	border-color: var(--fdt-dl-blue);
	color: #fff;
}

@media (max-width: 767px) {
	.fdt-dl-center .fdt-dl-filters {
		padding: 10px;
	}

	.fdt-dl-center .fdt-dl-filter {
		flex-basis: 100%;
	}

	.fdt-dl-center .fdt-dl-filter__options {
		position: static;
		max-width: none;
		margin-top: 4px;
		box-shadow: none;
	}

	.fdt-dl-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.fdt-dl-card__body {
		padding: 10px 12px 4px;
	}

	.fdt-dl-card__files {
		padding: 4px 12px 12px;
	}
}

@media (max-width: 420px) {
	.fdt-dl-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fdt-dl-card,
	.fdt-dl-center .fdt-dl-filter summary::after {
		transition: none;
	}
}
