/**
 * Foliefabrikken — compact mini-cart + checkout order / shipping UI.
 *
 * Scoped to Elementor/WC mini-cart and classic checkout review only.
 * Does NOT restyle the cart page table (/kurv/).
 *
 * !important is used only on the details-toggle to defeat theme/Elementor
 * global button styles (blue filled buttons).
 */

/* -------------------------------------------------------------------------
 * Shared: discrete “Vis detaljer” text control
 * ---------------------------------------------------------------------- */

.wctc-product-details {
	margin: 4px 0 0;
	max-width: 100%;
}

.elementor-menu-cart__main button.wctc-product-details-toggle,
.widget_shopping_cart_content button.wctc-product-details-toggle,
.wctc-checkout-ui button.wctc-product-details-toggle,
button.wctc-product-details-toggle {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #667085 !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	text-align: left !important;
	text-decoration: none !important;
	text-transform: none !important;
	cursor: pointer !important;
	min-height: 0 !important;
	width: auto !important;
	height: auto !important;
}

.elementor-menu-cart__main button.wctc-product-details-toggle:hover,
.elementor-menu-cart__main button.wctc-product-details-toggle:focus,
.widget_shopping_cart_content button.wctc-product-details-toggle:hover,
.widget_shopping_cart_content button.wctc-product-details-toggle:focus,
.wctc-checkout-ui button.wctc-product-details-toggle:hover,
.wctc-checkout-ui button.wctc-product-details-toggle:focus,
button.wctc-product-details-toggle:hover,
button.wctc-product-details-toggle:focus {
	color: #1d2327 !important;
	background: transparent !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
	outline: none !important;
	box-shadow: none !important;
}

.wctc-product-details:not(.is-open) .wctc-product-details__panel {
	display: none;
}

.wctc-product-details.is-open .wctc-product-details__panel {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 6px 0 0;
	padding: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-size: 12px;
	line-height: 1.4;
	color: #475467;
}

.wctc-product-details__panel.variation dt {
	float: none;
	display: inline;
	margin: 0;
	font-weight: 600;
	color: #344054;
}

.wctc-product-details__panel.variation dd {
	display: inline;
	margin: 0;
	color: #475467;
}

.wctc-product-details__panel.variation dd::after {
	content: none !important;
	display: none !important;
}

.wctc-product-details__panel .wc-block-components-product-details__item > [aria-hidden="true"],
.wctc-product-details__panel .wc-block-components-product-details__text > [aria-hidden="true"] {
	display: none;
}

.wctc-cart-qty {
	font-weight: 400;
	font-size: 13px;
	color: #344054;
}

.wctc-cart-qty__hint {
	color: #98a2b3;
	font-size: 12px;
}

/* -------------------------------------------------------------------------
 * Mini-cart (Elementor side cart + WC widget)
 * ---------------------------------------------------------------------- */

