/* BB Donation Goals */

/* ---------- Progress ---------- */
.bb-progress {
	margin: 18px 0;
	color: #2a3b4c;
	font-size: 13px;
	line-height: 1.7;
}
.bb-progress--loop { margin: 12px 0; font-size: 12px; }
.bb-progress--single { margin-top: 25px; }

.bb-progress__head,
.bb-progress__foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
}
.bb-progress__head { margin-bottom: 6px; }
.bb-progress__foot { margin-top: 6px; opacity: .9; }

.bb-progress__percent {
	font-weight: 700;
	direction: ltr;
	unicode-bidi: isolate;
}
.bb-progress__badge {
	background: #e6f6ec;
	color: #1c7a3e;
	border-radius: 999px;
	padding: 0 10px;
	font-weight: 600;
	font-size: .95em;
}

.bb-progress__track {
	height: 12px;
	background: var(--bb-track, #e7ecf0);
	border-radius: 999px;
	overflow: hidden;
}
.bb-progress__bar {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--bb-start, #1a324c), var(--bb-end, #385c85));
	transition: width .6s ease;
}
html[dir="rtl"] .bb-progress__bar,
.rtl .bb-progress__bar {
	background: linear-gradient(270deg, var(--bb-start, #1a324c), var(--bb-end, #385c85));
}

/* ---------- Custom amount ---------- */
.bb-amount { margin: 15px 0; }
.bb-amount__label { display: block; font-weight: 600; margin-bottom: 6px; }
.bb-amount__opt {
	font-weight: 400;
	font-size: .9em;
	opacity: .65;
	margin-inline-start: 6px;
}

.bb-amount__field { display: flex; align-items: stretch; }
.bb-amount__input {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 10px 14px;
	font-size: 18px;
	font-weight: 600;
	text-align: center;
	direction: ltr; /* ارقام و جداکننده همیشه درست چیده شوند */
	border-radius: 8px;
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}
.bb-amount__unit {
	display: inline-flex;
	align-items: center;
	padding: 0 14px;
	border: 1px solid rgba(0, 0, 0, .15);
	border-inline-start: 0;
	background: rgba(0, 0, 0, .04);
	font-size: 13px;
	white-space: nowrap;
	border-start-end-radius: 8px;
	border-end-end-radius: 8px;
}
.bb-amount__input[aria-invalid="true"] { border-color: #c0392b; }

.bb-amount__quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; }

/*
 * دکمه‌های مبلغ پیشنهادی.
 * قالب‌ها (ودمارت و ...) برای همه‌ی <button>ها رنگ و اندازه تعیین می‌کنند، پس این‌جا
 * با اولویت بالا همه‌چیز صریح نوشته شده تا همیشه خوانا بماند.
 */
.bb-amount .bb-amount__quick button.bb-amount__chip {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex !important;
	align-items: baseline;
	gap: 5px;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 6px 16px !important;
	font-family: inherit;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.6 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-shadow: none !important;
	color: var(--bb-start, #1a324c) !important;
	background: #fff !important;
	border: 1.5px solid var(--bb-end, #385c85) !important;
	border-radius: 999px !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}
.bb-amount .bb-amount__quick button.bb-amount__chip small {
	font-size: 11px;
	font-weight: 400;
	opacity: .8;
	color: inherit;
}
.bb-amount .bb-amount__quick button.bb-amount__chip:hover,
.bb-amount .bb-amount__quick button.bb-amount__chip:focus-visible,
.bb-amount .bb-amount__quick button.bb-amount__chip.is-active {
	color: #fff !important;
	background: var(--bb-start, #1a324c) !important;
	border-color: var(--bb-start, #1a324c) !important;
}
.bb-amount .bb-amount__quick button.bb-amount__chip:focus-visible {
	outline: 2px solid var(--bb-end, #385c85);
	outline-offset: 2px;
}
.bb-amount__hint { margin: 8px 0 0; font-size: 12px; opacity: .7; }

.bb-donate-form .bb-donate-btn { width: 100%; margin-top: 12px; }

/* ---------- Kind supporter (checkout) ---------- */
.bb-kind {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	width: fit-content;
	margin-bottom: 20px;
	padding: 10px 15px;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 12px;
	cursor: pointer;
}
.bb-kind input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.bb-kind__toggle {
	position: relative;
	flex: none;
	width: 40px;
	height: 20px;
	background: #ccc;
	border-radius: 20px;
	transition: background .3s;
}
.bb-kind__toggle::before {
	content: "";
	position: absolute;
	top: 1px;
	inset-inline-start: 1px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: inset-inline-start .3s;
}
.bb-kind input:checked + .bb-kind__toggle { background: #3b73c9; }
.bb-kind input:checked + .bb-kind__toggle::before { inset-inline-start: 21px; }
.bb-kind input:focus-visible + .bb-kind__toggle { outline: 2px solid #3b73c9; outline-offset: 2px; }

.bb-kind__tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: 1px solid #888;
	border-radius: 50%;
	font-size: 12px;
	line-height: 1;
	cursor: default;
}
.bb-kind__tip-text {
	position: absolute;
	bottom: calc(100% + 8px);
	inset-inline-end: -10px;
	z-index: 10;
	padding: 5px 10px;
	background: #2d2d2d;
	color: #fff;
	border-radius: 6px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: .25s;
	pointer-events: none;
}
.bb-kind__tip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	inset-inline-end: 14px;
	border: 6px solid transparent;
	border-top-color: #2d2d2d;
}
.bb-kind__tip:hover .bb-kind__tip-text,
.bb-kind__tip:focus .bb-kind__tip-text {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* ---------- Campaign days ---------- */
.bb-progress__days {
	font-weight: 600;
	color: var(--bb-start, #1a324c);
}
.bb-progress__days.is-ended { color: #a33; }
.bb-donate-closed {
	padding: 10px 14px;
	background: #fbeaea;
	color: #a33;
	border-radius: 8px;
}

/* ---------- Donors list ---------- */
.bb-donors {
	list-style: none;
	margin: 16px 0;
	padding: 0;
}
.bb-donors__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.bb-donors__item:last-child { border-bottom: 0; }
.bb-donors__avatar {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--bb-start, #1a324c), var(--bb-end, #385c85));
	color: #fff;
	font-weight: 700;
}
.bb-donors__item.is-kind .bb-donors__avatar { background: #c9a227; }
.bb-donors__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bb-donors__time { opacity: .6; font-size: 12px; }
.bb-donors__amount { font-weight: 700; white-space: nowrap; }
.bb-donors__empty { opacity: .7; }

/* ---------- Donation box ([bb_donation_box]) ---------- */
.bb-box {
	box-sizing: border-box;
	max-width: 100%;
	margin: 16px 0;
	padding: 22px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 14px;
}
.bb-box__title {
	margin: 0 0 14px;
	font-size: 1.2em;
	text-align: center;
}
.bb-box .bb-progress { margin-top: 0; }
.bb-box__price {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin: 18px 0 6px;
}
.bb-box__price-label { font-weight: 600; font-size: 1.05em; }
.bb-box__price strong { font-size: 1.5em; color: var(--bb-start, #1a324c); }
.bb-open-price { font-weight: 600; color: var(--bb-start, #1a324c); }
