/**
 * Ordering Food — styles du shortcode [ordering_food].
 *
 * Tous les sélecteurs enfants sont préfixés par .ordering-food-wrap pour
 * augmenter la spécificité et écraser les styles globaux Elementor/Hello
 * sans recourir à !important.
 *
 * @package Ordering_Food
 */

/* ── Conteneur principal ──────────────────────────────────────────────────── */

.ordering-food-wrap {
	margin-right: auto;
	margin-left: auto;
	padding-top: 10rem;
	padding-bottom: 10rem;
}

/* ── Barre allergènes ─────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-allergen-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 16px;
	margin-bottom: 40px;
	background: #f9f9f9;
	border-radius: 8px;
}

.ordering-food-wrap .ordering-food-allergen-bar__label {
	font-weight: 600;
	white-space: nowrap;
}

.ordering-food-wrap .ordering-food-allergen-bar__list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ordering-food-wrap .ordering-food-allergen-bar__checkbox-label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 0.9rem;
}

.ordering-food-wrap .ordering-food-allergen-checkbox {
	cursor: pointer;
}

/* ── Layout 2 colonnes ────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-layout {
	display: flex;
	gap: 24px;
}

/* ── Sidebar catégories ───────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-sidebar {
	width: 260px;
	flex-shrink: 0;
	align-self: flex-start;
}

.ordering-food-wrap .ordering-food-sidebar__list {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ordering-food-wrap .ordering-food-sidebar__item {
	margin-bottom: 2px;
}

.ordering-food-wrap .ordering-food-sidebar__item + .ordering-food-sidebar__item {
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
}

.ordering-food-wrap .ordering-food-sidebar__btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 16px;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	user-select: none;
	font-size: 1rem;
	background: #ffffff;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ordering-food-wrap .ordering-food-sidebar__btn:hover {
	background-color: #f5f5f5;
	border-color: #e0e0e0;
}

.ordering-food-wrap .ordering-food-sidebar__btn:focus {
	outline: none;
}

.ordering-food-wrap .ordering-food-sidebar__btn:focus-visible {
	outline: 2px solid #A77447;
	outline-offset: 2px;
}

.ordering-food-wrap .ordering-food-sidebar__btn.is-active {
	background: inherit;
	border-left: 4px solid #A77447;
}

/* ── Fond alterné des items catégorie ─────────────────────────────────────── */

.ordering-food-wrap .ordering-food-sidebar__item:nth-child(odd) {
	background: #f5f5f5;
}

.ordering-food-wrap .ordering-food-sidebar__item:nth-child(even) {
	background: #ffffff;
}

.ordering-food-wrap .ordering-food-sidebar__btn svg {
	width: 22px !important;
	height: 22px !important;
	filter: brightness(0) invert(1);
}

.ordering-food-wrap .ordering-food-sidebar__cat-img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 50%;
	flex-shrink: 0;
}

.ordering-food-wrap .ordering-food-sidebar__cat-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ordering-food-wrap .ordering-food-sidebar__empty {
	padding: 12px 16px;
	color: #666;
	font-style: italic;
}

/* ── Icône de catégorie — fallback initiale colorée ──────────────────────── */

