/**
 * Kubota Europe products by division (WPBakery element
 * `vc_kbeu_products_by_division`).
 *
 * Tabs (Figma 4595-1890): a centered row of labels with a 3px turquoise
 * underline under the active one; the active label is bold, the rest medium.
 * Slider (Figma 4595-1625 / 4595-1634 / 4595-1638): a rounded cover (image or
 * video) with a "n/total" counter badge top-right and a blurred dark text box
 * over its bottom-right corner, and below it a footer with the product title, a
 * grey division tag, a turquoise "Discover more" button and the prev/next
 * circular controls.
 *
 * Font "Helvetica Neue LT Pro" comes from the plugin's fonts stylesheet (this
 * handle depends on `kbeu-fonts`), referenced through `--kbeu-font-principal`.
 */

.kbeu-pbd {
	--kbeu-pbd-teal: #03a8a9;
	font-family: var( --kbeu-font-principal );
	color: #000;
}

/* --- Header (tabs + "View all products") ----------------------------------- */

.kbeu-pbd__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: clamp( 20px, 3vw, 48px );
	border-bottom: 1px solid #e2e2e2;
}

/* "View all products" link (bold label + forward chevron), right of the tabs. */
.kbeu-pbd__viewall {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	padding-bottom: 14px;
	color: #000;
	font-weight: 700;
	font-size: clamp( 16px, 1.5vw, 20px );
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.kbeu-pbd__viewall:hover,
.kbeu-pbd__viewall:focus {
	color: var( --kbeu-pbd-teal );
}

.kbeu-pbd__viewall-icon {
	flex-shrink: 0;
}

.kbeu-pbd__viewall:focus-visible {
	outline: 2px solid var( --kbeu-pbd-teal );
	outline-offset: 3px;
}

/* --- Tabs ------------------------------------------------------------------ */

.kbeu-pbd__tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: clamp( 18px, 3vw, 35px );
	min-width: 0;
}

.kbeu-pbd__tab {
	margin: 0 0 -1px;
	padding: 0 2px 14px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	cursor: pointer;
	font-family: inherit;
	font-weight: 500;
	font-size: clamp( 16px, 1.5vw, 20px );
	line-height: 1.3;
	color: #000;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.kbeu-pbd__tab:hover {
	color: var( --kbeu-pbd-teal );
}

.kbeu-pbd__tab.is-active {
	font-weight: 700;
	border-bottom-color: var( --kbeu-pbd-teal );
}

.kbeu-pbd__tab:focus-visible {
	outline: 2px solid var( --kbeu-pbd-teal );
	outline-offset: 3px;
}

/* --- Panels / slider ------------------------------------------------------- */

.kbeu-pbd__panel[hidden] {
	display: none;
}

.kbeu-pbd__panel {
	margin-top: clamp( 24px, 3vw, 40px );
}

.kbeu-pbd__viewport {
	position: relative;
	overflow: hidden;
	border-radius: 15px;
	transition: opacity 0.3s ease;
}

.kbeu-pbd__viewport.is-fading {
	opacity: 0;
}

.kbeu-pbd__track {
	display: flex;
	will-change: transform;
}

.kbeu-pbd__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
}

.kbeu-pbd__media {
	position: relative;
	aspect-ratio: 1872 / 589;
}

.kbeu-pbd__img,
.kbeu-pbd__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 15px;
}

.kbeu-pbd__img--empty {
	background: #e9ecef;
}

/* Counter badge (top-right of the cover). */
.kbeu-pbd__counter {
	position: absolute;
	top: clamp( 12px, 1.6vw, 22px );
	right: clamp( 12px, 1.6vw, 22px );
	z-index: 2;
	padding: 4px 12px;
	border-radius: 7px;
	background: rgba( 0, 0, 0, 0.65 );
	color: #fff;
	font-weight: 300;
	font-size: clamp( 15px, 1.3vw, 20px );
	line-height: 1.5;
}