.elementor-menu-cart__main .woocommerce-mini-cart-item,
.widget_shopping_cart_content .woocommerce-mini-cart-item {
	position: relative;
	display: block;
	box-sizing: border-box;
	padding: 12px 28px 12px 68px;
	margin: 0;
	border: 0;
	border-bottom: 1px solid #eaecf0;
	list-style: none;
	overflow: hidden;
	max-width: 100%;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item:last-child,
.widget_shopping_cart_content .woocommerce-mini-cart-item:last-child {
	border-bottom: 0;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item img,
.widget_shopping_cart_content .woocommerce-mini-cart-item img {
	position: absolute;
	left: 0;
	top: 12px;
	width: 56px;
	height: 56px;
	max-width: 56px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item > a:not(.remove):not(.remove_from_cart_button),
.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove):not(.remove_from_cart_button) {
	display: block;
	min-width: 0;
	padding-right: 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
	text-decoration: none;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item .remove,
.widget_shopping_cart_content .woocommerce-mini-cart-item .remove,
.elementor-menu-cart__main .woocommerce-mini-cart-item .remove_from_cart_button,
.widget_shopping_cart_content .woocommerce-mini-cart-item .remove_from_cart_button {
	position: absolute;
	top: 10px;
	right: 0;
	z-index: 2;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item .wctc-product-details,
.widget_shopping_cart_content .woocommerce-mini-cart-item .wctc-product-details,
.elementor-menu-cart__main .woocommerce-mini-cart-item .quantity,
.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity,
.elementor-menu-cart__main .woocommerce-mini-cart-item .wctc-cart-qty,
.widget_shopping_cart_content .woocommerce-mini-cart-item .wctc-cart-qty {
	display: block;
	margin-top: 4px;
}

/* -------------------------------------------------------------------------
 * Checkout “Din ordre” — match mini-cart feel
 * ---------------------------------------------------------------------- */

.wctc-checkout-ui .woocommerce-checkout-review-order-table {
	width: 100%;
	border-collapse: collapse;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table thead {
	display: none;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table tbody .cart_item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 12px;
	row-gap: 4px;
	padding: 12px 0;
	border-bottom: 1px solid #eaecf0;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table tbody .cart_item > td {
	border: 0;
	padding: 0;
	background: transparent;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table tbody .cart_item .product-name {
	grid-column: 1 / -1;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table tbody .cart_item .product-total {
	grid-column: 2;
	grid-row: 2;
	text-align: right;
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
}

.wctc-checkout-ui .wctc-checkout-product {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	column-gap: 12px;
	align-items: start;
}

.wctc-checkout-ui .wctc-checkout-product__media {
	display: block;
	width: 56px;
}

.wctc-checkout-ui .wctc-checkout-product__img,
.wctc-checkout-ui .wctc-checkout-product__media img {
	display: block;
	width: 56px;
	height: 56px;
	max-width: 56px;
	object-fit: cover;
	border-radius: 6px;
}

.wctc-checkout-ui .wctc-checkout-product__body {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .wctc-product-details {
	margin-left: 68px;
}

.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .product-quantity,
.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .wctc-cart-qty {
	display: inline-block;
	margin-left: 68px;
	margin-top: 2px;
	font-weight: 400;
}

/*
 * Break the review table out of real <table> layout so shipping can
 * leave the 2-column th|td track. (Browsers keep table-row layout while
 * parent tfoot is still table-footer-group — grid on tr alone is ignored.)
 */
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > thead,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tbody,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}

/* Subtotal / total / fee rows: label left, amount right */
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr:not(.woocommerce-shipping-totals) {
	display: flex !important;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 0;
	border-top: 1px solid #eaecf0;
	background: transparent;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr:not(.woocommerce-shipping-totals) > th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr:not(.woocommerce-shipping-totals) > td {
	display: block !important;
	float: none !important;
	width: auto !important;
	max-width: none !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	text-align: left;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr:not(.woocommerce-shipping-totals) > td {
	text-align: right;
	margin-left: auto;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr.cart-subtotal {
	padding-top: 14px;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot > tr.order-total {
	font-size: 1.05em;
}

/* -------------------------------------------------------------------------
 * Shipping — full-width, cleaner option cards (checkout /kasse/ only)
 * One outer frame on the whole <tr>; Shipmondo DOM/JS untouched.
 * ---------------------------------------------------------------------- */

body.woocommerce-checkout #order_review
tr.woocommerce-shipping-totals.shipping {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	margin: 16px 0 0;
	padding: 14px;
	border: 1px solid #d0d5dd;
	border-radius: 12px;
	background: #fafbfc;
}

body.woocommerce-checkout #order_review
tr.woocommerce-shipping-totals.shipping > th,
body.woocommerce-checkout #order_review
tr.woocommerce-shipping-totals.shipping > td {
	display: block !important;
	float: none !important;
	clear: both !important;
	width: 100% !important;
	max-width: none !important;
	box-sizing: border-box;
	text-align: left !important;
	border: 0 !important;
	background: transparent !important;
}

body.woocommerce-checkout #order_review
tr.woocommerce-shipping-totals.shipping > th {
	padding: 0 0 12px !important;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #101828;
}

body.woocommerce-checkout #order_review
tr.woocommerce-shipping-totals.shipping > td {
	padding: 0 !important;
}

body.woocommerce-checkout #order_review ul#shipping_method {
	display: flex !important;
	flex-direction: column;
	gap: 8px;
	width: 100% !important;
	max-width: none !important;
	margin: 0;
	padding: 0;
	list-style: none;
	box-sizing: border-box;
}

body.woocommerce-checkout #order_review ul#shipping_method > li {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 10px;
	position: relative !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 14px 16px !important;
	border: 1px solid #e4e7ec !important;
	border-radius: 10px !important;
	background: #fff !important;
	list-style: none !important;
	box-sizing: border-box !important;
	overflow: visible !important;
	/* Kill old “hide radio with text-indent” hacks from theme/Additional CSS */
	text-indent: 0 !important;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.woocommerce-checkout #order_review ul#shipping_method > li:hover {
	border-color: #c8d0db !important;
}

body.woocommerce-checkout #order_review
#shipping_method input.shipping_method {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	/* Keep off the visible card edge so it cannot push/overlap the label */
	left: 8px !important;
	top: 8px !important;
	pointer-events: none;
}

body.woocommerce-checkout #order_review
#shipping_method > li:has(input.shipping_method:checked) {
	border-color: #2463eb !important;
	background: #f5f8ff !important;
	box-shadow: none !important;
}

body.woocommerce-checkout #order_review
#shipping_method > li:has(input.shipping_method:focus-visible) {
	outline: 2px solid #2463eb;
	outline-offset: 2px;
}

/* Method title + hint must stay inside the card */
body.woocommerce-checkout #order_review ul#shipping_method > li > label,
body.woocommerce-checkout #order_review #shipping_method > li > label {
	display: block !important;
	float: none !important;
	position: static !important;
	order: 0;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 0 !important;
	cursor: pointer;
	line-height: 1.4 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: #1d2939 !important;
	text-align: left !important;
	text-indent: 0 !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}

body.woocommerce-checkout #order_review ul#shipping_method > li .woocommerce-Price-amount {
	font-weight: 600;
	white-space: normal !important;
}

body.woocommerce-checkout #order_review ul#shipping_method > li > label .wctc-shipping-hint,
body.woocommerce-checkout #order_review #shipping_method > li > label .wctc-shipping-hint,
body.woocommerce-checkout #order_review .wctc-shipping-hint {
	display: block !important;
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	margin: 4px 0 0 !important;
	padding: 0 !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	color: #667085 !important;
	line-height: 1.35 !important;
	text-indent: 0 !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}

/* Shipmondo widgets stay inside the same bordered card as the label */
body.woocommerce-checkout #order_review #shipping_method > li > .shipmondo-shipping-field-wrapper,
body.woocommerce-checkout #order_review #shipping_method > li > .shipmondo-shipping-field,
body.woocommerce-checkout #order_review #shipping_method > li > .shipmondo-original,
body.woocommerce-checkout #order_review #shipping_method > li > .shipmondo_service_point_selection,
body.woocommerce-checkout #order_review .shipmondo-shipping-field-wrapper,
body.woocommerce-checkout #order_review .shipmondo-shipping-field,
body.woocommerce-checkout #order_review .shipmondo-original,
body.woocommerce-checkout #order_review .shipmondo_service_point_selection,
body.woocommerce-checkout #order_review .selected_service_point,
body.woocommerce-checkout #order_review .shipmondo-dropdown,
body.woocommerce-checkout #order_review .shipmondo-selector {
	display: block !important;
	float: none !important;
	position: static !important;
	order: 1;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	margin: 0 !important;
}

body.woocommerce-checkout #order_review .selected_service_point {
	padding: 10px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #f8fafc;
}

body.woocommerce-checkout #order_review .selected_service_point .header .name {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1d2939;
	line-height: 1.3;
}

