/* Floating contact widget — Vakil Nova / expandable FAB pattern */

.sabteto-fab-widget {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	left: auto;
	z-index: 9999;
	font-family: var(--font-body, "Vazirmatn", sans-serif);
	direction: rtl;
}

.sabteto-fab-toggle {
	width: 3.6rem;
	height: 3.6rem;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(145deg, #1a4a6e 0%, #0b2238 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 24px rgba(11, 34, 56, 0.4);
	transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
	position: relative;
	flex-shrink: 0;
}

.sabteto-fab-toggle:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 28px rgba(11, 34, 56, 0.5);
}

.sabteto-fab-widget.is-open .sabteto-fab-toggle {
	background: linear-gradient(145deg, #ffaa01 0%, #e69500 100%);
	color: #0b2238;
	box-shadow: 0 6px 24px rgba(255, 170, 1, 0.4);
}

.sabteto-fab-toggle__icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.25s ease, transform 0.3s ease;
}

.sabteto-fab-toggle__icon--open {
	opacity: 1;
	transform: scale(1) rotate(0);
}

.sabteto-fab-toggle__icon--close {
	opacity: 0;
	transform: scale(0.5) rotate(-90deg);
}

.sabteto-fab-widget.is-open .sabteto-fab-toggle__icon--open {
	opacity: 0;
	transform: scale(0.5) rotate(90deg);
}

.sabteto-fab-widget.is-open .sabteto-fab-toggle__icon--close {
	opacity: 1;
	transform: scale(1) rotate(0);
}

.sabteto-fab-menu {
	position: absolute;
	bottom: calc(100% + 1.1rem);
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75rem;
	opacity: 0;
	visibility: hidden;
	transform: translateX(1rem);
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.sabteto-fab-widget.is-open:not(.is-form-open) .sabteto-fab-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	pointer-events: auto;
}

.sabteto-fab-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.65rem;
}

.sabteto-fab-action {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem;
	width: 9.25rem;
	height: 2.75rem;
	padding: 0 0.9rem;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	color: #fff;
	font-family: inherit;
	font-size: 0.88rem;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
	box-sizing: border-box;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	flex-shrink: 0;
}

.sabteto-fab-widget.is-open:not(.is-form-open) .sabteto-fab-action:nth-child(1) {
	transition-delay: 0.04s;
}
.sabteto-fab-widget.is-open:not(.is-form-open) .sabteto-fab-action:nth-child(2) {
	transition-delay: 0.08s;
}
.sabteto-fab-widget.is-open:not(.is-form-open) .sabteto-fab-action:nth-child(3) {
	transition-delay: 0.12s;
}

.sabteto-fab-action:hover {
	transform: translateX(-6px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
	color: #fff;
	text-decoration: none;
}

.sabteto-fab-action--wa {
	background: #25d366;
}
.sabteto-fab-action--call {
	background: #1a4a6e;
}
.sabteto-fab-action--form {
	background: #ffaa01;
	color: #0b2238;
}

.sabteto-fab-action--form:hover {
	color: #0b2238;
}

.sabteto-fab-action__label {
	flex: 1;
	font-size: 0.82rem;
	text-align: right;
	line-height: 1;
}

.sabteto-fab-action svg {
	flex-shrink: 0;
}

.sabteto-fab-panel {
	position: absolute;
	bottom: calc(100% + 0.75rem);
	right: 0;
	width: 20rem;
	max-width: calc(100vw - 3rem);
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 12px 48px rgba(11, 34, 56, 0.18);
	padding: 1.25rem;
	opacity: 0;
	visibility: hidden;
	transform: translateX(1rem) scale(0.96);
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.sabteto-fab-panel[hidden] {
	display: block !important; /* keep for transition; visibility handles hide */
}

.sabteto-fab-widget.is-form-open .sabteto-fab-panel {
	opacity: 1;
	visibility: visible;
	transform: translateX(0) scale(1);
	pointer-events: auto;
}

.sabteto-fab-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.35rem;
}

.sabteto-fab-panel__header h3 {
	margin: 0;
	font-size: 1rem;
	font-weight: 800;
	color: #0b2238;
}

.sabteto-fab-panel__close {
	width: 2rem;
	height: 2rem;
	border: none;
	background: #f4f3f1;
	border-radius: 0.5rem;
	cursor: pointer;
	color: #5c6b7a;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.sabteto-fab-panel__close:hover {
	background: #e8e6e2;
}

.sabteto-fab-panel__desc {
	margin: 0 0 1rem;
	font-size: 0.82rem;
	color: #5c6b7a;
	line-height: 1.65;
}

.sabteto-fab-field {
	margin-bottom: 0.85rem;
}

.sabteto-fab-field label {
	display: block;
	font-size: 0.82rem;
	font-weight: 700;
	color: #1a2b3c;
	margin-bottom: 0.35rem;
}

.sabteto-fab-field .req {
	color: #dc2626;
}

.sabteto-fab-field input,
.sabteto-fab-field textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1.5px solid rgba(10, 10, 10, 0.12);
	border-radius: 0.5rem;
	font-family: inherit;
	font-size: 0.9rem;
	color: #1a2b3c;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	resize: vertical;
	box-sizing: border-box;
}

.sabteto-fab-field input[type="tel"] {
	direction: rtl;
	text-align: right;
}

.sabteto-fab-field input:focus,
.sabteto-fab-field textarea:focus {
	outline: none;
	border-color: #ffaa01;
	box-shadow: 0 0 0 3px rgba(255, 170, 1, 0.18);
}

.sabteto-fab-field input.is-error,
.sabteto-fab-field textarea.is-error {
	border-color: #dc2626;
}

.sabteto-fab-error {
	display: block;
	font-size: 0.75rem;
	color: #dc2626;
	margin-top: 0.25rem;
	min-height: 1rem;
}

.sabteto-fab-submit {
	width: 100%;
	padding: 0.75rem;
	border: none;
	border-radius: 0.5rem;
	background: #1a4a6e;
	color: #fff;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
	margin-top: 0.25rem;
}

.sabteto-fab-submit:hover:not(:disabled) {
	background: #123552;
	transform: translateY(-1px);
}

.sabteto-fab-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.sabteto-fab-success {
	text-align: center;
	padding: 1rem 0.5rem;
}

.sabteto-fab-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: rgba(37, 211, 102, 0.12);
	color: #128c7e;
	font-size: 1.35rem;
	font-weight: 800;
	margin-bottom: 0.65rem;
}

.sabteto-fab-success p {
	margin: 0;
	font-size: 0.9rem;
	color: #5c6b7a;
	line-height: 1.65;
}

.sabteto-fab-widget .sabteto-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 480px) {
	.sabteto-fab-widget {
		bottom: 1rem;
		right: 1rem;
	}

	.sabteto-fab-panel {
		width: calc(100vw - 2rem);
		max-width: calc(100vw - 2rem);
	}

	.sabteto-fab-toggle {
		width: 3.35rem;
		height: 3.35rem;
	}

	.sabteto-fab-action {
		width: 8.25rem;
		height: 2.6rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sabteto-fab-action,
	.sabteto-fab-panel,
	.sabteto-fab-toggle,
	.sabteto-fab-toggle__icon,
	.sabteto-fab-menu {
		transition: none !important;
	}
}
