/* Hopilo Sticky Add to Cart.
   Wartości wizualne skopiowane z głównego formularza Hopilo (Salient). Zmiany wyglądu: tylko blok :root poniżej. */
:root {
	--hsac-accent: #3e7fa9;
	--hsac-accent-text: #fff;
	--hsac-border: #aaa;
	--hsac-height: 49.2px;
	--hsac-radius: 200px;
	--hsac-qty-width: 110px;
	--hsac-gap: 20px;
	--hsac-pad-y: 8px;
	/* wysokość paska: padding góra + dół + linia 1 px + kontrolka + safe-area */
	--hsac-bar-height: calc(var(--hsac-height) + (var(--hsac-pad-y) * 2) + 1px + env(safe-area-inset-bottom, 0px));
}

#hsac-bar {
	display: none;
}

/* Tylko mobile: powyżej 767 px pasek jest wyłączony (ten sam próg co dotychczasowy StickyCue). */
@media (max-width: 767px) {
	#hsac-bar {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9000;
		box-sizing: border-box;
		margin: 0;
		padding: var(--hsac-pad-y) 16px calc(var(--hsac-pad-y) + env(safe-area-inset-bottom, 0px));
		background: #fff;
		background-image: none;
		border-top: 1px solid #e6e6e6;
		box-shadow: none;
		filter: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		transform: translateY(100%);
		visibility: hidden;
		transition: transform 0.18s ease, visibility 0s linear 0.18s;
	}

	body.hsac-visible #hsac-bar {
		transform: none;
		visibility: visible;
		transition: transform 0.18s ease, visibility 0s;
	}

	/* Miejsce na dole strony tylko wtedy, gdy pasek jest faktycznie widoczny. */
	body.hsac-visible {
		padding-bottom: var(--hsac-bar-height);
	}
}

#hsac-bar *,
#hsac-bar *::before,
#hsac-bar *::after {
	box-sizing: border-box;
}

#hsac-bar .hsac-inner {
	display: flex;
	align-items: stretch;
	gap: var(--hsac-gap);
	max-width: 480px;
	margin: 0 auto;
	padding: 0;
}

#hsac-bar .hsac-qty {
	display: flex;
	align-items: stretch;
	flex: 0 0 var(--hsac-qty-width);
	width: var(--hsac-qty-width);
	height: var(--hsac-height);
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: transparent;
	border: 1px solid var(--hsac-border);
	border-radius: var(--hsac-radius);
}

#hsac-bar .hsac-minus,
#hsac-bar .hsac-plus {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 34.8px;
	width: 34.8px;
	height: auto;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #000;
	font: 400 18px/18px "Open Sans", sans-serif;
	text-transform: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

#hsac-bar .hsac-minus:disabled,
#hsac-bar .hsac-plus:disabled {
	opacity: 0.35;
	cursor: default;
}

#hsac-bar .hsac-input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #000;
	font: 500 16px/16px Poppins, sans-serif;
	text-align: center;
	-webkit-appearance: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

#hsac-bar .hsac-input::-webkit-inner-spin-button,
#hsac-bar .hsac-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

#hsac-bar .hsac-cta {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	height: var(--hsac-height);
	margin: 0;
	padding: 0 10px;
	background: var(--hsac-accent);
	border: 0;
	border-radius: var(--hsac-radius);
	box-shadow: none;
	color: var(--hsac-accent-text);
	font: 500 16px/19.2px "Work Sans", sans-serif;
	letter-spacing: normal;
	text-align: center;
	text-transform: capitalize;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

#hsac-bar .hsac-cta:hover,
#hsac-bar .hsac-cta:focus,
#hsac-bar .hsac-cta:active {
	background: var(--hsac-accent);
	color: var(--hsac-accent-text);
}

#hsac-bar .hsac-cta:disabled {
	opacity: 0.7;
	cursor: wait;
}

#hsac-bar .hsac-cta:focus-visible,
#hsac-bar .hsac-minus:focus-visible,
#hsac-bar .hsac-plus:focus-visible {
	outline: 2px solid var(--hsac-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	#hsac-bar,
	body.hsac-visible #hsac-bar {
		transition: none;
	}
}

/* Wąskie ekrany (320 px): tekst CTA zawsze w jednej linii. */
@media (max-width: 767px) {
	#hsac-bar .hsac-cta {
		white-space: nowrap;
		padding: 0 4px;
	}
}

/* Otwarte menu mobilne Salient: pasek nie może leżeć nad menu. */
body.material-ocm-open #hsac-bar {
	visibility: hidden;
	transform: translateY(100%);
}
