/*
 * Tableau des tarifs — en cartes ou en tableau.
 * Chargée par Blocs Creator sur les seules pages qui portent le bloc.
 */

.kahel-tarifs-section {
	/* Plus resserré qu'une section ordinaire. */
	padding-top: clamp(56px, 7vw, 96px);
	padding-bottom: clamp(56px, 7vw, 96px);
}

.kahel-tarifs-section .kahel-tarifs-entete {
	margin-bottom: clamp(36px, 5vw, 64px);
}

.kahel-tarifs-section .kahel-tarifs-titre {
	max-width: 16ch;
	margin: 0;
}

.kahel-tarifs-section .kahel-tarifs-intro {
	max-width: 58ch;
	margin: 24px 0 0;
}

.kahel-tarifs-section .kahel-tarifs-note {
	max-width: 70ch;
	margin-top: clamp(28px, 3.5vw, 40px);
	margin-bottom: 0;
}

/* ---- Cartes ---- */

.kahel-tarifs-section .kahel-tarifs-grille {
	display: grid;
	grid-template-columns: repeat(var(--kahel-colonnes, 3), minmax(0, 1fr));
	gap: clamp(16px, 2vw, 28px);
	align-items: stretch;
}

.kahel-tarifs-section .kahel-tarif {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: clamp(26px, 3vw, 38px);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--default);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--ink);
}

.kahel-tarifs-section .kahel-tarif.is-vedette {
	border-color: transparent;
	background: var(--wp--preset--color--orange);
}

.kahel-tarifs-section .kahel-tarif-tete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 14px;
}

.kahel-tarifs-section .kahel-tarif-nom {
	margin: 0;
	font-size: var(--wp--preset--font-size--h-3);
	letter-spacing: -0.03em;
}

/* L'étiquette (« Le plus choisi ») : une pastille. */
.kahel-tarifs-section .kahel-tarif-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 11px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--utility);
	font-weight: var(--wp--custom--weight--strong);
	letter-spacing: 0.04em;
	line-height: 1.2;
	white-space: nowrap;
}

/* Sur une carte, l'étiquette chevauche le bord du haut : les prix restent alignés d'une carte à l'autre. */
.kahel-tarifs-section .kahel-tarif .kahel-tarif-badge {
	position: absolute;
	top: 0;
	left: clamp(26px, 3vw, 38px);
	translate: 0 -50%;
	box-shadow: 0 6px 14px rgba(36, 23, 15, 0.14);
}

