/* ==========================================================================
   Stratoflights – Warenkorb
   Eigene Komponenten: .sf-*
   Überschreibungen von WooCommerce-/Theme-Standards laufen über #sf-cart.
   Alle Größen in px (Basis 16px), damit die Root-Schriftgröße des Themes
   keinen Einfluss hat.
   ========================================================================== */

#sf-cart {
	--sf-ink: #1f2f3a;
	--sf-ink-soft: #2d3e4a;
	--sf-navy: #1f3341;
	--sf-muted: #5c6b75;
	--sf-line: #dfe3e7;
	--sf-block: #f5f5f5;
	--sf-surface: #f5f5f5;
	--sf-white: #ffffff;
	--sf-radius-lg: 14px;
	--sf-radius: 8px;

	font-size: 16px;
	line-height: 1.5;
	color: var(--sf-ink);
	max-width: 1200px;
	margin: 0 auto;
}

#sf-cart *,
#sf-cart *::before,
#sf-cart *::after {
	box-sizing: border-box;
}

#sf-cart a:focus-visible,
#sf-cart button:focus-visible,
#sf-cart input:focus-visible,
#sf-cart summary:focus-visible {
	outline: 2px solid var(--sf-ink);
	outline-offset: 3px;
}

/* --- Kopf ---------------------------------------------------------------- */

#sf-cart .sf-cart__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 32px;
	flex-wrap: wrap;
	margin-bottom: 32px;
}

#sf-cart .sf-cart__title {
	margin: 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--sf-ink);
}

#sf-cart .sf-cart__count {
	margin: 4px 0 0;
	font-size: 16px;
	color: var(--sf-muted);
}

#sf-cart .sf-cart__continue {
	font-size: 16px;
	font-weight: 600;
	color: var(--sf-ink-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
	padding-bottom: 4px;
}

/* --- Layout -------------------------------------------------------------- */

#sf-cart .sf-cart__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
	gap: 32px;
	align-items: start;
}

/* --- Artikel ------------------------------------------------------------- */

#sf-cart .sf-cart-items {
	background: var(--sf-block);
	border-radius: var(--sf-radius-lg);
	padding: 4px 20px;
}

#sf-cart .sf-cart-item {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) max-content max-content;
	grid-template-areas: "thumb info qty total";
	gap: 12px 24px;
	align-items: start;
	padding: 16px 0;
}

#sf-cart .sf-cart-item + .sf-cart-item {
	border-top: 1px solid var(--sf-line);
}

#sf-cart .sf-cart-item__thumb {
	grid-area: thumb;
	align-self: start;
	width: 72px;
	height: 72px;
	background: var(--sf-white);
	border: 1px solid var(--sf-line);
	border-radius: var(--sf-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

#sf-cart .sf-cart-item__thumb a {
	display: block !important;
	width: 100%;
	height: 100%;
}

#sf-cart .sf-cart-item__thumb img {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: static !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: contain;
	margin: 0;
	padding: 4px;
	box-shadow: none;
}

#sf-cart .sf-cart-item__info {
	grid-area: info;
	min-width: 0;
}

#sf-cart .sf-cart-item__name {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

#sf-cart .sf-cart-item__name a {
	color: var(--sf-ink);
	text-decoration: none;
}

#sf-cart .sf-cart-item__name a:hover {
	text-decoration: underline;
}

#sf-cart .sf-cart-item__unit {
	margin: 2px 0 0;
	font-size: 15px;
	color: var(--sf-muted);
}

/* Varianten: jede Eigenschaft als eigene Zeile ("Bezeichnung: Wert") */
#sf-cart .sf-cart-item__info dl.variation {
	display: block;
	margin: 8px 0 0;
	padding: 0;
	border: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sf-muted);
}

#sf-cart .sf-cart-item__info dl.variation dt,
#sf-cart .sf-cart-item__info dl.variation dd,
#sf-cart .sf-cart-item__info dl.variation p {
	display: inline;
	float: none;
	clear: none;
	margin: 0;
	padding: 0;
}

#sf-cart .sf-cart-item__info dl.variation dt {
	font-weight: 600;
	color: var(--sf-ink-soft);
}

/* Zeilenumbruch nach jedem Wert */
#sf-cart .sf-cart-item__info dl.variation dd::after {
	content: "";
	display: block;
}

