:root {
	--sf-sticky-accent: #96c873;
	--sf-sticky-accent-dark: #5f963d;

	/* Warenkorb-Button */
	--sf-sticky-button: #ffcc00;
	--sf-sticky-button-hover: #e6b800;
	--sf-sticky-button-active: #d9ad00;

	/* Texte und Flächen */
	--sf-sticky-text: #2d2d2d;
	--sf-sticky-muted: #707070;
	--sf-sticky-price: #849800;
	--sf-sticky-border: rgba(0, 0, 0, 0.08);
}


/*
 * Sticky-Grundelement
 */

.sf-sticky-cart {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1040;

	background: rgba(255, 255, 255, 0.97);
	border-top: 1px solid var(--sf-sticky-border);
	box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.10);

	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(calc(100% + 20px));

	transition:
		transform 220ms ease,
		opacity 180ms ease,
		visibility 220ms ease;
}

.sf-sticky-cart.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}


/*
 * Platz am unteren Seitenrand freihalten
 */

body.sf-sticky-cart-visible {
	padding-bottom: calc(76px + env(safe-area-inset-bottom));
}


/*
 * Desktop-Container
 */

.sf-sticky-cart__container {
	width: min(calc(100% - 32px), 1180px);
	margin-right: auto;
	margin-left: auto;

	padding-top: 10px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.sf-sticky-cart__inner {
	display: grid;
	grid-template-columns:
		48px
		minmax(180px, 1fr)
		auto
		minmax(220px, 270px);

	align-items: center;
	gap: 16px;
}


/*
 * Produktbild
 */

.sf-sticky-cart__thumbnail {
	width: 48px;
	height: 48px;
	overflow: hidden;

	background: #f5f5f5;
	border: 1px solid #e3e3e3;
	border-radius: 6px;
}

.sf-sticky-cart__image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;

	object-fit: cover;
}


/*
 * Produktinformationen
 */

.sf-sticky-cart__product {
	min-width: 0;
}