body.woocommerce-checkout #order_review .selected_service_point .location {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 12px;
	margin-top: 4px;
}

body.woocommerce-checkout #order_review .selected_service_point .address_info {
	font-size: 12px;
	color: #475467;
	line-height: 1.35;
}

body.woocommerce-checkout #order_review .selected_service_point .distance {
	font-size: 12px;
	font-weight: 500;
	color: #667085;
	white-space: nowrap;
}

body.woocommerce-checkout #order_review .powered_by_shipmondo {
	display: none !important;
}

@media (max-width: 782px) {
	.elementor-menu-cart__main .woocommerce-mini-cart-item,
	.widget_shopping_cart_content .woocommerce-mini-cart-item {
		padding-left: 60px;
	}

	.elementor-menu-cart__main .woocommerce-mini-cart-item img,
	.widget_shopping_cart_content .woocommerce-mini-cart-item img,
	.wctc-checkout-ui .wctc-checkout-product__img,
	.wctc-checkout-ui .wctc-checkout-product__media img {
		width: 48px;
		height: 48px;
		max-width: 48px;
	}

	.wctc-checkout-ui .wctc-checkout-product {
		grid-template-columns: 48px minmax(0, 1fr);
	}

	.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .wctc-product-details,
	.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .product-quantity,
	.wctc-checkout-ui .woocommerce-checkout-review-order-table .cart_item .wctc-cart-qty {
		margin-left: 60px;
	}

	body.woocommerce-checkout #order_review
	tr.woocommerce-shipping-totals.shipping {
		padding: 12px;
	}

	body.woocommerce-checkout #order_review ul#shipping_method > li {
		padding: 14px 16px !important;
	}

	body.woocommerce-checkout #order_review ul#shipping_method > li > label,
	body.woocommerce-checkout #order_review #shipping_method > li > label {
		padding: 0 !important;
	}
}