#sf-cart .product-remove {
	margin-top: 8px;
}

#sf-cart a.sf-remove {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sf-muted);
	font-size: 14px;
	text-decoration: none;
}

#sf-cart a.sf-remove svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

#sf-cart a.sf-remove span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

#sf-cart a.sf-remove:hover {
	color: var(--sf-ink);
}

/* Mengenauswahl */
#sf-cart .sf-cart-item__qty {
	grid-area: qty;
	width: auto !important;
	max-width: none !important;
	float: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

#sf-cart .sf-cart-item__total .woocommerce-Price-amount,
#sf-cart .sf-cart-item__total bdi {
	display: inline !important;
	width: auto !important;
	white-space: nowrap;
}

#sf-cart .sf-qty {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	height: 44px;
	background: var(--sf-white);
	border: 1px solid var(--sf-line);
	border-radius: var(--sf-radius);
	overflow: hidden;
}

#sf-cart .sf-qty--single {
	padding: 0 16px;
	font-weight: 700;
}

#sf-cart .sf-qty .quantity {
	display: block;
	flex: 0 0 auto;
	width: auto !important;
	margin: 0 !important;
	padding: 0;
	float: none;
	position: static;
}

#sf-cart .sf-qty .quantity label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

#sf-cart .sf-qty input.qty {
	display: block;
	width: 44px !important;
	min-width: 0 !important;
	max-width: 44px !important;
	height: 42px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	text-align: center;
	font-size: 16px !important;
	font-weight: 700;
	line-height: 42px;
	color: var(--sf-ink);
	-moz-appearance: textfield;
	appearance: textfield;
}

#sf-cart .sf-qty input.qty::-webkit-outer-spin-button,
#sf-cart .sf-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

#sf-cart .sf-qty__btn {
	flex: 0 0 40px;
	position: static;
	width: 40px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--sf-ink);
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}

#sf-cart .sf-qty__btn:hover:not(:disabled) {
	background: var(--sf-surface);
}

#sf-cart .sf-qty__btn:disabled {
	color: #b6bec4;
	cursor: default;
}

/* Theme-eigene +/- Buttons ausblenden, falls vorhanden */
#sf-cart .sf-qty .quantity .plus,
#sf-cart .sf-qty .quantity .minus {
	display: none !important;
}

#sf-cart .sf-cart-item__total {
	grid-area: total;
	display: block !important;
	width: auto !important;
	min-width: 88px !important;
	max-width: none !important;
	float: none !important;
	overflow: visible;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 44px; /* auf Höhe der Mengenauswahl */
	text-align: right;
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}

/* --- Gutschein ----------------------------------------------------------- */

#sf-cart .sf-cart__actions {
	margin-top: 24px;
	padding: 0;
	border: 0;
}

#sf-cart .sf-coupon__toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	list-style: none;
	font-size: 16px;
	font-weight: 600;
	color: var(--sf-ink-soft);
}

#sf-cart .sf-coupon__toggle svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

#sf-cart .sf-coupon__toggle::-webkit-details-marker {
	display: none;
}

#sf-cart .sf-coupon__toggle span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

#sf-cart .sf-coupon__form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: 420px;
	width: auto;
	margin-top: 12px;
	float: none;
}

#sf-cart .sf-coupon__form #coupon_code {
	flex: 1 1 180px;
	width: auto;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--sf-line);
	border-radius: var(--sf-radius);
	background: var(--sf-white);
	font-size: 16px;
	color: var(--sf-ink);
}

/* "Warenkorb aktualisieren" wird per JS automatisch ausgelöst */
#sf-cart.sf-js .sf-cart__update {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --- Buttons ------------------------------------------------------------- */

#sf-cart .sf-btn-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 8px 16px;
	border: 2px solid var(--sf-navy);
	border-radius: var(--sf-radius);
	background: transparent;
	color: var(--sf-navy);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	position: static;
	transition: background-color 0.15s, color 0.15s;
}

#sf-cart .sf-btn-outline:hover,
#sf-cart .sf-btn-outline:focus-visible {
	background: var(--sf-navy);
	border-color: var(--sf-navy);
	color: var(--sf-white);
	text-decoration: none;
}

