/*
 * Warenkorb (Avada-Layout »Shop Warenkorb«): Tabelle, Summe, Meldungen.
 *
 * Tabelle, Summe und Leer-Zustand sind Avada-Elemente (Woo Cart Table, Woo Cart Totals, Section mit Render-Logik).
 * Hier steht nur, was Avada nicht einstellen kann: Zeilenraster der Tabelle (Bild | Name | Preis | Anzahl | Zwischen-
 * summe | ✕), Mengenfeld, Fusszeile, Handy-Ansicht, Meldungen und Kassen-Button.
 * Werte aus dem Design »Warenkorb«.
 */

.as-cart-table-card,
.as-cart-sum {
	--as-cart-ink: #0f1450;
	--as-cart-blue: var(--as-theme-dark, #4b6ec8);
	--as-cart-muted: #4a4e57;
	--as-cart-line: var(--as-theme-lighter, #c3eeee);
	--as-cart-line-soft: var(--as-theme-soft, #dff5f5);
}

/* ---------- Meldungen (»… wurde entfernt. Rückgängig?«) ---------- */

.as-cart-notices:not(:empty) {
	margin-bottom: 28px;
}

/* WooCommerce gibt die Meldungen als Banner-Markup (`wc-block-components-notice-banner`) oder klassisch aus. */
#main .as-cart-notices .wc-block-components-notice-banner,
#main .as-cart-notices .woocommerce-message,
#main .as-cart-notices .woocommerce-info,
#main .as-cart-notices .woocommerce-error {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	box-sizing: border-box;
	padding: 14px 18px;
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.4;
	color: #0f1450;
	list-style: none;
	background: var(--as-theme-soft, #dff5f5);
	border: 0;
	border-radius: 10px;
}

#main .as-cart-notices .wc-block-components-notice-banner > svg,
#main .as-cart-notices .woocommerce-message::before,
#main .as-cart-notices .woocommerce-info::before,
#main .as-cart-notices .woocommerce-error::before {
	display: none;
}

#main .as-cart-notices .wc-block-components-notice-banner__content {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 0;
}

#main .as-cart-notices .wc-block-components-notice-banner a,
#main .as-cart-notices .woocommerce-message a,
#main .as-cart-notices .woocommerce-info a {
	order: 2;
	margin: 0;
	font-weight: 600;
	color: #0f1450;
	text-decoration: underline !important;
	background: transparent;
	border: 0;
}

/* ---------- Tabelle ---------- */

#main .as-cart-table-card {
	overflow: hidden;
}

#main .as-cart-table-card .woocommerce-cart-form {
	margin: 0;
}

#main .as-cart-table-card table.fusion-woo-cart_table,
#main .as-cart-table-card table.fusion-woo-cart_table thead,
#main .as-cart-table-card table.fusion-woo-cart_table tbody {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
}

/* Gemeinsames Raster für Kopfzeile und Zeilen. */
#main .as-cart-table-card table.fusion-woo-cart_table tr.woocommerce-cart-form__cart-item,
#main .as-cart-table-card table.fusion-woo-cart_table thead tr {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr) 100px 140px 110px 44px;
	grid-template-areas: "img name price qty sub rm";
	column-gap: 16px;
	align-items: center;
	padding: 18px 20px;
	border: 0;
}

#main .as-cart-table-card table.fusion-woo-cart_table tbody tr.woocommerce-cart-form__cart-item + tr.woocommerce-cart-form__cart-item,
#main .as-cart-table-card table.fusion-woo-cart_table tbody tr.woocommerce-cart-form__cart-item:first-child {
	border-top: 1px solid var(--as-cart-line-soft);
}

#main .as-cart-table-card table.fusion-woo-cart_table thead tr {
	padding: 14px 20px;
	font-size: 13px;
	font-weight: 600;
}

#main .as-cart-table-card table.fusion-woo-cart_table th,
#main .as-cart-table-card table.fusion-woo-cart_table td {
	display: block;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: left;
}

#main .as-cart-table-card table.fusion-woo-cart_table thead th.product-name {
	grid-column: 1 / 3;
}

#main .as-cart-table-card table.fusion-woo-cart_table thead th.product-price { grid-column: 3; }
#main .as-cart-table-card table.fusion-woo-cart_table thead th.product-quantity { grid-column: 4; }
#main .as-cart-table-card table.fusion-woo-cart_table thead th.product-subtotal { grid-column: 5; text-align: right; }
#main .as-cart-table-card table.fusion-woo-cart_table thead th.product-remove { grid-column: 6; }

/* Produktzelle: Bild und Name sind eigene Rasterfelder. */
#main .as-cart-table-card table.fusion-woo-cart_table td.product-name,
#main .as-cart-table-card table.fusion-woo-cart_table .fusion-product-name-wrapper {
	display: contents;
}

#main .as-cart-table-card .product-thumbnail {
	grid-area: img;
	display: block;
	width: 100%;
	margin: 0;
}

