/**
 * Cart and checkout-facing refinements.
 */

.linkco-storefront.woocommerce-checkout .main-page-wrapper,
.linkco-storefront.woocommerce-cart .main-page-wrapper {
	background: linear-gradient(180deg, var(--linkco-surface-soft), #fff 420px);
}

.linkco-checkout-progress {
	margin-block: 0 34px;
	padding: 18px 22px;
	border: 1px solid var(--linkco-border);
	border-radius: var(--linkco-radius-md);
	background: #fff;
	box-shadow: 0 12px 32px rgba(23, 33, 43, 0.05);
}

.linkco-checkout-progress ol {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.linkco-checkout-progress li {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	color: var(--linkco-muted);
	font-size: 13px;
	font-weight: 700;
}

.linkco-checkout-progress li:not(:last-child)::after {
	position: absolute;
	inset-inline-end: calc(50% + 62px);
	width: calc(100% - 124px);
	height: 1px;
	background: var(--linkco-border);
	content: "";
}

.linkco-checkout-progress li span {
	display: grid;
	width: 30px;
	aspect-ratio: 1;
	place-items: center;
	border: 1px solid var(--linkco-border);
	border-radius: 50%;
	background: #fff;
	font-size: 11px;
}

.linkco-checkout-progress li.is-active {
	color: var(--linkco-ink);
}

.linkco-checkout-progress li.is-active span {
	border-color: var(--linkco-accent);
	background: var(--linkco-accent);
	color: #fff;
}

.linkco-storefront .woocommerce-checkout .customer-details,
.linkco-storefront .woocommerce-checkout .checkout-order-review,
.linkco-storefront .cart-content-wrapper .cart-table-section,
.linkco-storefront .cart-content-wrapper .cart-totals-section {
	padding: clamp(20px, 3vw, 34px);
	border: 1px solid var(--linkco-border);
	border-radius: var(--linkco-radius-md);
	background: #fff;
	box-shadow: 0 14px 38px rgba(23, 33, 43, 0.05);
}

.linkco-storefront .woocommerce-checkout h3,
.linkco-storefront .cart-totals-inner h2 {
	margin-block-start: 0;
	color: var(--linkco-ink);
	font-size: clamp(20px, 2vw, 26px);
}

.linkco-storefront .woocommerce form .form-row label {
	margin-block-end: 7px;
	color: var(--linkco-ink);
	font-size: 13px;
	font-weight: 700;
}

.linkco-storefront .woocommerce form .form-row .required {
	color: #b42318;
}

.linkco-storefront .woocommerce :where(input.input-text, textarea, select),
.linkco-storefront .select2-container--default .select2-selection--single {
	min-height: 48px;
	border-color: var(--linkco-border);
	border-radius: 9px;
	background-color: #fff;
}

.linkco-storefront .woocommerce textarea {
	min-height: 120px;
	padding-block: 12px;
}

.linkco-storefront .woocommerce :where(input.input-text, textarea, select):focus,
.linkco-storefront .select2-container--focus .select2-selection--single {
	border-color: var(--linkco-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--linkco-accent) 12%, transparent);
}

.linkco-storefront .woocommerce-checkout-review-order-table {
	border: 0;
}

.linkco-storefront .woocommerce-checkout-review-order-table :where(th, td) {
	padding-block: 14px;
	border-color: var(--linkco-border);
}

.linkco-storefront .woocommerce-checkout-payment {
	border-radius: var(--linkco-radius-sm);
	background: var(--linkco-surface-soft);
}

.linkco-storefront #place_order,
.linkco-storefront .checkout-button {
	min-height: 52px;
	border-radius: var(--linkco-radius-sm);
	background: var(--linkco-accent);
	box-shadow: 0 12px 28px color-mix(in srgb, var(--linkco-accent) 22%, transparent);
	font-weight: 800;
}

.linkco-checkout-reassurance {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-block: 16px;
	padding: 12px 14px;
	border: 1px solid color-mix(in srgb, var(--linkco-success) 24%, var(--linkco-border));
	border-radius: 8px;
	background: color-mix(in srgb, var(--linkco-success) 6%, white);
	color: #375146;
	font-size: 12px;
	line-height: 1.75;
}

.linkco-checkout-reassurance span {
	display: grid;
	width: 20px;
	min-width: 20px;
	aspect-ratio: 1;
	place-items: center;
	border-radius: 50%;
	background: var(--linkco-success);
	color: #fff;
	font-size: 11px;
}

.linkco-storefront .woocommerce-error,
.linkco-storefront .woocommerce-info,
.linkco-storefront .woocommerce-message {
	border-radius: var(--linkco-radius-sm);
}

/* WooCommerce Blocks checkout uses its own markup instead of classic hooks. */
.linkco-storefront .wc-block-checkout__main,
.linkco-storefront .wc-block-checkout__sidebar,
.linkco-storefront .wc-block-cart__main,
.linkco-storefront .wc-block-cart__sidebar {
	padding: clamp(18px, 2.5vw, 30px);
	border: 1px solid var(--linkco-border);
	border-radius: var(--linkco-radius-md);
	background: #fff;
	box-shadow: 0 14px 38px rgba(23, 33, 43, 0.05);
}

.linkco-storefront .wc-block-components-checkout-step {
	padding-block: 22px;
	border-bottom: 1px solid var(--linkco-border);
}

.linkco-storefront .wc-block-components-checkout-step:last-child {
	border-bottom: 0;
}

.linkco-storefront .wc-block-components-checkout-step__heading h2,
.linkco-storefront .wc-block-components-title {
	color: var(--linkco-ink);
	font-size: clamp(18px, 2vw, 23px);
}

.linkco-storefront .wc-block-components-text-input input,
.linkco-storefront .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input {
	min-height: 50px;
	border-color: var(--linkco-border);
	border-radius: 9px;
}

.linkco-storefront .wc-block-components-button:not(.is-link) {
	min-height: 52px;
	border-radius: var(--linkco-radius-sm);
}

@media (max-width: 767px) {
	.linkco-checkout-progress {
		overflow-x: auto;
		padding-inline: 14px;
	}

	.linkco-checkout-progress ol {
		min-width: 520px;
	}

	.linkco-storefront .woocommerce-checkout .customer-details,
	.linkco-storefront .woocommerce-checkout .checkout-order-review,
	.linkco-storefront .cart-content-wrapper .cart-table-section,
	.linkco-storefront .cart-content-wrapper .cart-totals-section,
	.linkco-storefront .wc-block-checkout__main,
	.linkco-storefront .wc-block-checkout__sidebar,
	.linkco-storefront .wc-block-cart__main,
	.linkco-storefront .wc-block-cart__sidebar {
		padding: 18px;
	}
}
