/**
 * Icône "Book an Appointment" dans le menu + panneau coulissant.
 * Indépendant du système .side-nav (menu mobile) du thème parent :
 * pas de classes ni de JS partagés, pour éviter tout conflit.
 */

/* ---------- Icône dans le menu ---------- */

.inspiro-appointment-menu-item {
	display: flex;
	align-items: center;
}

.inspiro-appointment-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	transition: opacity 0.2s ease;
}

.inspiro-appointment-trigger:hover,
.inspiro-appointment-trigger:focus-visible {
	opacity: 0.7;
}

/* ---------- Déclencheur mobile, ajouté en JS dans le header avant .navbar-toggle ---------- */

.inspiro-appointment-trigger--header {
	display: none;
	color: #fff;
	margin-left: 0.9375em;
}

@media screen and (max-width: 64em) {
	.inspiro-appointment-trigger--header {
		display: inline-flex;
	}
}

/* ---------- Bouton sous la description produit ---------- */

.inspiro-appointment-inline {
	margin: 24px 0 0;
}

.inspiro-appointment-trigger--inline {
	width: auto;
	height: auto;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 28px;
	background: var(--inspiro-dark-color, #101010);
	color: #fff;
	font-family: var(--font-helvetica-now, inherit);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.inspiro-appointment-trigger--inline:hover,
.inspiro-appointment-trigger--inline:focus-visible {
	opacity: 0.85;
}

.inspiro-appointment-trigger--inline i {
	font-size: 15px;
}

/* ---------- Overlay ---------- */

.inspiro-appointment-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	z-index: 9998;
}

.inspiro-appointment-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* ---------- Panneau ---------- */

.inspiro-appointment-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 90vw;
	background: #ffffff;
	box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.inspiro-appointment-sidebar.is-open {
	transform: translateX(0);
}

.inspiro-appointment-sidebar__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 32px 32px 8px;
}

.inspiro-appointment-sidebar__title {
	margin: 0;
	font-family: var(--font-editorial-new, inherit);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.inspiro-appointment-close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	padding: 0;
	color: inherit;
}

.inspiro-appointment-sidebar__content {
	padding: 32px;
}

.inspiro-appointment-placeholder {
	opacity: 0.6;
	font-size: 14px;
}

/* Empêche le scroll du fond quand le panneau est ouvert */
body.inspiro-appointment-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.inspiro-appointment-sidebar {
		width: 100%;
		max-width: 100vw;
	}

	.inspiro-appointment-form__row--half {
		flex-direction: column;
		gap: 18px;
	}
}

/* ---------- Formulaire ---------- */

.inspiro-appointment-form {
	--appt-border: #cfcfcf;
	--appt-border-focus: var(--inspiro-dark-color, #101010);
	--appt-placeholder: #9a9a9a;
	font-family: var(--font-helvetica-now, inherit);
}

.inspiro-appointment-form__row {
	margin: 0 0 18px;
}

.inspiro-appointment-form input[type="text"],
.inspiro-appointment-form input[type="tel"],
.inspiro-appointment-form input[type="email"],
.inspiro-appointment-form input[type="date"],
.inspiro-appointment-form input[type="time"],
.inspiro-appointment-form select,
.inspiro-appointment-form textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid var(--appt-border);
	border-radius: 0;
	font-family: inherit;
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--inspiro-dark-color, #101010);
	transition: border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.inspiro-appointment-form select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23101010' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px;
	padding-right: 40px;
	cursor: pointer;
}

.inspiro-appointment-form select:invalid,
.inspiro-appointment-form select option[value=""] {
	color: var(--appt-placeholder);
}

.inspiro-appointment-form input::placeholder,
.inspiro-appointment-form textarea::placeholder {
	color: var(--appt-placeholder);
	text-transform: uppercase;
	opacity: 1;
}

.inspiro-appointment-form input:focus,
.inspiro-appointment-form select:focus,
.inspiro-appointment-form textarea:focus {
	outline: none;
	border-color: var(--appt-border-focus);
}

.inspiro-appointment-form__row--half {
	display: flex;
	gap: 14px;
}

.inspiro-appointment-form__row--half .inspiro-appointment-form__field {
	flex: 1 1 0;
	min-width: 0;
}

.inspiro-appointment-form input:invalid {
	box-shadow: none;
}

.inspiro-appointment-form__row--textarea textarea {
	min-height: 130px;
	resize: vertical;
	text-transform: none;
}

.inspiro-appointment-form__row--textarea textarea::placeholder {
	text-transform: uppercase;
}

/* Honeypot : champ caché aux humains, laissé accessible aux bots */
.inspiro-appointment-form__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.inspiro-appointment-form__checkbox label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--inspiro-dark-color, #101010);
	cursor: pointer;
}

.inspiro-appointment-form__checkbox input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0;
	border: 1px solid var(--appt-border);
	accent-color: var(--inspiro-dark-color, #101010);
	cursor: pointer;
}

.inspiro-appointment-form__recaptcha {
	margin: 0 0 18px;
}

.inspiro-appointment-form__submit-row {
	margin: 24px 0 0;
}

.inspiro-appointment-form__submit {
	position: relative;
	display: block;
	width: 100%;
	padding: 18px;
	background: var(--inspiro-dark-color, #101010);
	border: none;
	color: #fff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.inspiro-appointment-form__submit:hover {
	opacity: 0.85;
}

.inspiro-appointment-form__submit:disabled {
	cursor: not-allowed;
}

.inspiro-appointment-form__submit.is-loading .btn-text {
	visibility: hidden;
}

.inspiro-appointment-form__submit.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: inspiro-appointment-spin 0.7s linear infinite;
}

@keyframes inspiro-appointment-spin {
	to {
		transform: rotate(360deg);
	}
}

.inspiro-appointment-form__feedback {
	margin-top: 16px;
	font-size: 13px;
	text-align: center;
}

.inspiro-appointment-form__feedback.is-success {
	color: #1a7a3c;
}

.inspiro-appointment-form__feedback.is-error {
	color: #c0392b;
}
