/**
 * Checkout Step 4: Confirmation (Thank You)
 *
 * @package Hafo\Checkout
 * @version 1.0.0
 */

.hafo-thankyou {
	--hafo-checkout-font-family: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1e315e;
	font-family: var(--hafo-checkout-font-family);
}

.hafo-thankyou--standalone {
	margin: 0 auto;
	max-width: 1280px;
	padding: 2rem 2rem 4rem;
}

/* Override checkout grid layout for confirmation step */
.hafo-multistep-checkout[data-current-step="4"] {
	max-width: 1440px;
	padding: 2rem;
}

.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-content-wrapper {
	display: block;
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
}

.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-main {
	width: 100%;
	max-width: 100%;
}

.hafo-checkout-step--confirmation {
	max-width: 100%;
	margin: 0 auto;
	width: 100%;
}

.hafo-checkout-step--confirmation .hafo-thankyou--multistep {
	margin: 0 auto;
	max-width: 100%;
}

.hafo-thankyou .hafo-checkout-progress {
	margin: 0 auto 3rem;
	width: 100%;
}

.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-progress {
	margin: 0 auto 3rem;
	width: 100%;
}

.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-progress__step.is-completed .hafo-checkout-progress__step-number,
.hafo-thankyou .hafo-checkout-progress__step.is-completed .hafo-checkout-progress__step-number {
	background-color: #22c55e;
	border-color: #22c55e;
	color: #fff;
}

.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-progress__connector.is-completed,
.hafo-thankyou .hafo-checkout-progress__connector.is-completed {
	background-color: #22c55e;
}

.hafo-thankyou__layout {
	align-items: stretch;
	background: #fff;
	border: 1px solid #d2d6df;
	border-radius: 4px;
	display: grid;
	gap: 0;
	grid-template-columns: minmax(0, 1fr) 349px;
	margin: 0 auto;
	max-width: 1060px;
	overflow: hidden;
	width: 100%;
}

.hafo-thankyou__card {
	align-items: center;
	background: #ecf3fa;
	border: 0;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 380px;
	padding: 3.5rem 3rem;
	text-align: center;
}

.hafo-thankyou__success-icon {
	align-items: center;
	background: #43ad55;
	border-radius: 50%;
	color: #fff;
	display: flex;
	font-size: 2rem;
	font-weight: 400;
	height: 4rem;
	justify-content: center;
	line-height: 1;
	margin: 0 auto 1.125rem;
	width: 4rem;
}

.hafo-thankyou__title {
	color: var(--hafo-checkout-primary);
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.15;
	margin: 0 0 1.125rem;
}

.hafo-thankyou__description {
	color: #666;
	font-size: 1.125rem;
	font-weight: 300;
	line-height: 1.5;
	margin: 0 auto 1rem;
	max-width: 520px;
}

.hafo-thankyou__order-number {
	color: #666;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.5;
	margin: 0 0 1.125rem;
}

.hafo-thankyou__order-number span {
	color: #666;
	font-weight: 600;
}

.hafo-thankyou__cta {
	margin-top: 0;
}

.hafo-thankyou__button.hafo-button {
	background-color: var(--hafo-checkout-primary);
	border-color: var(--hafo-checkout-primary);
	border-radius: 100px;
	color: #fcfcfc;
	font-size: 1rem !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	min-height: 3.25rem;
	height: 3.25rem;
	min-width: 16rem;
	padding: 0.5rem 1.5rem;
}

.hafo-thankyou__button.hafo-button:focus,
.hafo-thankyou__button.hafo-button:hover {
	background-color: var(--hafo-checkout-primary-hover);
	border-color: var(--hafo-checkout-primary-hover);
}

.hafo-thankyou__contact {
	align-self: stretch;
	border-left: 1px solid #d2d6df;
	color: #171717;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 3rem 2.5rem;
}

.hafo-thankyou__contact-title {
	color: #1e315e;
	display: block;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 1.5rem;
}