.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-badge {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

.kahel-tarifs-section .kahel-tarif-prix {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	margin: 0;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-prix {
	border-bottom-color: rgba(36, 23, 15, 0.16);
}

.kahel-tarifs-section .kahel-tarif-montant {
	color: var(--wp--preset--color--orange);
	font-size: clamp(2.6rem, 4.2vw, 3.4rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.06em;
	font-variant-numeric: tabular-nums;
}

.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-montant {
	color: var(--wp--preset--color--ink);
}

.kahel-tarifs-section .kahel-tarif-unite {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--weight--strong);
}

.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-unite,
.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-description {
	color: var(--wp--preset--color--ink);
}

.kahel-tarifs-section .kahel-tarif-description {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.kahel-tarifs-section .kahel-tarif-inclus {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.kahel-tarifs-section .kahel-tarif-inclus li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
}

/* Une petite patte en guise de puce. */
.kahel-tarifs-section .kahel-tarif-inclus .kahel-picto {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 0.15em;
	color: var(--wp--preset--color--orange);
	rotate: -14deg;
}

.kahel-tarifs-section .kahel-tarif.is-vedette .kahel-tarif-inclus .kahel-picto {
	color: var(--wp--preset--color--ink);
}

/* Le bouton descend au pied de la carte : les boutons s'alignent d'une carte à l'autre. */
.kahel-tarifs-section .kahel-tarif-action {
	margin-top: auto;
	padding-top: 8px;
}

.kahel-tarifs-section .kahel-tarif.is-vedette .wp-element-button {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

.kahel-tarifs-section .kahel-tarif.is-vedette .wp-element-button:hover,
.kahel-tarifs-section .kahel-tarif.is-vedette .wp-element-button:focus-visible {
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
}

/* ---- Tableau ---- */

.kahel-tarifs-section .kahel-tarifs-tableau-cadre {
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--default);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
}

.kahel-tarifs-section .kahel-tarifs-tableau {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

.kahel-tarifs-section .kahel-tarifs-ligne + .kahel-tarifs-ligne {
	border-top: 1px solid var(--wp--preset--color--line);
}

.kahel-tarifs-section .kahel-tarifs-ligne > * {
	padding: clamp(20px, 2.4vw, 28px) clamp(22px, 3vw, 36px);
	border: 0;
	vertical-align: middle;
}

.kahel-tarifs-section .kahel-tarifs-ligne > * {
	background: transparent;
}

/* La ligne mise en avant : fond crème et filet orange à gauche. */
.kahel-tarifs-section .kahel-tarifs-ligne.is-vedette > * {
	background: var(--wp--preset--color--cream);
}

.kahel-tarifs-section .kahel-tarifs-ligne.is-vedette > :first-child {
	box-shadow: inset 4px 0 0 var(--wp--preset--color--orange);
}

.kahel-tarifs-section .kahel-tarifs-formule {
	text-align: start;
	font-weight: inherit;
}

.kahel-tarifs-section .kahel-tarifs-nom {
	margin-right: 10px;
	font-size: clamp(1.08rem, 1.6vw, 1.25rem);
	font-weight: 850;
	letter-spacing: -0.02em;
}

.kahel-tarifs-section .kahel-tarifs-formule .kahel-tarif-badge {
	vertical-align: 0.15em;
}

.kahel-tarifs-section .kahel-tarifs-detail,
.kahel-tarifs-section .kahel-tarifs-avantages {
	display: block;
	max-width: 60ch;
	margin: 6px 0 0;
	font-weight: 400;
}

.kahel-tarifs-section .kahel-tarifs-avantages {
	color: var(--wp--preset--color--orange-deep);
	font-weight: 600;
}

.kahel-tarifs-section .kahel-tarifs-lien {
	display: inline-flex;
	gap: 6px;
	margin-top: 10px;
	color: var(--wp--preset--color--orange-deep);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--weight--strong);
	text-decoration: none;
}

.kahel-tarifs-section .kahel-tarifs-lien:hover,
.kahel-tarifs-section .kahel-tarifs-lien:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.22em;
}

.kahel-tarifs-section .kahel-tarifs-prix {
	width: 1%;
	text-align: end;
	white-space: nowrap;
}

.kahel-tarifs-section .kahel-tarifs-prix .kahel-tarif-montant {
	font-size: clamp(1.7rem, 2.6vw, 2.2rem);
}

.kahel-tarifs-section .kahel-tarifs-prix .kahel-tarif-unite {
	margin-left: 4px;
}

@media (max-width: 900px) {
	.kahel-tarifs-section .kahel-tarifs-grille {
		grid-template-columns: repeat(min(2, var(--kahel-colonnes, 3)), minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.kahel-tarifs-section .kahel-tarifs-grille {
		grid-template-columns: 1fr;
	}

	/* Le prix passe sous le nom : la ligne reste lisible sans défilement. */
	.kahel-tarifs-section .kahel-tarifs-ligne,
	.kahel-tarifs-section .kahel-tarifs-ligne > * {
		display: block;
		width: auto;
	}

	.kahel-tarifs-section .kahel-tarifs-ligne > .kahel-tarifs-prix {
		padding-top: 0;
		text-align: start;
	}

	.kahel-tarifs-section .kahel-tarifs-ligne.is-vedette > * {
		box-shadow: inset 4px 0 0 var(--wp--preset--color--orange);
	}
}
