/* Order actions — modal, stepper, timeline */

body.altctrl-modal-open,
html.altctrl-modal-open {
	overflow: hidden;
	height: 100%;
}

.altctrl-order-hub {
	margin: 0 0 24px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid #eaecf0;
	border-radius: 12px;
}

.altctrl-order-timeline {
	--timeline-dot-size: 18px;
	--timeline-line-height: 3px;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid #eaecf0;
}

.altctrl-order-timeline__track {
	position: relative;
}

.altctrl-order-timeline__line {
	position: absolute;
	top: calc(var(--timeline-dot-size) / 2);
	left: 10%;
	right: 10%;
	height: var(--timeline-line-height);
	background: #e4e7ec;
	border-radius: 999px;
	overflow: hidden;
	z-index: 0;
	transform: translateY(-50%);
}

.altctrl-order-timeline__line-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, #0052cc 0%, #0066ff 55%, #3b82f6 100%);
	animation: altctrl-timeline-progress 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes altctrl-timeline-progress {
	from {
		width: 0;
	}

	to {
		width: var(--timeline-progress, 0%);
	}
}

.altctrl-order-timeline__steps {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

.altctrl-order-timeline__step {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	min-width: 0;
	text-align: center;
}

.altctrl-order-timeline__dot {
	position: relative;
	z-index: 1;
	width: var(--timeline-dot-size);
	height: var(--timeline-dot-size);
	box-sizing: border-box;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d0d5dd;
	box-shadow: 0 0 0 2px #fff;
	flex-shrink: 0;
	transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.altctrl-order-timeline__step--done .altctrl-order-timeline__dot::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4px;
	height: 7px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: translate(-55%, -60%) rotate(45deg);
}

.altctrl-order-timeline__step--done .altctrl-order-timeline__dot {
	background: #0066cc;
	border-color: #0066cc;
}

.altctrl-order-timeline__step--current .altctrl-order-timeline__dot {
	background: #0066cc;
	border-color: #0066cc;
	box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.18), 0 0 0 2px #fff;
	animation: altctrl-timeline-pulse 2s ease-in-out infinite;
}

@keyframes altctrl-timeline-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.18), 0 0 0 2px #fff;
	}

	50% {
		box-shadow: 0 0 0 7px rgba(0, 102, 204, 0.1), 0 0 0 2px #fff;
	}
}

.altctrl-order-timeline__label {
	font-size: 0.8125rem;
	color: #667085;
	line-height: 1.3;
}

.altctrl-order-timeline__step--done .altctrl-order-timeline__label {
	color: #344054;
}

.altctrl-order-timeline__step--current .altctrl-order-timeline__label {
	color: #101828;
	font-weight: 600;
}

.altctrl-order-timeline--cancelled .altctrl-order-timeline__line-fill {
	background: linear-gradient(90deg, #0066cc 0%, #b42318 100%);
}

.altctrl-order-timeline__step--cancelled .altctrl-order-timeline__dot {
	background: #b42318;
	border-color: #b42318;
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.16), 0 0 0 2px #fff;
	animation: none;
}

.altctrl-order-timeline__step--cancelled .altctrl-order-timeline__dot::after {
	content: "×";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -54%);
	color: #fff;
	font-size: 11px;
	line-height: 1;
	font-weight: 700;
	border: 0;
	width: auto;
	height: auto;
}

.altctrl-order-timeline__step--cancelled .altctrl-order-timeline__label {
	color: #b42318;
	font-weight: 600;
}

.altctrl-order-hub__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.altctrl-order-hub__btn {
	min-height: 40px !important;
	padding: 8px 20px !important;
	border-radius: 8px !important;
}

.altctrl-order-hub__btn--cancel {
	background: #fff !important;
	color: #b42318 !important;
	border: 1px solid #f04438 !important;
}

.altctrl-order-hub__btn--secondary {
	background: #fff !important;
	color: #0066cc !important;
	border: 1px solid #0066cc !important;
}

.altctrl-order-hub__policy {
	margin: 12px 0 0;
	font-size: 0.875rem;
}

.altctrl-order-hub__policy a {
	color: #0066cc;
}

/* Modal */
.altctrl-order-modal {
	--altctrl-modal-offset-top: 140px;
	--altctrl-modal-gap-bottom: 20px;
	position: fixed;
	inset: 0;
	z-index: 1000001;
	overflow: hidden;
}

.altctrl-order-modal[hidden] {
	display: none !important;
}

.altctrl-order-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 24, 40, 0.55);
}

