/* --- Masque le lien "Voir le panier" que WooCommerce ajoute lui-même
   après un ajout réussi (à côté du bouton) : redondant avec notre propre
   panier latéral, et renvoie vers la page panier classique. --- */
.thresto-inline-panel .added_to_cart,
.thresto-cart-edit-panel .added_to_cart {
	display: none !important;
}

/* --- Barre de recherche + filtres catégorie --- */
.thresto-menu-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.thresto-menu-search {
	flex: 1 1 220px;
	min-width: 180px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}

.thresto-menu-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.thresto-menu-cat-btn {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.thresto-menu-cat-btn:hover {
	border-color: #999;
}
.thresto-menu-cat-btn.is-active {
	background: #1e1e1e;
	border-color: #1e1e1e;
	color: #fff;
}

.thresto-menu-empty-filtered[hidden] {
	display: none;
}

/* --- Grille de produits (masonry via colonnes CSS — pas de JS requis,
   les cartouches gardent leur hauteur naturelle au lieu d'être étirées) --- */
.thresto-menu-grid {
	column-count: 3;
	column-gap: 20px;
}

.thresto-menu-card {
	break-inside: avoid;
	margin-bottom: 20px;
}

@media (max-width: 900px) {
	.thresto-menu-grid {
		column-count: 2;
	}
}

@media (max-width: 560px) {
	.thresto-menu-grid {
		column-count: 1;
	}
}

.thresto-menu-card {
	border: none;
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: 0 2px 14px rgba(0, 0, 0, .09);
}

.thresto-menu-card-image {
	display: block;
	background: #f2f2f2;
	cursor: pointer;
}
.thresto-menu-card-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.thresto-menu-card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	text-align: center;
}

.thresto-menu-card-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
}

.thresto-menu-card-excerpt {
	font-size: 13px;
	color: #767676;
	line-height: 1.4;
}
.thresto-menu-card-excerpt p {
	margin: 0;
}

