/* KURV */

/* Smagene vises under kassens navn, så deres egne rækker skjules */
.woocommerce-cart-form table.shop_table tr.cart_item.nk-kurv-smag {
	display: none !important;
}

/* Kurven ligger i en shortcode, og wpautop indsætter tomme <p> mellem elementerne */
.woocommerce-cart-form td.product-name p:empty,
#pwgc-redeem-gift-card-container p:empty,
#pwgc-redeem-gift-card-container br {
	display: none;
}

.woocommerce-message a.restore-item {
	margin-left: 0.3em;
}

/* wpautop pakker scriptet fra cart-totals.php i et <p>, hvis margen skubber totalen ned */
.cart-collaterals > p:has(> script) {
	margin: 0;
}

.nk-kurv-smage {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: #5f6b64;
}

.nk-kurv-smage__label {
	display: block;
	margin: 0;
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #5f6b64;
}

.nk-kurv-smage ul {
	margin: 1px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
}

.nk-kurv-smage li {
	margin: 0;
}

.nk-kurv-smag__antal {
	font-weight: 600;
	color: #173e2b;
}

.woocommerce-cart-form td.product-thumbnail img {
	border-radius: 8px;
}

/* +/- på antal (wpautop sætter et <br> efter feltets skjulte label) */
.woocommerce-cart-form td.product-quantity br {
	display: none;
}

.woocommerce-cart-form .nk-kurv-stepper {
	display: inline-flex;
	align-items: stretch;
	height: 40px;
	border-radius: 999px;
	overflow: hidden;
	background: #f5f3ee;
}

.woocommerce-cart-form .nk-kurv-stepper button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #e5e0ce;
	color: #333;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.woocommerce-cart-form .nk-kurv-stepper button:hover:not(:disabled) {
	background: #d9d4c2;
	color: #333;
}

/* Ingen stiplet ramme ved klik i nogen browser (Firefox tegner en via :-moz-focusring);
   tastaturbrugere får en diskret ring i stedet */
.nk-kurv-stepper button,
.nk-kurv-stepper button:focus,
.nk-kurv-stepper button:focus-visible,
.nk-kurv-stepper button:active,
.nk-kurv-stepper input.qty:focus {
	outline: 0 !important;
	border: 0 !important;
}

/* Firefox-only selektorer i egne regler, så andre browsere ikke smider hele reglen væk */
.nk-kurv-stepper button:-moz-focusring {
	outline: 0 !important;
}

.nk-kurv-stepper button::-moz-focus-inner {
	border: 0;
}

.nk-kurv-stepper button:focus-visible {
	box-shadow: inset 0 0 0 2px #173e2b;
}

/* Feltet: ingen stiplet kant fra temaet, bare hvid baggrund mens man skriver */
.woocommerce-cart-form .nk-kurv-stepper input.qty:focus {
	border: 0 !important;
	box-shadow: none !important;
	background: #fff;
}

.woocommerce-cart-form .nk-kurv-stepper button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.woocommerce-cart-form .nk-kurv-stepper input.qty {
	width: 44px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font-weight: 600;
	color: #173e2b;
	-moz-appearance: textfield;
}

.woocommerce-cart-form .nk-kurv-stepper input.qty::-webkit-outer-spin-button,
.woocommerce-cart-form .nk-kurv-stepper input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Gavekort: feltet og Anvend på én linje, som rabatkuponen */
#pwgc-redeem-gift-card-container label {
	display: block;
	margin-bottom: 8px;
}

#pwgc-redeem-gift-card-container p:has(#pwgc-redeem-gift-card-number) {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin: 0;
}

#pwgc-redeem-gift-card-number {
	flex: 1 1 auto;
	min-width: 0;
	width: auto !important;
	margin: 0 !important;
}

#pwgc-redeem-button {
	flex: 0 0 auto;
	margin: 0 !important;
	white-space: nowrap;
}

/* De to "Anvend"-knapper i samme størrelse */
#pwgc-redeem-gift-card-number,
#pwgc-redeem-button,
.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
	height: 48px !important;
	box-sizing: border-box;
}

#pwgc-redeem-button,
.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
	padding: 10px 25px !important;
}

/* Rabatkupon i samme højde som gavekortet */
.woocommerce-cart-form td.actions .coupon #coupon_code,
.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
	height: 48px !important;
	max-height: none !important; /* Astra sætter max-height: 35px på kuponfeltet */
	box-sizing: border-box;
}

.woocommerce-cart-form td.actions .coupon {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.woocommerce-cart-form td.actions .coupon #coupon_code {
	width: 220px;
	margin: 0;
}

.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
	margin: 0;
	white-space: nowrap;
}

