/**
 * Barre de réservation (maquette Figma « Barre de réservation », accueil V3).
 * Couleurs : variables globales Divi (Customizer + palette « sdc »).
 */

.sdc-resa {
	--sdc-resa-nuit: var(--gcid-secondary-color, #14233a);
	--sdc-resa-label: var(--gcid-primary-color, #96592a);
	--sdc-resa-encre: var(--gcid-sdc-encre, #1b2a3d);
	--sdc-resa-attenue: var(--gcid-sdc-texte-attenue, #6b7787);
	--sdc-resa-bordure: var(--gcid-sdc-bordure, #e4e8ee);
	--sdc-resa-fond: var(--gcid-sdc-fond-bleute, #eef2f6);
	--sdc-resa-ombre: 0 20px 50px rgba(14, 26, 44, 0.25);

	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	min-height: 96px;
	margin: 0 auto;
	padding: 0 16px 0 36px;
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--sdc-resa-ombre);
	font-family: var(--et_global_body_font, 'Inter'), sans-serif;
	text-align: left;
}

.sdc-resa.has-popover {
	z-index: 40;
}

/*
 * Les colonnes Divi ont un z-index (2) : celle de la section suivante passerait devant le calendrier.
 * La section qui contient la barre passe au premier plan pendant qu'une fenêtre est ouverte.
 */
.et_pb_section:has(.sdc-resa.has-popover) {
	z-index: 10;
}

.sdc-resa *,
.sdc-resa *::before,
.sdc-resa *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ Champs */

.sdc-resa__field {
	position: relative;
	isolation: isolate;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 6px 16px 6px 0;
}

.sdc-resa__field + .sdc-resa__field {
	padding-left: 24px;
	border-left: 1px solid var(--sdc-resa-bordure);
}

.sdc-resa__label {
	margin: 0;
	padding: 0;
	color: var(--sdc-resa-label);
	font-size: 12px;
	font-weight: 600;
	line-height: 14px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	pointer-events: none;
}

.sdc-resa__value {
	all: unset;
	display: block;
	overflow: hidden;
	color: var(--sdc-resa-encre);
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 19px;
	white-space: nowrap;
	text-overflow: ellipsis;
	cursor: pointer;
}

.sdc-resa__value[hidden] {
	display: none;
}

.sdc-resa__value.is-empty {
	color: var(--sdc-resa-attenue);
}

/* Tout le champ est cliquable ; fond léger quand sa fenêtre est ouverte. */
.sdc-resa__value::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -10px 4px -10px -14px;
	border-radius: 12px;
	transition: background-color 0.15s;
}

.sdc-resa__field + .sdc-resa__field .sdc-resa__value::after {
	left: 8px;
}

.sdc-resa__value:hover::after,
.sdc-resa.is-picking-in .sdc-resa__field--in .sdc-resa__value::after,
.sdc-resa.is-picking-out .sdc-resa__field--out .sdc-resa__value::after,
.sdc-resa__value[data-open="guests"][aria-expanded="true"]::after {
	background: var(--sdc-resa-fond);
}

.sdc-resa__value:focus-visible::after {
	outline: 2px solid var(--sdc-resa-nuit);
	outline-offset: -2px;
}

.sdc-resa__short {
	display: none;
}

/* Liste déroulante affichée seulement sans JavaScript. */
.sdc-resa__fallback {
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sdc-resa-encre);
	font: inherit;
	font-size: 16px;
}

/* ------------------------------------------------------------------ Bouton */

.sdc-resa__submit {
	flex: 0 0 auto;
	margin: 0 0 0 16px;
	padding: 20px 36px;
	border: 0;
	border-radius: 999px;
	background: var(--sdc-resa-nuit);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 18px;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.2s;
}

.sdc-resa__submit:hover {
	background: var(--gcid-sdc-nuit-profonde, #0e1a2c);
}

.sdc-resa__submit:focus-visible {
	outline: 2px solid var(--sdc-resa-nuit);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ Fenêtres */

.sdc-resa__popover {
	position: absolute;
	z-index: 1;
	top: calc(100% + 12px);
	left: var(--sdc-pop-left, 0);
	padding: 20px 24px;
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--sdc-resa-ombre);
	color: var(--sdc-resa-encre);
	font-size: 15px;
	line-height: 1.4;
}

.sdc-resa__popover[hidden] {
	display: none;
}

.sdc-resa__popover.is-above {
	top: auto;
	bottom: calc(100% + 12px);
}

.sdc-resa__popover p {
	margin: 0;
	padding: 0;
}

.sdc-resa__popover button {
	font-family: inherit;
}

/* Calendrier */

.sdc-resa__cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.sdc-resa__hint {
	color: var(--sdc-resa-attenue);
	font-size: 14px;
	text-align: center;
}

.sdc-resa__nav {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0 0 3px;
	border: 1px solid var(--sdc-resa-bordure);
	border-radius: 50%;
	background: #fff;
	color: var(--sdc-resa-encre);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.sdc-resa__nav:hover:not(:disabled) {
	border-color: var(--sdc-resa-encre);
}

.sdc-resa__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.sdc-resa__months {
	display: flex;
	gap: 32px;
}

.sdc-resa__month-title {
	margin-bottom: 8px !important;
	font-weight: 600;
	text-align: center;
}

.sdc-resa__grid {
	display: grid;
	grid-template-columns: repeat(7, 40px);
	grid-auto-rows: 40px;
	row-gap: 2px;
}

.sdc-resa__wd {
	display: grid;
	place-items: center;
	color: var(--sdc-resa-attenue);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

.sdc-resa__day {
	position: relative;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sdc-resa-encre);
	font-size: 14px;
	cursor: pointer;
}

.sdc-resa__day:hover:not(:disabled),
.sdc-resa__day:focus-visible {
	outline: 1.5px solid var(--sdc-resa-encre);
	outline-offset: -1.5px;
}

.sdc-resa__day:disabled {
	color: var(--gcid-sdc-gris-bleute, #c9d3df);
	text-decoration: line-through;
	cursor: default;
}

.sdc-resa__day.is-today::after {
	content: "";
	position: absolute;
	bottom: 6px;
	left: 50%;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: currentColor;
}

.sdc-resa__day.is-range,
.sdc-resa__day.is-preview {
	border-radius: 0;
	background: var(--sdc-resa-fond);
}

.sdc-resa__day.is-start,
.sdc-resa__day.is-end {
	background: var(--sdc-resa-nuit);
	color: #fff;
	font-weight: 600;
}

.sdc-resa__day.is-start:focus-visible,
.sdc-resa__day.is-end:focus-visible {
	outline-color: var(--sdc-resa-label);
	outline-width: 2px;
}

.sdc-resa__cal-foot,
.sdc-resa__guests-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--sdc-resa-bordure);
}

.sdc-resa__nights {
	margin-left: auto;
	color: var(--sdc-resa-attenue);
	font-size: 14px;
}

.sdc-resa__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--sdc-resa-encre);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.sdc-resa__link:disabled {
	opacity: 0.4;
	cursor: default;
}

.sdc-resa__ok {
	padding: 10px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--sdc-resa-nuit);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

/* Voyageurs */

.sdc-resa__guests {
	width: 340px;
}

.sdc-resa__counter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
}

.sdc-resa__counter + .sdc-resa__counter {
	border-top: 1px solid var(--sdc-resa-bordure);
}

.sdc-resa__counter-title {
	font-weight: 600;
}

.sdc-resa__counter-help,
.sdc-resa__note {
	color: var(--sdc-resa-attenue);
	font-size: 13px;
}

.sdc-resa__stepper {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sdc-resa__step {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0 0 2px;
	border: 1px solid var(--gcid-sdc-gris-bleute, #c9d3df);
	border-radius: 50%;
	background: #fff;
	color: var(--sdc-resa-encre);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.sdc-resa__step:hover:not(:disabled) {
	border-color: var(--sdc-resa-encre);
}

.sdc-resa__step:disabled {
	opacity: 0.35;
	cursor: default;
}

.sdc-resa__count {
	min-width: 20px;
	font-weight: 600;
	text-align: center;
}

/* ------------------------------------------------------------------ Tablette : champs sur une ligne, bouton dessous */

@media (max-width: 980px) {
	.sdc-resa {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		row-gap: 20px;
		padding: 20px 24px 24px;
	}

	.sdc-resa__submit {
		grid-column: 1 / -1;
		margin: 0;
	}
}

/* ------------------------------------------------------------------ Mobile (maquette V3 · Mobile) */

@media (max-width: 600px) {
	.sdc-resa {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 0;
		padding: 20px;
	}

	.sdc-resa__field {
		padding: 0 16px 16px 0;
	}

	.sdc-resa__field + .sdc-resa__field {
		padding-left: 16px;
	}

	.sdc-resa__field--guests {
		grid-column: 1 / -1;
		padding: 16px 0 20px !important;
		border-top: 1px solid var(--sdc-resa-bordure);
		border-left: 0 !important;
	}

	.sdc-resa__value::after,
	.sdc-resa__field + .sdc-resa__field .sdc-resa__value::after {
		inset: -8px -8px -8px -8px;
	}

	.sdc-resa__field--guests .sdc-resa__value::after {
		inset: -12px -8px -12px -8px !important;
	}

	/* Masqué visuellement mais lu par les lecteurs d'écran (la version courte est aria-hidden). */
	.sdc-resa__long {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.sdc-resa__short {
		display: inline;
	}

	.sdc-resa__popover,
	.sdc-resa__guests {
		right: 0;
		left: 0;
		width: auto;
		padding: 16px;
	}

	.sdc-resa__grid {
		grid-template-columns: repeat(7, minmax(0, 1fr));
	}

	.sdc-resa__months {
		justify-content: center;
	}

	.sdc-resa__month {
		flex: 1 1 auto;
		max-width: 320px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sdc-resa *,
	.sdc-resa *::after {
		transition: none !important;
	}
}
