/* Classic shortcode checkout — body.theme-checkout */

body.theme-checkout form.checkout.woocommerce-checkout {
	display: block;
}

body.theme-checkout .theme-checkout-grid {
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

body.theme-checkout .theme-checkout-form-col {
	order: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

body.theme-checkout .theme-checkout-summary-col {
	order: 2;
	min-width: 0;
	background: hsl(var(--secondary) / 0.45);
	border: 1px solid hsl(var(--border));
	border-radius: 1rem;
	padding: 2rem;
}

@media (min-width: 1024px) {
	body.theme-checkout .theme-checkout-grid {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: 4rem;
		align-items: start;
	}

	body.theme-checkout .theme-checkout-summary-col {
		order: 1;
		position: sticky;
		top: 7rem;
	}

	body.theme-checkout .theme-checkout-form-col {
		order: 2;
	}
}

body.theme-checkout .theme-checkout-section-title {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.25rem;
}

body.theme-checkout .theme-checkout-form-col .woocommerce-billing-fields,
body.theme-checkout .theme-checkout-form-col .woocommerce-shipping-fields,
body.theme-checkout .theme-checkout-form-col .woocommerce-additional-fields {
	margin-bottom: 0;
}

body.theme-checkout .woocommerce-billing-fields__field-wrapper,
body.theme-checkout .woocommerce-shipping-fields__field-wrapper,
body.theme-checkout .woocommerce-additional-fields__field-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	width: 100%;
}

body.theme-checkout #customer_details .form-row {
	margin: 0;
	padding: 0;
	float: none;
	width: auto;
}

@media (min-width: 560px) {
	body.theme-checkout .woocommerce-billing-fields__field-wrapper,
	body.theme-checkout .woocommerce-shipping-fields__field-wrapper {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 1.25rem;
		row-gap: 1.25rem;
	}

	body.theme-checkout #billing_first_name_field,
	body.theme-checkout #billing_last_name_field,
	body.theme-checkout #shipping_first_name_field,
	body.theme-checkout #shipping_last_name_field {
		grid-column: span 1;
	}

	body.theme-checkout #billing_address_1_field,
	body.theme-checkout #billing_address_2_field,
	body.theme-checkout #billing_company_field,
	body.theme-checkout #billing_country_field,
	body.theme-checkout #billing_email_field,
	body.theme-checkout #shipping_address_1_field,
	body.theme-checkout #shipping_address_2_field,
	body.theme-checkout #shipping_company_field,
	body.theme-checkout #shipping_country_field,
	body.theme-checkout #order_comments_field {
		grid-column: 1 / -1;
	}

	body.theme-checkout #billing_city_field,
	body.theme-checkout #billing_state_field,
	body.theme-checkout #shipping_city_field,
	body.theme-checkout #shipping_state_field {
		grid-column: 1 / -1;
	}

	body.theme-checkout #billing_postcode_field,
	body.theme-checkout #shipping_postcode_field {
		grid-column: 1 / 2;
	}

	body.theme-checkout #billing_phone_field {
		grid-column: 2 / 3;
	}
}

@media (min-width: 720px) {
	body.theme-checkout #billing_city_field,
	body.theme-checkout #shipping_city_field {
		grid-column: 1 / 2;
	}

	body.theme-checkout #billing_state_field,
	body.theme-checkout #shipping_state_field {
		grid-column: 2 / 3;
	}

	body.theme-checkout #billing_postcode_field,
	body.theme-checkout #shipping_postcode_field {
		grid-column: 1 / 2;
	}

	body.theme-checkout #billing_phone_field {
		grid-column: 2 / 3;
	}
}

body.theme-checkout #customer_details .form-row label {
	margin-bottom: 0.375rem;
}

body.theme-checkout .theme-checkout-summary-col #order_review_heading {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 1.25rem;
	padding: 0;
}

body.theme-checkout #customer_details {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

body.theme-checkout #customer_details .col-1,
body.theme-checkout #customer_details .col-2 {
	width: 100%;
	float: none;
}

body.theme-checkout #customer_details .woocommerce-billing-fields {
	margin-bottom: 0;
}

body.theme-checkout #billing_email_field {
	margin-bottom: 0;
}

body.theme-checkout .woocommerce-checkout-review-order-table {
	border: 0;
	border-collapse: collapse;
	width: 100%;
	table-layout: fixed;
}

body.theme-checkout .woocommerce-checkout-review-order-table thead {
	display: none;
}

body.theme-checkout .woocommerce-checkout-review-order-table .cart_item td {
	border: 0;
	padding: 0.75rem 0;
	vertical-align: top;
}

body.theme-checkout .theme-checkout-summary-line {
	display: grid;
	grid-template-columns: 5rem minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

body.theme-checkout .theme-checkout-summary-line__media {
	width: 5rem;
	height: 6rem;
	border-radius: calc(var(--radius) - 2px);
	overflow: hidden;
	background: hsl(var(--secondary));
}

body.theme-checkout .theme-checkout-summary-line__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 500;
}

body.theme-checkout .woocommerce-checkout-review-order-table td.product-name {
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 500;
}

body.theme-checkout .theme-checkout-summary-qty,
body.theme-checkout .woocommerce-checkout-review-order-table .product-quantity {
	display: block;
	margin-top: 0.125rem;
	font-size: 0.75rem;
	line-height: 1.4;
	color: hsl(var(--muted-foreground));
	font-weight: 400;
}

body.theme-checkout .woocommerce-checkout-review-order-table td.product-name,
body.theme-checkout .woocommerce-checkout-review-order-table tfoot th {
	width: auto;
	padding-right: 1rem;
}

