/* Warenkorbseite: Tabelle, Aktionen, Summen, Versandrechner. Lädt nur auf dem Warenkorb. */

/* Block-Warenkorb und mobile Tabellendarstellung. */
.wc-block-cart {
	max-width: var(--theme-content-width);
	margin-inline: auto;
}

body.site-layout .wc-block-cart__totals-block {
	border-color: var(--theme-color-line);
	border-radius: var(--theme-radius-s);
}

.woocommerce .cart-collaterals {
	min-width: 0;
}

/* 48rem statt 47.9375rem: WooCommerce smallscreen bricht bei exakt 768px auf
   seinemobile Tabellendarstellung um, das Theme-Mobile-Layout muss dann greifen. */
@media (max-width: 48rem) {
	.woocommerce-cart table.cart thead { display: none; }

	.woocommerce-cart table.cart tr {
		display: block;
		padding: .75rem 0;
		border-bottom: 1px solid var(--theme-color-line);
	}

	.woocommerce-cart table.cart td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: .65rem 1rem;
		border: none;
	}

	.woocommerce-cart table.cart td::before {
		margin-right: .5rem;
		color: #465664;
		font-family: var(--theme-font-heading);
		font-weight: 700;
		content: attr(data-title) ": ";
	}

	.woocommerce-cart table.cart td.product-thumbnail::before,
	.woocommerce-cart table.cart td.actions::before { display: none; }

	/* Entfernen-Link inline neben dem Mengenfeld, vertikal zentriert. */
	.woocommerce-cart table.cart td.product-quantity {
		gap: .75rem;
		justify-content: flex-end;
	}

	.woocommerce-cart table.cart td.product-quantity .quantity {
		display: inline-flex;
	}

	/* Zwischensumme nur bei belastbarem Wert zeigen: ausgeblendet bei Anzahl 1
	   und solange der angezeigte Wert nicht Preis mal Anzahl entspricht
	   (Markierung durch assets/js/cart-single-quantity.js). */
	.woocommerce-cart table.cart tr.theme-cart-hide-subtotal td.product-subtotal {
		display: none;
	}

	.woocommerce-cart table.cart td.product-thumbnail {
		/* Überstimmt die mobile WooCommerce-Regel, die Produktbilder ausblendet. */
		display: flex;
		justify-content: flex-end;
		width: 100%;
		padding-left: 1rem;
	}

	.woocommerce-cart table.cart td.actions {
		display: block;
		text-align: center;
	}

	.woocommerce-cart table.cart td.actions button[name="update_cart"] {
		width: 100%;
		justify-content: center;
	}
}

/* Leerer Warenkorb */
.woocommerce .cart-empty.woocommerce-info {
	margin: 0;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px solid var(--theme-color-line);
	border-left: .35rem solid var(--theme-color-blue);
	border-radius: var(--theme-radius-s);
	text-align: center;
}

.woocommerce .return-to-shop {
	margin: 0;
	text-align: center;
}

/* Warenkorb Tabelle & Aktionen */
.woocommerce-cart table.cart {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--theme-color-line);
	border-radius: var(--theme-radius-s);
	background: #ffffff;
	box-shadow: var(--theme-card-shadow);
	overflow: hidden;
	/* Der Abstand zwischen den Cart-Blöcken kommt aus dem übergeordneten Grid. */
	margin-bottom: 0;
}

.woocommerce-cart table.cart thead th {
	background: #f8fafc;
	color: var(--theme-color-ink);
	font-family: var(--theme-font-heading);
	font-size: 1.05rem;
	font-weight: 700;
	padding: 1rem 1.15rem;
	border-bottom: 1px solid var(--theme-color-line);
	border-top: none;
	border-left: none;
	border-right: none;
	text-align: left;
}

.woocommerce-cart table.cart tbody td {
	padding: 1.25rem 1.15rem;
	border-top: none;
	border-left: none;
	border-right: none;
	border-bottom: 1px solid #edf2f7;
	vertical-align: middle;
	background: #fff;
}

/* Die Standardspalte hat keinen eigenen Template-Hook; der vorhandene
   Inline-Link übernimmt das Entfernen in allen Bildschirmgrößen. */
