/*
 * Oste – menu pubblico.
 * Tutto l'aspetto passa dalle variabili --oste-*: gli stili (e il personalizzatore) cambiano solo quelle.
 */

.oste-menu,
.oste-page {
	--oste-bg: transparent;
	--oste-page-bg: #fffdf8;
	--oste-pad: 0;
	--oste-toolbar-bg: var(--oste-surface);
	--oste-surface: #fffdf8;
	--oste-text: #2b2420;
	--oste-muted: #6f625a;
	--oste-accent: #9c3d1f;
	--oste-accent-contrast: #fff;
	--oste-line: rgba(43, 36, 32, 0.14);
	--oste-alert-bg: #fbe9e4;
	--oste-alert-text: #8a2a12;
	--oste-trace-bg: #fdf4dc;
	--oste-trace-text: #6b4e00;
	--oste-font-heading: Georgia, "Times New Roman", serif;
	--oste-font-body: inherit;
	--oste-radius: 10px;
	--oste-gap: 1rem;
	--oste-toolbar-top: 0px;
}

.oste-menu {
	max-width: 52rem;
	margin-inline: auto;
	padding: var(--oste-pad);
	border-radius: var(--oste-radius);
	background: var(--oste-bg);
	color: var(--oste-text);
	font-family: var(--oste-font-body);
	line-height: 1.45;
}

.oste-leader {
	display: none;
}

.oste-menu *,
.oste-menu *::before,
.oste-menu *::after {
	box-sizing: border-box;
}

.oste-menu .screen-reader-text,
.oste-sprite {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.oste-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: middle;
}

/* Barra con sezioni e filtro */
.oste-toolbar {
	position: sticky;
	top: var(--oste-toolbar-top);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0;
	background: var(--oste-toolbar-bg);
	border-bottom: 1px solid var(--oste-line);
}

.oste-nav-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
}

.oste-nav {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scrollbar-width: none;
	cursor: grab;
}

.oste-nav.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	user-select: none;
}

.oste-nav::-webkit-scrollbar {
	display: none;
}

.oste-nav-wrap.can-prev .oste-nav {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5rem);
	mask-image: linear-gradient(90deg, transparent, #000 2.5rem);
}

.oste-nav-wrap.can-next .oste-nav {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
}

.oste-nav-wrap.can-prev.can-next .oste-nav {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
}

.oste-nav-arrow {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	padding: 0 0 0.15em;
	border: 1px solid var(--oste-line);
	border-radius: 50%;
	background: var(--oste-surface);
	color: var(--oste-text);
	font: inherit;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.oste-nav-arrow[hidden] {
	display: none;
}

.oste-nav-arrow.is-prev {
	left: 0;
}

.oste-nav-arrow.is-next {
	right: 0;
}

/* Sui touch si scorre col dito: niente frecce. */
@media (hover: none) {
	.oste-nav-arrow {
		display: none !important;
	}
}

.oste-nav ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0 0.5rem 0 0;
	list-style: none;
}

.oste-nav a {
	display: block;
	padding: 0.45rem 0.8rem;
	border-radius: 999px;
	color: inherit;
	font-size: 0.92rem;
	text-decoration: none;
	white-space: nowrap;
}

.oste-nav a:hover,
.oste-nav a:focus-visible,
.oste-nav a[aria-current="true"] {
	background: var(--oste-line);
}

.oste-nav a[aria-current="true"] {
	font-weight: 600;
}

.oste-filter-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	flex: none;
	margin-left: auto;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--oste-text);
	border-radius: 999px;
	background: transparent;
	color: var(--oste-text);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.oste-filter-toggle.is-active,
.oste-filter-toggle[aria-expanded="true"] {
	background: var(--oste-text);
	color: var(--oste-surface);
}

.oste-menu :focus-visible {
	outline: 3px solid var(--oste-accent);
	outline-offset: 2px;
}

/* Pannello filtro */
.oste-filter {
	margin: 0.75rem 0;
	padding: 1rem;
	border: 1px solid var(--oste-line);
	border-radius: var(--oste-radius);
	background: var(--oste-surface);
}

.oste-filter[hidden] {
	display: none;
}

.oste-filter fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.oste-filter legend {
	margin-bottom: 0.6rem;
	font-family: var(--oste-font-heading);
	font-size: 1.1rem;
}

.oste-filter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: 0.4rem;
}

.oste-filter-option {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--oste-line);
	border-radius: calc(var(--oste-radius) * 0.7);
	font-size: 0.92rem;
	cursor: pointer;
}

.oste-filter-option input {
	margin: 0;
	accent-color: var(--oste-accent);
}

.oste-filter-option:has(input:checked) {
	border-color: var(--oste-alert-text);
	background: var(--oste-alert-bg);
	color: var(--oste-alert-text);
}

.oste-filter-help {
	margin: 0.75rem 0 0.5rem;
	color: var(--oste-muted);
	font-size: 0.85rem;
}

