.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	z-index: 900;
	display: none;
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	padding: 20px 0;
}
.modal-overlay.open {
	display: flex;
}

.modal {
	width: 500px;
	max-width: calc(100vw - 30px);
	border-radius: 38px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: radial-gradient(#272727 0%, #161616 97%);
	overflow: hidden;
	display: none;
	margin: auto 0;
	flex-shrink: 0;
}
.modal.active {
	display: block;
}

/* ========== Step 1: Purchase Form ========== */

.modal__header {
	height: 115px;
	border-radius: 28px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	margin: 15px;
	margin-bottom: 8px;
	padding: 35px 46px;
	position: relative;
	background: url('/assets/images/modal/header-bg.png') no-repeat center;
	background-size: cover;
	overflow: hidden;
}
.modal__header-label {
	font-size: 14px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.6);
	letter-spacing: -0.28px;
	line-height: 1;
}
.modal__header-name {
	font-size: 25px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.5px;
	margin-top: 1px;
	line-height: 30px;
}
.modal__close {
	position: absolute;
	top: 11px;
	right: 11px;
	width: 30px;
	height: 30px;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}
.modal__close img {
	width: 30px;
	height: 30px;
}

.modal__body {
	margin: 0 15px 15px;
	padding: 26px;
	background: #212020;
	border-radius: 28px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	position: relative;
	overflow: hidden;
}

.modal__input {
	width: 100%;
	height: 61px;
	background: #2c2c2c;
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0 20px;
	font-family: 'Inter', sans-serif;
	font-size: 17px;
	font-weight: 700;
	color: #ffffff;
	text-align: center;
	outline: none;
	transition: border-color 0.2s;
}
.modal__input::placeholder {
	color: #757575;
	font-weight: 700;
}
.modal__input:focus {
	border-color: rgba(255, 255, 255, 0.25);
}
.modal__input + .modal__input {
	margin-top: 10px;
}

.modal__discount {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0;
	margin-top: 20px;
	border-top: 1px solid #2f2f2f;
	border-bottom: 1px solid #2f2f2f;
}
.modal__discount.visible {
	display: flex;
}
.modal__discount-left {
	display: flex;
	align-items: center;
	gap: 8px;
}
.modal__discount-percent {
	color: #e76c03;
	font-size: 16px;
	font-weight: 700;
}
.modal__discount-text {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
}
.modal__discount-value {
	font-size: 16px;
	font-weight: 700;
	color: #e76c03;
}

.modal__bottom {
	display: flex;
	align-items: center;
	margin-top: 16px;
	height: 70px;
	background: #242424;
	border-radius: 20px;
	overflow: hidden;
}
.modal__total {
	display: flex;
	flex-direction: column;
	gap: 2px;
	/* padding-left: 34px; */
	min-width: 150px;
	align-items: center;
}
.modal__total-label {
	font-size: 12px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -0.6px;
}
.modal__total-price {
	font-size: 18.6px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -0.6px;
}
.modal__submit-btn {
	flex: 1;
	height: 100%;
	background: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 20px;
	font-size: 17px;
	font-weight: 700;
	color: #000000;
	cursor: pointer;
	transition: opacity 0.2s;
}
.modal__submit-btn:hover {
	opacity: 0.85;
}

.modal__disclaimer {
	margin-top: 20px;
	font-size: 12px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.5);
	text-align: center;
	line-height: 15px;
	letter-spacing: 0.12px;
}
.modal__disclaimer-orange {
	color: #e76c03;
}
.modal__disclaimer-link {
	color: #F07309;
	text-decoration: underline;
	font-weight: 700;
}

/* ========== Step 2: Payment Method ========== */

.modal-payment__body {
	margin: 15px;
	padding: 26px;
	background: #212020;
	border-radius: 28px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	position: relative;
}

.modal-payment__title {
	font-size: 20px;
	font-weight: 500;
	color: #ffffff;
	margin-bottom: 30px;
}
.modal-payment__close {
	position: absolute;
	top: 11px;
	right: 11px;
	width: 30px;
	height: 30px;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}
.modal-payment__close img {
	width: 30px;
	height: 30px;
}

