/* =========================================
   JEssentials — Menu Frontend Styles
   Speisekarte, Filter, Allergics
   ========================================= */

/* ═══ JMenu List ═══ */

.jml-menu {
	--jml-accent: #6366f1;
	--jml-title-color: #1e293b;
	--jml-desc-color: rgba(71,85,105,.75);
	--jml-item-color: #1e293b;
	--jml-price: #6366f1;
	--jml-title-size: 28px;
	--jml-title-weight: 700;
	--jml-title-font: inherit;
	--jml-desc-size: 14px;
	--jml-desc-font: inherit;
	--jml-item-size: 16px;
	--jml-item-weight: 500;
	--jml-item-font: inherit;
	--jml-price-size: 16px;
	--jml-price-weight: 700;
	--jml-price-font: inherit;
	--jml-divider-style: dotted;
	--jml-divider-color: #e2e8f0;
	--jml-item-spacing: 16px;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	max-width: 700px;
	margin: 0 auto;
}

.jml-title {
	font-size: var(--jml-title-size);
	font-weight: var(--jml-title-weight);
	font-family: var(--jml-title-font);
	margin: 0 0 8px;
	text-align: center;
	color: var(--jml-title-color);
}

.jml-desc {
	font-size: var(--jml-desc-size);
	font-family: var(--jml-desc-font);
	text-align: center;
	color: var(--jml-desc-color);
	margin: 0 0 28px;
	line-height: 1.6;
}

.jml-items {
	display: flex;
	flex-direction: column;
}

/* ── Product Row ── */
.jml-item {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: var(--jml-item-spacing) 0;
	border-bottom: 1px var(--jml-divider-style) var(--jml-divider-color);
	transition: opacity .3s ease, transform .3s ease, max-height .3s ease;
}

.jml-item:last-child {
	border-bottom: none;
}

.jml-item.jml-hidden {
	opacity: 0;
	max-height: 0 !important;
	padding: 0;
	border: none;
	overflow: hidden;
	pointer-events: none;
}

.jml-item__left {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-shrink: 0;
}

.jml-item__name {
	font-size: var(--jml-item-size);
	font-weight: var(--jml-item-weight);
	font-family: var(--jml-item-font);
	color: var(--jml-item-color);
	white-space: nowrap;
}

.jml-item__allergens {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	flex-shrink: 0;
}

.jml-allergen {
	font-size: 13px;
	line-height: 1;
	cursor: help;
}

.jml-allergen sup {
	font-size: 9px;
	font-weight: 700;
	color: var(--jml-accent);
	margin-left: 1px;
}

.jml-item__dots {
	flex: 1;
	min-width: 20px;
	border-bottom: 2px var(--jml-divider-style) var(--jml-divider-color);
	margin: 0 4px;
	align-self: center;
	transform: translateY(-3px);
}

.jml-item__price {
	font-size: var(--jml-price-size);
	font-weight: var(--jml-price-weight);
	font-family: var(--jml-price-font);
	color: var(--jml-price);
	white-space: nowrap;
	flex-shrink: 0;
	text-align: right;
}

/* ═══ JMenu Filter ═══ */

.jmf-filter {
	--jmf-accent: #6366f1;
	--jmf-font-size: 15px;
	--jmf-font-family: inherit;

	max-width: 700px;
	margin: 0 auto 24px;
	padding: 10px 14px;
	position: relative;
	font-family: var(--jmf-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.jmf-search-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.jmf-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	opacity: .5;
}

.jmf-search {
	flex: 1;
	border: none;
	background: transparent;
	font-size: var(--jmf-font-size);
	color: inherit;
	outline: none;
	padding: 6px 0;
}

.jmf-search::placeholder {
	opacity: .5;
}

.jmf-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	border-radius: 10px;
	cursor: pointer;
	color: inherit;
	opacity: .5;
	transition: all .2s ease;
	flex-shrink: 0;
}

.jmf-btn:hover {
	opacity: 1;
	background: rgba(0,0,0,.05);
}

.jmf-btn.active {
	opacity: 1;
	color: var(--jmf-accent);
	background: rgba(99,102,241,.08);
}

.jmf-btn svg {
	width: 18px;
	height: 18px;
}

/* ── Tags Popup ── */
.jmf-tags-popup {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 12px 40px rgba(0,0,0,.12);
	z-index: 100;
	animation: jmf-popIn .2s ease both;
}

@keyframes jmf-popIn {
	from { opacity: 0; transform: translateY(-6px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.jmf-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jmf-tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	color: #334155;
	cursor: pointer;
	transition: all .2s ease;
	user-select: none;
	background: #f8fafc;
}

.jmf-tag:hover {
	border-color: var(--jmf-accent);
	color: var(--jmf-accent);
}

.jmf-tag.active {
	background: var(--jmf-accent);
	border-color: var(--jmf-accent);
	color: #fff;
}

.jmf-no-results {
	text-align: center;
	padding: 20px;
	color: #94a3b8;
	font-size: 14px;
	display: none;
}

/* ═══ JAllergics ═══ */

.jma-allergics {
	max-width: 700px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.jma-title {
	margin: 0 0 18px;
	font-weight: 700;
	color: inherit;
}

.jma-grid {
	display: grid;
	gap: 10px;
}

.jma-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: rgba(0,0,0,.02);
	border-radius: 10px;
	transition: background .2s;
}

.jma-item:hover {
	background: rgba(0,0,0,.04);
}

.jma-icon {
	line-height: 1;
	flex-shrink: 0;
}

.jma-letter {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e2e8f0;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	color: #475569;
	flex-shrink: 0;
}

.jma-label {
	font-size: 14px;
	font-weight: 500;
}

/* ═══ Responsive ═══ */

@media (max-width: 600px) {
	.jml-item__name {
		white-space: normal;
	}

	.jml-item__dots {
		min-width: 10px;
	}

	.jmf-tags-popup {
		left: -8px;
		right: -8px;
	}
}

@media (max-width: 980px) {
	.jml-menu,
	.jmf-filter,
	.jma-allergics {
		max-width: 100%;
	}

	.jml-item {
		align-items: flex-start;
	}

	.jml-item__left {
		flex: 1;
		min-width: 0;
		align-items: flex-start;
	}

	.jml-item__name {
		white-space: normal;
		overflow-wrap: anywhere;
	}

	.jml-item__dots {
		display: none;
	}

	.jml-item__price {
		margin-left: auto;
		padding-left: 10px;
	}
}

@media (max-width: 768px) {
	.jml-item {
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 10px;
	}

	.jml-item__left {
		display: block;
	}

	.jml-item__allergens {
		display: flex;
		flex-wrap: wrap;
		margin-top: 4px;
	}

	.jmf-filter {
		padding: 10px;
	}

	.jma-grid {
		grid-template-columns: 1fr !important;
	}
}
