/* Compositeur de coffrets Tea Copines — s'appuie sur les variables --tc-* du thème. */

.tcb-composer {
	--tcb-gold: var( --tc-gold, #b8913f );
	--tcb-gold-light: var( --tc-gold-light, #e6cf8f );
	--tcb-paper: var( --tc-paper, #fffcf5 );
	--tcb-ink: var( --tc-ink, #30422c );
	--tcb-deep: var( --tc-sage-deep, #496642 );
	margin: 0 0 4rem;
}

.tcb-step {
	margin: 0 0 2.8rem;
}

.tcb-step__title {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	margin: 0 0 1.2rem;
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp( 1.6rem, 2.6vw, 2.1rem );
	color: var( --tc-forest, #283726 );
}

.tcb-step__num {
	display: inline-grid;
	place-items: center;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background: linear-gradient( 180deg, #f5e6b4, #c9a24e );
	color: #4a3512;
	font-family: "Jost", sans-serif;
	font-size: 1rem;
	font-weight: 600;
}

.tcb-step__hint {
	margin: -0.6rem 0 1.2rem;
	color: var( --tcb-ink );
	opacity: 0.8;
}

/* Étape 1 — formules */
.tcb-formulas {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 1rem;
}

.tcb-formula {
	position: relative;
	cursor: pointer;
}

.tcb-formula input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tcb-formula__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: 1.4rem 1rem 1.2rem;
	border: 1px solid var( --tcb-gold-light );
	border-radius: 18px;
	background: var( --tcb-paper );
	box-shadow: inset 0 0 0 4px var( --tcb-paper ), inset 0 0 0 5px rgba( 184, 145, 63, 0.25 );
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tcb-formula:hover .tcb-formula__card {
	transform: translateY( -2px );
}

.tcb-formula input:checked + .tcb-formula__card {
	border-color: var( --tcb-gold );
	box-shadow: inset 0 0 0 4px var( --tcb-paper ), inset 0 0 0 6px var( --tcb-gold ), 0 12px 26px rgba( 40, 55, 38, 0.12 );
}

.tcb-formula input:focus-visible + .tcb-formula__card {
	outline: 2px solid var( --tcb-deep );
	outline-offset: 3px;
}

.tcb-formula__name {
	margin-bottom: 0.5rem;
	font-family: "Playfair Display", Georgia, serif;
	font-style: italic;
	font-size: 1.35rem;
	line-height: 1.2;
	color: var( --tcb-ink );
}

.tcb-formula__count {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 3.2rem;
	line-height: 1;
	color: var( --tcb-deep );
}

.tcb-formula__label {
	margin-top: 0.2rem;
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --tcb-ink );
}

.tcb-formula__cup {
	margin-top: 0.6rem;
	padding: 0.25em 1.2em;
	background: linear-gradient( 180deg, #f5e6b4, #d9b866 );
	clip-path: polygon( 0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50% );
	color: #4a3512;
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 0.95rem;
}

.tcb-formula__price {
	margin-top: auto;
	padding-top: 0.9rem;
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 1.6rem;
	color: var( --tcb-deep );
}

/* Étape 2 — thés */
.tcb-teas {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcb-tea {
	position: relative;
	display: grid;
	grid-template-columns: 76px 1fr;
	grid-template-rows: 1fr auto;
	gap: 0.3rem 0.9rem;
	padding: 0.8rem;
	border: 1px solid var( --tcb-gold-light );
	border-radius: 16px;
	background: var( --tcb-paper );
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tcb-tea.is-picked {
	border-color: var( --tc-accent );
	background: color-mix( in srgb, var( --tc-accent ) 6%, var( --tcb-paper ) );
	box-shadow: 0 0 0 1px var( --tc-accent );
}

/* Médaillon en arche zoomé sur le personnage, comme les portraits de
   « Notre histoire » (.tc-portraits__frame du thème). */
.tcb-tea__media {
	position: relative;
	grid-row: 1 / 3;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	align-self: start;
	margin: 4px;
	border: 2px solid var( --tc-accent );
	border-radius: 999px 999px 10px 10px;
	box-shadow: 0 0 0 2px var( --tcb-paper ), 0 0 0 3px var( --tcb-gold-light ), 0 6px 12px rgba( 40, 55, 38, 0.12 );
}

.tcb-tea__media img {
	position: absolute;
	top: -24%;
	left: -2%;
	display: block;
	width: 205%;
	max-width: none;
	height: auto;
	margin: 0;
}

.tcb-tea__body p {
	margin: 0;
}

.tcb-tea__name {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 1.35rem;
	line-height: 1.1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --tc-accent );
}

.tcb-tea__surname {
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #8a6a2a;
}

.tcb-tea__blend {
	margin-top: 0.25rem !important;
	font-size: 0.85rem;
	line-height: 1.3;
	color: var( --tcb-ink );
}

.tcb-tea__stepper {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	justify-self: start;
}

.tcb-tea__btn,
.tcb-tea__btn:hover,
.tcb-tea__btn:focus {
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 1px solid var( --tc-accent );
	border-radius: 50%;
	background: #fff;
	color: var( --tc-accent );
	font-size: 1.15rem;
	line-height: 1;
}

.tcb-tea__btn[data-step="1"]:not( :disabled ) {
	background: var( --tc-accent );
	color: #fff;
}

.tcb-tea__btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.tcb-tea__qty {
	min-width: 1.4rem;
	text-align: center;
	font-weight: 600;
	font-size: 1.05rem;
	color: var( --tcb-ink );
}

/* Picto "voir le détail" (fiche produit dans un nouvel onglet) */
.tcb-tea__details,
.tcb-tea__details:visited {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border: 1px solid var( --tcb-gold-light );
	border-radius: 50%;
	background: #fff;
	color: var( --tc-accent );
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tcb-tea__details:hover,
.tcb-tea__details:focus-visible {
	border-color: var( --tc-accent );
	background: var( --tc-accent );
	color: #fff;
}

.tcb-tea__body {
	padding-right: 2.2rem; /* place du picto */
}

/* Barre récapitulative collante */
.tcb-summary {
	position: sticky;
	bottom: 1rem;
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem 1.5rem;
	margin-top: 1.5rem;
	padding: 1rem 1.4rem;
	border: 1px solid var( --tcb-gold-light );
	border-radius: 20px;
	background: rgba( 255, 252, 245, 0.94 );
	backdrop-filter: blur( 8px );
	box-shadow: 0 14px 34px rgba( 40, 55, 38, 0.16 );
}

.tcb-summary__counter {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.6rem;
}

.tcb-summary__count {
	font-family: "Playfair Display", Georgia, serif;
	font-size: 2rem;
	line-height: 1;
	color: var( --tcb-deep );
}

.tcb-summary__label {
	color: var( --tcb-ink );
}

.tcb-summary__status {
	flex-basis: 100%;
	font-size: 0.9rem;
	color: var( --tcb-ink );
	opacity: 0.8;
}

.tcb-form.is-complete .tcb-summary__status {
	color: var( --tcb-deep );
	font-weight: 600;
	opacity: 1;
}

.tcb-form.is-over .tcb-summary__status {
	color: #b3261e;
	opacity: 1;
}

.tcb-summary__action {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.tcb-summary__price {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 1.8rem;
	color: var( --tcb-deep );
}

.tcb-summary .button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Tasse seule */







@media ( max-width: 600px ) {
	.tcb-teas {
		grid-template-columns: 1fr;
	}

	.tcb-summary {
		bottom: 4.5rem; /* au-dessus de la barre mobile Storefront */
		padding: 0.9rem 1rem;
	}

	.tcb-summary__action {
		width: 100%;
		justify-content: space-between;
	}
}

/* Page non-WooCommerce : on reprend la couleur des boutons du site. */
.tcb-composer button.button.alt,
.tcb-composer button.button.alt:hover,
.tcb-composer button.button.alt:focus {
	border-color: var( --tcb-deep );
	background-color: var( --tcb-deep );
	color: #fff;
}

.tcb-composer button.button.alt:hover {
	filter: brightness( 1.12 );
}

/* Étape 3 : tasse du coffret (formules avec tasse), une par Tea Copine. */
.tcb-step--cup[hidden] {
	display: none;
}

.tcb-cups {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 120px, 1fr ) );
	gap: 0.9rem;
}

.tcb-cupchoice {
	position: relative;
	cursor: pointer;
}

.tcb-cupchoice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tcb-cupchoice__card {
	display: block;
	padding: 0.5rem 0.5rem 0.6rem;
	border: 1px solid var( --tcb-gold-light );
	border-radius: 16px;
	background: var( --tcb-paper );
	text-align: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tcb-cupchoice:hover .tcb-cupchoice__card {
	transform: translateY( -3px );
	border-color: var( --tc-accent );
}

.tcb-cupchoice input:checked + .tcb-cupchoice__card {
	border-color: var( --tc-accent );
	box-shadow: 0 0 0 2px var( --tc-accent ), 0 8px 18px rgba( 40, 55, 38, 0.14 );
}

.tcb-cupchoice input:focus-visible + .tcb-cupchoice__card {
	outline: 2px solid var( --tc-accent );
	outline-offset: 3px;
}

.tcb-cupchoice__media {
	display: block;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 1;
}

.tcb-cupchoice__media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.tcb-cupchoice__name {
	display: block;
	margin-top: 0.45rem;
	color: var( --tc-accent );
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.85rem;
}

.tcb-cupchoice input:checked + .tcb-cupchoice__card .tcb-cupchoice__name::before {
	content: "✓ ";
}

@media ( max-width: 600px ) {
	.tcb-cups {
		grid-template-columns: repeat( 3, 1fr );
		gap: 0.6rem;
	}
}

/* Thé épuisé (Produits → Stocks) : visible mais non sélectionnable. */
.tcb-tea.is-soldout {
	opacity: 0.55;
}

.tcb-tea__soldout {
	margin-top: 0.2rem !important;
	color: #b32d2e;
	font-size: 0.8rem;
	font-weight: 600;
}
