/* Gustivo — menu pubblico. Usato sia dalla pagina /{slug} sia dal widget embed (Shadow DOM). */

.gm {
	--accent: #c2410c;
	--accent-text: var(--accent);
	--font-display: Georgia, serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--bg: #fbf8f3;
	--surface: #ffffff;
	--fg: #1c1917;
	--muted: #6b625a;
	--line: #e9e2d8;
	--chip: #f3ede4;
	--sold: #a8a29e;
	--shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 4px 16px rgb(28 25 23 / 0.06);

	box-sizing: border-box;
	color: var(--fg);
	background: var(--bg);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	min-height: 100%;
}

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

.gm[data-theme="dark"] {
	--bg: #141210;
	--surface: #1d1a17;
	--fg: #f5f0ea;
	--muted: #a89f95;
	--line: #2e2a25;
	--chip: #27231f;
	--sold: #6b645d;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
	--accent-text: color-mix(in srgb, var(--accent) 60%, #ffffff);
}

@media (prefers-color-scheme: dark) {
	.gm[data-theme="auto"] {
		--bg: #141210;
		--surface: #1d1a17;
		--fg: #f5f0ea;
		--muted: #a89f95;
		--line: #2e2a25;
		--chip: #27231f;
		--sold: #6b645d;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
		--accent-text: color-mix(in srgb, var(--accent) 60%, #ffffff);
	}
}

.gm a {
	color: inherit;
}

.gm button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.gm-wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 16px;
}

/* ---------- Header ---------- */

.gm-hero {
	position: relative;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.gm-hero__cover {
	height: 180px;
	background-size: cover;
	background-position: center;
}

.gm-hero__body {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	padding: 24px 16px 20px;
}

.gm-hero:not(.gm-hero--cover) .gm-hero__body {
	padding-top: 60px;
}

.gm-hero--cover .gm-hero__body {
	padding-top: 0;
}

.gm-hero__logo {
	width: 88px;
	height: 88px;
	border-radius: 22px;
	object-fit: contain;
	background: var(--surface);
	box-shadow: var(--shadow);
	padding: 8px;
}

.gm-hero--cover .gm-hero__logo {
	margin-top: -44px;
}

.gm-hero__name {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(1.6rem, 6vw, 2.2rem);
	line-height: 1.15;
	margin: 6px 0 0;
	letter-spacing: -0.01em;
}

.gm-hero__meta {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 0;
}

.gm-toolbar {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	gap: 6px;
}

/* Intestazione nascosta dal sito del locale: resta solo la lingua, sullo sfondo della pagina. */
.gm-hero.gm-hero--compact {
	display: flex;
	justify-content: center;
	padding: 12px 12px 0;
	background: transparent;
	border-bottom: 0;
}

/* Con la barra delle categorie subito sotto, un po' di respiro tra le due. */
.gm-hero.gm-hero--compact:has(~ .gm-nav) {
	padding-bottom: 16px;
}

.gm-hero--compact .gm-toolbar {
	position: static;
}

.gm-tools .gm-filter-btn:only-child {
	margin-left: auto;
}

.gm-toolbar__btn,
.gm-lang summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(8px);
	font-size: 0.85rem;
	list-style: none;
	cursor: pointer;
}

.gm-lang summary::-webkit-details-marker {
	display: none;
}

.gm-lang {
	position: relative;
}

.gm-lang__menu {
	position: absolute;
	right: 0;
	top: 42px;
	z-index: 30;
	min-width: 160px;
	padding: 6px;
	border-radius: 14px;
	border: 1px solid var(--line);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.gm-lang__menu a {
	display: flex;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	text-decoration: none;
	font-size: 0.9rem;
}

.gm-lang__menu a:hover,
.gm-lang__menu a[aria-current="true"] {
	background: var(--chip);
}

/* ---------- Menu switcher + navigazione categorie ---------- */

.gm-menus {
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
	padding: 16px 0 4px;
}

.gm-menus a {
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid var(--line);
	text-decoration: none;
	font-size: 0.9rem;
	background: var(--surface);
}

.gm-menus a[aria-current="true"] {
	background: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
}

.gm-nav {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}

.gm-nav__scroll {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 10px 16px;
	max-width: 760px;
	margin: 0 auto;
}

.gm-nav__scroll::-webkit-scrollbar {
	display: none;
}

.gm-nav a {
	flex: none;
	padding: 6px 14px;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.875rem;
	color: var(--muted);
	white-space: nowrap;
	transition: background-color 0.15s, color 0.15s;
}

.gm-nav a.is-active {
	background: var(--accent);
	color: #fff;
}

/* ---------- Ricerca e filtri ---------- */

.gm-tools {
	display: flex;
	gap: 8px;
	padding: 16px 0 0;
}

.gm-search {
	flex: 1;
	position: relative;
}

.gm-search input {
	width: 100%;
	height: 44px;
	padding: 0 14px 0 40px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-size: 0.95rem;
}

.gm-search input:focus {
	outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
	outline-offset: 1px;
}

.gm-search svg {
	position: absolute;
	left: 13px;
	top: 13px;
	color: var(--muted);
}

.gm-filter-btn {
	height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9rem;
}

.gm-filter-btn[aria-expanded="true"],
.gm-filter-btn.has-filters {
	border-color: var(--accent);
	color: var(--accent);
}

.gm-filters {
	margin-top: 10px;
	padding: 14px;
	border-radius: 14px;
	border: 1px solid var(--line);
	background: var(--surface);
}

.gm-filters[hidden] {
	display: none;
}

.gm-filters__title {
	font-size: 0.85rem;
	color: var(--muted);
	margin: 0 0 10px;
}

.gm-filters__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.gm-filters label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--chip);
	font-size: 0.85rem;
	cursor: pointer;
	user-select: none;
}

