/**
 * Express Buy Now modal — layout only (colors from button system).
 */

.vn-buy-now-modal-root {
	--vn-buy-now-modal-z: 100012;
}

.vn-buy-now-modal__overlay {
	position: fixed;
	inset: 0;
	border: 0;
	padding: 0;
	margin: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100011;
	cursor: pointer;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.vn-buy-now-modal-root:has(.vn-buy-now-modal.is-open) .vn-buy-now-modal__overlay:not([hidden]) {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.vn-buy-now-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	width: min(760px, calc(100% - 32px));
	max-height: min(90dvh, 820px);
	transform: translate(-50%, -48%);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	overflow: hidden;
	z-index: var(--vn-buy-now-modal-z);
	display: flex;
	flex-direction: column;
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s ease;
}

.vn-buy-now-modal.is-open {
	transform: translate(-50%, -50%);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.vn-buy-now-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
}

.vn-buy-now-modal__eyebrow {
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #6b7280;
}

.vn-buy-now-modal__header h2 {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.vn-buy-now-modal__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 20px 22px;
}

.vn-buy-now-modal__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 220px;
	color: #6b7280;
}

.vn-buy-now-form__grid {
	display: grid;
	grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
	gap: 24px;
}

.vn-buy-now-product {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.vn-buy-now-product__thumb img {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	background: #f5f5f5;
}

.vn-buy-now-product__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.4;
}

.vn-buy-now-product__variation {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
}

.vn-buy-now-product__unit-price {
	margin: 0;
	font-weight: 700;
}

.vn-buy-now-product__qty {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.vn-buy-now-qty__btn {
	width: 36px;
	height: 36px;
}

.vn-buy-now-qty__input {
	width: 56px;
	height: 36px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	text-align: center;
	font-size: 15px;
}

.vn-buy-now-product__subtotal {
	margin: 0;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.vn-buy-now-product__shipping-note,
.vn-buy-now-product__cart-note {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #6b7280;
}

.vn-buy-now-form__field {
	margin-bottom: 14px;
}

.vn-buy-now-form__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 600;
}

.vn-buy-now-form__field input,
.vn-buy-now-form__field select,
.vn-buy-now-form__field textarea {
	width: 100%;
	min-height: 44px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	padding: 10px 12px;
	font: inherit;
}

.vn-buy-now-form__field textarea {
	min-height: 88px;
	resize: vertical;
}

.vn-buy-now-form__actions {
	display: grid;
	gap: 10px;
	margin-top: 8px;
}

.vn-buy-now-form__error {
	margin: 12px 0 0;
	color: #b91c1c;
	font-size: 0.875rem;
}

.vn-buy-now-success {
	text-align: center;
	padding: 12px 4px 4px;
}

.vn-buy-now-success h3 {
	margin: 0 0 10px;
	font-size: 1.25rem;
}

.vn-buy-now-success p {
	margin: 0 0 10px;
	color: #4b5563;
}

.vn-buy-now-success__actions {
	display: grid;
	gap: 10px;
	margin-top: 18px;
}

body.vn-buy-now-open {
	overflow: hidden;
}

@media (max-width: 768px) {
	.vn-buy-now-modal {
		width: calc(100% - 24px);
		max-height: 92dvh;
	}

	.vn-buy-now-form__grid {
		grid-template-columns: 1fr;
	}
}
