/* ================= Dialog ================= */

html:has(.bisn-dialog[open]) { overflow: hidden; } /* lock page scroll behind the modal */

.bisn-dialog {
	box-sizing: border-box;
	width: min(420px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: #fff;
	color: var(--bisn-charcoal);
	box-shadow: 0 24px 60px rgba(28, 27, 25, .2);
	overflow: hidden auto;
	--fl-bg: #fff; /* floating label notch must match the dialog background */
}
.bisn-dialog *, .bisn-dialog *::before, .bisn-dialog *::after { box-sizing: border-box; }
.bisn-dialog::backdrop { background: rgba(28, 27, 25, .5); }
.bisn-dialog[open] { animation: bisn-in .2s ease-out; }
@keyframes bisn-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bisn-dialog__inner { position: relative; margin: 0; padding: 28px; }
.bisn-dialog__view[hidden] { display: none !important; }

/* close */
.bisn-dialog__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	background: transparent !important;
	cursor: pointer;
}
.bisn-dialog__close::before,
.bisn-dialog__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 1.5px;
	background: var(--bisn-charcoal);
}
.bisn-dialog__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.bisn-dialog__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.bisn-dialog__close:hover { background: rgba(28, 27, 25, .06) !important; }

/* text (div, not h-tag: Breakdance's global heading sizes would blow it up) */
.bisn-dialog__title {
	margin: 0 40px 6px 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -.01em;
	color: var(--bisn-charcoal);
}
.bisn-dialog__lead {
	margin: 0 0 20px !important;
	font-size: 14px;
	line-height: 1.55;
	color: var(--bisn-muted);
}
.bisn-dialog__lead strong { color: var(--bisn-charcoal); font-weight: 600; }

/* product context: what exactly they're signing up for (no fill) */
.bisn-dialog__product {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 24px;
}
.bisn-dialog__thumb {
	flex: none;
	width: 56px;
	height: 75px; /* 3:4, matches the 600x800 product images */
	object-fit: cover;
	border-radius: 4px;
}
.bisn-dialog__thumb[hidden] { display: none; }
.bisn-dialog__product-text { min-width: 0; }
.bisn-dialog__product-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--bisn-charcoal);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bisn-dialog__product-name:empty { display: none; }
.bisn-dialog__variant { margin-top: 4px; font-size: 13px; color: var(--bisn-muted); }

/* native WooCommerce row; look comes from Breakdance Global Settings > Forms + the site's .flbl CSS */
.bisn-dialog .form-row {
	display: block;
	float: none;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
}
.bisn-dialog .form-row .woocommerce-input-wrapper { display: block; }
.bisn-dialog .form-row .input-text { width: 100%; }

.bisn-dialog__error {
	margin: 6px 0 0 !important;
	font-size: 13px;
	line-height: 1.4;
	color: var(--bisn-error);
}
.bisn-dialog__error:empty { display: none; }

/* primary */
.bisn-dialog__submit,
.bisn-dialog__secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 50px;
	margin: 16px 0 0;
	padding: 0 20px;
	border-radius: 6px;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color .15s ease;
}
.bisn-dialog__submit {
	border: 0;
	background: var(--bisn-charcoal);
	color: #fff;
}
.bisn-dialog__submit:hover { background: var(--bisn-charcoal-hover); }
.bisn-dialog__submit:active { background: var(--bisn-charcoal-active); }
.bisn-dialog__submit:disabled { opacity: .55; cursor: default; }
.bisn-dialog__submit .bisn-bell {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* secondary (brand: cream fill + hairline) */
.bisn-dialog__secondary {
	border: 1px solid var(--bisn-border);
	background: #F8F4ED;
	color: var(--bisn-charcoal);
}
.bisn-dialog__secondary:hover { background: #F0E8D6; }

.bisn-dialog__fine {
	margin: 10px 0 0 !important;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
	color: var(--bisn-muted);
}

/* success */
.bisn-dialog__view--done { text-align: center; padding-top: 8px; }
.bisn-dialog__view--done .bisn-dialog__title { margin: 0 0 6px; }
.bisn-dialog__view--done .bisn-dialog__lead { margin-bottom: 4px !important; }
.bisn-dialog__check {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0 auto 14px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1.5px var(--bisn-charcoal);
}
.bisn-dialog__check svg {
	fill: none;
	stroke: var(--bisn-charcoal);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* honeypot: present for bots, invisible and non-interactive for people */
.bisn-dialog__hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	overflow: hidden;
}

/* mobile: bottom sheet */
@media (max-width: 600px) {
	.bisn-dialog {
		width: 100vw;
		max-height: 90dvh;
		margin: auto 0 0;
		border-radius: 14px 14px 0 0;
	}
	.bisn-dialog[open] { animation-name: bisn-up; }
	@keyframes bisn-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
	.bisn-dialog__inner { padding: 28px 20px calc(20px + env(safe-area-inset-bottom)); }
	.bisn-dialog__inner::before { /* grab handle */
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 36px;
		height: 4px;
		margin-left: -18px;
		border-radius: 2px;
		background: var(--bisn-line);
	}
}

/* keep "Телесен · 75 · B" on one line */
.bisn-dialog__done-text strong:last-child { white-space: nowrap; }