.oste-filter-reset {
	padding: 0;
	border: 0;
	background: none;
	color: var(--oste-accent);
	font: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	cursor: pointer;
}

.oste-live:empty {
	display: none;
}

.oste-live {
	margin: 0.5rem 0 0;
	color: var(--oste-muted);
	font-size: 0.9rem;
}

/* Sezioni */
.oste-section {
	scroll-margin-top: calc(var(--oste-toolbar-top) + 4rem);
	padding-top: 1.5rem;
}

.oste-section-title {
	margin: 0 0 0.25rem;
	font-family: var(--oste-font-heading);
	font-weight: 400;
	letter-spacing: 0.02em;
}

.oste-level-2 > .oste-section-title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--oste-text);
}

.oste-level-3 > .oste-section-title {
	font-size: 1.2rem;
	color: var(--oste-accent);
}

.oste-section-note {
	margin: 0.25rem 0 0.5rem;
	color: var(--oste-muted);
	font-size: 0.9rem;
	font-style: italic;
}

/* Piatti */
.oste-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.oste-item {
	position: relative;
	display: flex;
	gap: var(--oste-gap);
	padding: 0.85rem 0;
	border-bottom: 1px dashed var(--oste-line);
	transition: opacity 0.2s ease;
}

.oste-item-image {
	width: 4.5rem;
	height: 4.5rem;
	flex: none;
	border-radius: calc(var(--oste-radius) * 0.7);
	object-fit: cover;
}

.oste-item-body {
	flex: 1;
	min-width: 0;
}

.oste-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.6rem;
}

.oste-item-name {
	flex: 1 1 12rem;
	margin: 0;
	font-family: var(--oste-font-heading);
	font-size: 1.12rem;
	font-weight: 400;
}

.oste-price {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.oste-item-head > .oste-price {
	margin-left: auto;
	font-size: 1.05rem;
}

.oste-prices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.9rem;
	margin: 0 0 0 auto;
	padding: 0;
	font-size: 1.05rem;
	list-style: none;
}

.oste-prices li {
	margin: 0;
	font-size: inherit;
}

.oste-price-label {
	color: var(--oste-muted);
	font-size: 0.85rem;
}

.oste-item-description {
	margin: 0.2rem 0 0;
	color: var(--oste-muted);
	font-size: 0.92rem;
}

.oste-badge {
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	background: var(--oste-accent);
	color: var(--oste-accent-contrast);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.oste-badge-sold-out {
	background: var(--oste-muted);
}

.is-sold-out .oste-item-name,
.is-sold-out .oste-price {
	text-decoration: line-through;
	opacity: 0.6;
}

.oste-item-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.75rem;
	margin-top: 0.4rem;
}

.oste-allergens {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem;
	margin: 0;
}

.oste-allergen {
	display: inline-flex;
	align-items: center;
	gap: 0.1rem;
	color: var(--oste-text);
	font-size: 0.8rem;
}

.oste-allergen .oste-icon {
	width: 1.5rem;
	height: 1.5rem;
}

.oste-allergen-number {
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	color: var(--oste-muted);
}

.oste-allergens.is-trace .oste-allergen {
	opacity: 0.6;
}

.oste-traces-label {
	color: var(--oste-muted);
	font-size: 0.75rem;
}

.oste-label {
	padding: 0.05rem 0.5rem;
	border: 1px solid var(--oste-line);
	border-radius: 999px;
	color: var(--oste-muted);
	font-size: 0.75rem;
}

/* Piatti spenti dal filtro, con il banner "Contiene …" */
.oste-item-alert {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: max-content;
	max-width: calc(100% - 1rem);
	margin: 0;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	background: var(--oste-alert-text);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	text-align: center;
	transform: translate(-50%, -50%) rotate(-1.5deg);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	pointer-events: none;
}

.oste-item-alert[hidden] {
	display: none;
}

.oste-item.is-excluded > :not(.oste-item-alert) {
	opacity: 0.28;
	filter: grayscale(1);
}

.oste-item.is-trace-excluded > :not(.oste-item-alert) {
	opacity: 0.5;
}

.oste-item.is-trace-excluded .oste-item-alert {
	background: var(--oste-trace-bg);
	color: var(--oste-trace-text);
	border: 1px solid currentColor;
	font-weight: 500;
}

/* Legenda */
.oste-legend {
	margin-top: 2.5rem;
	padding: 1.25rem;
	border: 1px solid var(--oste-line);
	border-radius: var(--oste-radius);
	background: var(--oste-surface);
}

.oste-legend-title {
	margin: 0 0 0.75rem;
	font-family: var(--oste-font-heading);
	font-size: 1.3rem;
	font-weight: 400;
}

.oste-legend-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.75rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.oste-legend-list li {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 0.5rem;
	align-items: start;
}