.hafo-thankyou__contact-list,
.hafo-thankyou__social {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hafo-thankyou__contact-list {
	display: grid;
	gap: 0.875rem;
}

.hafo-thankyou__contact-list li {
	align-items: flex-start;
	color: #171717;
	display: flex;
	font-size: 1rem;
	font-weight: 300;
	gap: 0.875rem;
	line-height: 1.4;
}

.hafo-thankyou__contact-list i {
	color: #1e315e;
	font-size: 1.5rem;
	min-width: 1.5rem;
	text-align: center;
	transform: translateY(2px);
}

.hafo-thankyou__contact-list a {
	color: inherit;
	text-decoration: none;
}

.hafo-thankyou__contact-list a:focus,
.hafo-thankyou__contact-list a:hover {
	text-decoration: underline;
}

.hafo-thankyou__social-title {
	color: #1e315e;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.4;
	margin: 1.5rem 0 0.75rem;
}

.hafo-thankyou__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.hafo-thankyou__social a {
	align-items: center;
	color: #dd0908;
	display: inline-flex;
	font-size: 1.25rem;
	justify-content: center;
	text-decoration: none;
	transition: color 0.2s ease-in-out;
}

.hafo-thankyou__social a:focus,
.hafo-thankyou__social a:hover {
	color: #b91c1c;
}

.hafo-thankyou__hook-output {
	margin-top: 2rem;
}

/* AWCDP partial payment details on confirmation */
.hafo-thankyou .awcdp_deposits_summary_title {
	color: var(--hafo-checkout-text);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 2rem auto 0.75rem;
	max-width: 1060px;
}

.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary {
	background: #fff;
	border: 1px solid var(--hafo-checkout-border);
	border-collapse: separate;
	border-radius: var(--hafo-checkout-radius-lg);
	border-spacing: 0;
	box-shadow: var(--hafo-checkout-shadow-sm);
	margin: 0 auto;
	max-width: 1060px;
	overflow: hidden;
	width: 100%;
}

.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary thead th {
	background: #ecf3fa;
	border: 0;
	border-bottom: 1px solid var(--hafo-checkout-border);
	color: var(--hafo-checkout-text);
	font-size: var(--hafo-checkout-font-size-sm);
	font-weight: var(--hafo-checkout-font-weight-semibold);
	line-height: 1.4;
	padding: 0.875rem 1rem;
	text-align: left;
}

.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody td {
	border: 0;
	border-bottom: 1px solid var(--hafo-checkout-border);
	color: var(--hafo-checkout-text-light);
	font-size: 0.9375rem;
	font-weight: var(--hafo-checkout-font-weight-normal);
	line-height: 1.45;
	padding: 0.875rem 1rem;
	vertical-align: middle;
}

.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody tr:last-child td {
	border-bottom: 0;
}

.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody td:nth-child(3),
.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody td:nth-child(4) {
	color: var(--hafo-checkout-text);
	font-weight: var(--hafo-checkout-font-weight-semibold);
}

.hafo-thankyou .awcdp_balance_pay {
	margin: 1rem auto 0;
	max-width: 1060px;
}

.hafo-thankyou .awcdp_balance_pay p {
	align-items: center;
	color: var(--hafo-checkout-text);
	display: flex;
	flex-wrap: wrap;
	font-size: var(--hafo-checkout-font-size-base);
	font-weight: var(--hafo-checkout-font-weight-medium);
	gap: var(--hafo-checkout-spacing-sm);
	line-height: 1.4;
	margin: 0;
}

.hafo-thankyou .awcdp_balance_pay .button {
	align-items: center;
	background-color: var(--hafo-checkout-primary);
	border: 1px solid var(--hafo-checkout-primary);
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	font-size: var(--hafo-checkout-font-size-base);
	font-weight: var(--hafo-checkout-font-weight-medium);
	justify-content: center;
	line-height: 1.2;
	min-height: 3rem;
	padding: 0.625rem 1.5rem;
	text-decoration: none;
	transition: var(--hafo-checkout-transition);
}

.hafo-thankyou .awcdp_balance_pay .button:hover,
.hafo-thankyou .awcdp_balance_pay .button:focus {
	background-color: var(--hafo-checkout-primary-hover);
	border-color: var(--hafo-checkout-primary-hover);
	color: #fff;
}

.hafo-thankyou .awcdp_balance_pay .button:focus-visible {
	outline: 2px solid var(--hafo-checkout-primary);
	outline-offset: 2px;
}

/* Safety fallback: never show order-details/customer-details blocks on confirmation */
.hafo-thankyou .woocommerce-order-overview,
.hafo-thankyou .woocommerce-order-details,
.hafo-thankyou .woocommerce-customer-details,
.hafo-thankyou .woocommerce-table--order-details {
	display: none !important;
}

.hafo-thankyou__message--error {
	background-color: #fef2f2;
	border: 1px solid var(--hafo-checkout-error);
	border-radius: var(--hafo-checkout-radius-lg);
	color: var(--hafo-checkout-text);
	padding: var(--hafo-checkout-spacing-xl);
}

.hafo-thankyou__message--error p {
	margin: 0 0 var(--hafo-checkout-spacing-md) 0;
}

.hafo-thankyou__message--error p:last-child {
	margin-bottom: 0;
}

.hafo-thankyou__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hafo-checkout-spacing-md);
	margin-top: var(--hafo-checkout-spacing-lg) !important;
}

