/**
 * Thank You / Order Confirmation page styles.
 * BEM with dtec-thankyou__ prefix, using --dtec-* design tokens.
 */

/* --- Page wrapper --- */

.dtec-thankyou {
	max-width: 1100px;
	margin: var(--space-xl) auto;
	padding: 0 var(--space-m) var(--space-4xl) var(--space-m);
	font-family: var(--dtec-font-family);
	color: var(--dtec-text);
	view-transition-name: step-content;
}

/* --- Loading state --- */

.dtec-thankyou__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	gap: var(--space-m);
}

.dtec-thankyou__loading p {
	font-size: var(--text-m);
	color: var(--dtec-text-muted);
	margin: 0;
}

.dtec-thankyou__spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--dtec-border);
	border-top-color: var(--dtec-primary);
	border-radius: 50%;
	animation: dtec-spin 0.8s linear infinite;
}

@keyframes dtec-spin {
	to { transform: rotate(360deg); }
}

/* --- Error state --- */

.dtec-thankyou__error {
	text-align: center;
	padding: var(--space-4xl) var(--space-m);
}

.dtec-thankyou__error-icon {
	width: 64px;
	height: 64px;
	color: var(--dtec-error);
	margin-bottom: var(--space-m);
}

.dtec-thankyou__error h2 {
	font-size: var(--text-2xl);
	font-weight: var(--dtec-font-bold);
	color: var(--dtec-text);
	margin: 0 0 var(--space-2xs);
}

.dtec-thankyou__error p {
	font-size: var(--text-m);
	color: var(--dtec-text-muted);
	margin: 0 0 var(--space-l);
}

/* --- Hero --- */

.dtec-thankyou__hero {
	text-align: center;
	margin-bottom: var(--space-xl);
	padding-bottom: var(--space-m);
}

.dtec-thankyou__checkmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	background: var(--dtec-cta);
	border-radius: 50%;
	margin-bottom: var(--space-m);
}

.dtec-thankyou__checkmark svg {
	width: 48px;
	height: 48px;
}

/* Stroke-draw animation on the checkmark path */
.dtec-thankyou__check-path {
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
}

.dtec-thankyou__checkmark.is-visible .dtec-thankyou__check-path {
	animation: dtec-check-draw 0.4s ease 0.5s forwards;
}

.dtec-thankyou__title {
	font-size: var(--text-4xl);
	font-weight: var(--dtec-font-extrabold);
	color: var(--dtec-text);
	margin: 0 0 var(--space-2xs);
	line-height: var(--dtec-leading-tight);
}

.dtec-thankyou__order-number {
	font-size: var(--text-l);
	font-weight: var(--dtec-font-semibold);
	color: var(--dtec-primary);
	margin: 0 0 var(--space-3xs);
}

.dtec-thankyou__subtitle {
	font-size: var(--text-l);
	color: var(--dtec-text-muted);
	margin: 0;
}

/* --- Main card --- */

.dtec-thankyou__card {
	border: 2px solid var(--dtec-primary);
	border-radius: var(--dtec-radius-3xl);
	overflow: hidden;
	margin-bottom: var(--space-xl);
}

.dtec-thankyou__card-inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
	.dtec-thankyou__card-inner {
		grid-template-columns: 1fr;
	}
}

/* --- Left column: Details --- */

.dtec-thankyou__details {
	padding: var(--space-xl);
	display: flex;
	flex-direction: column;
	gap: var(--space-l);
}

/* Delivery date box (same style as checkout sidebar) */

.dtec-thankyou__delivery-date {
	background: var(--dtec-primary);
	padding: var(--space-l) var(--space-xl);
	border-radius: var(--dtec-radius-lg);
}

.dtec-thankyou__delivery-date-label {
	font-size: var(--text-m);
	font-weight: var(--dtec-font-semibold);
	color: var(--dtec-white);
	margin: 0 0 var(--space-s);
}

.dtec-thankyou__delivery-date-box {
	background: var(--dtec-primary-dark);
	border-radius: var(--dtec-radius-sm);
	padding: var(--space-m) var(--space-l);
}

.dtec-thankyou__delivery-date-value {
	font-size: 24px;
	font-weight: var(--dtec-font-semibold);
	color: var(--dtec-white);
	margin: 0;
}

/* Subscription details list */

.dtec-thankyou__subscription-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-m);
}

.dtec-thankyou__subscription-item {
	display: flex;
	align-items: baseline;
	gap: var(--space-2xs);
	padding-left: var(--space-l);
	position: relative;
	font-size: var(--text-m);
}

.dtec-thankyou__subscription-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 8px;
	height: 8px;
	background: var(--dtec-cta);
	border-radius: 50%;
}

.dtec-thankyou__subscription-label {
	font-weight: var(--dtec-font-semibold);
	color: var(--dtec-text);
	white-space: nowrap;
}

.dtec-thankyou__subscription-value {
	color: var(--dtec-text-muted-75);
}

/* What's Next */

.dtec-thankyou__next {
	border-top: 1px solid var(--dtec-border);
	padding-top: var(--space-l);
}

.dtec-thankyou__next-title {
	font-size: var(--text-xl);
	font-weight: var(--dtec-font-bold);
	color: var(--dtec-text);
	margin: 0 0 var(--space-s);
}

.dtec-thankyou__next-text {
	font-size: var(--text-m);
	color: var(--dtec-text-muted-75);
	line-height: var(--dtec-leading-relaxed);
	margin: 0;
}

