/*
 * Nexsaver Buy Box Prompts — boxes in the buy card and the two popups.
 * Each box/popup gets its colour from --nexsaver-bbp-color (set inline from the Settings tab).
 * Logical properties (inline-start/end) keep the layout right in RTL (Persian) too.
 */

.nexsaver-buybox-prompt { display: grid; gap: 8px; margin: 12px 0 0; }

.nexsaver-bbp {
	--nexsaver-bbp-color: #b45309;
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--nexsaver-bbp-color);
	border-inline-start-width: 4px;
	border-radius: 8px;
	background: #fff; /* Fallback for browsers without color-mix (Safari < 16.2). */
	background: color-mix(in srgb, var(--nexsaver-bbp-color) 8%, #fff);
	font-size: 13px; line-height: 1.35;
}
.nexsaver-bbp__text { flex: 1 1 auto; min-width: 0; }
.nexsaver-bbp__title { display: block; color: var(--nexsaver-bbp-color); font-size: 14px; font-weight: 700; }
.nexsaver-bbp__desc { display: block; color: #3c434a; }
.nexsaver-bbp__btn {
	flex: 0 0 auto;
	min-height: 36px; padding: 6px 12px;
	border: 1px solid var(--nexsaver-bbp-color); border-radius: 6px;
	background: #fff; color: var(--nexsaver-bbp-color);
	font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.nexsaver-bbp__btn:hover, .nexsaver-bbp__btn:focus-visible { background: var(--nexsaver-bbp-color); color: #fff; }
.nexsaver-bbp__btn:focus-visible { outline: 2px solid var(--nexsaver-bbp-color); outline-offset: 2px; }

@media (max-width: 420px) {
	.nexsaver-bbp { flex-wrap: wrap; }
	.nexsaver-bbp__btn { width: 100%; }
}

/* Popups */
.nexsaver-bbp-dialog {
	--nexsaver-bbp-color: #b45309;
	width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
	padding: 0; border: 0; border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: #1d2327;
	overflow: auto;
}
.nexsaver-bbp-dialog::backdrop { background: rgba(11, 36, 64, .55); }
.nexsaver-bbp-dialog__head {
	position: sticky; top: 0; z-index: 1;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 16px; background: var(--nexsaver-bbp-color); color: #fff;
}
.nexsaver-bbp-dialog__head h2 { margin: 0; color: inherit; font-size: 18px; line-height: 1.3; }
.nexsaver-bbp-close {
	width: 36px; height: 36px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15);
	color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.nexsaver-bbp-dialog__body { padding: 14px 16px 18px; }
.nexsaver-bbp-intro, .nexsaver-bbp-product { margin: 0 0 10px; font-size: 14px; }
.nexsaver-bbp-product { font-weight: 700; }
.nexsaver-bbp-status:empty { display: none; }
.nexsaver-bbp-status { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.nexsaver-bbp-status.is-ok { background: #edfaef; color: #0a5c2b; }
.nexsaver-bbp-status.is-error { background: #fcf0f1; color: #8a1f11; }

.nexsaver-bbp-form { margin: 0 0 14px; }
.nexsaver-bbp-form[hidden] { display: none; }
.nexsaver-bbp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nexsaver-bbp-field { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.nexsaver-bbp-field > span { display: block; margin-bottom: 4px; }
.nexsaver-bbp-field abbr { color: #b32d2e; text-decoration: none; border: 0; }
.nexsaver-bbp-field input, .nexsaver-bbp-field textarea {
	box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 10px;
	border: 1px solid #8c8f94; border-radius: 6px; background: #fff;
	font: inherit; font-size: 16px; /* 16px: iPhone does not zoom in on focus */
	font-weight: 400;
}
.nexsaver-bbp-field input[aria-invalid="true"], .nexsaver-bbp-field textarea[aria-invalid="true"] { border-color: #b32d2e; box-shadow: 0 0 0 1px #b32d2e; }
.nexsaver-bbp-primary, .nexsaver-bbp-secondary {
	min-height: 42px; padding: 8px 16px; border-radius: 6px;
	font: inherit; font-weight: 700; cursor: pointer;
}
.nexsaver-bbp-primary { width: 100%; border: 0; background: var(--nexsaver-bbp-color); color: #fff; }
.nexsaver-bbp-primary:disabled { opacity: .6; cursor: wait; }
.nexsaver-bbp-secondary { border: 1px solid var(--nexsaver-bbp-color); background: #fff; color: var(--nexsaver-bbp-color); }
.nexsaver-bbp-sendtitle, .nexsaver-bbp-projects h3 { margin: 8px 0; font-size: 15px; }

.nexsaver-bbp-projects { margin: 0 0 12px; padding-top: 10px; border-top: 1px solid #dcdcde; }
.nexsaver-bbp-empty { margin: 0; color: #646970; font-size: 14px; }
.nexsaver-bbp-project { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #dcdcde; border-radius: 8px; }
.nexsaver-bbp-project ul { margin: 6px 0 10px; padding: 0; list-style: none; }
.nexsaver-bbp-project li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; border-bottom: 1px dashed #f0f0f1; }
.nexsaver-bbp-project li a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nexsaver-bbp-qty { flex: 0 0 auto; color: #646970; }
.nexsaver-bbp-remove { flex: 0 0 auto; padding: 4px 8px; border: 0; background: none; color: #b32d2e; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.nexsaver-bbp-hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 480px) {
	.nexsaver-bbp-row { grid-template-columns: 1fr; gap: 0; }
	.nexsaver-bbp-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; margin: auto 0 0; border-radius: 12px 12px 0 0; }
}
