/**
 * WooCommerce Blocks: hide raw m² quantity UI on Suo restoration lines.
 *
 * Pinta-ala (ha) is shown via item metadata; badge/stepper counts are misleading.
 */

/* Checkout order summary thumbnail badge (e.g. "10000"). */
.hp-wc-suo-restoration-item .wc-block-components-order-summary-item__quantity {
	display: none !important;
}

/* Cart block quantity stepper and row quantity badge. */
.hp-wc-suo-restoration-item .wc-block-components-quantity-selector,
.hp-wc-suo-restoration-item .wc-block-cart-item__quantity-badge {
	display: none !important;
}

/* Mini-cart drawer: hide m² stepper only, keep remove control in column. */
.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .wc-block-components-quantity-selector {
	display: none !important;
}

.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
	display: none !important;
}

.wc-block-mini-cart__drawer .wc-block-components-product-name,
.wc-block-mini-cart__drawer .wc-block-components-product-name a,
.wc-block-mini-cart__drawer .wc-block-components-product-metadata,
.wc-block-mini-cart__drawer .wc-block-components-product-details,
.wc-block-mini-cart__drawer .wc-block-components-product-details__name,
.wc-block-mini-cart__drawer .wc-block-components-product-details__value,
.wc-block-mini-cart__drawer .wc-block-components-product-details p,
.wc-block-mini-cart__drawer .wc-block-cart-item__prices,
.wc-block-mini-cart__drawer .wc-block-components-product-price {
	font-size: var(--wp--preset--font-size--medium, 1rem) !important;
	line-height: 1.5;
}

.wc-block-mini-cart__drawer .wc-block-components-product-name,
.wc-block-mini-cart__drawer .wc-block-components-product-name a {
	line-height: 1.35;
}

/* Drawer title: "Ostoskorisi (tuotteita: 2)" */
.wc-block-mini-cart__title {
	font-size: 1.5em !important;
	font-weight: 800 !important;
}

.wc-block-mini-cart__drawer [data-wp-text="state.itemPrice"] {
	display: none !important;
}

/* Hide "Näytä ostoskori" — checkout only. */
.wc-block-mini-cart__footer-cart {
	display: none !important;
}

.wc-block-mini-cart__footer-actions {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	gap: 0.75rem;
	width: 100%;
}

