/**
 * Studio Tabs - panier.
 *
 * Deux colonnes en desktop, une seule en mobile avec une barre de commande fixe.
 * Le tableau d'origine de WooCommerce est remplace par une liste : sur un
 * telephone, cinq colonnes se replient toujours mal, et la quantite finit par
 * etre une cible de quelques pixels.
 */

.st-cart {
	display: grid;
	gap: var(--st-space-md);
	align-items: start;
	margin-bottom: var(--st-space-lg);
}

@media (min-width: 1025px) {
	.st-cart {
		grid-template-columns: minmax(0, 1fr) 360px;
		gap: var(--st-space-lg);
	}

	.st-cart__aside {
		position: sticky;
		top: var(--st-space-md);
	}
}

/**
 * Articles.
 */
.st-cart__items {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--st-line, #e4ded9);
}

.st-cart__item {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: var(--st-space-sm);
	padding: var(--st-space-sm) 0;
	border-bottom: 1px solid var(--st-line, #e4ded9);
}

@media (min-width: 768px) {
	.st-cart__item {
		grid-template-columns: 128px minmax(0, 1fr);
	}
}

.st-cart__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	padding: 10px;
	background-color: var(--st-surface, #f6f6f6);
	border-radius: 0 0 0 var(--st-radius-md, 15px);
}

.st-cart__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.st-cart__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--st-space-sm);
}

