/* =============================================================================
   INVIA — Booking Modal
   ============================================================================= */

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.invia-book-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.invia-book-modal[hidden] {
	display: none;
}

.invia-book-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.48);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* ── Dialog ──────────────────────────────────────────────────────────────────── */
.invia-book-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 520px;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
	animation: ibm-in .22s ease;
}
@keyframes ibm-in {
	from { transform: scale(0.96) translateY(8px); opacity: 0; }
	to   { transform: scale(1)    translateY(0);   opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────────────────────── */
.invia-book-modal__header {
	background: #151515;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	direction: rtl;
}
.invia-book-modal[dir="ltr"] .invia-book-modal__header { direction: ltr; }
.invia-book-modal__title {
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 17px;
	font-weight: 600;
	color: #fff;
	letter-spacing: 0.03em;
}
.invia-book-modal__close {
	position: relative;
	background: none;
	border: none;
	outline: none;
	-webkit-appearance: none;
	box-shadow: none;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}
.invia-book-modal__close:focus,
.invia-book-modal__close:focus-visible {
	outline: none;
	box-shadow: none;
}
.invia-book-modal__close::before,
.invia-book-modal__close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 1px;
	background: rgba(255, 255, 255, 0.6);
	transition: background .15s;
}
.invia-book-modal__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.invia-book-modal__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.invia-book-modal__close:hover::before,
.invia-book-modal__close:hover::after { background: #fff; }

/* ── Body ────────────────────────────────────────────────────────────────────── */
.invia-book-modal__body {
	padding: 28px 28px 32px;
	background: #fff;
	direction: rtl;
}
.invia-book-modal[dir="ltr"] .invia-book-modal__body { direction: ltr; }

/* ── Intro text ──────────────────────────────────────────────────────────────── */
.ibf__intro {
	font-size: 13px;
	color: #888;
	line-height: 1.6;
	margin: 0 0 20px;
	text-align: right;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
}
.invia-book-modal[dir="ltr"] .ibf__intro { text-align: left; }

/* ── Form layout ─────────────────────────────────────────────────────────────── */
.ibf__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}
.ibf__field {
	position: relative;
	margin-bottom: 12px;
}
.ibf__row .ibf__field { margin-bottom: 0; }

/* ── Floating label ──────────────────────────────────────────────────────────── */
.ibf__label {
	position: absolute !important;
	top: 50% !important;
	right: 18px !important;
	left: auto !important;
	transform: translateY(-50%) !important;
	font-size: 14px !important;
	color: #aaa !important;
	pointer-events: none !important;
	transition: top .15s, font-size .15s, color .15s, transform .15s !important;
	z-index: 1 !important;
	line-height: 1 !important;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.ibf__field.has-value .ibf__label,
.ibf__field.is-focused .ibf__label {
	top: 9px !important;
	transform: translateY(0) !important;
	font-size: 10px !important;
	color: #bbb !important;
	letter-spacing: 0.04em !important;
}
.ibf__label--ta {
	top: 20px !important;
	transform: translateY(0) !important;
}
.ibf__field.has-value .ibf__label--ta,
.ibf__field.is-focused .ibf__label--ta {
	top: 9px !important;
	font-size: 10px !important;
}
.ibf__req { color: #c0392b; font-size: 11px; }

/* LTR: flip label anchor from right → left */
.invia-book-modal[dir="ltr"] .ibf__label {
	right: auto !important;
	left: 18px !important;
}

/* ── Input / Textarea ────────────────────────────────────────────────────────── */
.ibf__input {
	display: block !important;
	width: 100% !important;
	box-sizing: border-box !important;
	background: #fafafa !important;
	border: 1.5px solid #e0e0e0 !important;
	border-radius: 12px !important;
	padding: 26px 18px 10px !important;
	font-size: 15px !important;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif !important;
	color: #151515 !important;
	outline: none !important;
	transition: border-color .2s, box-shadow .2s, background .2s !important;
	direction: rtl !important;
	min-height: 56px !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.ibf__input:focus {
	border-color: #151515 !important;
	background: #fff !important;
	box-shadow: 0 0 0 3px rgba(21, 21, 21, 0.06) !important;
}
.ibf__textarea {
	resize: none !important;
	min-height: 96px !important;
	padding-top: 28px !important;
}

/* LTR inputs */
.invia-book-modal[dir="ltr"] .ibf__input { direction: ltr !important; }

/* ── Select (service dropdown) ───────────────────────────────────────────────── */
.ibf__select {
	cursor: pointer !important;
	/* Custom chevron arrow, RTL: arrow on the left */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23aaa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: 14px center !important;
	background-size: 12px 12px !important;
	padding-left: 38px !important;
	padding-right: 18px !important;
}
/* При фокусе .ibf__input:focus сбрасывает background шортхэндом (→ background-repeat:repeat).
   Поэтому повторяем все background-свойства полностью чтобы отменить тайлинг. */
.ibf__select:focus {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23151515' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: 14px center !important;
	background-size: 12px 12px !important;
}
/* LTR: arrow on the right */
.invia-book-modal[dir="ltr"] .ibf__select {
	background-position: calc(100% - 14px) center !important;
	background-size: 12px 12px !important;
	padding-right: 38px !important;
	padding-left: 18px !important;
}
.invia-book-modal[dir="ltr"] .ibf__select:focus {
	background-position: calc(100% - 14px) center !important;
	background-repeat: no-repeat !important;
	background-size: 12px 12px !important;
}
/* Select label is always floated (select has visible state by default) */
.ibf__field--select .ibf__label {
	top: 9px !important;
	transform: translateY(0) !important;
	font-size: 10px !important;
	color: #bbb !important;
	letter-spacing: 0.04em !important;
}
/* Dim the placeholder option */
.ibf__select option[value=""] { color: #aaa; }

/* ── Privacy ─────────────────────────────────────────────────────────────────── */
.ibf__privacy {
	margin: 14px 0 12px;
}
.ibf__privacy-label {
	display: flex !important;
	align-items: flex-start !important;
	gap: 10px !important;
	cursor: pointer !important;
	direction: rtl !important;
}
.invia-book-modal[dir="ltr"] .ibf__privacy-label { direction: ltr !important; }
.ibf__privacy-check {
	flex-shrink: 0 !important;
	width: 16px !important;
	height: 16px !important;
	margin: 2px 0 0 !important;
	accent-color: #151515 !important;
	cursor: pointer !important;
}
.ibf__privacy-text {
	font-size: 12px !important;
	color: #888 !important;
	line-height: 1.55 !important;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.ibf__privacy-link {
	color: #151515 !important;
	text-decoration: underline !important;
}
.ibf__privacy-link:hover { opacity: 0.7; }

/* ── Status message ──────────────────────────────────────────────────────────── */
.ibf__status {
	font-size: 13px;
	margin-bottom: 10px;
	min-height: 16px;
	text-align: right;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
	direction: rtl;
}
.invia-book-modal[dir="ltr"] .ibf__status { text-align: left; direction: ltr; }
.ibf__status.is-success { color: #1a7a3c; }
.ibf__status.is-error   { color: #c0392b; }

/* ── Submit button ───────────────────────────────────────────────────────────── */
.ibf__submit {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	background: #151515 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 16px 24px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	cursor: pointer !important;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif !important;
	transition: opacity .2s !important;
	margin-top: 4px !important;
}
.ibf__submit:hover    { opacity: 0.82 !important; }
.ibf__submit:disabled { opacity: 0.5 !important; cursor: default !important; }

.ibf__spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ibf-spin .7s linear infinite;
	flex-shrink: 0;
}
.ibf__submit.is-loading .ibf__spinner       { display: block; }
.ibf__submit.is-loading .ibf__submit-label  { opacity: .6; }
@keyframes ibf-spin { to { transform: rotate(360deg); } }

/* ── Shortcode trigger button ────────────────────────────────────────────────── */
.invia-book-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #151515 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 14px 40px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	cursor: pointer !important;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif !important;
	transition: opacity .2s !important;
	text-decoration: none !important;
}
.invia-book-btn:hover { opacity: 0.82 !important; color: #fff !important; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 580px) {
	.invia-book-modal__body { padding: 20px 18px 28px; }
	.ibf__row { grid-template-columns: 1fr; }
	.invia-book-modal__dialog { border-radius: 16px; }
}
