/*
 * WooCommerce cart and checkout blocks. The theme loads this file on the
 * cart page and the checkout page only.
 * Every color, size and space comes from a theme.json variable.
 */

/* Cart items. */

.wc-block-cart .wc-block-cart-items,
.wc-block-cart .wc-block-cart-items th,
.wc-block-cart .wc-block-cart-items td {
	border-color: var(--wp--preset--color--border);
}

.wc-block-cart .wc-block-cart-items .wc-block-cart-items__header th {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--medium);
	letter-spacing: 0.04em;
}

.wc-block-cart-item__image img {
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--sm);
}

.wc-block-cart-items .wc-block-components-product-name {
	font-size: var(--wp--preset--font-size--md);
}

.wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--text-muted) !important;
	font-size: var(--wp--preset--font-size--sm) !important;
	min-height: 1.5rem;
}

.wc-block-cart-item__remove-link:hover {
	color: var(--wp--preset--color--error) !important;
}

/* Totals: cart sidebar and checkout order summary. */

.wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wc-block-components-sidebar .wc-block-components-panel,
.wp-block-woocommerce-checkout-order-summary-block {
	border-color: var(--wp--preset--color--border);
}

.wp-block-woocommerce-cart-order-summary-block,
.wp-block-woocommerce-checkout-order-summary-block {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-woocommerce-cart-order-summary-block {
	padding-inline: var(--wp--preset--spacing--40);
}

/*
 * On a small screen WooCommerce shows the checkout order summary two times:
 * a closed toggle above the form and the full list below the form.
 * The toggle needs side padding. The full list has its own inner box, so the
 * outer box loses its border and background.
 */
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
	border: 0;
	padding-inline: var(--wp--preset--spacing--40);
}

.wp-block-woocommerce-checkout-order-summary-block.checkout-order-summary-block-fill-wrapper {
	background-color: transparent;
	border: 0;
}

.checkout-order-summary-block-fill-wrapper .checkout-order-summary-block-fill {
	background-color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
}

.wc-block-cart__totals-title,
.wc-block-components-checkout-order-summary__title-text {
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: 0;
	text-transform: none;
}

.wc-block-components-totals-item {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--md);
}

.wc-block-components-totals-item__description,
.wc-block-components-totals-shipping__via,
.wc-block-components-totals-footer-item-tax {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: var(--wp--preset--font-size--lg);
	font-weight: var(--wp--custom--font-weight--bold);
}

.wc-block-components-panel__button,
.wc-block-components-totals-coupon-link {
	color: var(--wp--preset--color--text);
	min-height: 1.5rem;
}

.wc-block-components-chip {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--text);
}

.wc-block-components-order-summary-item__quantity {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: none;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--sm);
}

.wc-block-components-order-summary-item__image img {
	background-color: var(--wp--preset--color--background);
	border-radius: var(--wp--custom--radius--sm);
}

/* Checkout steps. */

.wc-block-components-checkout-step__heading {
	margin-bottom: var(--wp--preset--spacing--30);
}

.wc-block-components-checkout-step__title,
.wc-block-components-title.wc-block-components-title {
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: var(--wp--custom--font-weight--bold);
}

.wc-block-components-checkout-step__description {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

/* Inputs. */

.wc-block-components-form .wc-block-components-text-input input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"]),
.wc-block-components-text-input input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"]),
.wc-block-components-textarea,
.wc-blocks-components-select .wc-blocks-components-select__select {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--hmx-control-border);
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--md);
}

.wc-blocks-components-select .wc-blocks-components-select__container {
	background-color: var(--wp--preset--color--background);
	border-radius: var(--wp--custom--radius--sm);
}

.wc-block-components-form .wc-block-components-text-input label,
.wc-block-components-text-input label,
.wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--wp--preset--color--text-muted);
}

.wc-block-components-form .wc-block-components-text-input input:focus,
.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus {
	border-color: var(--wp--preset--color--text);
	box-shadow: none;
	outline: var(--wp--custom--focus--width) solid var(--hmx-focus-color);
	outline-offset: var(--wp--custom--focus--offset);
}

.wc-block-components-text-input.has-error input,
.wc-block-components-text-input.has-error input:focus,
.has-error .wc-blocks-components-select .wc-blocks-components-select__select {
	border-color: var(--wp--preset--color--error);
}

.wc-block-components-text-input.has-error label,
.has-error .wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--wp--preset--color--error);
}

/* Checkboxes and radio buttons. */

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-radio-control .wc-block-components-radio-control__input {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--hmx-control-border);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background-color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--text);
}

.wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: var(--wp--preset--color--text);
}

.wc-block-components-radio-control .wc-block-components-radio-control__input:checked {
	border-color: var(--wp--preset--color--text);
}

.wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before {
	background-color: var(--wp--preset--color--text);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:focus,
.wc-block-components-radio-control .wc-block-components-radio-control__input:focus {
	box-shadow: none;
	outline: var(--wp--custom--focus--width) solid var(--hmx-focus-color);
	outline-offset: var(--wp--custom--focus--offset);
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option {
	border-color: var(--wp--preset--color--border);
}

.wc-block-components-radio-control--highlight-checked::after {
	border-color: var(--wp--preset--color--border);
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--text);
}

.wc-block-components-address-card {
	border-color: var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--sm);
}

/* Submit buttons. */

.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	font-size: var(--wp--preset--font-size--lg);
	width: 100%;
}

.wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button {
	color: var(--wp--preset--color--text);
}

.wc-block-checkout__terms,
.wc-block-checkout__guest-checkout-notice {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

/* The reduced checkout header. */

.hmx-header--checkout .wc-block-cart-link {
	gap: var(--wp--preset--spacing--20);
	text-decoration: none;
}