.thresto-menu-card-price {
	font-weight: 700;
	font-size: 20px;
	color: var(--thresto-accent, #1e1e1e);
}

/* Bouton à contour — cohérent avec "Modifier" et "Continuer ma commande",
   couleur paramétrable dans ThResto → Apparence panier. */
.thresto-menu-card-cta {
	display: block;
	width: 100%;
	background: none;
	border: 2px solid var(--thresto-contour, #1e1e1e);
	color: var(--thresto-contour, #1e1e1e);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .01em;
	padding: 14px 12px;
	cursor: pointer;
	text-align: center;
	transition: filter .15s ease;
}
.thresto-menu-card-cta:hover {
	filter: brightness(.9);
}
.thresto-menu-card-cta[aria-expanded="true"] {
	background: var(--thresto-contour, #1e1e1e);
	color: #fff;
}

/* --- Dépliant inline (suppléments + formulaire d'ajout) ---
   Réutilisé sur la cartouche ET dans le panier ("Modifier"). */
.thresto-inline-panel {
	border-top: 1px solid #eee;
	padding: 6px 14px 8px;
	background: #fafafa;
}
.thresto-inline-panel[hidden] {
	display: none;
}

.thresto-inline-panel-loading {
	text-align: center;
	color: #666;
	padding: 16px 0;
	margin: 0;
}

.thresto-product-panel-inner .summary {
	min-width: 0;
}
.thresto-product-panel-inner .summary > *:first-child {
	margin-top: 0;
}

/* Description courte + allergènes/régime : même habillage que les
   groupes de suppléments (Accompagnement), pour une présentation homogène. */
.thresto-product-panel-inner .woocommerce-product-details__short-description,
.thresto-product-panel-inner .thresto-product-infos {
	margin: 0 0 4px;
	padding: 8px 10px;
	border: 1px solid var(--thresto-panel-border, #e5e5e5);
	border-radius: 6px;
}
.thresto-product-panel-inner .woocommerce-product-details__short-description > *:last-child,
.thresto-product-panel-inner .thresto-product-infos > *:last-child {
	margin-bottom: 0;
}

/* Quantité + bouton "Ajouter au panier" sur la même ligne, bouton dans le
   même style que "Voir les suppléments" (pleine largeur restante, fond
   plein). Les suppléments (avant dans le form) restent sur leur propre
   ligne via flex-basis: 100%. */
.thresto-inline-panel form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0;
}
.thresto-inline-panel form.cart > .thresto-supplements {
	flex: 1 1 100%;
	margin: 0 0 4px;
}
.thresto-inline-panel form.cart .quantity {
	flex: 0 0 auto;
	margin: 0;
}
.thresto-inline-panel form.cart .quantity .qty {
	width: 62px;
	padding: 12px 8px;
	border: 1px solid #ddd;
	border-radius: 10px;
	text-align: center;
}

.thresto-inline-panel form.cart .single_add_to_cart_button {
	flex: 1 1 auto;
	display: block;
	border: none;
	background: var( --thresto-accent, #1e1e1e );
	color: #fff;
	font-weight: 700;
	font-size: 18px;
	padding: 14px 12px;
	border-radius: 10px;
	cursor: pointer;
	text-align: center;
	transition: filter .15s ease;
}
.thresto-inline-panel form.cart .single_add_to_cart_button:hover {
	filter: brightness(1.08);
	color: #fff;
}
.thresto-inline-panel form.cart .single_add_to_cart_button:disabled,
.thresto-inline-panel form.cart .single_add_to_cart_button.disabled {
	opacity: .5;
	cursor: not-allowed;
	filter: none;
}

/* "Modifier" (reconfiguration d'un article déjà au panier) — même bouton
   que "Ajouter au panier", mais en contour pour bien le distinguer d'un
   nouvel ajout. */
.thresto-cart-edit-panel .single_add_to_cart_button {
	background: none;
	border: 2px solid var( --thresto-contour, #1e1e1e );
	color: var( --thresto-contour, #1e1e1e );
}
.thresto-cart-edit-panel .single_add_to_cart_button:hover {
	background: var( --thresto-contour, #1e1e1e );
	color: #fff;
}

/* --- Panier --- */
.thresto-cart-toggle {
	position: relative;
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	padding: 6px 10px;
}

.thresto-cart-toggle-flottant {
	position: fixed;
	right: 32px;
	bottom: 32px;
	width: 68px;
	height: 68px;
	background: #1e1e1e;
	color: #fff;
	border-radius: 50%;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
	z-index: 9997;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
}
.thresto-cart-toggle-flottant .thresto-cart-count {
	font-size: 12px;
	padding: 4px 7px;
}

.thresto-cart-count {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #d63638;
	color: #fff;
	font-size: 11px;
	line-height: 1;
	border-radius: 50%;
	padding: 3px 6px;
	min-width: 16px;
	text-align: center;
}

.thresto-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .4);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease;
	z-index: 9998;
}
.thresto-cart-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.thresto-cart-panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(380px, 100vw);
	background: var(--thresto-panel-bg, #fff);
	color: var(--thresto-panel-text, inherit);
	box-shadow: -4px 0 16px rgba(0, 0, 0, .15);
	transform: translateX(100%);
	transition: transform .3s ease;
	z-index: 9999;
	display: flex;
	flex-direction: column;
}
.thresto-cart-panel.is-open {
	transform: translateX(0);
}

.thresto-cart-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid #eee;
}
.thresto-cart-panel-header h3 {
	margin: 0;
}
.thresto-cart-panel-header button {
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
}

.thresto-cart-panel {
	font-size: 14px;
	line-height: 1.35;
}
.thresto-cart-panel-header h3 {
	font-size: 17px;
	margin: 0;
}
/* Le formulaire d'ajout/suppléments est réutilisé tel quel (mêmes classes
   que la cartouche de la grille) — on réduit polices et espaces ICI
   uniquement, pour ne pas affecter l'affichage sur la grille. */
.thresto-cart-panel .thresto-supplement-groupe-nom {
	font-size: 14px;
	margin-bottom: 4px;
}
.thresto-cart-panel .thresto-supplement-option {
	font-size: 13px;
	padding: 2px 0;
	gap: 6px;
}
.thresto-cart-panel .thresto-supplement-groupe {
	padding: 8px 10px;
	margin-bottom: 6px;
}
.thresto-cart-panel .thresto-product-panel-inner .woocommerce-product-details__short-description,
.thresto-cart-panel .thresto-product-panel-inner .thresto-product-infos {
	font-size: 13px;
	padding: 8px 10px;
	margin-bottom: 6px;
}
.thresto-cart-panel .thresto-inline-panel form.cart {
	gap: 8px;
}
.thresto-cart-panel .thresto-inline-panel form.cart .quantity .qty {
	padding: 10px 6px;
}
.thresto-cart-panel .thresto-inline-panel form.cart .single_add_to_cart_button {
	padding: 12px 10px;
	font-size: 16px;
}

.thresto-cart-panel-content {
	padding: 14px;
	overflow-y: auto;
	flex: 1;
}

.thresto-cart-items {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.thresto-cart-item {
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
}

.thresto-cart-item-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.thresto-cart-item.is-being-edited .thresto-cart-item-image,
.thresto-cart-item.is-being-edited .thresto-cart-item-name {
	opacity: .5;
}

.thresto-cart-item-image img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
}

.thresto-cart-item-details {
	flex: 1;
}
.thresto-cart-item-name {
	font-weight: 600;
	font-size: 14px;
}
.thresto-cart-item-qty {
	font-size: 13px;
	color: #666;
}

.thresto-cart-item-options {
	list-style: none;
	margin: 2px 0;
	padding: 0;
	font-size: 12px;
	color: #888;
}

.thresto-cart-item-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.thresto-cart-item-edit {
	background: none;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 11px;
	padding: 3px 8px;
	cursor: pointer;
	white-space: nowrap;
}
.thresto-cart-item-edit:hover {
	border-color: #999;
}

.thresto-cart-item-remove {
	background: none;
	border: none;
	color: #d63638;
	font-size: 18px;
	line-height: 1;
	padding: 0 4px;
	cursor: pointer;
}

.thresto-cart-edit-panel {
	margin-top: 6px;
	border-radius: 4px;
}

.thresto-cart-total {
	padding: 8px 0;
	border-top: 1px solid #eee;
	margin-bottom: 8px;
}

.thresto-cart-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background: var(--thresto-accent, #1e1e1e);
	color: #fff;
	padding: 12px;
	border-radius: 4px;
	text-decoration: none;
}

/* Bouton "Continuer ma commande" — ferme le panier pour reprendre la
   navigation là où on était, utile surtout sur mobile où le panier prend
   tout l'écran. Caché sur desktop (le clic hors panier ou la croix suffit). */
.thresto-cart-continue-btn {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background: none;
	border: 2px solid var(--thresto-contour, #1e1e1e);
	color: var(--thresto-contour, #1e1e1e);
	padding: 12px;
	border-radius: 4px;
	margin-top: 8px;
	cursor: pointer;
}
@media (max-width: 782px) {
	.thresto-cart-continue-btn {
		display: flex;
	}
}

.thresto-cart-empty {
	color: #666;
}