@media (width <= 1200px) {
	.hafo-thankyou__layout {
		grid-template-columns: 1fr;
	}

	.hafo-thankyou__contact {
		border-left: 0;
		border-top: 1px solid #d2d6df;
		max-width: 100%;
		padding: 2rem 1.5rem;
	}
}

@media (width <= 1024px) {
	.hafo-multistep-checkout[data-current-step="4"] {
		padding: 1.5rem;
	}

	.hafo-thankyou--standalone {
		padding: 1.5rem 1.25rem 2.5rem;
	}

	.hafo-thankyou__card {
		padding: 2rem 1.5rem;
		min-height: 0;
	}

	.hafo-thankyou__title {
		font-size: 2rem;
	}

	.hafo-thankyou__description {
		font-size: 1rem;
	}

	.hafo-thankyou__order-number {
		font-size: 1rem;
	}

	.hafo-thankyou__button.hafo-button {
		font-size: 1rem !important;
		min-width: 0;
		width: 100%;
	}

	.hafo-thankyou__contact-title {
		font-size: 1.125rem;
	}

	.hafo-thankyou__contact-list li {
		font-size: 1rem;
	}

	.hafo-thankyou__social-title {
		font-size: 0.875rem;
	}

	.hafo-thankyou .awcdp_deposits_summary_title {
		font-size: 1.25rem;
	}
}

@media (width <= 768px) {
	.hafo-multistep-checkout[data-current-step="4"] {
		padding: 1rem;
	}

	.hafo-multistep-checkout[data-current-step="4"] .hafo-checkout-progress {
		max-width: 100%;
		padding: 0;
	}

	.hafo-thankyou .hafo-checkout-progress {
		margin-bottom: 2rem;
		max-width: 100%;
	}

	.hafo-thankyou__success-icon {
		font-size: 1.5rem;
		height: 3.5rem;
		width: 3.5rem;
	}

	.hafo-thankyou__layout {
		gap: 2rem;
	}

	.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary thead,
	.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody {
		display: table;
		min-width: 560px;
		width: 100%;
	}

	.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary thead th,
	.hafo-thankyou table.woocommerce-table.awcdp_deposits_summary tbody td {
		white-space: nowrap;
	}

	.hafo-thankyou .awcdp_balance_pay p {
		align-items: stretch;
		flex-direction: column;
	}

	.hafo-thankyou .awcdp_balance_pay .button {
		width: 100%;
	}
}