.altctrl-order-modal__dialog {
	position: fixed;
	top: var(--altctrl-modal-offset-top);
	left: 50%;
	transform: translateX(-50%);
	width: min(calc(100% - 32px), 760px);
	max-height: calc(100vh - var(--altctrl-modal-offset-top) - var(--altctrl-modal-gap-bottom));
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(16, 24, 40, 0.18);
	overflow: hidden;
	z-index: 1;
}

.altctrl-order-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0;
	background: #f2f4f7;
	border-radius: 50%;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	color: #344054;
}

.altctrl-order-modal__body {
	padding: 48px 24px 20px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.altctrl-order-modal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	flex: 0 0 auto;
	padding: 16px 24px 20px;
	border-top: 1px solid #eaecf0;
	background: #fafafa;
}

.altctrl-modal-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 600;
	color: #101828;
}

.altctrl-modal-subtitle {
	margin: 0 0 16px;
	color: #667085;
	font-size: 0.9375rem;
}

.altctrl-modal-error {
	margin-bottom: 14px;
	padding: 10px 12px;
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-radius: 8px;
	color: #b42318;
	font-size: 0.875rem;
}

.altctrl-reason-list,
.altctrl-item-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.altctrl-reason-option,
.altctrl-item-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #eaecf0;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.altctrl-reason-option {
	position: relative;
	gap: 0;
}

.altctrl-reason-option input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.altctrl-reason-option span {
	flex: 1 1 auto;
	font-size: 0.9375rem;
	color: #344054;
	line-height: 1.4;
}

.altctrl-reason-option.is-selected,
.altctrl-reason-option:has(input:checked) {
	border-color: #0066cc;
	background: #f0f7ff;
	box-shadow: 0 0 0 1px rgba(0, 102, 204, 0.1);
}

.altctrl-reason-option.is-selected span,
.altctrl-reason-option:has(input:checked) span {
	color: #004a99;
	font-weight: 500;
}

.altctrl-reason-option:not(.is-selected):not(:has(input:checked)):hover,
.altctrl-item-row:hover {
	border-color: #0066cc;
	background: #f9fafb;
}

.altctrl-item-row.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.altctrl-item-row img {
	border-radius: 8px;
	object-fit: cover;
}

.altctrl-item-row__name {
	flex: 1 1 auto;
	font-size: 0.9375rem;
}

.altctrl-item-row__qty {
	width: 64px;
}

.altctrl-other-text {
	width: 100%;
	margin-top: 12px;
	padding: 12px 14px;
	border: 1px solid #eaecf0;
	border-radius: 10px;
	font: inherit;
	line-height: 1.5;
	color: #101828;
	resize: vertical;
	min-height: 88px;
	box-sizing: border-box;
}

.altctrl-other-text:focus {
	outline: none;
	border-color: #0066cc;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

.altctrl-upload-label input {
	width: 100%;
	margin-top: 12px;
}

.altctrl-upload-label {
	display: block;
	margin-bottom: 12px;
	padding: 14px;
	border: 1px dashed #98a2b3;
	border-radius: 10px;
	text-align: center;
	font-size: 0.875rem;
	color: #344054;
	cursor: pointer;
}

.altctrl-upload-count {
	font-size: 0.8125rem;
	color: #667085;
}

.altctrl-review-card,
.altctrl-review-grid {
	padding: 14px 16px;
	background: #f9fafb;
	border: 1px solid #eaecf0;
	border-radius: 10px;
	margin-top: 12px;
}

.altctrl-review-grid {
	display: grid;
	gap: 12px;
}

.altctrl-review-grid span {
	display: block;
	font-size: 0.75rem;
	color: #667085;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.altctrl-review-grid .altctrl-price-html .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.altctrl-modal-order-num {
	font-weight: 600;
	margin-bottom: 12px;
}

.altctrl-success {
	text-align: center;
	padding: 12px 0 8px;
}

.altctrl-success__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: #ecfdf3;
	color: #027a48;
	font-size: 1.75rem;
	line-height: 56px;
}

@media (max-width: 640px) {
	.altctrl-order-modal {
		--altctrl-modal-gap-bottom: 16px;
	}

	.altctrl-order-modal__dialog {
		width: 95%;
		max-height: calc(100vh - var(--altctrl-modal-offset-top) - var(--altctrl-modal-gap-bottom));
		border-radius: 16px;
	}

	.altctrl-order-timeline__track {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.altctrl-order-timeline__steps {
		min-width: 34rem;
	}

	.altctrl-order-timeline__label {
		font-size: 0.75rem;
	}
}