#main .as-cart-table-card .product-thumbnail a {
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--as-theme-light, #7cceda);
	border-radius: 8px;
}

#main .as-cart-table-card .product-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

#main .as-cart-table-card .product-info {
	grid-area: name;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 0;
}

/* Das Theme unterstreicht Links mit ID-Selektoren; darum !important. */
#main .as-cart-table-card .product-info a,
#main .as-cart-table-card .product-info a:hover {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--as-cart-ink);
	text-decoration: none !important;
}

#main .as-cart-table-card .as-cart-category {
	font-size: 13px;
	font-weight: 400;
	color: var(--as-cart-muted);
}

#main .as-cart-table-card td.product-price {
	grid-area: price;
	font-size: 15px;
}

#main .as-cart-table-card td.product-quantity {
	grid-area: qty;
}

#main .as-cart-table-card td.product-subtotal {
	grid-area: sub;
	font-size: 16px;
	font-weight: 600;
	text-align: right;
}

#main .as-cart-table-card table.fusion-woo-cart_table td.product-remove {
	grid-area: rm;
	position: static;
	width: auto;
	height: auto;
}

/* Mengenfeld: Rahmen mit − [Zahl] +. */
#main .as-cart-table-card .quantity {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: 136px;
	height: 44px;
	margin: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--as-theme, #b9d4ee);
	border-radius: 10px;
}

#main .as-cart-table-card .quantity .minus,
#main .as-cart-table-card .quantity .plus {
	flex: 0 0 44px;
	width: 44px;
	height: 100%;
	padding: 0;
	margin: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--as-cart-ink);
	cursor: pointer;
	background: #fff;
	border: 0;
	border-radius: 0;
}

#main .as-cart-table-card .quantity input.qty {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 100%;
	padding: 0;
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--as-cart-ink);
	text-align: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

#main .as-cart-table-card .quantity input.qty::-webkit-inner-spin-button,
#main .as-cart-table-card .quantity input.qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* Entfernen: runder Knopf mit ✕. */
#main .as-cart-table-card table.fusion-woo-cart_table a.remove {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	font-size: 0;
	line-height: 0;
	color: var(--as-cart-ink);
	background: transparent;
	border-radius: 999px;
}

#main .as-cart-table-card a.remove::before {
	display: block;
	width: 18px;
	height: 18px;
	content: "";
	background: var(--as-cart-ink);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%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'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

#main .as-cart-table-card a.remove:hover {
	background: #eef3fc;
}

/* Fusszeile: »Weiter einkaufen« links, »Warenkorb aktualisieren« rechts. */
#main .as-cart-table-card tr.avada-cart-actions,
#main .as-cart-table-card tr.avada-cart-actions td.actions {
	display: block;
	padding: 0;
	border: 0;
	visibility: visible;
}

#main .as-cart-table-card tr.avada-cart-actions {
	border-top: 1px solid var(--as-cart-line);
}

#main .as-cart-table-card tr.avada-cart-actions td.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
}

#main .as-cart-table-card .as-cart-continue {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 44px;
	font-size: 15px;
	font-weight: 500;
	color: var(--as-cart-blue);
	text-decoration: none !important;
}

#main .as-cart-table-card .as-cart-continue:hover {
	color: var(--as-cart-ink);
}

#main .as-cart-table-card button[name="update_cart"] {
	min-height: 44px;
	padding: 0 18px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--as-cart-blue);
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--as-cart-blue);
	border-radius: 10px;
	visibility: visible;
	position: static;
}

#main .as-cart-table-card button[name="update_cart"]:hover:not(:disabled) {
	color: var(--as-cart-ink);
	border-color: var(--as-cart-ink);
}

#main .as-cart-table-card button[name="update_cart"]:disabled {
	cursor: default;
	opacity: 0.55;
}

/* ---------- Summe ---------- */

#main .as-cart-totals .cart_totals h2 {
	display: none;
}

#main .as-cart-totals .cart_totals table.shop_table,
#main .as-cart-totals .cart_totals table.shop_table tbody {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
}

#main .as-cart-totals .cart_totals table.shop_table tbody {
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-size: 15px;
}

#main .as-cart-totals .cart_totals table.shop_table tr {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	justify-content: space-between;
	padding: 0;
	border: 0;
}

#main .as-cart-totals .cart_totals table.shop_table th,
#main .as-cart-totals .cart_totals table.shop_table td {
	display: block;
	flex: 0 0 auto;
	width: auto;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
}

/* Avada legt Titel und Inhalt des Versands übereinander; im Design stehen sie untereinander im Fluss. */
#main .as-cart-totals .cart_totals .awb-shipping-heading,
#main .as-cart-totals .cart_totals .awb-shipping-td {
	position: static;
}

#main .as-cart-totals .cart_totals td::before {
	display: none;
}

#main .as-cart-totals .cart_totals tr.cart-subtotal td {
	font-weight: 600;
	text-align: right;
}