/* Blurred text box over the cover's bottom-right corner. */
.kbeu-pbd__overlay {
	position: absolute;
	right: clamp( 14px, 1.6vw, 24px );
	bottom: clamp( 14px, 1.6vw, 24px );
	z-index: 1;
	max-width: min( 42%, 520px );
	padding: clamp( 14px, 1.4vw, 22px );
	border-radius: 29px;
	background: rgba( 0, 0, 0, 0.35 );
	-webkit-backdrop-filter: blur( 3.5px );
	backdrop-filter: blur( 3.5px );
	color: #fff;
}

.kbeu-pbd__overlay-text {
	font-weight: 500;
	font-size: clamp( 14px, 1.1vw, 18px );
	line-height: 1.5;
}

.kbeu-pbd__overlay-text p {
	margin: 0 0 0.5em;
}

.kbeu-pbd__overlay-text p:last-child {
	margin-bottom: 0;
}

/* --- Footer (title + tag + CTA + nav) -------------------------------------- */

.kbeu-pbd__footer {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-top: clamp( 18px, 2vw, 28px );
}

.kbeu-pbd__heading {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
}

.kbeu-pbd__title {
	margin: 0;
	font-weight: 700;
	font-size: clamp( 22px, 2.4vw, 32px );
	line-height: 1.37;
	color: #000;
}

.kbeu-pbd__tag {
	display: inline-block;
	padding: 5px 16px;
	border-radius: 7px;
	background: #6a6a6a;
	color: #fff;
	font-weight: 300;
	font-size: clamp( 15px, 1.3vw, 20px );
	line-height: 1.56;
}

.kbeu-pbd__subtitle {
	margin: clamp( 8px, 1vw, 14px ) 0 0;
	max-width: 720px;
	font-weight: 300;
	font-size: clamp( 17px, 1.7vw, 24px );
	line-height: 1.55;
	color: #000;
}

.kbeu-pbd__subtitle[hidden] {
	display: none;
}

.kbeu-pbd__cta {
	display: inline-flex;
	align-items: center;
	margin-top: clamp( 14px, 1.5vw, 20px );
	padding: 16px 26px;
	border-radius: 15px;
	background: var( --kbeu-pbd-teal );
	color: #fff;
	font-weight: 400;
	font-size: clamp( 16px, 1.3vw, 20px );
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.kbeu-pbd__cta:hover,
.kbeu-pbd__cta:focus {
	background: #028788;
	color: #fff;
}

/* Circular prev/next controls. */
.kbeu-pbd__nav {
	display: flex;
	gap: 16px;
	flex-shrink: 0;
}

.kbeu-pbd__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.kbeu-pbd__arrow--prev {
	border: 1px solid #c7c7c7;
	background: #fff;
	color: #6a6a6a;
}

.kbeu-pbd__arrow--prev:hover:not( :disabled ) {
	border-color: var( --kbeu-pbd-teal );
	color: var( --kbeu-pbd-teal );
}

.kbeu-pbd__arrow--next {
	border: 1px solid var( --kbeu-pbd-teal );
	background: var( --kbeu-pbd-teal );
	color: #fff;
}

.kbeu-pbd__arrow--next:hover:not( :disabled ) {
	background: #028788;
	border-color: #028788;
}

.kbeu-pbd__arrow:disabled {
	opacity: 0.4;
	cursor: default;
}

.kbeu-pbd__arrow:focus-visible {
	outline: 2px solid var( --kbeu-pbd-teal );
	outline-offset: 3px;
}

/* --- Responsive ------------------------------------------------------------ */

@media ( max-width: 782px ) {
	.kbeu-pbd__header {
		flex-wrap: wrap;
		align-items: stretch;
	}

	.kbeu-pbd__tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		width: 100%;
	}

	.kbeu-pbd__tab {
		white-space: nowrap;
	}

	.kbeu-pbd__viewall {
		padding-top: 12px;
		padding-bottom: 0;
	}

	.kbeu-pbd__media {
		aspect-ratio: 4 / 3;
	}

	.kbeu-pbd__overlay {
		max-width: 70%;
	}

	.kbeu-pbd__footer {
		flex-wrap: wrap;
	}
}

/* Respect reduced-motion: only the gentle opacity crossfade remains (via CSS). */
@media ( prefers-reduced-motion: reduce ) {
	.kbeu-pbd__tab,
	.kbeu-pbd__cta,
	.kbeu-pbd__arrow {
		transition: none;
	}
}
