/* ==========================================================================
   CESFO — Page catalogue style menu restaurant (inspiré Shrimpy)
   ========================================================================== */

/* Variables locales */
.cesfo-menu-catalogue {
	--menu-teal:        #4BBDAD;
	--menu-teal-dark:   #38A898;
	--menu-teal-light:  #E8F8F6;
	--menu-navy:        #2D3A4E;
	--menu-gray:        #5F6B7A;
	--menu-gray-light:  #f5f8f8;
	--menu-border:      #DDE8E7;
	--menu-white:       #ffffff;
	--menu-radius:      12px;
	--menu-shadow:      0 3px 14px rgba(45,58,78,.10);
	--menu-shadow-hover:0 8px 28px rgba(45,58,78,.18);
	font-family: 'Nunito', sans-serif;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* ==========================================================================
   SÉLECTEUR DE MARCHÉ (niveau 1) — même style que les onglets catégories
   ========================================================================== */

.cesfo-marche-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 1rem 0 0;
	justify-content: center;
}

/* Identique à .cesfo-menu-tab */
.cesfo-marche-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	padding: 0.75rem 1.25rem;
	background: var(--menu-white);
	border: 2px solid var(--menu-border);
	border-radius: var(--menu-radius);
	cursor: pointer;
	font-family: 'Nunito', sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--menu-gray);
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
	min-width: 90px;
	text-align: center;
}

.cesfo-marche-btn:hover {
	border-color: var(--menu-teal);
	color: var(--menu-teal);
	background: var(--menu-teal-light);
	transform: translateY(-2px);
	box-shadow: var(--menu-shadow);
}

.cesfo-marche-btn.active {
	background: var(--menu-teal);
	border-color: var(--menu-teal);
	color: var(--menu-white);
	box-shadow: 0 4px 14px rgba(75,189,173,.35);
}

.cesfo-marche-btn.active:hover {
	background: var(--menu-teal-dark);
	border-color: var(--menu-teal-dark);
	transform: translateY(-2px);
}

/* ==========================================================================
   ONGLETS CATÉGORIES (niveau 2)
   ========================================================================== */

/* Groupes d'onglets cachés par défaut — !important pour battre .cesfo-menu-tabs */
.cesfo-menu-tabs[data-marche] {
	display: none !important;
}

.cesfo-menu-tabs[data-marche].cesfo-tabs-visible {
	display: flex !important;
}

/* Pendant la recherche : cacher le sélecteur marché ET tous les groupes d'onglets */
.cesfo-menu-catalogue.cesfo-search-active .cesfo-marche-switcher,
.cesfo-menu-catalogue.cesfo-search-active .cesfo-menu-tabs[data-marche] {
	display: none;
}

.cesfo-menu-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 1rem 0 1.5rem;
	border-bottom: 2px solid var(--menu-border);
	margin-bottom: 1.5rem;
	justify-content: center;
	background: #fff;
}

.cesfo-menu-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	padding: 0.75rem 1.25rem;
	background: var(--menu-white);
	border: 2px solid var(--menu-border);
	border-radius: var(--menu-radius);
	cursor: pointer;
	font-family: 'Nunito', sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--menu-gray);
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
	min-width: 90px;
	text-align: center;
}

.cesfo-menu-tab:hover {
	border-color: var(--menu-teal);
	color: var(--menu-teal);
	background: var(--menu-teal-light);
	transform: translateY(-2px);
	box-shadow: var(--menu-shadow);
}

.cesfo-menu-tab.active {
	background: var(--menu-teal);
	border-color: var(--menu-teal);
	color: var(--menu-white);
	box-shadow: 0 4px 14px rgba(75,189,173,.35);
}

.cesfo-menu-tab.active:hover {
	background: var(--menu-teal-dark);
	border-color: var(--menu-teal-dark);
	transform: translateY(-2px);
}

/* Icône onglet */
.cesfo-tab-icon {
	font-size: 1.4rem;
	line-height: 1;
	display: block;
}

.cesfo-tab-icon img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

.cesfo-tab-label {
	display: block;
	white-space: nowrap;
}

/* ==========================================================================
   LOADER
   ========================================================================== */

.cesfo-menu-loader {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	height: 0;
	overflow: hidden;
	transition: height 0.2s ease;
	margin-bottom: 0;
}