#main .as-cart-totals .cart_totals table.shop_table tr.shipping,
#main .as-cart-totals .cart_totals table.shop_table tr.order-total {
	padding-top: 12px;
	border-top: 1px solid var(--as-cart-line);
}

#main .as-cart-totals .cart_totals tr.shipping td {
	flex: 1 1 100%;
	width: 100%;
}

#main .as-cart-totals .cart_totals .awb-shipping-heading {
	margin-bottom: 8px;
	font-weight: 600;
}

#main .as-cart-totals .cart_totals ul.woocommerce-shipping-methods {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0;
	margin: 0 0 8px;
	list-style: none;
}

#main .as-cart-totals .cart_totals ul.woocommerce-shipping-methods li {
	display: flex;
	gap: 10px;
	align-items: center;
	min-height: 32px;
	margin: 0;
}

#main .as-cart-totals .cart_totals ul.woocommerce-shipping-methods input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--as-cart-blue);
}

#main .as-cart-totals .cart_totals ul.woocommerce-shipping-methods label {
	display: flex;
	flex: 1 1 auto;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	cursor: pointer;
}

#main .as-cart-totals .cart_totals .woocommerce-shipping-destination,
#main .as-cart-totals .cart_totals .awb-calc-shipping {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--as-cart-muted);
}

#main .as-cart-totals .cart_totals .shipping-calculator-button {
	font-size: 13px;
	color: var(--as-cart-blue);
}

#main .as-cart-totals .cart_totals tr.order-total {
	align-items: baseline;
}

#main .as-cart-totals .cart_totals tr.order-total th {
	font-size: 17px;
	font-weight: 600;
}

#main .as-cart-totals .cart_totals tr.order-total td,
#main .as-cart-totals .cart_totals tr.order-total td strong {
	font-size: 22px;
	font-weight: 600;
}

/* MwSt.-Hinweis und Kassen-Button. */
#main .as-cart-totals .wc-proceed-to-checkout {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 0;
	margin: 14px 0 0;
}

#main .as-cart-totals .as-cart-hint {
	margin: -2px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--as-cart-muted);
}

/* Der Aktualisieren-Button steht in der Fusszeile der Tabelle. */
#main .as-cart-totals .wc-proceed-to-checkout .fusion-update-cart {
	display: none;
}

#main .as-cart-totals .wc-proceed-to-checkout a.checkout-button,
#main .as-cart-totals .wc-proceed-to-checkout a.checkout-button:visited {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	padding: 0 20px;
	margin: 0;
	font-family: inherit;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--as-theme-text, #fff) !important;
	text-decoration: none !important;
	text-transform: none;
	letter-spacing: normal;
	background: var(--as-theme, linear-gradient(120deg, #4b6ec8 0%, #4a8cc6 100%));
	border: 0;
	border-radius: 10px;
}

#main .as-cart-totals .wc-proceed-to-checkout a.checkout-button::after {
	display: block;
	width: 18px;
	height: 18px;
	content: "";
	background: currentcolor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h15M14 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%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'%3E%3Cpath d='M4 12h15M14 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

#main .as-cart-totals .wc-proceed-to-checkout a.checkout-button:hover {
	color: var(--as-theme-text, #fff) !important;
	filter: brightness(0.93);
}

/* ---------- Handy (Avada »small«, bis 768 px): Bild links, Name/Menge/Zwischensumme rechts ---------- */

@media (max-width: 768px) {
	#main .as-cart-table-card table.fusion-woo-cart_table thead {
		display: none;
	}

	#main .as-cart-table-card table.fusion-woo-cart_table tr.woocommerce-cart-form__cart-item {
		grid-template-columns: 72px minmax(0, 1fr) 44px;
		grid-template-areas:
			"img name rm"
			"img qty qty"
			"img sub sub";
		row-gap: 10px;
	}

	#main .as-cart-table-card table.fusion-woo-cart_table td.product-price {
		display: none;
	}

	#main .as-cart-table-card table.fusion-woo-cart_table td.product-subtotal {
		text-align: left;
	}

	/* WooCommerce setzt auf kleinen Bildschirmen die Spaltentitel vor die Zellen. */
	#main .as-cart-table-card table.fusion-woo-cart_table td::before {
		display: none;
		content: none;
	}
}

@media (max-width: 480px) {
	/* Auf 320 px mehr Platz für den Namen. */
	#main .as-cart-table-card table.fusion-woo-cart_table tr.woocommerce-cart-form__cart-item {
		grid-template-columns: 64px minmax(0, 1fr) 40px;
		column-gap: 12px;
		padding: 16px 14px;
	}

	#main .as-cart-table-card table.fusion-woo-cart_table td.product-remove,
	#main .as-cart-table-card table.fusion-woo-cart_table a.remove {
		width: 40px;
		height: 40px;
	}

	#main .as-cart-table-card tr.avada-cart-actions td.actions {
		flex-direction: column;
		align-items: stretch;
	}

	#main .as-cart-table-card button[name="update_cart"] {
		width: 100%;
	}
}
