/**
 * Marketplace — /marketplace
 * CMS content stays editable. Style aligned with /spare_parts:
 * warranty-like title/intro, hp-categories cards, care-style CTA pill.
 */

#marketplace {
	--mp-ink: #000;
	--mp-navy: var(--spiro-color-navy, #002c41);
	--mp-blue: var(--spiro-color-blue, #007ec1);
	--mp-bg: var(--spiro-color-bg, #f6f6f6);
	--mp-hover: var(--spiro-hover-dim);
	--mp-cat-ratio: 485 / 620;
	--mp-cat-radius: 22px;
	--mp-cat-pad: 40px;
	--mp-cat-fallback: #e8e8e8;

	background: var(--mp-bg);
	color: var(--mp-ink);
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif);
	padding: clamp(24px, 3vw, 40px) 0 clamp(72px, 8vw, 120px);
	box-sizing: border-box;
}

#marketplace > div {
	max-width: var(--spiro-content-max, 1630px);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--spiro-gutter, 50px);
	padding-right: var(--spiro-gutter, 50px);
	box-sizing: border-box;
}

#marketplace > div > .container {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

#marketplace .max-width-1260,
#marketplace .max-width-780,
#marketplace .max-width-960 {
	max-width: var(--spiro-content-max, 1630px) !important;
}

/* ---- Title ---- */
#marketplace .regular_box_title h2 {
	margin: 0 0 clamp(20px, 2.5vw, 32px);
}

#marketplace .regular_box_title h2 p {
	margin: 0 !important;
	font-size: var(--spiro-type-hero) !important;
	font-weight: var(--spiro-font-weight-extrabold, 800) !important;
	line-height: 1.05 !important;
	text-transform: uppercase;
	text-align: center !important;
	color: var(--mp-ink) !important;
}

/* ---- Intro ---- */
#marketplace .smaller_text {
	padding-bottom: clamp(36px, 4vw, 56px);
}

#marketplace .smaller_text .cell_1_1 > .full-height,
#marketplace .smaller_text .description_content {
	max-width: 780px;
	margin-left: auto;
	margin-right: auto;
}

#marketplace .smaller_text .description_content {
	text-align: left;
}

#marketplace .smaller_text .description_content p {
	margin: 0 !important;
	font-size: var(--spiro-type-intro) !important;
	font-weight: var(--spiro-font-weight-medium, 500) !important;
	line-height: 1.45 !important;
	color: var(--mp-ink) !important;
	text-align: left !important;
}

#marketplace .smaller_text .description_content a {
	color: var(--mp-blue) !important;
	text-decoration: none;
	font-weight: var(--spiro-font-weight-medium, 500);
	transition: filter 0.2s ease;
}

#marketplace .smaller_text .description_content a:hover,
#marketplace .smaller_text .description_content a:focus-visible {
	filter: var(--mp-hover);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- Product cards (= spare_parts / hp-categories) ---- */
#marketplace .marketplace_items {
	margin-bottom: clamp(28px, 3vw, 48px) !important;
	padding-bottom: 0 !important;
}

#marketplace .marketplace_items > .container {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

#marketplace .marketplace_items .row.flex_container {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(16px, 1.8vw, 24px);
	align-items: stretch;
	margin: 0 !important;
	width: 100% !important;
}

#marketplace .marketplace_items .row.flex_container::before,
#marketplace .marketplace_items .row.flex_container::after {
	content: none !important;
	display: none !important;
}

#marketplace .marketplace_items .cell_1_3,
#marketplace .marketplace_items .cell_1_2 {
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	float: none !important;
	flex: none !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	position: relative;
}

#marketplace .marketplace_items .full-height.regular_box_content,
#marketplace .marketplace_items .full-height {
	height: auto !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

#marketplace .marketplace_items .box_background {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	aspect-ratio: var(--mp-cat-ratio);
	padding: 0 !important;
	padding-top: 0 !important;
	margin: 0 !important;
	border-radius: var(--mp-cat-radius);
	overflow: hidden;
	isolation: isolate;
	background-color: var(--mp-cat-fallback);
	background-size: 0 0 !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	z-index: 0;
}

#marketplace .marketplace_items .box_background::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: var(--mp-cat-fallback);
	background-image: inherit;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	transform: scale(1);
	transform-origin: center center;
	transition: transform var(--spiro-hover-duration, 0.55s) var(--spiro-hover-ease, cubic-bezier(0.22, 1, 0.36, 1));
	pointer-events: none;
}

#marketplace .marketplace_items .cell_1_3:hover .box_background::before,
#marketplace .marketplace_items .cell_1_3:focus-within .box_background::before {
	transform: scale(var(--spiro-hover-zoom, 1.04));
}

#marketplace .marketplace_items .box_background > .container {
	position: absolute !important;
	left: var(--mp-cat-pad) !important;
	right: var(--mp-cat-pad) !important;
	bottom: var(--mp-cat-pad) !important;
	top: auto !important;
	z-index: 2;
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	max-height: calc(100% - (var(--mp-cat-pad) * 2));
}

#marketplace .marketplace_items .box_caption {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	width: 100%;
	min-width: 0;
}

#marketplace .marketplace_items h2 {
	margin: 0 !important;
	padding: 0 !important;
}

#marketplace .marketplace_items h2 p,
#marketplace .marketplace_items h2 p span {
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif) !important;
	font-size: clamp(22px, 2vw, 35px) !important;
	font-weight: var(--spiro-font-weight-extrabold, 800) !important;
	line-height: 1.15 !important;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-align: left !important;
	color: #000 !important;
}

#marketplace .marketplace_items .description_content {
	display: block;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, margin-top 0.45s ease;
}