/* Bred skærm: varer til venstre, total til højre (under 1200px bliver varetabellen for smal) */
@media (min-width: 1200px) {
	body.woocommerce-cart .elementor-widget-container > .woocommerce {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 380px;
		column-gap: 32px;
		align-items: start;
	}

	body.woocommerce-cart .elementor-widget-container > .woocommerce > * {
		grid-column: 1 / -1;
	}

	body.woocommerce-cart .elementor-widget-container > .woocommerce > .woocommerce-cart-form {
		grid-column: 1;
	}

	body.woocommerce-cart .elementor-widget-container > .woocommerce > .cart-collaterals {
		grid-column: 2;
		position: sticky;
		top: 24px;
		width: auto;
	}

	body.woocommerce-cart .cart-collaterals .cart_totals {
		float: none;
		width: 100%;
	}
}

/* Kurven opdaterer selv ved ændring af antal */
.woocommerce-cart-form button[name="update_cart"] {
	display: none !important;
}

.woocommerce-cart-form.processing,
.woocommerce-cart-form .blockUI ~ * {
	cursor: progress;
}

/* Mobil: hver vare som et kort */
@media (max-width: 921px) {
	/* Elementor-sektionen har ingen sidemargen på mobil */
	body.woocommerce-cart .elementor-widget-container > .woocommerce {
		padding-left: 16px;
		padding-right: 16px;
	}

	.woocommerce-cart-form table.shop_table_responsive,
	.woocommerce-cart-form table.shop_table_responsive tbody {
		display: block;
		width: 100%;
		border: 0;
	}

	.woocommerce-cart-form table.shop_table_responsive tr.cart_item td.product-quantity {
		min-width: 0 !important;
	}

	.woocommerce-cart-form table.shop_table_responsive thead {
		display: none;
	}

	.woocommerce-cart-form table.shop_table_responsive tr.cart_item {
		display: grid !important;
		grid-template-columns: 76px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb name remove"
			"thumb qty subtotal";
		column-gap: 14px;
		row-gap: 10px;
		align-items: center;
		padding: 16px 0;
		border-bottom: 1px solid #e8e4d4;
		background: transparent !important;
	}

	.woocommerce-cart-form table.shop_table_responsive tr.cart_item td {
		display: block !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: left !important;
		background: transparent !important;
	}

	.woocommerce-cart-form table.shop_table_responsive tr.cart_item td::before {
		display: none !important;
	}

	.woocommerce-cart-form tr.cart_item td.product-thumbnail {
		grid-area: thumb;
		align-self: start;
	}

	.woocommerce-cart-form tr.cart_item td.product-thumbnail img {
		display: block;
		width: 76px !important;
		max-width: 76px !important;
		height: 76px !important;
		object-fit: cover;
		border-radius: 8px;
	}

	.woocommerce-cart-form tr.cart_item td.product-name {
		grid-area: name;
		align-self: start;
		font-size: 15px;
		line-height: 1.35;
	}

	.woocommerce-cart-form tr.cart_item td.product-name > a {
		font-weight: 600;
		color: #173e2b;
	}

	.woocommerce-cart-form tr.cart_item td.product-remove {
		grid-area: remove;
		align-self: start;
		justify-self: end;
	}

	.woocommerce-cart-form table.shop_table_responsive tr.cart_item td.product-price {
		display: none !important;
	}

	.woocommerce-cart-form tr.cart_item td.product-quantity {
		grid-area: qty;
	}

	.woocommerce-cart-form tr.cart_item td.product-subtotal {
		grid-area: subtotal;
		justify-self: end;
		font-weight: 600;
		color: #173e2b;
		white-space: nowrap;
	}

	.woocommerce-cart-form table.shop_table_responsive td.actions {
		display: block !important;
		padding: 16px 0 0 !important;
		border: 0 !important;
	}

	.woocommerce-cart-form td.actions .coupon {
		display: flex !important;
		gap: 8px;
		width: 100%;
	}

	.woocommerce-cart-form td.actions .coupon input.input-text {
		flex: 1 1 auto;
		min-width: 0;
		width: auto !important;
		margin: 0 !important;
	}

	.woocommerce-cart-form td.actions .coupon button {
		flex: 0 0 auto;
		width: auto !important;
		margin: 0 !important;
		white-space: nowrap;
	}
}

/* Totaler: label-kolonnen så smal som teksten, så beløb og forsendelsestekst får pladsen */
@media (min-width: 922px) {
	body.woocommerce-cart .cart_totals table.shop_table th {
		width: 1%;
		white-space: nowrap;
		padding-right: 8px;
	}
}

body.woocommerce-cart .cart_totals .order-total small.includes_tax {
	display: block;
}

.cart_totals .nk-pant-info {
	display: block;
	font-size: 0.85em;
	color: #5f6b64;
}
