/* AJ Advance Payment — Front-end
   Matches ajexpress.com.bd's red/orange sale-badge accent colours. */

:root {
	--aj-ap-f-primary: #e6272c;
	--aj-ap-f-primary-dark: #b81e22;
	--aj-ap-f-accent: #ff7a00;
	--aj-ap-f-ink: #1c1d21;
	--aj-ap-f-muted: #6b7280;
	--aj-ap-f-border: #ececf0;
	--aj-ap-f-radius: 16px;
}

.aj-ap-box {
	background: #fff;
	border: 1px solid var(--aj-ap-f-border);
	border-radius: var(--aj-ap-f-radius);
	padding: 16px 16px 12px;
	margin: 0 0 18px;
	box-shadow: 0 6px 24px rgba(20,20,30,.05);
	box-sizing: border-box;
	max-width: 100%;
}

.aj-ap-box__head { display: flex !important; gap: 10px; align-items: flex-start !important; margin-bottom: 12px; }
.aj-ap-box__icon {
	flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
	background: linear-gradient(135deg, var(--aj-ap-f-primary), var(--aj-ap-f-accent));
	color: #fff; display: flex !important; align-items: center; justify-content: center;
}
.aj-ap-box__icon svg { width: 16px; height: 16px; }
.aj-ap-box__head h3 { margin: 0 0 3px; font-size: 14px; line-height: 1.3; color: var(--aj-ap-f-ink); }
.aj-ap-box__head p { margin: 0; font-size: 12px; color: var(--aj-ap-f-muted); line-height: 1.4; }

.aj-ap-options { display: flex; flex-direction: column; gap: 8px; }

