/**
 * WooCommerce block Cart/Checkout presentation.
 *
 * This stylesheet deliberately changes presentation only. The Ship and Pickup
 * labels remain rendered by WooCommerce, so the Local pickup Title setting is
 * always the source of the customer-facing pickup label.
 */

/* One base scale for WooCommerce form controls. These tokens intentionally
 * stay close to WooCommerce defaults while neutralizing the theme's larger
 * desktop button type inside forms. WooCommerce retains responsibility for
 * floating-label positioning and active-field padding. */
:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) {
	--swf-wc-control-font-size: 1.125rem;
	--swf-wc-control-height: 3.375rem;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) :is(
	.wc-block-components-text-input input,
	.wc-block-components-select-input select,
	.wc-block-components-combobox-control input,
	.wc-block-components-totals-coupon__button
),
:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) .wc-block-components-form .wc-block-components-text-input input[type] {
	box-sizing: border-box;
	font-size: var(--swf-wc-control-font-size);
	height: var(--swf-wc-control-height);
	line-height: 1.25;
	min-height: var(--swf-wc-control-height);
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) :is(
	.wc-block-components-textarea,
	.wc-block-components-text-input input::placeholder,
	.wc-block-components-textarea::placeholder,
	.wc-block-components-combobox-control input::placeholder
) {
	font-size: var(--swf-wc-control-font-size);
	line-height: 1.25;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) .wc-block-components-totals-coupon__button {
	margin-block: 0;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-container {
	align-items: stretch;
	background: transparent;
	gap: 0.5rem;
	padding: 0;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option {
	align-items: center;
	background: #fff;
	border: 2px solid #a6a6a6;
	border-radius: 8px;
	column-gap: 0.75rem;
	flex-wrap: nowrap;
	justify-content: flex-start;
	min-height: 72px;
	padding: 1rem 1.25rem;
	text-align: left;
}

/* The second control is WooCommerce's Local Pickup delivery mode. Its label is
 * intentionally untouched so it continues to use the saved WC setting. */
.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option:nth-child(2) {
	background: #eef6e7;
	border-color: #2f6b3b;
	color: #153f22;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option::before {
	align-items: center;
	background: #fff;
	border: 2px solid currentColor;
	border-radius: 50%;
	box-sizing: border-box;
	color: #fff;
	content: "";
	display: inline-flex;
	flex: 0 0 24px;
	font-family: Arial, sans-serif;
	font-size: 15px;
	font-weight: 700;
	height: 24px;
	justify-content: center;
	line-height: 1;
	width: 24px;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option.wc-block-checkout__shipping-method-option--selected {
	background: #fff;
	border-color: #2e2e2e;
	box-shadow: inset 0 0 0 1px #2e2e2e;
	color: #2e2e2e;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option.wc-block-checkout__shipping-method-option--selected::before {
	background: #2e2e2e;
	border-color: #2e2e2e;
	content: "\2713";
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option-title-wrapper {
	align-items: center;
	gap: 0.625rem;
	justify-content: flex-start;
	min-width: 0;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option-icon {
	flex: 0 0 auto;
	height: 28px;
	width: 28px;
}

.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option-title {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
}

/* Preserve an obvious keyboard focus treatment independently of selection. */
.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option:focus-visible,
.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option:focus-within {
	outline: 3px solid #2f6b3b;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-container {
		flex-direction: column;
	}

	.wp-block-woocommerce-checkout .wc-block-checkout__shipping-method-option {
		flex-basis: auto;
		width: 100%;
	}
}