.st-cart__name {
	margin: 0;
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1rem;
	line-height: 1.35;
	color: var(--st-ink, #3d1e14);
}

.st-cart__name a {
	color: inherit;
	text-decoration: none;
}

.st-cart__name a:hover {
	color: var(--st-accent, #a3280a);
}

.st-cart__specs {
	margin: 4px 0 0;
	color: var(--st-muted, #7a6a5f);
	font-size: 0.8125rem;
}

.st-cart__line-total {
	margin: 0;
	flex: 0 0 auto;
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.0625rem;
	font-weight: 500;
	color: var(--st-ink, #3d1e14);
	white-space: nowrap;
}

.st-cart__foot {
	display: flex;
	align-items: center;
	gap: var(--st-space-sm);
	margin-top: auto;
}

.st-cart__remove {
	color: var(--st-muted, #7a6a5f);
	font-size: 0.8125rem;
	text-decoration: underline;
}

.st-cart__remove:hover {
	color: var(--st-accent, #a3280a);
}

/**
 * Quantite.
 *
 * Le champ nu de WooCommerce est une cible minuscule au pouce. On l'encadre de
 * deux boutons de 40px, et le changement declenche seul la mise a jour.
 */
.st-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--st-line, #e4ded9);
	border-radius: var(--st-radius-pill, 999px);
	overflow: hidden;
}

.st-qty__btn {
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--st-ink, #3d1e14);
	font-size: 1.125rem;
	line-height: 1;
	cursor: pointer;
}

.st-qty__btn:hover {
	background-color: var(--st-surface, #f6f6f6);
}

.st-qty .quantity {
	margin: 0;
	width: auto !important;
}

/* WooCommerce fixe une largeur en em sur ce champ depuis un selecteur plus
   specifique : sans !important, le pas de quantite fait deux fois la largeur
   utile sur un telephone. */
.st-qty input.qty {
	width: 46px !important;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	color: var(--st-ink, #3d1e14);
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.9375rem;
	-moz-appearance: textfield;
}

.st-qty input.qty::-webkit-outer-spin-button,
.st-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/**
 * Outils sous la liste.
 */
.st-cart__tools {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--st-space-sm);
	padding-top: var(--st-space-sm);
}

.st-cart__back {
	color: var(--st-ink, #3d1e14);
	font-size: 0.9375rem;
	text-decoration: underline;
}

.st-cart__back:hover {
	color: var(--st-accent, #a3280a);
}

.st-coupon {
	margin-left: auto;
}

.st-coupon__toggle {
	border: 0;
	background: transparent;
	padding: 0;
	color: var(--st-muted, #7a6a5f);
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.875rem;
	text-decoration: underline;
	cursor: pointer;
}

.st-coupon__fields {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

.st-coupon__fields input {
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--st-line, #e4ded9);
	border-radius: 8px;
	background-color: #ffffff;
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.9375rem;
}

.st-coupon__apply {
	height: 44px;
	padding: 0 16px;
	border: 1px solid var(--st-ink, #3d1e14);
	border-radius: 8px;
	background: transparent;
	color: var(--st-ink, #3d1e14);
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.st-cart__update {
	height: 44px;
	padding: 0 16px;
	border: 1px solid var(--st-line, #e4ded9);
	border-radius: var(--st-radius-pill, 999px);
	background: transparent;
	color: var(--st-ink, #3d1e14);
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.875rem;
	cursor: pointer;
}

/**
 * Recapitulatif.
 */
.st-summary {
	padding: var(--st-space-sm);
	background-color: var(--st-surface, #f6f6f6);
	border-radius: 0 0 0 var(--st-radius-md, 15px);
}

.st-summary__title {
	margin: 0 0 var(--st-space-sm);
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.25rem !important;
	line-height: 1.2 !important;
	color: var(--st-ink, #3d1e14);
}

.st-summary__line,
.st-summary__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--st-space-sm);
	padding: 8px 0;
	color: var(--st-ink, #3d1e14);
	font-size: 0.9375rem;
}

.st-summary__line--coupon {
	color: var(--st-accent, #a3280a);
}

.st-summary__free {
	color: var(--st-accent, #a3280a);
	font-weight: 600;
}

.st-summary__total {
	margin-top: 8px;
	padding-top: var(--st-space-sm);
	border-top: 1px solid var(--st-line, #e4ded9);
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.25rem;
	font-weight: 500;
}

.st-summary__total .amount,
.st-summary__total strong {
	font-weight: 500;
}

.st-summary__total .includes_tax {
	display: block;
	margin-top: 2px;
	color: var(--st-muted, #7a6a5f);
	font-family: var(--st-font-ui, "Figtree", sans-serif);
	font-size: 0.75rem;
	font-weight: 400;
}

.st-summary__total > span:last-child {
	text-align: right;
}

.st-summary .wc-proceed-to-checkout {
	padding: 0;
}

.st-summary__note {
	margin: 10px 0 0;
	text-align: center;
	color: var(--st-muted, #7a6a5f);
	font-size: 0.8125rem;
}

.st-summary__note strong {
	color: var(--st-ink, #3d1e14);
}

.st-summary__facts {
	margin: var(--st-space-sm) 0 0;
	padding: var(--st-space-sm) 0 0;
	border-top: 1px solid var(--st-line, #e4ded9);
	list-style: none;
	color: var(--st-muted, #7a6a5f);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.st-summary__facts li {
	position: relative;
	margin: 0 0 8px;
	padding-left: 18px;
}

.st-summary__facts li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 7px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--st-accent, #a3280a);
}

.st-summary__facts strong {
	color: var(--st-ink, #3d1e14);
}

.st-summary .st-paiement {
	margin-top: var(--st-space-sm);
	padding-top: var(--st-space-sm);
	border-top: 1px solid var(--st-line, #e4ded9);
}

/**
 * Barre fixe, mobile uniquement.
 */
.st-cart-bar {
	display: none;
}

@media (max-width: 1024px) {
	.st-cart-bar.is-hidden {
		display: none;
	}

	.st-cart-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		display: flex;
		align-items: center;
		gap: var(--st-space-sm);
		padding: 12px var(--st-space-sm);
		background-color: var(--st-bg, #ffffff);
		border-top: 1px solid var(--st-line, #e4ded9);
		box-shadow: 0 -8px 24px rgba(61, 30, 20, 0.08);
	}

	.st-cart-bar__total {
		display: flex;
		flex-direction: column;
		line-height: 1.2;
	}

	.st-cart-bar__total span {
		color: var(--st-muted, #7a6a5f);
		font-size: 0.75rem;
	}

	.st-cart-bar__total strong {
		color: var(--st-ink, #3d1e14);
		font-family: var(--st-font, "Cabin", sans-serif);
		font-size: 1.125rem;
		font-weight: 500;
	}

	.st-cart-bar .st-btn-solid {
		width: auto;
		flex: 1 1 auto;
	}

	/* La barre ne doit pas masquer la fin de page. */
	.woocommerce-cart .site-main {
		padding-bottom: 88px;
	}
}

/**
 * Panier vide.
 */
.st-cart-empty {
	padding: var(--st-space-md) 0 var(--st-space-lg);
	text-align: center;
}

.st-cart-empty__title {
	margin: 0 0 10px;
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.5rem;
	color: var(--st-ink, #3d1e14);
}

.st-cart-empty__text {
	margin: 0 auto var(--st-space-sm);
	max-width: 46ch;
	color: var(--st-muted, #7a6a5f);
}

.st-cart-empty .st-btn-solid {
	width: auto;
}

.st-cart-empty__cats {
	justify-content: center;
	margin-top: var(--st-space-sm);
}

/**
 * Ventes croisees.
 */
.st-crosssell {
	margin-top: var(--st-space-lg);
	padding-top: var(--st-space-md);
	border-top: 1px solid var(--st-line, #e4ded9);
}

.st-crosssell__title {
	margin: 0 0 6px;
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.5rem !important;
	line-height: 1.2 !important;
	color: var(--st-ink, #3d1e14);
}

.st-crosssell__intro {
	margin: 0 0 var(--st-space-sm);
	color: var(--st-muted, #7a6a5f);
	font-size: 0.9375rem;
}

/* Quatre vignettes par ligne sur la page panier, ventes croisees comme
   suggestions du panier vide : trois colonnes y donnent des vignettes plus
   grandes que celles du catalogue, ce qui les fait passer pour le contenu
   principal de la page. */
@media (min-width: 1025px) {
	.woocommerce-cart ul.products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Les messages de WooCommerce gardent la meme langue graphique que le reste. */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-info {
	border-top-color: var(--st-accent, #a3280a);
	background-color: var(--st-surface, #f6f6f6);
	color: var(--st-ink, #3d1e14);
	font-size: 0.9375rem;
}

/**
 * Panier vide par expiration : on explique, et on propose de revenir en arriere.
 */
.st-hold-expired {
	max-width: 44rem;
	margin: 0 auto var(--st-space-md);
	padding: var(--st-space-sm);
	background-color: var(--st-surface, #f6f6f6);
	border-radius: 0 0 0 var(--st-radius-md, 15px);
	text-align: center;
}

.st-hold-expired__title {
	margin: 0 0 6px;
	font-family: var(--st-font, "Cabin", sans-serif);
	font-size: 1.125rem;
	color: var(--st-ink, #3d1e14);
}

.st-hold-expired__text {
	margin: 0 auto var(--st-space-sm);
	max-width: 46ch;
	color: var(--st-muted, #7a6a5f);
	font-size: 0.9375rem;
}

.st-hold-expired .st-btn-solid {
	width: auto;
}
