/**
 * The Santander bundle only ships a "floating" mode: it creates its own
 * div.san-widget-floating, pins it to the viewport corner and animates it with
 * a transform. Once the node is moved into #apfinance these rules flatten it
 * back into normal document flow.
 */

#apfinance {
	position: relative;
	width: 100%;
}

#apfinance .san-widget-floating {
	position: static !important;
	inset: auto !important;
	transform: none !important;
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	z-index: auto !important;
	opacity: 1 !important;
	overflow: visible !important;
	transition: none !important;
}

#apfinance .san-expandable-content-container-outer,
#apfinance .san-expandable-content-container-inner {
	position: static !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	transform: none !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
	overflow: visible !important;
}

/* The corner bubble is only used as a programmatic trigger. */
#apfinance .san-floating-button {
	display: none !important;
}

/*
 * The modal's scroll container uses overscroll-behavior: contain, which swallows
 * wheel events over the widget and stops the page from scrolling. Inline there is
 * nothing to scroll, so the container is flattened into the normal flow.
 */
#apfinance [class*="MainScreen_contentContainer"],
#apfinance [class*="MainScreen_productSelector"],
#apfinance [class*="MainScreen_mainScreen"] {
	overflow: visible !important;
	overscroll-behavior: auto !important;
	height: auto !important;
	max-height: none !important;
}

/* Santander's API strips pictureURL, so the real photo is supplied as a custom property. */
#apfinance.ap-has-car-image [class*="VehicleInformation_imageWrapper"] {
	background-image: var(--ap-santander-car-image);
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	min-height: 110px;
}

#apfinance.ap-has-car-image [class*="VehicleInformation_defaultCarIllustration"] {
	visibility: hidden;
}

/* There is nothing to close when the widget is embedded. */
#apfinance .TopNavigation_navigationBar__4aUfI .MuiIconButton-root {
	display: none !important;
}

/* Placeholder height so the page does not jump while the bundle loads. */
#apfinance.ap-santander-host:empty {
	min-height: 640px;
}

@media (max-width: 767px) {
	#apfinance.ap-santander-host:empty {
		min-height: 860px;
	}
}