.gm-filters input {
	accent-color: var(--accent);
}

/* ---------- Categorie e piatti ---------- */

.gm-category {
	padding-top: 28px;
	scroll-margin-top: 64px;
}

.gm-category__cover {
	height: 140px;
	border-radius: 18px;
	background-size: cover;
	background-position: center;
	margin-bottom: 16px;
}

.gm-category__title {
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 12px;
}

.gm-category__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.gm-category__desc {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 6px 0 0;
	white-space: pre-line;
}

.gm-items {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
}

.gm-item {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px dashed var(--line);
}

.gm-item:last-child {
	border-bottom: 0;
}

.gm-item__main {
	flex: 1;
	min-width: 0;
}

.gm-item__head {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.gm-item__name {
	font-weight: 600;
	font-size: 1rem;
	margin: 0;
	flex: 1;
}

.gm-item__price {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
	color: var(--accent-text);
}

.gm-item__desc {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 4px 0 0;
	white-space: pre-line;
}

.gm-item__variants {
	list-style: none;
	padding: 0;
	margin: 6px 0 0;
	font-size: 0.875rem;
}

.gm-item__variants li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--muted);
}

.gm-item__variants li + li {
	margin-top: 2px;
}

/* Stesso aspetto del prezzo principale del piatto. */
.gm-item__variants span:last-child {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
	color: var(--accent-text);
}

.gm-item__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 8px;
}

.gm-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--chip);
	font-size: 0.75rem;
}

.gm-item__allergens {
	margin: 6px 0 0;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--muted);
}

.gm-item__allergens span {
	font-weight: 600;
}

.gm-item__photo {
	flex: none;
	width: 84px;
	height: 84px;
	border-radius: 14px;
	object-fit: cover;
	background: var(--chip);
}

.gm-item--sold .gm-item__name,
.gm-item--sold .gm-item__price {
	color: var(--sold);
	text-decoration: line-through;
}

.gm-item--sold .gm-item__photo {
	filter: grayscale(1);
	opacity: 0.6;
}

.gm-sold {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sold);
}

.gm-empty {
	text-align: center;
	padding: 48px 0;
	color: var(--muted);
}

.gm-empty[hidden],
.gm-item[hidden],
.gm-category[hidden] {
	display: none;
}

/* ---------- Footer ---------- */

.gm-info {
	margin: 36px 0 0;
	padding: 20px;
	border-radius: 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	font-size: 0.9rem;
}