#sf-cart .sf-btn-outline--block {
	display: flex;
	width: 100%;
	min-height: 52px;
	font-size: 16px;
}

/* "Warenkorb anzeigen"-Link, den WooCommerce nach AJAX-Hinzufügen einfügt */
#sf-cart .sf-cross a.added_to_cart {
	display: none;
}

/* --- Passt dazu ---------------------------------------------------------- */

#sf-cart .sf-cross {
	margin-top: 40px;
}

#sf-cart .sf-cross__title {
	margin: 0 0 16px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.25;
}

#sf-cart .sf-cross__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

#sf-cart .sf-cross__card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	padding: 16px;
	border: 0;
	border-radius: var(--sf-radius-lg);
	background: var(--sf-block);
}

#sf-cart .sf-cross__thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: var(--sf-radius);
	background: var(--sf-white);
	border: 1px solid var(--sf-line);
	overflow: hidden;
	display: block;
}

#sf-cart .sf-cross__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	margin: 0;
	padding: 4px;
}

#sf-cart .sf-cross__info {
	flex: 1 1 120px;
	min-width: 120px;
}

#sf-cart .sf-cross__name {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

#sf-cart .sf-cross__name a {
	color: var(--sf-ink);
	text-decoration: none;
}

#sf-cart .sf-cross__price {
	margin: 2px 0 0;
	font-size: 15px;
	color: var(--sf-muted);
}

#sf-cart .sf-cross__card .sf-btn-outline {
	flex: 0 0 auto;
	margin-left: auto;
}

#sf-cart .sf-cart__vat-note {
	margin: 20px 0 0;
	font-size: 14px;
	color: var(--sf-muted);
}

/* --- Seitenleiste / Übersicht ------------------------------------------- */

#sf-cart .sf-cart__sidebar {
	position: sticky;
	top: 24px;
	padding: 24px;
	background: var(--sf-block);
	border-radius: var(--sf-radius-lg);
}

#sf-cart .sf-cart__sidebar-title {
	margin: 0 0 12px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.25;
}

#sf-cart .cart-collaterals,
#sf-cart .cart-collaterals .cart_totals {
	float: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

#sf-cart .cart_totals > h2 {
	display: none;
}

#sf-cart .cart_totals table.shop_table {
	width: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	border-collapse: collapse;
	background: none;
}

#sf-cart .cart_totals table.shop_table tbody {
	display: block;
}

#sf-cart .cart_totals table.shop_table tr {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 4px 16px;
	padding: 6px 0;
	border: 0;
	background: none;
}

#sf-cart .cart_totals table.shop_table th,
#sf-cart .cart_totals table.shop_table td {
	display: block;
	width: auto;
	padding: 0 !important;
	border: 0 !important;
	background: none;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--sf-ink);
	text-align: left;
}

#sf-cart .cart_totals table.shop_table td {
	text-align: right !important;
	margin-left: auto;
}

#sf-cart .cart_totals table.shop_table td::before {
	content: none !important;
	display: none !important;
}

/* Versand */
#sf-cart .cart_totals tr.shipping td,
#sf-cart .cart_totals tr.woocommerce-shipping-totals td {
	flex: 1 1 100%;
}

#sf-cart .cart_totals ul#shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
}

#sf-cart .cart_totals ul#shipping_method li {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 4px;
	padding: 0;
	border: 0;
	text-indent: 0;
	font-size: 15px;
}

#sf-cart .cart_totals ul#shipping_method img {
	max-height: 20px;
	width: auto;
	margin: 0;
}

#sf-cart .cart_totals .woocommerce-shipping-destination,
#sf-cart .cart_totals .shipping-calculator-button {
	display: block;
	margin: 4px 0 0;
	padding: 0;
	border: 0;
	font-size: 14px;
	color: var(--sf-muted);
}

#sf-cart .cart_totals .shipping-calculator-button {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Versandrechner ("Adresse ändern") */
#sf-cart .cart_totals .shipping-calculator-form,
#sf-cart .cart_totals .shipping-calculator-form .form-row,
#sf-cart .cart_totals .shipping-calculator-form label {
	text-align: left !important;
}

#sf-cart .cart_totals .shipping-calculator-form {
	margin-top: 12px;
}

