/**
 * Back In Stock Notifier - Frontend Styles
 * נכתב מההתחלה ל-RTL
 */

/* ========== כפתור הקריאה ========== */
.bisn-notify-button {
	font-family: inherit;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.bisn-notify-button:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* בלופ של החנות - מגביל רוחב */
.products .bisn-notify-button {
	margin-top: 8px;
}

/* ========== המודאל ========== */
.bisn-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: none;
	direction: rtl;
	text-align: right;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", "Assistant", "Rubik", Arial, sans-serif;
}

.bisn-modal.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: bisnFadeIn 0.2s ease;
}

.bisn-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(2px);
}

.bisn-modal-content {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	padding: 35px 30px 30px;
	max-width: 460px;
	width: calc(100% - 30px);
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: bisnSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bisnFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes bisnSlideUp {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

.bisn-modal-close {
	position: absolute;
	top: 10px;
	left: 12px;
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #999;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 4px;
	transition: all 0.15s ease;
}

.bisn-modal-close:hover {
	background: #f3f3f3;
	color: #333;
}

.bisn-modal-title {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.3;
}

.bisn-modal-description,
.bisn-verify-description {
	margin: 0 0 20px;
	font-size: 14px;
	color: #555;
	line-height: 1.5;
}

.bisn-product-info {
	background: #f5f7fa;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-bottom: 18px;
	color: #333;
}

.bisn-product-label {
	color: #666;
	margin-left: 6px;
}

/* ========== שדות טופס ========== */
.bisn-field {
	margin-bottom: 16px;
}

.bisn-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.bisn-field .required {
	color: #d9534f;
}

.bisn-field input {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
	background: #fff;
	color: #1a1a1a;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.bisn-field input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.bisn-field input.has-error {
	border-color: #d9534f;
}

.bisn-field-error {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	color: #d9534f;
	min-height: 16px;
}

/* ========== כפתור שליחה ========== */
.bisn-modal-submit {
	width: 100%;
	padding: 13px;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 8px;
	transition: opacity 0.2s ease, transform 0.1s ease;
	font-family: inherit;
}

.bisn-modal-submit:hover {
	opacity: 0.92;
}

.bisn-modal-submit:active {
	transform: translateY(1px);
}

.bisn-modal-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.bisn-form-message,
.bisn-verify-message {
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	display: none;
}

.bisn-form-message.is-error,
.bisn-verify-message.is-error {
	display: block;
	background: #fdecea;
	color: #b71c1c;
	border: 1px solid #f5c2c0;
}

.bisn-form-message.is-success,
.bisn-verify-message.is-success {
	display: block;
	background: #e8f5e9;
	color: #1b5e20;
	border: 1px solid #c8e6c9;
}

/* ========== שדות קוד אימות (6 ספרות) ========== */
.bisn-code-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 24px 0;
}

.bisn-code-digit {
	width: 48px;
	height: 56px;
	text-align: center;
	font-size: 24px;
	font-weight: 700;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
	transition: all 0.15s ease;
	-moz-appearance: textfield;
}

.bisn-code-digit::-webkit-outer-spin-button,
.bisn-code-digit::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.bisn-code-digit:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.bisn-code-digit.has-value {
	border-color: #2271b1;
	background: #f0f7ff;
}

.bisn-resend-link {
	display: block;
	width: 100%;
	background: transparent;
	border: none;
	color: #2271b1;
	font-size: 13px;
	margin-top: 14px;
	cursor: pointer;
	text-decoration: underline;
	font-family: inherit;
}

.bisn-resend-link:hover {
	color: #135e96;
}

.bisn-resend-link:disabled {
	color: #999;
	cursor: not-allowed;
	text-decoration: none;
}

/* ========== מסך הצלחה ========== */
.bisn-step-success {
	text-align: center;
	padding: 10px 0;
}

.bisn-success-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 18px;
	color: #10b981;
}

.bisn-success-message {
	color: #444;
	font-size: 15px;
	line-height: 1.5;
	margin-bottom: 22px;
}

/* ========== loading state ========== */
.bisn-modal-submit.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.bisn-modal-submit.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	border-top-color: transparent;
	animation: bisnSpin 0.7s linear infinite;
}

@keyframes bisnSpin {
	to { transform: rotate(360deg); }
}

/* ========== mobile ========== */
@media (max-width: 480px) {
	.bisn-modal-content {
		padding: 30px 20px 25px;
		border-radius: 10px;
	}

	.bisn-modal-title {
		font-size: 19px;
	}

	.bisn-code-digit {
		width: 40px;
		height: 50px;
		font-size: 20px;
	}

	.bisn-code-inputs {
		gap: 6px;
	}
}