.woocommerce-cart table.cart th.product-remove,
.woocommerce-cart table.cart td.product-remove {
	display: none;
}

.woocommerce-cart table.cart td.product-quantity {
	white-space: nowrap;
}

.woocommerce-cart table.cart td.product-quantity a.remove.remove--inline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	flex: 0 0 auto;
	width: 2.85rem;
	height: 2.85rem;
	border-radius: 50%;
	color: #dc2626 !important;
	background: transparent;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	transition: background var(--theme-transition), color var(--theme-transition);
}

.woocommerce-cart table.cart td.product-quantity a.remove.remove--inline:hover {
	background: #fee2e2;
	color: #991b1b !important;
}

@media (width > 48rem) {
	.woocommerce-cart table.cart td.product-quantity a.remove.remove--inline {
		margin-left: .35rem;
	}

	/* Kompakte Zahlenspalten lassen Bild und Produktbeschreibung mehr Raum. */
	.woocommerce-cart table.cart :is(th, td):is(.product-price, .product-quantity, .product-subtotal) {
		width: 1%;
		padding-inline: .75rem;
		white-space: nowrap;
	}

	.woocommerce-cart table.cart thead th:is(.product-price, .product-quantity, .product-subtotal) {
		font-size: 1rem;
	}

	.woocommerce-cart table.cart tbody td.product-thumbnail {
		/* Bildbreite plus beide Innenabstände trotz border-box reservieren. */
		width: calc(7rem + 2 * 1.15rem);
		min-width: calc(7rem + 2 * 1.15rem);
		padding-left: 1.15rem;
	}

	.woocommerce-cart table.cart td.product-thumbnail img {
		min-width: 7rem;
	}
}

.woocommerce-cart table.cart td.product-thumbnail img {
	width: 7rem;
	height: 7rem;
	border-radius: 6px;
	object-fit: cover;
	border: 1px solid var(--theme-color-line);
	display: block;
}

.woocommerce-cart table.cart td.product-name a {
	color: var(--theme-color-ink);
	font-family: var(--theme-font-heading);
	font-size: 1.15rem;
	font-weight: 700;
	text-decoration: none;
}

.woocommerce-cart table.cart td.product-name a:hover {
	color: var(--theme-color-ink);
}

.woocommerce-cart table.cart td.product-name .wc-gzd-cart-info,
.woocommerce-cart table.cart td.product-name .delivery-time-info {
	margin-top: .35rem;
	margin-bottom: 0;
	font-size: var(--theme-text-small);
}

/* Produktdetails, Lieferzeit und Montageauswahl im Warenkorb typografisch angleichen. */
.woocommerce-cart table.cart td.product-name .wc-gzd-cart-info,
.woocommerce-cart table.cart td.product-name .delivery-time-info,
.woocommerce-cart table.cart td.product-name .wc-gzd-item-desc,
.woocommerce-cart table.cart td.product-name .theme-cart-installation-service,
.woocommerce-cart table.cart td.product-name dl.variation {
	font-family: var(--theme-font-body);
	font-size: var(--theme-text-small);
	line-height: 1.45;
}

/* Germanized-Beschreibung ohne globalen Absatzabstand direkt unter der Lieferzeit halten. */
.woocommerce-cart table.cart td.product-name .delivery-time-info + .wc-gzd-item-desc {
	margin-top: 0;
}

.woocommerce-cart table.cart td.product-name .wc-gzd-item-desc p {
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.woocommerce-cart table.cart td.product-name .theme-cart-installation-service {
	width: 100%;
	margin-top: .7rem;
	color: #465664;
	font-size: var(--theme-text-small);
	font-weight: 700;
}

.woocommerce-cart table.cart td.product-name .theme-cart-installation-service label {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	min-height: 2.75rem;
	cursor: pointer;
}

.woocommerce-cart table.cart td.product-name .theme-cart-installation-service input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0;
	accent-color: var(--theme-color-blue);
	cursor: pointer;
}

.woocommerce-cart table.cart td.product-name .theme-cart-installation-service__price {
	color: var(--theme-color-ink);
	white-space: nowrap;
}

/* Variantendaten als kompakte Zeile "Farbe: Schwarz": Browser-Standard-Einzug
   der Definitionsliste und wpautop-Absatz im Wert entfernen. */