#sf-cart .cart_totals .shipping-calculator-form select,
#sf-cart .cart_totals .shipping-calculator-form input.input-text {
	width: 100%;
	text-align: left !important;
	text-align-last: left;
	padding-left: 12px;
	padding-right: 36px;
}

/* Falls die Länderauswahl als Select2/SelectWoo dargestellt wird */
#sf-cart .cart_totals .shipping-calculator-form .select2-container {
	width: 100% !important;
	text-align: left !important;
}

#sf-cart .cart_totals .shipping-calculator-form .select2-selection__rendered {
	text-align: left !important;
	padding-left: 12px;
	padding-right: 36px;
}

#sf-cart .cart_totals .shipping-calculator-form button[name="calc_shipping"] {
	margin-left: auto;
	display: block;
}

/* Gesamt */
#sf-cart .cart_totals tr.order-total {
	align-items: center;
	margin-top: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--sf-line);
}

#sf-cart .cart_totals tr.order-total th {
	font-size: 18px;
	font-weight: 800;
}

#sf-cart .cart_totals tr.order-total td,
#sf-cart .cart_totals tr.order-total td strong {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
}

#sf-cart .cart_totals tr.order-total .includes_tax,
#sf-cart .cart_totals tr.order-total small {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 400;
	color: var(--sf-muted);
}

#sf-cart .cart_totals tr.order-total .includes_tax .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
}

/* Steuerzeilen (z. B. Germanized) klein darunter */
#sf-cart .cart_totals tr.tax-rate,
#sf-cart .cart_totals tr.order-tax {
	padding-top: 0;
}

#sf-cart .cart_totals tr.tax-rate th,
#sf-cart .cart_totals tr.tax-rate td,
#sf-cart .cart_totals tr.order-tax th,
#sf-cart .cart_totals tr.order-tax td {
	font-size: 14px;
	color: var(--sf-muted);
}

/* Zur Kasse */
#sf-cart .wc-proceed-to-checkout {
	margin: 0;
	padding: 20px 0 0;
}

#sf-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 20px;
	border: 1px solid #eea236 !important;
	border-radius: 10px;
	background-color: #f0ad4e !important;
	color: #fff !important;
	text-shadow: 0 1px 0 #eea236;
	font-size: 17px !important;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.15s;
}

#sf-cart .wc-proceed-to-checkout a.checkout-button:hover,
#sf-cart .wc-proceed-to-checkout a.checkout-button:focus-visible {
	background-color: #ec971f !important;
	border-color: #d58512 !important;
	color: #fff !important;
}

#sf-cart .wc-proceed-to-checkout a.checkout-button::after {
	content: "";
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Kauf auf Rechnung */
#sf-cart .sf-invoice {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--sf-line);
}

/* Auf Rechnung kaufen: dunkelblau gefüllt, beim Hover als Outline */
#sf-cart .sf-invoice .sf-btn-outline {
	background-color: #1f3341;
	border-color: #1f3341;
	color: #fff;
}

#sf-cart .sf-invoice .sf-btn-outline:hover,
#sf-cart .sf-invoice .sf-btn-outline:focus-visible {
	background-color: transparent;
	border-color: #1f3341;
	color: #1f3341;
}

#sf-cart .sf-invoice__note {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.3;
	color: var(--sf-muted);
}

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

@media (max-width: 1100px) {
	#sf-cart .sf-cross__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 900px) {
	#sf-cart .sf-cart__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	#sf-cart .sf-cart__sidebar {
		position: static;
	}
}

@media (max-width: 600px) {
	#sf-cart .sf-cart__title {
		font-size: 32px;
	}

	#sf-cart .sf-cart__header {
		margin-bottom: 20px;
	}

	#sf-cart .sf-cart-items {
		padding: 4px 16px;
	}

	#sf-cart .sf-cart-item {
		grid-template-columns: 64px max-content minmax(0, 1fr);
		grid-template-areas:
			"thumb info info"
			"thumb qty total";
		align-items: start;
	}

	#sf-cart .sf-cart-item__thumb {
		width: 64px;
		height: 64px;
	}


	#sf-cart .sf-cross__card .sf-btn-outline {
		flex: 1 1 100%;
		margin-left: 0;
	}

	#sf-cart .sf-cart__sidebar {
		padding: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#sf-cart * {
		transition: none !important;
	}
}
