/**
 * RestoPress — carte du restaurant en front-office.
 * Palette claire, typographie éditoriale, filtres discrets.
 */

.restopress {
	--rp-accent: #c2963c;
	--rp-ink: #16181d;
	--rp-muted: #6c7280;
	--rp-line: #e7e4dd;
	--rp-surface: #ffffff;
	--rp-canvas: #faf9f6;
	--rp-radius: 16px;
	--rp-shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 12px 32px -20px rgba(22, 24, 29, .35);
	--rp-sticky-top: 0px;

	box-sizing: border-box;
	max-width: 1040px;
	margin: 0 auto;
	color: var(--rp-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
}

.restopress *,
.restopress *::before,
.restopress *::after {
	box-sizing: inherit;
}

.restopress .rp-intro {
	margin: 0 0 28px;
	color: var(--rp-muted);
	font-size: 1.05rem;
	text-align: center;
}

.restopress .rp-intro p {
	margin: 0 0 .5em;
}

/* --- Filtres ------------------------------------------------------------ */

.restopress .rp-filters {
	position: sticky;
	top: var(--rp-sticky-top);
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-bottom: 34px;
	padding: 20px 22px;
	border: 1px solid var(--rp-line);
	border-radius: var(--rp-radius);
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(10px);
	box-shadow: var(--rp-shadow);
}

.restopress .rp-search {
	position: relative;
	display: flex;
	align-items: center;
}

.restopress .rp-search__icon {
	position: absolute;
	left: 16px;
	width: 18px;
	height: 18px;
	fill: var(--rp-muted);
	pointer-events: none;
}

.restopress .rp-search__input {
	width: 100%;
	margin: 0;
	padding: 13px 44px 13px 46px;
	border: 1px solid var(--rp-line);
	border-radius: 999px;
	background: var(--rp-canvas);
	color: var(--rp-ink);
	font: inherit;
	line-height: 1.4;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.restopress .rp-search__input::placeholder {
	color: #9aa0a8;
}

.restopress .rp-search__input:focus {
	outline: none;
	border-color: var(--rp-accent);
	background: var(--rp-surface);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--rp-accent) 18%, transparent);
}

.restopress .rp-search__clear {
	position: absolute;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--rp-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.restopress .rp-search__clear:hover {
	background: var(--rp-canvas);
	color: var(--rp-ink);
}

/* Une déclaration « display » d'auteur l'emporte sur la feuille du navigateur :
   sans ces règles, l'attribut hidden ne masquerait plus ces deux boutons. */
.restopress .rp-search__clear[hidden],
.restopress .rp-reset[hidden] {
	display: none;
}

.restopress .rp-filter {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.restopress .rp-filter__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.restopress .rp-filter__label {
	color: var(--rp-muted);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.restopress .rp-filter__hint {
	margin: 2px 0 0;
	color: var(--rp-muted);
	font-size: .84rem;
}

.restopress .rp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.restopress .rp-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 8px 15px;
	border: 1px solid var(--rp-line);
	border-radius: 999px;
	background: var(--rp-surface);
	color: var(--rp-ink);
	font: inherit;
	font-size: .92rem;
	line-height: 1.25;
	cursor: pointer;
	transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.restopress .rp-chip:hover {
	border-color: var(--rp-accent);
	transform: translateY(-1px);
}

.restopress .rp-chip:focus-visible {
	outline: 2px solid var(--rp-accent);
	outline-offset: 2px;
}

.restopress .rp-chip.is-active {
	border-color: var(--rp-accent);
	background: var(--rp-accent);
	color: #fff;
}

.restopress .rp-chip__count {
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--rp-canvas);
	color: var(--rp-muted);
	font-size: .74rem;
	font-variant-numeric: tabular-nums;
}

.restopress .rp-chip.is-active .rp-chip__count {
	background: rgba(255, 255, 255, .24);
	color: #fff;
}

.restopress .rp-chip--allergen.is-active {
	border-color: #c9484a;
	background: #fdf2f2;
	color: #a3282a;
	text-decoration: line-through;
}

.restopress .rp-filter--allergens[data-mode="include"] .rp-chip--allergen.is-active {
	border-color: var(--rp-accent);
	background: var(--rp-accent);
	color: #fff;
	text-decoration: none;
}

.restopress .rp-mode {
	display: inline-flex;
	padding: 3px;
	border: 1px solid var(--rp-line);
	border-radius: 999px;
	background: var(--rp-canvas);
}

.restopress .rp-mode__btn {
	margin: 0;
	padding: 5px 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--rp-muted);
	font: inherit;
	font-size: .84rem;
	cursor: pointer;
	transition: background-color .16s ease, color .16s ease;
}

.restopress .rp-mode__btn.is-active {
	background: var(--rp-surface);
	color: var(--rp-ink);
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(22, 24, 29, .12);
}

.restopress .rp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 4px;
	border-top: 1px solid var(--rp-line);
}

.restopress .rp-count {
	margin: 8px 0 0;
	color: var(--rp-muted);
	font-size: .88rem;
}