.woocommerce-cart table.cart td.product-name dl.variation {
	margin: 0;
}

.woocommerce-cart table.cart td.product-name dl.variation dt,
.woocommerce-cart table.cart td.product-name dl.variation dd {
	display: inline;
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.woocommerce-cart table.cart td.product-name dl.variation dd p {
	display: inline;
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

/* Nach jedem Variantenwert umbrechen, damit mehrere Angaben zeilenweise bleiben. */
.woocommerce-cart table.cart td.product-name dl.variation dd::after {
	content: "";
	display: block;
}

.woocommerce-cart table.cart td.product-price,
.woocommerce-cart table.cart td.product-subtotal {
	color: var(--theme-color-ink);
	font-family: var(--theme-font-heading);
	font-size: 1rem;
	font-weight: 700;
	white-space: nowrap;
}

.woocommerce-cart table.cart td.product-quantity .quantity {
	--quantity-height: 3rem;
	--quantity-font-size: 1rem;
	display: inline-block;
	vertical-align: middle;
	margin: 0;
}

.woocommerce-cart table.cart td.actions {
	background: #ffffff;
	padding: 1.25rem 1.15rem;
	border-bottom: none;
	text-align: right;
}

.woocommerce-cart table.cart td.actions .coupon {
	display: none !important;
}

.woocommerce-cart table.cart td.actions button[name="update_cart"] {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: .55rem;
	min-height: 2.85rem;
	padding: .65rem 1.5rem;
	border: 1px solid #c4cdd5 !important;
	border-radius: var(--theme-radius-s) !important;
	background: #ffffff !important;
	color: var(--theme-color-ink) !important;
	box-shadow: 0 2px 4px rgb(0 0 0 / 4%) !important;
	font-family: var(--theme-font-heading);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: all var(--theme-transition);
}

.woocommerce-cart table.cart td.actions button[name="update_cart"]::after {
	content: "";
	width: .9rem;
	height: .9rem;
	background-color: currentColor;
	-webkit-mask: var(--theme-icon-circle-chevron-right) center / contain no-repeat;
	mask: var(--theme-icon-circle-chevron-right) center / contain no-repeat;
}

.woocommerce-cart table.cart td.actions button[name="update_cart"]:hover {
	background: #f8fafc !important;
	border-color: #94a3b8 !important;
	color: #002244 !important;
	box-shadow: 0 4px 8px rgb(0 0 0 / 8%) !important;
	transform: translateY(-1px);
}

.woocommerce-cart table.cart td.actions button[name="update_cart"]:disabled,
.woocommerce-cart table.cart td.actions button[name="update_cart"][aria-disabled="true"] {
	opacity: .55;
	cursor: not-allowed;
	transform: none !important;
}

/* Gutschein-Hinweis zwischen Summen-Tabelle und Kasse-Button */
.theme-cart-coupon-notice {
	margin: 0 0 1.25rem 0;
	font-size: 1.05rem;
	line-height: 1.5;
	color: #64748b;
}

.theme-cart-coupon-notice strong {
	color: inherit;
	font-weight: 600;
}

/* Kombinationsangebot zwischen Produktliste und Warenkorb-Summe */
.woocommerce-cart .theme-cart-installation-offer {
	margin: 0;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--theme-color-line);
	border-left: .35rem solid var(--theme-color-blue);
	border-radius: var(--theme-radius-s);
	background: #ffffff;
	box-shadow: var(--theme-card-shadow);
}

.woocommerce-cart .theme-cart-installation-offer h2 {
	margin: 0 0 .9rem;
	color: var(--theme-color-ink);
	font-family: var(--theme-font-heading);
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	font-weight: 700;
	line-height: 1.25;
	text-wrap: balance;
}

.woocommerce-cart .theme-cart-installation-offer p {
	max-width: 70rem;
	margin: 0 0 .9rem;
	color: #465664;
	font-size: 1rem;
	line-height: 1.6;
}

.woocommerce-cart .theme-cart-installation-offer p:last-of-type {
	margin-bottom: 1.1rem;
}

.woocommerce-cart .theme-cart-installation-offer strong {
	color: var(--theme-color-ink);
	font-weight: 800;
}

.woocommerce-cart .theme-cart-installation-offer__link {
	color: var(--theme-color-blue);
	font-family: var(--theme-font-heading);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.woocommerce-cart .theme-cart-installation-offer__link:hover {
	color: var(--theme-color-blue-dark);
}

.woocommerce-cart .woocommerce-cart-form > .theme-cart-installation-offer {
	margin-top: var(--theme-space-l);
}

/* Warenkorb-Summe Card */
.woocommerce-cart .cart-collaterals .cart_totals {
	width: 100%;
	max-width: none;
	background: #ffffff;
	border: 1px solid var(--theme-color-line);
	border-radius: var(--theme-radius-s);
	box-shadow: var(--theme-card-shadow);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.woocommerce-cart .cart_totals h2 {
	margin: 0 0 1.25rem 0;
	font-family: var(--theme-font-heading);
	font-size: 1.6rem;
	font-weight: 700;
}

.woocommerce-cart .cart_totals table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: none;
	margin-bottom: 1.25rem;
}

.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
	padding: 1rem 0;
	border-top: none;
	border-left: none;
	border-right: none;
	border-bottom: 1px solid #edf2f7;
	font-size: 1.05rem;
}

.woocommerce-cart .cart_totals table.shop_table th {
	color: #465664;
	font-family: var(--theme-font-heading);
	font-weight: 700;
	text-align: left;
	width: 40%;
}

.woocommerce-cart .cart_totals table.shop_table td {
	color: var(--theme-color-ink);
	font-family: var(--theme-font-heading);
	font-weight: 700;
	text-align: right;
}

.woocommerce-cart .cart_totals table.shop_table tr.order-total th,
.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
	border-bottom: none;
	font-size: 1.25rem;
	font-weight: 800;
	padding-top: 1.25rem;
	color: var(--theme-color-ink);
}