.gm-info p {
	margin: 0 0 10px;
}

.gm-info p:last-child {
	margin: 0;
}

.gm-info__cover {
	font-size: 1rem;
}

.gm-info__notes {
	color: var(--muted);
	white-space: pre-line;
}

.gm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.gm-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 8px 16px;
	line-height: 1.2;
	text-align: center;
	flex: 1 1 150px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
}

.gm-action__icon {
	flex-shrink: 0;
}

.gm-action--primary {
	flex-basis: 100%;
	background: var(--accent);
	border-color: var(--accent);
	color: #fff !important;
}

.gm-social {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 20px;
	font-size: 0.9rem;
}

.gm-footer {
	text-align: center;
	color: var(--muted);
	font-size: 0.8rem;
	padding: 32px 0 40px;
}

.gm-footer a {
	text-decoration: none;
	font-weight: 600;
}

.gm-footer img {
	height: 22px;
	vertical-align: middle;
}

/* ---------- Stato non disponibile ---------- */

.gm-unavailable {
	min-height: 100vh;
	display: grid;
	place-items: center;
	text-align: center;
	padding: 24px;
}

@media (min-width: 640px) {
	.gm-hero__cover {
		height: 240px;
	}

	.gm-item__photo {
		width: 104px;
		height: 104px;
	}
}

/* ---------- Stile "Brace" ----------
 * Fondo nero, categorie enormi in maiuscolo, nomi in maiuscolo con linea tratteggiata
 * e prezzi nel colore principale. Scuro di default; il pulsante tema passa al chiaro.
 */

.gm[data-style="brace"] {
	--bg: #000000;
	--surface: #0d0d0d;
	--fg: #ffffff;
	--muted: rgb(255 255 255 / 0.6);
	--line: rgb(255 255 255 / 0.4);
	--chip: #161616;
	--sold: #6f6f6f;
	--shadow: none;
	--accent-text: var(--accent);
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-display: var(--font-body);
}

.gm[data-style="brace"][data-theme="light"] {
	--bg: #ffffff;
	--surface: #f6f6f6;
	--fg: #111111;
	--muted: rgb(0 0 0 / 0.6);
	--line: rgb(0 0 0 / 0.3);
	--chip: #f0f0f0;
	--sold: #9a9a9a;
	--accent-text: color-mix(in srgb, var(--accent) 55%, #3a2a00);
}

.gm[data-style="brace"] .gm-hero__name {
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.gm[data-style="brace"] .gm-nav a.is-active,
.gm[data-style="brace"] .gm-menus a[aria-current="true"] {
	border-color: var(--accent);
	background: var(--accent);
	color: #000000;
}

.gm[data-style="brace"] .gm-category {
	margin-top: 56px;
}

.gm[data-style="brace"] .gm-category__title {
	display: block;
	font-size: clamp(2rem, 7vw, 4rem);
	font-weight: 800;
	letter-spacing: 0.03em;
	line-height: 1.05;
	text-align: center;
	text-transform: uppercase;
}

.gm[data-style="brace"] .gm-category__title::after {
	display: none;
}

.gm[data-style="brace"] .gm-category__desc {
	margin-top: 12px;
	text-align: center;
}

.gm[data-style="brace"] .gm-items {
	margin-top: 28px;
}

.gm[data-style="brace"] .gm-item {
	border-bottom: 0;
	padding: 12px 0 16px;
}

.gm[data-style="brace"] .gm-item__head {
	align-items: baseline;
	border-bottom: 1px dashed var(--line);
	padding-bottom: 10px;
}

.gm[data-style="brace"] .gm-item__name {
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.gm[data-style="brace"] .gm-item__price {
	font-size: 1.15rem;
	font-weight: 700;
}

.gm[data-style="brace"] .gm-item__variants span:last-child {
	font-weight: 700;
}

.gm[data-style="brace"] .gm-item__desc {
	margin-top: 10px;
	font-style: italic;
}

@media (min-width: 992px) {
	.gm[data-style="brace"] .gm-wrap {
		max-width: 1140px;
	}

	.gm[data-style="brace"] .gm-items {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gm * {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
