/* Réserver un atelier — formulaire public.
   Reprend les couleurs du thème (variables Global Styles) avec des valeurs
   de repli si le thème ne les définit pas. */

.htk-ped {
	--htk-accent: var(--wp--preset--color--accent-1, #e17a3e);
	--htk-ink: var(--wp--preset--color--contrast, #17130f);
	--htk-paper: var(--wp--preset--color--base, #f4ede3);
	--htk-line: var(--wp--preset--color--accent-4, #dcc9ae);
	--htk-soft: var(--wp--preset--color--accent-6, rgba(225, 122, 62, 0.2));
	max-width: 760px;
	margin-inline: auto;
	color: var(--htk-ink);
}

.htk-ped [hidden] {
	display: none !important;
}

.htk-ped-intro {
	margin-bottom: 1.5rem;
}

.htk-ped-section {
	border: 1px solid var(--htk-line);
	border-radius: 10px;
	padding: 1.25rem 1.25rem 0.5rem;
	margin: 0 0 1.25rem;
	background: rgba(255, 255, 255, 0.35);
}

.htk-ped-section legend {
	font-weight: 700;
	padding: 0 0.4rem;
}

.htk-ped-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 0 1rem;
}

.htk-ped-field {
	display: block;
	margin-bottom: 1rem;
}

.htk-ped-field > span {
	display: block;
	font-size: 0.9em;
	margin-bottom: 0.3rem;
}

.htk-ped-field input,
.htk-ped-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--htk-line);
	border-radius: 6px;
	background: #fff;
	color: var(--htk-ink);
	font: inherit;
}

.htk-ped-field input:focus,
.htk-ped-field textarea:focus {
	outline: 2px solid var(--htk-accent);
	outline-offset: 1px;
}

.htk-ped-field-small input {
	max-width: 180px;
}

.htk-ped-help {
	font-size: 0.85em;
	opacity: 0.8;
	margin: -0.4rem 0 1rem;
}

.htk-ped-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.htk-ped-card {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.9rem;
	border: 1px solid var(--htk-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.htk-ped-card:hover {
	border-color: var(--htk-accent);
}

.htk-ped-card:has(input:checked) {
	border-color: var(--htk-accent);
	box-shadow: 0 0 0 3px var(--htk-soft);
}

.htk-ped-card input {
	margin-top: 0.3rem;
	accent-color: var(--htk-accent);
}

.htk-ped-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.htk-ped-card-title {
	font-weight: 700;
}

.htk-ped-card-price {
	color: var(--htk-accent);
	font-weight: 600;
	font-size: 0.95em;
}

.htk-ped-card-desc {
	font-size: 0.85em;
	opacity: 0.85;
}

.htk-ped-articles {
	margin-bottom: 1rem;
	padding: 0.9rem;
	border-radius: 8px;
	background: var(--htk-soft);
}

.htk-ped-choose {
	font-weight: 600;
	margin: 0 0 0.6rem;
}

.htk-ped-count {
	font-weight: 400;
	opacity: 0.8;
	margin-left: 0.3rem;
}

.htk-ped-checks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 0.6rem;
}

.htk-ped-check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.5rem;
	align-items: start;
	padding: 0.6rem;
	background: #fff;
	border: 2px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s;
}

.htk-ped-check:has(input:checked) {
	border-color: var(--htk-accent);
}

.htk-ped-check-included {
	grid-template-columns: 1fr;
	cursor: default;
}

.htk-ped-article-img {
	grid-column: 1 / -1;
	order: -1;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 6px;
}

.htk-ped-check input {
	margin-top: 0.25rem;
	accent-color: var(--htk-accent);
}

.htk-ped-check:has(input:disabled:not(:checked)) {
	opacity: 0.5;
	cursor: not-allowed;
}

.htk-ped-check small {
	display: block;
	opacity: 0.8;
}

.htk-ped-included {
	margin: 0;
	padding-left: 1.2rem;
}

.htk-ped-estimate {
	border: 2px solid var(--htk-accent);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	background: #fff;
}

.htk-ped-estimate h3 {
	margin: 0 0 0.5rem;
	font-size: 1.1em;
}

.htk-ped-estimate dl {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.25rem 1rem;
	margin: 0 0 0.5rem;
}

.htk-ped-estimate dd {
	margin: 0;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.htk-ped-estimate .htk-ped-total {
	font-weight: 700;
	font-size: 1.15em;
	border-top: 1px solid var(--htk-line);
	padding-top: 0.35rem;
}

.htk-ped-errors {
	border-left: 4px solid #b3261e;
	background: #fdecea;
	color: #5f1410;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	margin-bottom: 1.25rem;
}

.htk-ped-errors ul {
	margin: 0.25rem 0 0;
	padding-left: 1.2rem;
}

.htk-ped-success {
	border: 2px solid var(--htk-accent);
	border-radius: 10px;
	padding: 1.5rem;
	background: #fff;
}

.htk-ped-notice {
	padding: 1rem;
	border: 1px dashed var(--htk-line);
	border-radius: 8px;
}

.htk-ped-submit {
	text-align: center;
}

.htk-ped-submit button:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Champ piège anti-robots : hors écran plutôt que display:none. */
.htk-ped-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Le champ texte du calendrier (créé par Flatpickr) hérite du style. */
.htk-ped-field input.flatpickr-input[readonly] {
	cursor: pointer;
	background: #fff;
}

/* Carte avec image (atelier) : l'image occupe toute la largeur, au-dessus. */
.htk-ped-card-with-img {
	flex-wrap: wrap;
}

.htk-ped-card-img {
	flex: 0 0 100%;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 6px;
}

/* Prix à rabais : ancien prix barré, nouveau prix mis en évidence. */
.htk-ped-price-old {
	color: var(--htk-ink);
	opacity: 0.55;
	font-weight: 400;
}

.htk-ped-price-sale {
	font-weight: 700;
}

/* Paliers selon le nombre d'enfants, sous le prix de la carte. */
.htk-ped-tiers {
	display: block;
	margin-top: 0.2rem;
	color: var(--htk-ink);
	font-weight: 400;
	font-size: 0.9em;
}

.htk-ped-tiers > span {
	display: block;
}

/* Détail du calcul dans l'estimation. */
.htk-ped-estimate-lines {
	list-style: none;
	margin: 0 0 0.6rem;
	padding: 0 0 0.6rem;
	border-bottom: 1px solid var(--htk-line);
	font-size: 0.9em;
}

.htk-ped-estimate-lines li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.15rem 0;
}

.htk-ped-estimate-lines li > span:last-child {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