.modal-payment__methods {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.payment-card {
	background: #2c2c2c;
	border-radius: 16px;
	padding: 18px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: border-color 0.2s;
	position: relative;
}
.payment-card[data-disabled] {
	opacity: 0.6;
	cursor: initial;
}

.payment-card:not([data-disabled]):hover {
	border-color: rgba(255, 255, 255, 0.15);
}
.payment-card.active {
	border-color: rgba(255, 255, 255, 0.3);
}
.payment-card--recommended {
	background: #393939;
}

.payment-card__icon {
	height: 30px;
	margin-bottom: 12px;
}
.payment-card__icon img {
	height: 30px;
	width: auto;
}
.payment-card__status {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 10px;
	height: 10px;
}
.payment-card__name {
	font-size: 13px;
	font-weight: 500;
	color: #ffffff;
}
.payment-card__desc {
	font-size: 11px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.5);
	margin-top: 2px;
}
.payment-card__desc--orange {
	color: #e76c03;
}

.payment-methods__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.payment-card--full {
	grid-column: 1 / -1;
}

.modal-payment__email {
	width: 100%;
	height: 65px;
	background: #2c2c2c;
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0 20px;
	font-family: 'Inter', sans-serif;
	font-size: 17px;
	font-weight: 500;
	color: #ffffff;
	text-align: center;
	outline: none;
	margin-top: 16px;
	transition: border-color 0.2s;
}
.modal-payment__email::placeholder {
	color: #757575;
	font-weight: 500;
}
.modal-payment__email:focus {
	border-color: rgba(255, 255, 255, 0.25);
}

.modal-payment__pay-btn {
	width: 100%;
	height: 67px;
	background: #ffffff;
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 17px;
	font-weight: 500;
	color: #000000;
	cursor: pointer;
	margin-top: 8px;
	transition: opacity 0.2s;
}
.modal-payment__pay-btn:hover {
	opacity: 0.85;
}

.modal-payment__disclaimer {
	margin-top: 20px;
	font-size: 12px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.5);
	text-align: center;
	line-height: 15px;
	letter-spacing: 0.12px;
}
.modal-payment__disclaimer-orange {
	color: #e76c03;
}
.modal-payment__disclaimer-link {
	color: #F07309;
	text-decoration: underline;
	font-weight: 500;
}

/* ========== Adaptive ========== */

@media (max-width: 580px) {
	.modal {
		width: 100%;
		max-width: calc(100vw - 20px);
		border-radius: 28px;
	}
	.modal__header {
		height: 95px;
		border-radius: 22px;
		margin: 10px;
		margin-bottom: 10px;
		padding: 25px 30px;
	}
	.modal__header-name {
		font-size: 22px;
	}
	.modal__body {
		margin: 0 10px 10px;
		padding: 20px;
		border-radius: 22px;
	}
	.modal__input {
		height: 54px;
		font-size: 15px;
		border-radius: 16px;
	}
	.modal__bottom {
		height: 60px;
		border-radius: 16px;
	}
	.modal__total {
		/* padding-left: 24px; */
		min-width: 100px;
	}
	.modal__total-price {
		font-size: 16px;
	}
	.modal__submit-btn {
		font-size: 15px;
		border-radius: 16px;
	}

	.modal-payment__body {
		margin: 10px;
		padding: 20px;
		border-radius: 22px;
	}
	.modal-payment__title {
		font-size: 18px;
		margin-bottom: 20px;
	}
	.payment-card {
		padding: 14px;
		border-radius: 14px;
	}
	.payment-card__icon {
		height: 24px;
		margin-bottom: 8px;
	}
	.payment-card__icon img {
		height: 24px;
	}
	.modal-payment__email {
		height: 54px;
		font-size: 15px;
		border-radius: 16px;
	}
	.modal-payment__pay-btn {
		height: 56px;
		font-size: 15px;
		border-radius: 16px;
	}
}

@media (max-width: 400px) {
	.modal__header {
		height: 85px;
		padding: 20px 24px;
	}
	.modal__header-label {
		font-size: 12px;
	}
	.modal__header-name {
		font-size: 20px;
	}
	.modal__close {
		width: 26px;
		height: 26px;
		top: 8px;
		right: 8px;
	}
	.modal__close img {
		width: 26px;
		height: 26px;
	}
	.payment-methods__grid {
		grid-template-columns: 1fr;
	}
}