.oste-legend-list .oste-icon {
	grid-row: span 2;
	width: 1.6rem;
	height: 1.6rem;
}

.oste-legend-name {
	font-weight: 600;
}

.oste-legend-description {
	color: var(--oste-muted);
	font-size: 0.8rem;
}

.oste-legend-notice {
	margin: 1rem 0 0;
	color: var(--oste-muted);
	font-size: 0.85rem;
}

/* Telefoni stretti: pulsante filtro compatto (solo icona + numero), il testo resta per i lettori di schermo */
@media (max-width: 480px) {
	.oste-filter-toggle {
		padding: 0.5rem 0.7rem;
	}

	.oste-filter-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.oste-filter-toggle .oste-icon {
		width: 1.4em;
		height: 1.4em;
	}
}

/* Pagina autonoma del menu (sito.it/carta/…) */
.oste-page {
	margin: 0;
	min-height: 100vh;
	background: var(--oste-page-bg);
	color: var(--oste-text);
	font-family: var(--oste-font-body);
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

.oste-page .oste-menu {
	padding: 0;
	background: none;
}

.oste-page-inner {
	max-width: 52rem;
	margin: 0 auto;
	padding: 0 16px 2rem;
}

.oste-page-header {
	padding: 2.5rem 0 1rem;
	text-align: center;
}

.oste-page-logo img {
	display: inline-block;
	width: auto;
	max-width: 70%;
	height: auto;
	max-height: 140px;
}

.oste-page-site {
	margin: 0;
	font-size: 0.85rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.oste-page a {
	color: inherit;
}

.oste-page-title {
	margin: 0.4rem 0 0.2rem;
	font-family: var(--oste-font-heading);
	font-size: clamp(2.2rem, 8vw, 3.4rem);
	font-weight: 400;
	line-height: 1.05;
}

.oste-page-intro {
	max-width: 34rem;
	margin: 0.5rem auto 0;
	color: var(--oste-muted);
}

.oste-page-footer {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--oste-line);
	color: var(--oste-muted);
	font-size: 0.9rem;
	text-align: center;
}

.oste-page-footer-text {
	white-space: pre-line;
}

.oste-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 10;
	padding: 0.5rem 1rem;
	background: #1f1a17;
	color: #fff !important;
}

.oste-skip-link:focus {
	top: 8px;
}

/* Pulsante "Traduci" (GTranslate, solo dopo il consenso) */
.oste-translate {
	position: absolute;
	top: 12px;
	right: 16px;
	z-index: 6;
	max-width: calc(100% - 32px);
	text-align: right;
}

.oste-translate-start,
.oste-translate-consent button {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 40px;
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--oste-line);
	border-radius: 999px;
	background: var(--oste-surface);
	color: var(--oste-text);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.oste-translate-start svg {
	width: 1.1rem;
	height: 1.1rem;
}

.oste-translate-consent {
	box-sizing: border-box;
	width: min(20rem, calc(100vw - 32px));
	margin-top: 0.5rem;
	margin-left: auto;
	padding: 0.9rem;
	border: 1px solid var(--oste-line);
	border-radius: var(--oste-radius);
	/* Sempre opaco: deve leggersi sopra il logo. */
	background: var(--oste-toolbar-bg);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	text-align: left;
	font-size: 0.85rem;
}

.oste-translate-consent p {
	margin: 0 0 0.5rem;
}

.oste-translate-consent p[lang="en"] {
	color: var(--oste-muted);
	font-size: 0.78rem;
}

.oste-translate-consent [data-oste-translate-yes] {
	background: var(--oste-text);
	color: var(--oste-surface);
}

.oste-translate [hidden] {
	display: none !important;
}

.oste-page-inner {
	position: relative;
}

/* Telefono: il pulsante "Traduci" sta sopra il logo, non sopra di esso. */
@media (max-width: 600px) {
	.oste-translate {
		position: relative;
		top: auto;
		right: auto;
		max-width: none;
		padding-top: 12px;
	}

	.oste-translate-start {
		min-height: 36px;
		padding: 0.3rem 0.7rem;
		font-size: 0.8rem;
	}

	.oste-translate-consent {
		position: absolute;
		right: 0;
		width: 100%;
		z-index: 7;
	}

	.oste-page-header {
		padding-top: 0.5rem;
	}
}

/* Solo per il ristoratore collegato: scorciatoia alla gestione rapida */
.oste-edit-link {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 20;
	padding: 0.7rem 1.1rem;
	border-radius: 999px;
	background: #1d2327;
	color: #fff !important;
	font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.oste-edit-link:focus-visible {
	outline: 3px solid #72aee6;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.oste-item {
		transition: none;
	}
}

@media print {
	.oste-toolbar,
	.oste-filter,
	.oste-item-alert {
		display: none !important;
	}

	.oste-item.is-excluded > *,
	.oste-item.is-trace-excluded > * {
		opacity: 1 !important;
		filter: none !important;
	}
}