/* --- Right column: Order summary --- */

.dtec-thankyou__summary {
	background: var(--dtec-white);
	padding: var(--space-xl);
	border-left: 1px solid var(--dtec-border);
}

@media (max-width: 768px) {
	.dtec-thankyou__summary {
		border-left: none;
		border-top: 1px solid var(--dtec-border);
	}
}

.dtec-thankyou__summary-header {
	margin-bottom: var(--space-l);
	padding-bottom: var(--space-m);
	border-bottom: 1px solid var(--dtec-border);
}

.dtec-thankyou__summary-title {
	font-size: var(--text-2xl);
	font-weight: var(--dtec-font-bold);
	color: var(--dtec-text);
	margin: 0 0 var(--space-3xs);
}

.dtec-thankyou__summary-order-num {
	font-size: var(--text-s);
	color: var(--dtec-text-muted);
	margin: 0;
}

/* Section headers (MEALS x 6, ADD-ONS x 2) */

.dtec-thankyou__summary-section {
	margin-bottom: var(--space-m);
}

.dtec-thankyou__summary-section-header {
	font-size: var(--text-s);
	font-weight: var(--dtec-font-bold);
	color: var(--dtec-primary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 var(--space-s);
}

/* Item rows */

.dtec-thankyou__summary-items {
	display: flex;
	flex-direction: column;
	gap: var(--space-3xs);
}

.dtec-thankyou__summary-item {
	display: flex;
	align-items: baseline;
	gap: 0.25em;
	padding: var(--space-3xs) 0;
	font-size: var(--text-m);
}

.dtec-thankyou__summary-item-qty {
	color: var(--dtec-primary);
	font-weight: var(--dtec-font-semibold);
}

.dtec-thankyou__summary-item-name {
	color: var(--dtec-text-muted-75);
	flex: 1;
}

/* Divider */

.dtec-thankyou__summary-divider {
	border-top: 1px solid var(--dtec-border);
	margin: var(--space-m) 0;
}

/* Pricing rows */

.dtec-thankyou__summary-pricing {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
}

.dtec-thankyou__summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--text-m);
	font-weight: var(--dtec-font-semibold);
	color: var(--dtec-text);
}

.dtec-thankyou__summary-row span:last-child {
	text-align: right;
	white-space: nowrap;
}

.dtec-thankyou__summary-row--subtotal {
	text-transform: uppercase;
}

.dtec-thankyou__summary-row--discount {
	color: var(--dtec-primary);
}

.dtec-thankyou__summary-row--tax {
	color: var(--dtec-text-muted-75);
	font-weight: var(--dtec-font-normal);
}

.dtec-thankyou__summary-row--tax span:last-child {
	color: var(--dtec-text);
	font-weight: var(--dtec-font-semibold);
}

.dtec-thankyou__summary-row--delivery {
	color: var(--dtec-text-muted-75);
	font-weight: var(--dtec-font-normal);
}

.dtec-thankyou__summary-row--delivery span:last-child {
	color: var(--dtec-primary-dark);
	font-weight: var(--dtec-font-semibold);
}

.dtec-thankyou__summary-row--total {
	padding-top: var(--space-s);
	margin-top: var(--space-2xs);
	border-top: 1px solid var(--dtec-border);
	font-size: var(--text-2xl);
	font-weight: var(--dtec-font-bold);
}

.dtec-thankyou__summary-row--total span:last-child {
	color: var(--dtec-cta);
}

/* --- Action buttons --- */

.dtec-thankyou__actions {
	display: flex;
	justify-content: center;
	gap: var(--space-m);
	flex-wrap: wrap;
}

.dtec-thankyou__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 220px;
	padding: var(--space-m) var(--space-l);
	font-family: var(--dtec-font-family);
	font-size: var(--text-m);
	font-weight: var(--dtec-font-semibold);
	text-decoration: none;
	border-radius: var(--dtec-radius-md);
	cursor: pointer;
	transition: background var(--dtec-duration-fast) var(--dtec-ease-default),
	            color var(--dtec-duration-fast) var(--dtec-ease-default),
	            transform var(--dtec-duration-fast) var(--dtec-ease-default);
}

.dtec-thankyou__btn:hover {
	transform: translateY(-1px);
}

.dtec-thankyou__btn--primary {
	background: var(--dtec-primary);
	color: var(--dtec-white);
	border: 2px solid var(--dtec-primary);
}

.dtec-thankyou__btn--primary:hover {
	background: var(--dtec-primary-dark);
	border-color: var(--dtec-primary-dark);
	color: var(--dtec-white);
}

.dtec-thankyou__btn--outline {
	background: transparent;
	color: var(--dtec-primary);
	border: 2px solid var(--dtec-primary);
}

.dtec-thankyou__btn--outline:hover {
	background: var(--dtec-primary-light);
	color: var(--dtec-primary-dark);
}

/* --- Responsive --- */

@media (max-width: 768px) {
	.dtec-thankyou__details {
		padding: var(--space-l);
	}

	.dtec-thankyou__delivery-date {
		padding: var(--space-l) var(--space-l);
	}

	.dtec-thankyou__summary {
		padding: var(--space-l);
	}

	.dtec-thankyou__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.dtec-thankyou__btn {
		min-width: auto;
	}
}

/* Checkmark stroke draw */
@keyframes dtec-check-draw {
	to { stroke-dashoffset: 0; }
}

/* Entrance animations use shared .dtec-animate utility classes from animations.css */
