/**
 * Available coupon code list — cart and checkout.
 */

.altctrl-coupon-section {
	position: relative;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e8edf3;
}

.altctrl-coupon-section__title {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #0f172a;
}

.altctrl-coupon-applied-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	width: 100%;
	margin-top: 0.75rem;
}

.altctrl-coupon-applied {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
}

.altctrl-coupon-applied__status {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: 0.625rem;
	min-width: 0;
	padding: 0.625rem 0.875rem;
	border: 1px solid #bbf7d0;
	border-radius: 0.5rem;
	background: #ecfdf3;
}

.altctrl-coupon-applied__text {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	color: #166534;
}

.altctrl-coupon-applied__icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
}

.altctrl-coupon-applied__remove,
.altctrl-coupon-applied__remove.button,
body.altctrl-cart-page .altctrl-coupon-applied__remove,
body.woocommerce-checkout .altctrl-coupon-applied__remove {
	flex: 0 0 auto;
	width: auto !important;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	color: #0066cc !important;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: none !important;
}

.altctrl-coupon-applied__remove:hover,
.altctrl-coupon-applied__remove:focus {
	color: #0052cc;
	background: transparent;
	text-decoration: underline;
	outline: none;
}

.altctrl-coupon-applied__remove:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	text-decoration: none;
}

.altctrl-coupon-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

.altctrl-coupon-field .input-text,
.altctrl-coupon-field input[name="coupon_code"] {
	width: 100%;
}

.altctrl-coupon-field.is-invalid .input-text,
.altctrl-coupon-field .input-text.is-invalid,
.altctrl-checkout-coupon-form .form-row.is-invalid .input-text {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 1px #dc2626;
	background: #fef2f2;
}

.altctrl-coupon-field__error {
	display: block;
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	color: #dc2626;
}

.altctrl-coupon-list-wrap {
	width: 100%;
	flex: 0 0 100%;
	margin-top: 0.625rem;
}

.altctrl-coupon-list__title {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #64748b;
}

.altctrl-coupon-list__items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.altctrl-coupon-list--collapsible:not(.is-expanded) .altctrl-coupon-list__item-wrap--overflow {
	display: none;
}

.altctrl-coupon-list__view-all {
	display: inline-flex;
	align-items: center;
	margin: 0.5rem 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0066cc;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
}

.altctrl-coupon-list__view-all:hover,
.altctrl-coupon-list__view-all:focus {
	color: #0052cc;
	text-decoration: underline;
	outline: none;
}