body.theme-checkout .woocommerce-checkout-review-order-table .product-total,
body.theme-checkout .woocommerce-checkout-review-order-table tfoot td {
	width: 22%;
	min-width: 5.5rem;
	text-align: right;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
	vertical-align: top;
	padding-left: 0;
	padding-right: 0;
}

body.theme-checkout .woocommerce-checkout-review-order-table .product-total .amount,
body.theme-checkout .woocommerce-checkout-review-order-table .product-total .woocommerce-Price-amount,
body.theme-checkout .woocommerce-checkout-review-order-table tfoot td .amount,
body.theme-checkout .woocommerce-checkout-review-order-table tfoot td .woocommerce-Price-amount {
	display: inline-block;
	width: 100%;
	text-align: right;
}

body.theme-checkout .woocommerce-checkout-review-order-table .product-name .variation {
	font-size: 0.75rem;
	color: hsl(var(--muted-foreground));
	font-weight: 400;
}

body.theme-checkout .woocommerce-checkout-review-order-table tfoot th {
	text-align: left;
	font-weight: 400;
	color: hsl(var(--muted-foreground));
	border-top: 1px solid hsl(var(--border));
	padding-top: 0.75rem;
}

body.theme-checkout .woocommerce-checkout-review-order-table tfoot td {
	text-align: right;
	border-top: 1px solid hsl(var(--border));
	padding-top: 0.75rem;
}

body.theme-checkout .woocommerce-checkout-review-order-table .order-total th,
body.theme-checkout .woocommerce-checkout-review-order-table .order-total td {
	font-weight: 600;
	font-size: 1rem;
	color: hsl(var(--foreground));
}

body.theme-checkout #payment {
	background: transparent;
	border-radius: calc(var(--radius) - 2px);
	margin-top: 0.5rem;
}

body.theme-checkout #payment .form-row {
	margin-top: 1rem;
}

body.theme-checkout #payment ul.payment_methods {
	margin-bottom: 1.25rem;
}

body.theme-checkout #payment ul.payment_methods li {
	padding: 0.75rem 0;
}

body.theme-checkout #place_order {
	width: 100%;
	border-radius: 9999px !important;
	min-height: 3rem;
	font-weight: 600;
	margin-top: 1rem;
}

body.theme-checkout .woocommerce-terms-and-conditions-wrapper {
	margin-bottom: 1rem;
}

body.theme-checkout form .form-row label.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
}

/* Coupon form */
body.theme-checkout form#woocommerce-checkout-form-coupon,
body.theme-checkout .checkout_coupon.woocommerce-form-coupon {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	width: fit-content;
	max-width: 100%;
	margin: 0 0 2rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: 1rem;
	background: hsl(var(--card));
}

body.theme-checkout form#woocommerce-checkout-form-coupon .form-row,
body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row {
	margin: 0;
	padding: 0;
	float: none;
	width: auto;
	max-width: 100%;
}

body.theme-checkout form#woocommerce-checkout-form-coupon .form-row-first .input-text,
body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row-first .input-text {
	width: min(18rem, 100%);
	min-width: 12rem;
	box-sizing: border-box;
}

@media (min-width: 560px) {
	body.theme-checkout form#woocommerce-checkout-form-coupon,
	body.theme-checkout .checkout_coupon.woocommerce-form-coupon {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		justify-content: flex-start;
		gap: 0.75rem;
	}

	body.theme-checkout form#woocommerce-checkout-form-coupon .form-row-first,
	body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row-first {
		flex: 0 1 auto;
		width: auto;
		max-width: min(100%, 18rem);
	}

	body.theme-checkout form#woocommerce-checkout-form-coupon .form-row-first .input-text,
	body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row-first .input-text {
		width: 100%;
		min-width: 12rem;
	}

	body.theme-checkout form#woocommerce-checkout-form-coupon .form-row-last,
	body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row-last {
		flex: 0 0 auto;
		width: auto;
		display: flex;
		align-items: flex-end;
		justify-content: flex-start;
	}

	body.theme-checkout form#woocommerce-checkout-form-coupon .form-row-last .button,
	body.theme-checkout .checkout_coupon.woocommerce-form-coupon .form-row-last .button {
		min-height: 3rem;
		margin: 0;
		white-space: nowrap;
	}
}

/* Select2 — match text inputs */
body.theme-checkout .select2-container {
	width: 100% !important;
	max-width: 100% !important;
}

body.theme-checkout .select2-container--default .select2-selection--single {
	height: 3rem !important;
	min-height: 3rem !important;
	border: 1px solid hsl(var(--foreground) / 0.15) !important;
	border-radius: calc(var(--radius) - 2px) !important;
	background-color: hsl(var(--background)) !important;
	box-shadow: none !important;
}

body.theme-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 3rem !important;
	padding-left: 1rem !important;
	padding-right: 2rem !important;
	color: hsl(var(--foreground)) !important;
	font-family: var(--font-body) !important;
	font-size: 0.9375rem !important;
}

body.theme-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 3rem !important;
	top: 0 !important;
	right: 0.5rem !important;
}

body.theme-checkout .select2-container--default.select2-container--focus .select2-selection--single,
body.theme-checkout .select2-container--default.select2-container--open .select2-selection--single {
	border-color: hsl(var(--primary)) !important;
	box-shadow: 0 0 0 1px hsl(var(--primary)) !important;
}

body.theme-checkout #customer_details select,
body.theme-checkout .woocommerce-checkout .form-row select {
	min-height: 3rem;
	padding: 0.75rem 1rem;
	background-color: hsl(var(--background));
	border: 1px solid hsl(var(--foreground) / 0.15);
	border-radius: calc(var(--radius) - 2px);
	font-family: var(--font-body);
	font-size: 0.9375rem;
	color: hsl(var(--foreground));
	width: 100%;
}