.restopress .rp-reset {
	margin: 8px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rp-accent);
	font: inherit;
	font-size: .88rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* --- Carte -------------------------------------------------------------- */

.restopress .rp-category {
	margin: 0 0 44px;
}

.restopress .rp-category[hidden] {
	display: none;
}

.restopress .rp-category__title {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 20px;
	color: var(--rp-ink);
	font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
	font-size: 1.6rem;
	font-weight: 500;
	letter-spacing: -.01em;
}

.restopress .rp-category__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(to right, var(--rp-line), transparent);
}

.restopress .rp-items {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.restopress--grid .rp-items {
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 14px;
}

.restopress .rp-item {
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 16px 18px;
	border: 1px solid transparent;
	border-radius: 14px;
	list-style: none;
	transition: background-color .18s ease, border-color .18s ease;
}

.restopress .rp-item:hover {
	border-color: var(--rp-line);
	background: var(--rp-canvas);
}

.restopress--grid .rp-item {
	border-color: var(--rp-line);
	background: var(--rp-surface);
	box-shadow: var(--rp-shadow);
}

.restopress .rp-item[hidden] {
	display: none;
}

.restopress .rp-item__image {
	flex: 0 0 auto;
	width: 76px;
	height: 76px;
	border-radius: 12px;
	object-fit: cover;
}

.restopress .rp-item__main {
	flex: 1 1 auto;
	min-width: 0;
}

.restopress .rp-item__head {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.restopress .rp-item__name {
	margin: 0;
	color: var(--rp-ink);
	font-family: inherit;
	font-size: 1.06rem;
	font-weight: 600;
	letter-spacing: -.005em;
}

.restopress .rp-item__dots {
	flex: 1 1 auto;
	min-width: 18px;
	height: .55em;
	border-bottom: 1px dotted #cfcbc2;
}

.restopress .rp-item__price {
	flex: 0 0 auto;
	color: var(--rp-accent);
	font-size: 1.02rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.restopress .rp-item__composition {
	margin: 5px 0 0;
	color: var(--rp-muted);
	font-size: .94rem;
}

.restopress .rp-item__allergens {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.restopress .rp-tag {
	margin: 0;
	padding: 3px 9px;
	border: 1px solid var(--rp-line);
	border-radius: 999px;
	background: var(--rp-canvas);
	color: var(--rp-muted);
	font-size: .74rem;
	letter-spacing: .02em;
	list-style: none;
	white-space: nowrap;
}

.restopress .rp-tag.is-flagged {
	border-color: #e3b5b6;
	background: #fdf2f2;
	color: #a3282a;
}

.restopress .rp-category__empty,
.restopress .rp-empty {
	margin: 0;
	padding: 28px;
	border: 1px dashed var(--rp-line);
	border-radius: var(--rp-radius);
	color: var(--rp-muted);
	text-align: center;
}

.restopress .rp-empty[hidden] {
	display: none;
}

/* --- Pied de carte ------------------------------------------------------ */

.restopress .rp-legend {
	margin-top: 12px;
	padding: 18px 20px;
	border-radius: var(--rp-radius);
	background: var(--rp-canvas);
	color: var(--rp-muted);
	font-size: .86rem;
}

.restopress .rp-legend strong {
	color: var(--rp-ink);
}

.restopress .rp-legend__note {
	display: block;
	margin-top: 6px;
	font-style: italic;
}

.restopress .rp-notice {
	padding: 40px 24px;
	border: 1px dashed var(--rp-line);
	border-radius: var(--rp-radius);
	color: var(--rp-muted);
	text-align: center;
}

.restopress .rp-notice__debug {
	margin-top: 10px;
	font-size: .86rem;
}

/* --- Notification de mise à jour ---------------------------------------- */

.restopress .rp-toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 999;
	padding: 11px 20px;
	border-radius: 999px;
	background: var(--rp-ink);
	color: #fff;
	font-size: .88rem;
	box-shadow: 0 12px 30px -12px rgba(22, 24, 29, .6);
	transform: translate(-50%, 12px);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
}

.restopress .rp-toast.is-visible {
	transform: translate(-50%, 0);
	opacity: 1;
}

.restopress .rp-body.is-updating {
	opacity: .55;
	transition: opacity .2s ease;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 640px) {
	.restopress .rp-filters {
		padding: 16px;
	}

	.restopress .rp-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.restopress .rp-chips::-webkit-scrollbar {
		display: none;
	}

	.restopress .rp-chips--allergens {
		flex-wrap: wrap;
		overflow: visible;
	}

	.restopress .rp-item {
		padding: 14px 12px;
	}

	.restopress .rp-item__head {
		flex-wrap: wrap;
	}

	.restopress .rp-item__dots {
		display: none;
	}

	.restopress .rp-item__price {
		margin-left: auto;
	}

	.restopress .rp-category__title {
		font-size: 1.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.restopress * {
		transition: none !important;
	}
}

@media print {
	.restopress .rp-filters,
	.restopress .rp-toast {
		display: none;
	}

	.restopress .rp-item,
	.restopress .rp-category {
		break-inside: avoid;
	}
}