.ordering-food-wrap .ordering-food-sidebar__cat-icon,
.ordering-food-wrap .ordering-food-sidebar__cat-initial {
	background: #1F1F1F;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	min-width: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* Actif : fond rouge sur la pastille */
.ordering-food-wrap .ordering-food-sidebar__btn.is-active .ordering-food-sidebar__cat-icon {
	background: #A77447 !important;
}
.ordering-food-wrap .ordering-food-sidebar__btn.is-active .ordering-food-sidebar__cat-initial {
	background: #A77447 !important;
}

/* ── Bouton parent : flèche et état ouvert ───────────────────────────────── */

.ordering-food-wrap .ordering-food-sidebar__arrow {
	margin-left: auto;
	font-size: 0.75rem;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.ordering-food-wrap .ordering-food-sidebar__item.is-open > .ordering-food-sidebar__btn--parent .ordering-food-sidebar__arrow {
	/* Le texte est changé de + à − par JS */
}

/* ── Liste des catégories enfants ────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-cat-children {
	display: none;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ordering-food-wrap .ordering-food-sidebar__item.is-open > .ordering-food-cat-children {
	display: block;
}

.ordering-food-wrap .ordering-food-sidebar__item--child .ordering-food-sidebar__btn {
	padding-left: 20px;
	font-size: 0.9rem;
}

.ordering-food-wrap .ordering-food-sidebar__item--child .ordering-food-sidebar__cat-initial,
.ordering-food-wrap .ordering-food-sidebar__item--child .ordering-food-sidebar__cat-icon {
	width: 32px;
	height: 32px;
	min-width: 32px;
	font-size: 0.75rem;
}

/* ── Barre de tri ─────────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-panel-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.ordering-food-wrap .ordering-food-sort-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 60px;
}

.ordering-food-wrap .ordering-food-sort-bar__label {
	font-weight: 600;
	white-space: nowrap;
	font-size: 0.9rem;
}

.ordering-food-wrap .ordering-food-sort-btn {
	padding: 6px 12px;
	background: #fff;
	color: #1f1f1f;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ordering-food-wrap .ordering-food-sort-btn:hover {
	background-color: #f5f5f5;
	border-color: #bbb;
}

.ordering-food-wrap .ordering-food-sort-btn.is-active {
	background-color: #A77447;
	color: #fff;
	border-color: #A77447;
}

/* ── Panel produits ───────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-panel {
	min-height: 400px;
}

.ordering-food-wrap .ordering-food-panel.is-loading {
	opacity: 0.4;
	pointer-events: none;
}

.ordering-food-wrap .ordering-food-panel__placeholder,
.ordering-food-wrap .ordering-food-panel__empty {
	padding: 40px 0;
	text-align: center;
	color: #888;
}

.ordering-food-wrap .ordering-food-panel__error {
	padding: 16px;
	color: #A77447;
	background: #fdf0ef;
	border: 1px solid #f5c6c2;
	border-radius: 6px;
}

/* ── Grille produits ──────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-product-grid {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 20px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ordering-food-wrap .ordering-food-product-grid__item {
	display: flex;
}

/* ── Carte produit ────────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-product-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	border: 1px solid #eee;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ordering-food-wrap .ordering-food-product-card__img-link {
	display: block;
	flex-shrink: 0;
}

.ordering-food-wrap .ordering-food-product-card__img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.ordering-food-wrap .ordering-food-product-card__body {
	flex: 1;
	padding: 12px;
}

.ordering-food-wrap .ordering-food-product-card__name {
	margin: 0 0 8px;
	font-size: 1rem;
	line-height: 1.3;
}

.ordering-food-wrap .ordering-food-product-card__name a {
	color: inherit;
	text-decoration: none;
}

.ordering-food-wrap .ordering-food-product-card__name a:hover {
	text-decoration: underline;
}

.ordering-food-wrap .ordering-food-product__description {
	font-size: 0.8rem;
	color: #888;
	margin: 2px 0 6px;
	line-height: 1.3;
}

.ordering-food-wrap .ordering-food-product-card__price {
	margin: 0 0 10px;
	font-weight: 700;
}

/* ── Allergènes ───────────────────────────────────────────────────────────── */

.ordering-food-wrap .ordering-food-product-card__allergens {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 0;
	margin: 0 0 10px;
	list-style: none;
	font-size: 11px;
}

.ordering-food-wrap .ordering-food-product-card__allergen {
	padding: 2px 6px;
	background: #fff3cd;
	border-radius: 3px;
	line-height: 1.4;
}

/* ── Footer carte (bouton ajout panier) ───────────────────────────────────── */

.ordering-food-wrap .ordering-food-product-card__footer {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.ordering-food-wrap .ordering-food-qty {
	display: flex;
	align-items: center;
	width: 100%;
	justify-content: center;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: visible;
}

.ordering-food-wrap .ordering-food-qty__btn {
	background: none;
	border: none;
	padding: 2px 8px;
	cursor: pointer;
	font-size: 0.85rem;
	color: #1f1f1f;
	line-height: 1;
}

.ordering-food-wrap .ordering-food-qty__btn:hover {
	background: #f0f0f0;
}

.ordering-food-wrap .ordering-food-qty__input {
	width: 60px;
	text-align: center;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	font-size: 0.95rem;
	padding: 6px 0;
	-moz-appearance: textfield;
}

.ordering-food-wrap .ordering-food-product-card__footer {
	padding: 0 12px 12px;
}

.ordering-food-wrap .ordering-food-product-card__footer .add_to_cart_button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 16px;
	background-color: #A77447 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 500px;
	text-align: center;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ordering-food-wrap .ordering-food-product-card__footer .add_to_cart_button:hover {
	background-color: #A77447 !important;
}

.ordering-food-wrap .ordering-food-product-card__footer .add_to_cart_button:focus {
	outline: none;
}

.ordering-food-wrap .ordering-food-product-card__footer .add_to_cart_button:focus-visible {
	outline: 2px solid #A77447;
	outline-offset: 2px;
}

/* ── Bouton ajout panier (div — insensible aux resets Elementor) ──────────── */

.ordering-food-wrap .ordering-food-product-card__footer .ordering-food-add-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 16px;
	background-color: #A77447;
	color: #fff;
	border-radius: 500px;
	text-align: center;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
	box-sizing: border-box;
}

.ordering-food-wrap .ordering-food-product-card__footer .ordering-food-add-btn:hover {
	background-color: #A77447;
}

.ordering-food-wrap .ordering-food-product-card__footer .ordering-food-add-btn:focus {
	outline: none;
}

.ordering-food-wrap .ordering-food-product-card__footer .ordering-food-add-btn:focus-visible {
	outline: 2px solid #A77447;
	outline-offset: 2px;
}

.ordering-food-wrap .ordering-food-product-card__footer .ordering-food-add-btn[aria-disabled="true"] {
	opacity: 0.7;
	cursor: not-allowed;
}

/* ── Responsive ≤ 768px ───────────────────────────────────────────────────── */

@media ( max-width: 768px ) {

	.ordering-food-wrap {
		padding-top: 4rem;
		padding-bottom: 4rem;
	}
}

@media ( max-width: 767px ) {

	.ordering-food-wrap .ordering-food-layout {
		flex-direction: column;
	}

	.ordering-food-wrap .ordering-food-sidebar {
		width: 100%;
		position: static;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ordering-food-wrap .ordering-food-sidebar__list {
		flex-direction: row;
		gap: 8px;
		padding-bottom: 4px;
	}

	.ordering-food-wrap .ordering-food-sidebar__item {
		flex-shrink: 0;
	}

	.ordering-food-wrap .ordering-food-sidebar__btn {
		white-space: nowrap;
	}

}

@media ( min-width: 600px ) and ( max-width: 899px ) {

	.ordering-food-wrap .ordering-food-product-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 599px ) {

	.ordering-food-wrap .ordering-food-product-grid {
		grid-template-columns: 1fr;
	}
}

@media ( min-width: 900px ) and ( max-width: 1199px ) {

	.ordering-food-wrap .ordering-food-product-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}