.cesfo-menu-loader.visible {
	height: 3rem;
	margin-bottom: 1.5rem;
}

.cesfo-loader-dot {
	width: 10px;
	height: 10px;
	background: var(--menu-teal);
	border-radius: 50%;
	animation: cesfo-bounce 1.2s infinite ease-in-out;
}

.cesfo-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.cesfo-loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes cesfo-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
	40%           { transform: scale(1.0); opacity: 1;   }
}

/* ==========================================================================
   GRILLE PRODUITS
   ========================================================================== */

.cesfo-menu-products {
	transition: opacity 0.25s ease, transform 0.25s ease;
	opacity: 1;
	transform: translateY(0);
	min-height: 200px;
}

.cesfo-menu-products.cesfo-menu-fade-out {
	opacity: 0;
	transform: translateY(8px);
}

.cesfo-menu-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem 2rem;
}

/* Message vide */
.cesfo-menu-empty {
	text-align: center;
	color: var(--menu-gray);
	padding: 3rem 0;
	font-size: 1rem;
	grid-column: 1 / -1;
}

/* ==========================================================================
   CARTE PRODUIT — style Shrimpy
   ========================================================================== */

.cesfo-menu-item {
	animation: cesfo-item-in 0.35s ease both;
}

@keyframes cesfo-item-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Décaler l'animation pour un effet cascade */
.cesfo-menu-item:nth-child(3n+2) { animation-delay: 0.05s; }
.cesfo-menu-item:nth-child(3n+3) { animation-delay: 0.10s; }

.cesfo-menu-item-link {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--menu-border);
	text-decoration: none !important;
	transition: transform 0.2s ease;
}

.cesfo-menu-item:last-child .cesfo-menu-item-link {
	border-bottom: none;
}

.cesfo-menu-item-link:hover {
	transform: translateX(4px);
}

/* Image ronde (style Shrimpy) */
.cesfo-menu-item-img-wrap {
	flex-shrink: 0;
	width: 90px;
	height: 90px;
	border-radius: 50%;
	overflow: hidden;
	border: 3px solid var(--menu-border);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background: var(--menu-gray-light);
}

.cesfo-menu-item-link:hover .cesfo-menu-item-img-wrap {
	border-color: var(--menu-teal);
	box-shadow: 0 0 0 3px rgba(75,189,173,.20);
}

.cesfo-menu-item-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
	transition: transform 0.4s ease;
}

.cesfo-menu-item-link:hover .cesfo-menu-item-img {
	transform: scale(1.08);
}

/* Texte */
.cesfo-menu-item-body {
	flex: 1;
	min-width: 0;
}

.cesfo-menu-item-name {
	font-family: 'Nunito', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--menu-navy);
	margin: 0 0 0.3rem;
	line-height: 1.3;
	transition: color 0.2s ease;
}

.cesfo-menu-item-link:hover .cesfo-menu-item-name {
	color: var(--menu-teal);
}

.cesfo-menu-item-desc {
	font-size: 0.85rem;
	color: var(--menu-gray);
	line-height: 1.5;
	margin: 0 0 0.5rem;
}

.cesfo-menu-item-price {
	font-size: 1rem;
	font-weight: 700;
	color: var(--menu-teal);
}

.cesfo-menu-item-price .woocommerce-Price-amount {
	color: var(--menu-teal);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.cesfo-menu-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
	padding: 2rem 0 1rem;
}

.cesfo-page-btn {
	min-width: 38px;
	height: 38px;
	padding: 0 0.6rem;
	border: 2px solid var(--menu-border);
	border-radius: 8px;
	background: var(--menu-white);
	color: var(--menu-gray);
	font-family: 'Nunito', sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cesfo-page-btn:hover:not([disabled]) {
	border-color: var(--menu-teal);
	color: var(--menu-teal);
	background: var(--menu-teal-light);
}

.cesfo-page-btn.active {
	background: var(--menu-teal);
	border-color: var(--menu-teal);
	color: var(--menu-white);
}

.cesfo-page-btn[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
	.cesfo-menu-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.cesfo-menu-tabs {
		justify-content: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 1rem;
	}

	.cesfo-menu-tab {
		flex-shrink: 0;
	}

	.cesfo-menu-grid {
		grid-template-columns: 1fr;
	}

	.cesfo-menu-item-img-wrap {
		width: 70px;
		height: 70px;
	}
}