.altctrl-coupon-list__item {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.125rem;
	max-width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px dashed #0066cc;
	border-radius: 0.5rem;
	background: #f0f7ff;
	color: #0f172a;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.altctrl-coupon-list__item:hover,
.altctrl-coupon-list__item:focus {
	background: #e0efff;
	border-color: #0052cc;
	outline: none;
}

.altctrl-coupon-list__item:active {
	transform: translateY(1px);
}

.altctrl-coupon-list__code {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #0066cc;
}

.altctrl-coupon-list__desc {
	font-size: 0.75rem;
	line-height: 1.3;
	color: #64748b;
}

.woocommerce-checkout .altctrl-price-details .altctrl-coupon-section {
	margin-top: 0.875rem;
	padding-top: 0.875rem;
	border-top: 1px solid #e5e7eb;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 0;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .form-row-first,
.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .form-row-last {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .form-row-first {
	flex: 1 1 12rem;
	min-width: 0;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .form-row-last {
	flex: 0 0 auto;
	display: flex;
	align-items: stretch;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .form-row-last .button {
	white-space: nowrap;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .clear {
	display: none;
}

.woocommerce-checkout .altctrl-price-details .altctrl-checkout-coupon-form .altctrl-coupon-list-wrap {
	flex: 0 0 100%;
	width: 100%;
	margin-top: 0;
}

.woocommerce-checkout .altctrl-checkout-coupon-form .altctrl-coupon-list-wrap {
	flex: 0 0 100%;
	width: 100%;
	order: 3;
	margin-top: 0;
}

body.altctrl-cart-page .altctrl-cart-summary .altctrl-coupon-section {
	margin-top: 0.875rem;
	padding-top: 0.875rem;
	border-top: 1px solid var(--altctrl-cart-border, #e8edf3);
}

body.altctrl-cart-page .altctrl-cart-coupon,
body.altctrl-cart-page .altctrl-cart-coupon-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.75rem;
	align-items: start;
}

body.altctrl-cart-page .altctrl-cart-coupon > label,
body.altctrl-cart-page .altctrl-cart-coupon-form > label {
	display: none;
}

body.altctrl-cart-page .altctrl-cart-coupon .altctrl-coupon-field,
body.altctrl-cart-page .altctrl-cart-coupon-form .altctrl-coupon-field,
body.altctrl-cart-page .altctrl-cart-coupon #altctrl_cart_coupon_code,
body.altctrl-cart-page .altctrl-cart-coupon-form #altctrl_cart_coupon_code,
body.altctrl-cart-page .altctrl-cart-coupon #coupon_code,
body.altctrl-cart-page .altctrl-cart-coupon-form #coupon_code {
	grid-column: 1;
	grid-row: 1;
}

body.altctrl-cart-page .altctrl-cart-coupon .altctrl-coupon-list-wrap,
body.altctrl-cart-page .altctrl-cart-coupon-form .altctrl-coupon-list-wrap {
	grid-column: 1 / -1;
	grid-row: 2;
	margin-top: 0;
}

body.altctrl-cart-page .altctrl-cart-coupon [name="apply_coupon"],
body.altctrl-cart-page .altctrl-cart-coupon-form [name="apply_coupon"] {
	grid-column: 2;
	grid-row: 1;
	align-self: stretch;
}

/* Coupon applied celebration popup */
.altctrl-coupon-celebration {
	position: fixed;
	z-index: 10050;
	box-sizing: border-box;
	padding: 1.35rem 1.1rem 1rem;
	border: 1px solid #e8edf3;
	border-radius: 1rem;
	background: #fff;
	box-shadow:
		0 18px 40px rgba(15, 23, 42, 0.14),
		0 4px 12px rgba(15, 23, 42, 0.08);
	text-align: center;
	pointer-events: auto;
	opacity: 0;
	transform: translate(-50%, -48%) scale(0.92);
	transition:
		opacity 0.28s ease,
		transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: visible;
}

.altctrl-coupon-celebration.is-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.altctrl-coupon-celebration.is-leaving {
	opacity: 0;
	transform: translate(-50%, -46%) scale(0.96);
}

.altctrl-coupon-celebration__close {
	position: absolute;
	top: 0.45rem;
	right: 0.55rem;
	width: 1.75rem;
	height: 1.75rem;
	border: 0;
	border-radius: 999rem;
	background: transparent;
	color: #94a3b8;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.altctrl-coupon-celebration__close:hover,
.altctrl-coupon-celebration__close:focus {
	color: #64748b;
	outline: none;
}

.altctrl-coupon-celebration__confetti {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.altctrl-coupon-celebration__particle {
	position: absolute;
	left: var(--ac-left);
	top: 38%;
	width: var(--ac-size);
	height: var(--ac-size);
	border-radius: var(--ac-radius);
	background: var(--ac-color);
	opacity: 0;
	transform: translateY(0) rotate(var(--ac-rotate));
	animation: altctrlCouponConfetti 1.35s ease-out var(--ac-delay) forwards;
}

@keyframes altctrlCouponConfetti {
	0% {
		opacity: 0;
		transform: translate3d(0, 0, 0) rotate(var(--ac-rotate));
	}

	12% {
		opacity: 1;
	}

	100% {
		opacity: 0;
		transform: translate3d(calc(var(--ac-left) - 50%), -72px, 0) rotate(calc(var(--ac-rotate) + 180deg));
	}
}

.altctrl-coupon-celebration__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	margin: 0 auto 0.65rem;
	border-radius: 999rem;
	background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
	color: #fff;
	box-shadow: 0 8px 18px rgba(34, 197, 94, 0.35);
}

.altctrl-coupon-celebration__title {
	margin: 0 0 0.35rem;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
	color: #16a34a;
}

.altctrl-coupon-celebration__code {
	margin: 0 0 0.25rem;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #0f172a;
}

.altctrl-coupon-celebration__savings {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: #334155;
}

.altctrl-coupon-celebration__poppers {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.15rem;
	height: 2.75rem;
	pointer-events: none;
}

.altctrl-coupon-celebration__popper {
	position: absolute;
	bottom: 0;
	display: inline-flex;
	opacity: 0.95;
	animation: altctrlCouponPopper 0.8s ease-out both;
}

.altctrl-coupon-celebration__popper--left {
	left: 0.35rem;
	transform: scaleX(-1);
	animation-delay: 0.05s;
}

.altctrl-coupon-celebration__popper--right {
	right: 0.35rem;
	animation-delay: 0.12s;
}

@keyframes altctrlCouponPopper {
	0% {
		opacity: 0;
		transform: translateY(8px) scale(0.8);
	}

	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 767px) {
	.altctrl-coupon-celebration {
		max-width: calc(100vw - 2rem);
		padding-top: 1.2rem;
	}

	.altctrl-coupon-celebration__title {
		font-size: 1.05rem;
	}
}