.sf-sticky-cart__title {
	overflow: hidden;

	color: var(--sf-sticky-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;

	text-overflow: ellipsis;
	white-space: nowrap;
}

.sf-sticky-cart__option {
	display: none;
	overflow: hidden;
	margin-top: 4px;

	color: var(--sf-sticky-muted);
	font-size: 13px;
	line-height: 1.25;

	text-overflow: ellipsis;
	white-space: nowrap;
}

.sf-sticky-cart__option.has-content {
	display: block;
}


/*
 * Preis
 */

.sf-sticky-cart__price,
.sf-sticky-cart__price .price {
	margin: 0;

	color: var(--sf-sticky-price);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.sf-sticky-cart__price del {
	font-size: 0.8em;
	opacity: 0.65;
}

.sf-sticky-cart__price ins {
	text-decoration: none;
}


/*
 * Steuer- und Versandhinweis
 */

.sf-sticky-cart__price small,
.sf-sticky-cart__price .woocommerce-price-suffix {
	margin-left: 6px;

	color: var(--sf-sticky-price);
	font-size: 10px;
	font-weight: 400;
	line-height: 1.2;
	white-space: normal;
}


/*
 * Warenkorb-Button
 */

.sf-sticky-cart__button,
.woocommerce .sf-sticky-cart__button.button,
.woocommerce .sf-sticky-cart__button.button.alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 18px;

	background-color: var(--sf-sticky-button);
	background-image: none;
	border: 1px solid var(--sf-sticky-button);
	border-radius: 5px;
	box-shadow: none;

	color: #1f1f1f;

	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;

	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;

	transition:
		background-color 180ms ease,
		border-color 180ms ease,
		color 180ms ease,
		transform 100ms ease;
}


/*
 * Hover und Tastaturfokus
 */

.sf-sticky-cart__button:hover,
.sf-sticky-cart__button:focus,
.sf-sticky-cart__button:focus-visible,
.woocommerce .sf-sticky-cart__button.button:hover,
.woocommerce .sf-sticky-cart__button.button:focus,
.woocommerce .sf-sticky-cart__button.button:focus-visible,
.woocommerce .sf-sticky-cart__button.button.alt:hover,
.woocommerce .sf-sticky-cart__button.button.alt:focus,
.woocommerce .sf-sticky-cart__button.button.alt:focus-visible {
	background-color: var(--sf-sticky-button-hover);
	background-image: none;
	border-color: var(--sf-sticky-button-hover);
	box-shadow: none;

	color: #1f1f1f;
	text-decoration: none;
}

.sf-sticky-cart__button:focus-visible,
.woocommerce .sf-sticky-cart__button.button:focus-visible,
.woocommerce .sf-sticky-cart__button.button.alt:focus-visible {
	outline: 2px solid #2d2d2d;
	outline-offset: 2px;
}


/*
 * Aktiver Klickzustand
 */

.sf-sticky-cart__button:active,
.woocommerce .sf-sticky-cart__button.button:active,
.woocommerce .sf-sticky-cart__button.button.alt:active {
	background-color: var(--sf-sticky-button-active);
	background-image: none;
	border-color: var(--sf-sticky-button-active);

	color: #1f1f1f;
	transform: translateY(1px);
}


/*
 * Noch keine Versandgröße gewählt
 *
 * Der Button bleibt gelb und führt beim Anklicken
 * zurück zur Variantenauswahl.
 */

.sf-sticky-cart__button.is-choice-needed,
.woocommerce .sf-sticky-cart__button.button.is-choice-needed,
.woocommerce .sf-sticky-cart__button.button.alt.is-choice-needed {
	background-color: var(--sf-sticky-button);
	background-image: none;
	border-color: var(--sf-sticky-button);

	color: #1f1f1f;
}

.sf-sticky-cart__button.is-choice-needed:hover,
.sf-sticky-cart__button.is-choice-needed:focus,
.woocommerce .sf-sticky-cart__button.button.is-choice-needed:hover,
.woocommerce .sf-sticky-cart__button.button.is-choice-needed:focus,
.woocommerce .sf-sticky-cart__button.button.alt.is-choice-needed:hover,
.woocommerce .sf-sticky-cart__button.button.alt.is-choice-needed:focus {
	background-color: var(--sf-sticky-button-hover);
	border-color: var(--sf-sticky-button-hover);

	color: #1f1f1f;
}


/*
 * Produkt oder Variante nicht verfügbar
 */

.sf-sticky-cart__button.is-unavailable,
.sf-sticky-cart__button:disabled,
.woocommerce .sf-sticky-cart__button.button.is-unavailable,
.woocommerce .sf-sticky-cart__button.button:disabled,
.woocommerce .sf-sticky-cart__button.button.alt.is-unavailable,
.woocommerce .sf-sticky-cart__button.button.alt:disabled {
	background-color: #e7e7e7;
	background-image: none;
	border-color: #e7e7e7;
	box-shadow: none;

	color: #8a8a8a;

	cursor: not-allowed;
	opacity: 1;
	transform: none;
}

.sf-sticky-cart__button.is-unavailable:hover,
.sf-sticky-cart__button.is-unavailable:focus,
.sf-sticky-cart__button:disabled:hover,
.sf-sticky-cart__button:disabled:focus,
.woocommerce .sf-sticky-cart__button.button.is-unavailable:hover,
.woocommerce .sf-sticky-cart__button.button.is-unavailable:focus,
.woocommerce .sf-sticky-cart__button.button:disabled:hover,
.woocommerce .sf-sticky-cart__button.button:disabled:focus,
.woocommerce .sf-sticky-cart__button.button.alt.is-unavailable:hover,
.woocommerce .sf-sticky-cart__button.button.alt.is-unavailable:focus,
.woocommerce .sf-sticky-cart__button.button.alt:disabled:hover,
.woocommerce .sf-sticky-cart__button.button.alt:disabled:focus {
	background-color: #e7e7e7;
	border-color: #e7e7e7;

	color: #8a8a8a;
}


/*
 * Tablet und Smartphone
 */

@media (max-width: 767.98px) {

	body.sf-sticky-cart-visible {
		padding-bottom: calc(78px + env(safe-area-inset-bottom));
	}

	.sf-sticky-cart__container {
		width: 100%;
		padding:
			8px
			10px
			calc(8px + env(safe-area-inset-bottom));
	}

	.sf-sticky-cart__inner {
		display: grid;
		grid-template-columns:
			minmax(0, 1fr)
			minmax(165px, 48%);

		grid-template-rows:
			auto
			auto;

		column-gap: 12px;
		row-gap: 2px;
	}

	/*
	 * Bild und Produktname mobil ausblenden
	 */

	.sf-sticky-cart__thumbnail,
	.sf-sticky-cart__title {
		display: none;
	}

	/*
	 * Preis links oben
	 */

	.sf-sticky-cart__price {
		grid-column: 1;
		grid-row: 1;

		align-self: end;
		min-width: 0;

		font-size: 17px;
		line-height: 1.15;
		white-space: normal;
	}

	.sf-sticky-cart__price .price {
		font-size: 17px;
		line-height: 1.15;
		white-space: normal;
	}

	/*
	 * Steuer- und Versandhinweis unter dem Preis
	 */
	.sf-sticky-cart__price small,
	.sf-sticky-cart__price .woocommerce-price-suffix {
		display: block;
		margin-top: 4px;
		margin-left: 0;

		font-size: 9px;
		font-weight: 400;
		line-height: 1.2;
		white-space: nowrap;
	}


	/*
	 * Gewählte Versandgröße links unten
	 */

	.sf-sticky-cart__product {
		grid-column: 1;
		grid-row: 2;

		min-width: 0;
	}

	.sf-sticky-cart__option {
		position: static;
		display: none;

		max-width: none;
		margin-top: 1px;

		font-size: 11px;
		line-height: 1.2;

		text-overflow: ellipsis;
		white-space: normal;
	}

	.sf-sticky-cart__option.has-content {
		display: block;
	}

	/*
	 * Button rechts über beide Zeilen
	 */

	.sf-sticky-cart__button,
	.woocommerce .sf-sticky-cart__button.button,
	.woocommerce .sf-sticky-cart__button.button.alt {
		grid-column: 2;
		grid-row: 1 / span 2;

		align-self: center;

		min-width: 0;
		min-height: 50px;
		padding: 10px 8px;

		font-size: 15px;
		white-space: normal;
	}
}


/*
 * Sehr kleine Smartphones
 */

@media (max-width: 374px) {

	.sf-sticky-cart__inner {
		grid-template-columns:
			minmax(0, 1fr)
			minmax(150px, 50%);

		column-gap: 8px;
	}

	.sf-sticky-cart__price,
	.sf-sticky-cart__price .price {
		font-size: 15px;
	}

	.sf-sticky-cart__price small,
	.sf-sticky-cart__price .woocommerce-price-suffix {
		font-size: 8px;
	}

	.sf-sticky-cart__option {
		font-size: 10px;
	}

	.sf-sticky-cart__button,
	.woocommerce .sf-sticky-cart__button.button,
	.woocommerce .sf-sticky-cart__button.button.alt {
		min-height: 48px;
		padding-right: 6px;
		padding-left: 6px;

		font-size: 14px;
	}
}


/*
 * Sehr schmale Displays
 */

@media (max-width: 339px) {

	.sf-sticky-cart__inner {
		grid-template-columns:
			minmax(0, 1fr)
			minmax(135px, 52%);
	}

	.sf-sticky-cart__price,
	.sf-sticky-cart__price .price {
		font-size: 14px;
	}

	.sf-sticky-cart__button,
	.woocommerce .sf-sticky-cart__button.button,
	.woocommerce .sf-sticky-cart__button.button.alt {
		font-size: 13px;
	}
}


/*
 * Bewegungsreduktion
 */

@media (prefers-reduced-motion: reduce) {

	.sf-sticky-cart,
	.sf-sticky-cart__button {
		transition: none;
	}
}