#marketplace .marketplace_items .description_content p {
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif) !important;
	font-size: 18px !important;
	font-weight: var(--spiro-font-weight-medium, 500) !important;
	line-height: 1.15 !important;
	color: #000 !important;
	text-align: left !important;
}

#marketplace .marketplace_items .cell_1_3:hover .description_content,
#marketplace .marketplace_items .cell_1_3:focus-within .description_content {
	margin-top: 12px !important;
	max-height: 10.5em;
	opacity: 1;
}

#marketplace .marketplace_items .box_caption::after {
	content: url("../images/black_arrow-s.svg");
	display: block;
	width: 28px;
	height: 28px;
	max-height: 0;
	margin: 0;
	opacity: 0;
	overflow: hidden;
	line-height: 1;
	transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease 0.04s, margin-top 0.45s ease;
}

#marketplace .marketplace_items .cell_1_3:hover .box_caption::after,
#marketplace .marketplace_items .cell_1_3:focus-within .box_caption::after {
	max-height: 28px;
	margin-top: 20px;
	opacity: 1;
}

/* NEW badge — .marketplace_items.new-item (same asset as legacy .img_cont:before) */
#marketplace .marketplace_items.new-item .box_background::after {
	content: "";
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 61px;
	height: 61px;
	background: url("../images/new-item.svg") no-repeat top center;
	background-size: contain;
	pointer-events: none;
}

/* ---- Request a Quote (care / spare_parts pill) ---- */
#marketplace .ta-center,
#marketplace .item {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

#marketplace .item .btn.btn-custom,
#marketplace a.btn.btn-custom {
	--mp-care-icon: 40px;
	--mp-care-pad: 7px;
	display: inline-flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	min-width: 259px;
	min-height: 54px;
	max-width: min(100%, 320px);
	margin: 0;
	padding: var(--mp-care-pad) var(--mp-care-pad) var(--mp-care-pad) 28px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--mp-blue) !important;
	box-shadow: none !important;
	overflow: hidden;
	isolation: isolate;
	position: relative;
	z-index: 0;
	text-decoration: none !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif);
	font-size: var(--spiro-type-btn);
	font-weight: var(--spiro-font-weight-medium, 500);
	line-height: 1.2;
	box-sizing: border-box;
}

#marketplace .item .btn.btn-custom::before,
#marketplace a.btn.btn-custom::before {
	content: "";
	position: absolute;
	top: 50%;
	right: var(--mp-care-pad);
	width: var(--mp-care-icon);
	height: var(--mp-care-icon);
	border-radius: 50%;
	background: var(--mp-navy);
	transform: translateY(-50%) scale(1);
	transform-origin: center center;
	transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
	/* -1 = under text (white stays visible) but over blue bg */
	z-index: -1;
	pointer-events: none;
}

#marketplace .item .btn.btn-custom::after,
#marketplace a.btn.btn-custom::after {
	content: "";
	position: relative;
	z-index: 1;
	display: inline-flex;
	flex-shrink: 0;
	width: var(--mp-care-icon);
	height: var(--mp-care-icon);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M4.5 2.1 9.4 6 4.5 9.9 3.6 9l3.6-3L3.6 3z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 12px;
}

#marketplace .item .btn.btn-custom:hover::before,
#marketplace .item .btn.btn-custom:focus-visible::before,
#marketplace a.btn.btn-custom:hover::before,
#marketplace a.btn.btn-custom:focus-visible::before {
	transform: translateY(-50%) scale(14);
}

#marketplace .item .btn.btn-custom:hover,
#marketplace .item .btn.btn-custom:focus-visible,
#marketplace a.btn.btn-custom:hover,
#marketplace a.btn.btn-custom:focus-visible {
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	text-decoration: none !important;
	filter: none;
	background: var(--mp-blue) !important;
}

@media (max-width: 1200px) {
	#marketplace {
		--mp-cat-pad: clamp(24px, 3vw, 40px);
	}
}

@media (max-width: 992px) {
	#marketplace .marketplace_items .row.flex_container {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	#marketplace .regular_box_title h2 p {
		font-size: clamp(40px, 8vw, 56px) !important;
	}
}

@media (max-width: 640px) {
	#marketplace .marketplace_items .row.flex_container {
		grid-template-columns: 1fr;
		max-width: 485px;
		margin-left: auto;
		margin-right: auto;
	}

	#marketplace .marketplace_items .description_content {
		max-height: none;
		opacity: 1;
		margin-top: 12px !important;
	}

	#marketplace .marketplace_items .box_caption::after {
		max-height: 28px;
		margin-top: 18px;
		opacity: 1;
	}

	#marketplace .marketplace_items .cell_1_3:hover .box_background::before {
		transform: scale(1);
	}

	#marketplace .item .btn.btn-custom,
	#marketplace a.btn.btn-custom {
		width: 100%;
		max-width: 360px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#marketplace .marketplace_items .box_background::before,
	#marketplace .marketplace_items .description_content,
	#marketplace .marketplace_items .box_caption::after,
	#marketplace .item .btn.btn-custom::before,
	#marketplace a.btn.btn-custom::before {
		transition: none !important;
	}

	#marketplace .marketplace_items .box_background::before {
		transform: scale(1);
	}

	#marketplace .marketplace_items .description_content {
		max-height: none;
		opacity: 1;
		margin-top: 12px !important;
	}

	#marketplace .marketplace_items .box_caption::after {
		max-height: 28px;
		margin-top: 18px;
		opacity: 1;
	}

	#marketplace .item .btn.btn-custom:hover::before,
	#marketplace a.btn.btn-custom:hover::before {
		transform: translateY(-50%) scale(1);
	}
}