.aj-ap-option {
	display: flex !important; align-items: center !important; flex-wrap: wrap; gap: 10px;
	border: 1.5px solid var(--aj-ap-f-border); border-radius: 10px;
	padding: 10px 12px; cursor: pointer; position: relative; transition: all .15s ease;
	margin: 0 !important; box-sizing: border-box; width: 100%;
}
.aj-ap-option:hover { border-color: #f4b8b9; background: #fffafa; }
.aj-ap-option.is-active { border-color: var(--aj-ap-f-primary); background: #fff6f6; box-shadow: 0 0 0 3px rgba(230,39,44,.08); }
.aj-ap-option input[type="radio"] {
	position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important;
	margin: 0 !important; padding: 0 !important; border: 0 !important; pointer-events: none !important;
}

.aj-ap-option__radio {
	display: inline-block !important; width: 18px !important; height: 18px !important; min-width: 18px;
	border-radius: 50% !important; border: 2px solid #d5d7dd !important; flex-shrink: 0; position: relative;
	box-sizing: border-box !important; background: #fff;
}
.aj-ap-option.is-active .aj-ap-option__radio { border-color: var(--aj-ap-f-primary) !important; }
.aj-ap-option.is-active .aj-ap-option__radio::after {
	content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--aj-ap-f-primary);
}

.aj-ap-option__body { flex: 1 1 140px; min-width: 0; }
.aj-ap-option__title { display: block; font-weight: 700; font-size: 13px; color: var(--aj-ap-f-ink); line-height: 1.3; }
.aj-ap-option__desc { display: block; font-size: 11px; color: var(--aj-ap-f-muted); margin-top: 2px; line-height: 1.35; }
.aj-ap-option__amount { font-weight: 800; font-size: 13.5px; color: var(--aj-ap-f-primary); white-space: nowrap; margin-left: auto; }

.aj-ap-option--custom { align-items: flex-start !important; }
.aj-ap-option--custom .aj-ap-option__radio { margin-top: 1px; }
.aj-ap-option__custom-input { display: none; align-items: center; gap: 6px; margin-top: 8px; width: 100%; }
.aj-ap-option--custom.is-active .aj-ap-option__custom-input { display: flex !important; }
.aj-ap-option__custom-input .aj-ap-currency { font-weight: 700; color: var(--aj-ap-f-primary); font-size: 13px; }
.aj-ap-option__custom-input input {
	border: 1px solid var(--aj-ap-f-border); border-radius: 8px; padding: 6px 8px; width: 120px; font-size: 13px;
	box-sizing: border-box;
}
.aj-ap-option__custom-input input:focus { outline: none; border-color: var(--aj-ap-f-primary); }
.aj-ap-custom-error { color: var(--aj-ap-f-primary); font-size: 11px; margin-top: 6px; display: none; }

.aj-ap-forced-note {
	background: #fff5f5; border: 1px solid #ffd7d8; color: #7a2224;
	border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.5;
}
.aj-ap-forced-note__badge {
	display: inline-block; background: var(--aj-ap-f-primary); color: #fff; font-size: 10px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; margin-right: 8px;
}

.aj-ap-box__foot { margin-top: 10px; font-size: 10.5px; color: var(--aj-ap-f-muted); display: flex; align-items: center; gap: 5px; }

/* Thank-you page balance notice */
.aj-ap-thankyou-due {
	background: #fff8ec; border: 1px solid #ffd98a; border-radius: 12px; padding: 14px 18px; margin: 18px 0;
}
.aj-ap-thankyou-due strong { color: #8a5300; }
.aj-ap-thankyou-due p { margin: 4px 0 0; font-size: 13.5px; color: #6b4a05; }

/* My Account balance box */
.aj-ap-balance-box {
	margin-top: 16px; padding: 16px 18px; border: 1px solid #ffd98a; background: #fff8ec; border-radius: 12px;
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.aj-ap-pay-balance-btn.button {
	background: var(--aj-ap-f-primary) !important; color: #fff !important; border-radius: 8px !important;
	font-weight: 600 !important;
}
.aj-ap-pay-balance-btn.button:hover { background: var(--aj-ap-f-primary-dark) !important; }

/* Pre-order badges */
.aj-ap-preorder-notice {
	background: #f4f6ff; border: 1px solid #d6ddff; border-radius: 10px; padding: 12px 16px; margin: 14px 0;
	font-size: 13px; color: #23306b; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
}
.aj-ap-preorder-tag {
	background: #3b4bc9; color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
	padding: 3px 9px; border-radius: 999px; letter-spacing: .03em;
}
.aj-ap-preorder-note { flex-basis: 100%; margin: 4px 0 0; color: #46508f; }
.aj-ap-loop-badge {
	position: absolute; top: 10px; left: 10px; z-index: 2; background: #3b4bc9; color: #fff;
	font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}

/* Pre-Order badge alignment only. */
.single-product .aj-ap-preorder-category-row {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 14px 0 !important;
}
.single-product .aj-ap-preorder-category-row .aj-ap-preorder-notice {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	width: auto !important;
	max-width: 100% !important;
	min-width: 0 !important;
	flex: 0 1 auto !important;
	margin: 0 !important;
}
.single-product .aj-ap-preorder-category-row .aj-ap-preorder-date {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: static !important;
	width: auto !important;
	height: auto !important;
	max-width: none !important;
	margin: 0 !important;
	clip: auto !important;
	overflow: visible !important;
}
.single-product .aj-ap-preorder-category-row .product_meta,
.single-product .aj-ap-preorder-category-row .product-meta {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	flex: 0 1 auto !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
}
.single-product .aj-ap-preorder-category-row .product_meta .posted_in,
.single-product .aj-ap-preorder-category-row .product-meta .posted_in {
	display: inline-flex !important;
	align-items: center !important;
	width: auto !important;
	margin: 0 !important;
}

.single-product .aj-ap-preorder-category-row > .posted_in {
	display: inline-flex !important;
	align-items: center !important;
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: max-content !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	position: static !important;
	inset: auto !important;
	white-space: nowrap !important;
	text-align: left !important;
}
.single-product .aj-ap-preorder-category-row > .posted_in a {
	margin: 0 !important;
	padding: 0 !important;
}
.aj-ap-loop-badge.aj-ap-loop-badge--with-sale {
	left: 82px;
}

/* Keep Pre-Order details + category together on single product mobile/tablet. */
@media (max-width: 1024px) {
	.single-product .aj-ap-preorder-category-row {
		flex-wrap: nowrap !important;
		justify-content: flex-start !important;
		column-gap: 8px !important;
	}
	.single-product .aj-ap-preorder-category-row .aj-ap-preorder-notice {
		flex: 0 1 auto !important;
		min-width: 0 !important;
		max-width: 100% !important;
		flex-wrap: wrap !important;
	}
	.single-product .aj-ap-preorder-category-row > .posted_in {
		flex: 0 0 auto !important;
		margin-left: 0 !important;
	}
	.single-product .aj-ap-preorder-category-row .aj-ap-preorder-date {
		white-space: normal !important;
	}
}