.woocommerce-cart .wc-proceed-to-checkout {
	padding: 0;
	margin-top: 1.25rem;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: .65rem;
	width: 100%;
	min-height: 3.35rem;
	font-size: 1.15rem !important;
	font-family: var(--theme-font-heading) !important;
	font-weight: 700 !important;
	color: #ffffff !important;
	background: var(--theme-color-blue) linear-gradient(180deg, #004b8d 0%, #003366 100%) !important;
	border: 1px solid #002244 !important;
	border-radius: var(--theme-radius-s) !important;
	box-shadow: 0 2px 6px rgb(0 34 68 / 25%), inset 0 1px 0 rgb(255 255 255 / 15%) !important;
	text-decoration: none;
	transition: all var(--theme-transition);
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button::after {
	content: "";
	width: .95rem;
	height: .95rem;
	background-color: currentColor;
	-webkit-mask: var(--theme-icon-circle-chevron-right) center / contain no-repeat;
	mask: var(--theme-icon-circle-chevron-right) center / contain no-repeat;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--theme-color-blue-dark) linear-gradient(180deg, #005a9e 0%, #002850 100%) !important;
	border-color: #001933 !important;
	box-shadow: 0 4px 12px rgb(0 34 68 / 35%), inset 0 1px 0 rgb(255 255 255 / 20%) !important;
	transform: translateY(-1px);
}

/* Versandarten-Liste: Listenmarker und Einzug ohne Funktion entfernen */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Versandkostenrechner im Warenkorb */
.woocommerce-cart .shipping-calculator-button {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	margin-top: .65rem;
	color: var(--theme-color-blue);
	font-family: var(--theme-font-heading);
	font-size: var(--theme-text-small);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.woocommerce-cart .shipping-calculator-button:hover {
	color: var(--theme-color-blue-dark);
}

.woocommerce-cart .shipping-calculator-form {
	margin-top: 1rem;
	display: grid;
	gap: .75rem;
	text-align: left;
}

.woocommerce-cart .shipping-calculator-form .form-row {
	margin: 0;
}

.woocommerce-cart .shipping-calculator-form button[name="calc_shipping"] {
	width: 100%;
	min-height: 2.85rem;
	padding: .65rem 1.25rem;
	font-size: var(--theme-text-small);
}

/* Warenkorb-Inhalt im Seitenfluss */
.woocommerce-cart .entry-content>.woocommerce {
	display: grid;
	gap: var(--theme-space-l);
}