/* Mini-cart checkout button — theme fill-brown proportions (40px height). */
.wc-block-mini-cart__footer-checkout.wc-block-components-button {
	box-sizing: border-box;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: var(--hp-btn-gap, 16px);
	height: var(--hp-btn-min-height, 40px) !important;
	min-height: var(--hp-btn-min-height, 40px) !important;
	padding: var(--hp-btn-padding-y, 8px) var(--hp-btn-padding-x, 20px) !important;
	border: 0 !important;
	border-radius: 0.5rem;
	background-color: var(--wp--preset--color--coffee, #6e3709) !important;
	color: var(--wp--preset--color--base, #fff) !important;
	font-size: 1.25rem !important;
	font-family: var(
		--wp--preset--font-family--ibm-plex-mono,
		"IBM Plex Mono",
		monospace
	) !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-transform: none;
	width: auto !important;
	max-width: fit-content;
	align-self: flex-start;
}

.wc-block-mini-cart__footer-checkout.wc-block-components-button:hover,
.wc-block-mini-cart__footer-checkout.wc-block-components-button:focus-visible {
	background-color: color-mix(
		in srgb,
		var(--wp--preset--color--coffee, #6e3709) 90%,
		#000
	) !important;
	color: var(--wp--preset--color--base, #fff) !important;
}

.wc-block-mini-cart__footer-checkout.wc-block-components-button::after {
	content: "";
	flex-shrink: 0;
	width: var(--hp-btn-arrow-size, 28px);
	height: var(--hp-btn-arrow-size, 28px);
	background-color: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 14h18M15 5l9 9-9 9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 14h18M15 5l9 9-9 9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wc-block-mini-cart__drawer .hp-wc-mini-cart-empty-link-wrap {
	display: flex !important;
	justify-content: center !important;
	width: 100%;
	text-align: center;
}

.wc-block-mini-cart__drawer .hp-wc-mini-cart-empty-link {
	display: inline-flex !important;
	margin-inline: auto !important;
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__empty-cart-wrapper .hp-wc-mini-cart-empty-link {
	display: inline-flex !important;
}

/* Never show empty-cart CTA styling on the filled-cart footer checkout button. */
.wc-block-mini-cart__footer-actions .hp-wc-mini-cart-empty-link {
	display: none !important;
}

/* Block checkout: "Lähetä tilaus" button follows shared normal button style. */
.wc-block-components-button.wc-block-components-checkout-place-order-button,
.wc-block-components-checkout-place-order-button.wc-block-components-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 40px;
	padding: 8px 20px !important;
	width: auto !important;
	max-width: fit-content !important;
	font-size: var(--wp--preset--font-size--button-large, 1.5rem) !important;
	font-family: var(
		--wp--preset--font-family--ibm-plex-mono,
		"IBM Plex Mono",
		monospace
	) !important;
	font-weight: 700 !important;
	line-height: 1.2;
	text-transform: none;
}

.wc-block-components-button.wc-block-components-checkout-place-order-button::after,
.wc-block-components-checkout-place-order-button.wc-block-components-button::after {
	content: "";
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	background-color: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 14h18M15 5l9 9-9 9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 14h18M15 5l9 9-9 9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wc-block-components-checkout-place-order-button--full-width {
	width: auto !important;
	max-width: fit-content !important;
}

/* "Muokkaa tilauksen sisältöä" / return-to-cart link above summary. */
.wp-block-woocommerce-checkout .wc-block-components-order-summary .wc-block-components-panel__button,
.wp-block-woocommerce-checkout-totals-block .wc-block-components-panel__button,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-return-to-cart-button,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-order-summary__button-text,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-order-summary__button {
	display: none !important;
}

/* Checkout summary: hide thumbnail and quantity badge. */
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-order-summary-item__image {
	display: none !important;
}

.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-order-summary-item__description {
	padding-left: 0 !important;
}

/* Unit price (0,16 €) — not the row total on the right. */
.wp-block-woocommerce-checkout-order-summary-block
	.wc-block-components-order-summary-item__description
	> .wc-block-cart-item__prices {
	display: none !important;
}

/* Pinta-ala metadata and product descriptions (checkout). */
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-metadata,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-details,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-metadata__description {
	display: none !important;
}

/* Mini-cart: hide long product description only; keep Pinta-ala item_data. */
.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .wc-block-components-product-metadata__description {
	display: none !important;
}

.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .wc-block-components-product-details {
	display: block !important;
}

.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .hp-wc-mini-cart-remove,
.wc-block-mini-cart__drawer .hp-wc-suo-restoration-item .hp-wc-checkout-remove-item {
	display: inline-flex !important;
	margin-top: 0.35rem;
}

.wp-block-woocommerce-checkout-order-summary-block .hp-wc-checkout-remove-item,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-details__remove-link,
.wc-block-mini-cart__drawer .hp-wc-checkout-remove-item,
.wc-block-mini-cart__drawer .wc-block-components-product-details__remove-link,
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.35rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--medium, 1rem);
	line-height: 1.5;
	cursor: pointer;
}

.wp-block-woocommerce-checkout-order-summary-block .hp-wc-checkout-remove-item:hover,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-details__remove-link:hover,
.wc-block-mini-cart__drawer .hp-wc-checkout-remove-item:hover,
.wc-block-mini-cart__drawer .wc-block-components-product-details__remove-link:hover,
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:hover {
	text-decoration: underline;
}

.wp-block-woocommerce-checkout-order-summary-block .hp-wc-checkout-remove-item__icon,
.wc-block-mini-cart__drawer .hp-wc-checkout-remove-item__icon {
	font-weight: 700;
}

.wp-block-woocommerce-checkout-order-summary-block .hp-wc-suo-link,
.wc-block-mini-cart__drawer .hp-wc-suo-link {
	color: inherit;
	text-decoration: underline;
}

.wp-block-woocommerce-checkout-order-summary-block .hp-wc-suo-link:hover,
.wc-block-mini-cart__drawer .hp-wc-suo-link:hover {
	text-decoration-thickness: 2px;
}

.wc-block-checkout__actions_row,
.wc-block-components-checkout-place-order-button__wrapper,
.wc-block-checkout__actions {
	text-align: right;
	justify-content: flex-end;
}
