/**
 * Modern Restaurant Menu Manager — frontend styles.
 * All rules are scoped under .mrmm-menu to avoid theme conflicts.
 * Colors and sizes come from CSS custom properties set per instance.
 */

.mrmm-menu {
	/* Fallback variables (overridden by the inline #mrmm-vars block). */
	--mrmm-background: #ffffff;
	--mrmm-max-width: 820px;
	--mrmm-outer-padding: 24px;
	--mrmm-section-spacing: 40px;
	--mrmm-border-color: #e8e8e8;
	--mrmm-divider-thickness: 1px;
	--mrmm-border-radius: 14px;
	--mrmm-box-shadow: none;
	--mrmm-font-family: inherit;
	--mrmm-base-font-size: 16px;
	--mrmm-item-name-size: 17px;
	--mrmm-item-name-weight: 600;
	--mrmm-description-size: 14px;
	--mrmm-price-size: 16px;
	--mrmm-heading-size: 24px;
	--mrmm-heading-weight: 700;
	--mrmm-line-height: 1.5;
	--mrmm-text-color: #222222;
	--mrmm-muted-color: #6b7280;
	--mrmm-price-color: #111111;
	--mrmm-heading-color: #111111;
	--mrmm-search-bg: #ffffff;
	--mrmm-search-text: #222222;
	--mrmm-search-border: #d5d7db;
	--mrmm-search-focus: #111111;
	--mrmm-search-radius: 999px;
	--mrmm-search-height: 48px;
	--mrmm-nav-bg: #ffffff;
	--mrmm-nav-btn-bg: #f3f4f6;
	--mrmm-nav-btn-text: #333333;
	--mrmm-nav-active-bg: #111111;
	--mrmm-nav-active-text: #ffffff;
	--mrmm-nav-btn-radius: 999px;
	--mrmm-nav-btn-size: 14px;
	--mrmm-nav-btn-spacing: 8px;
	--mrmm-more-btn-bg: #111111;
	--mrmm-more-btn-text: #ffffff;
	--mrmm-more-btn-radius: 10px;
	--mrmm-more-btn-size: 15px;
	--mrmm-thumb-width: 72px;
	--mrmm-thumb-height: 72px;
	--mrmm-thumb-radius: 10px;
	--mrmm-thumb-fit: cover;
	--mrmm-item-padding: 22px;

	box-sizing: border-box;
	max-width: var(--mrmm-max-width);
	margin-left: auto;
	margin-right: auto;
	padding: var(--mrmm-outer-padding);
	background: var(--mrmm-background);
	color: var(--mrmm-text-color);
	font-family: var(--mrmm-font-family);
	font-size: var(--mrmm-base-font-size);
	line-height: var(--mrmm-line-height);
	border-radius: var(--mrmm-border-radius);
	box-shadow: var(--mrmm-box-shadow);
}

.mrmm-menu.mrmm-align-left {
	margin-left: 0;
}

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

/* Header */
.mrmm-menu-header {
	margin-bottom: var(--mrmm-section-spacing);
	text-align: center;
}
.mrmm-menu-title {
	color: var(--mrmm-heading-color);
	font-size: calc(var(--mrmm-heading-size) + 6px);
	font-weight: var(--mrmm-heading-weight);
	margin: 0 0 8px;
	line-height: 1.2;
}
.mrmm-menu-intro {
	color: var(--mrmm-muted-color);
	font-size: var(--mrmm-description-size);
	max-width: 60ch;
	margin: 0 auto;
}
.mrmm-menu-intro p { margin: 0 0 8px; }

/* Search */
.mrmm-search-wrap {
	position: relative;
	margin-bottom: 20px;
}
.mrmm-search {
	width: 100%;
	height: var(--mrmm-search-height);
	padding: 0 44px 0 18px;
	background: var(--mrmm-search-bg);
	color: var(--mrmm-search-text);
	border: 1px solid var(--mrmm-search-border);
	border-radius: var(--mrmm-search-radius);
	font-size: var(--mrmm-base-font-size);
	line-height: normal;
	appearance: none;
	-webkit-appearance: none;
}
.mrmm-search::placeholder { color: var(--mrmm-muted-color); opacity: 0.9; }
.mrmm-search:focus {
	outline: none;
	border-color: var(--mrmm-search-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mrmm-search-focus) 22%, transparent);
}
.mrmm-search-clear {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: var(--mrmm-nav-btn-bg);
	color: var(--mrmm-nav-btn-text);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.mrmm-search-clear:focus-visible {
	outline: 2px solid var(--mrmm-search-focus);
	outline-offset: 2px;
}

/* Category navigation */
.mrmm-category-nav {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--mrmm-nav-btn-spacing);
	overflow-x: auto;
	overflow-y: hidden;
	padding: 6px 2px 12px;
	margin-bottom: 16px;
	background: var(--mrmm-nav-bg);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.mrmm-category-nav.is-sticky {
	position: sticky;
	top: 0;
	z-index: 5;
	backdrop-filter: saturate(1.1);
}
.mrmm-cat-btn {
	flex: 0 0 auto;
	padding: 8px 16px;
	min-height: 40px;
	background: var(--mrmm-nav-btn-bg);
	color: var(--mrmm-nav-btn-text);
	border: none;
	border-radius: var(--mrmm-nav-btn-radius);
	font-size: var(--mrmm-nav-btn-size);
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.mrmm-cat-btn:hover { filter: brightness(0.96); }
.mrmm-cat-btn.is-active {
	background: var(--mrmm-nav-active-bg);
	color: var(--mrmm-nav-active-text);
}
.mrmm-cat-btn:focus-visible {
	outline: 2px solid var(--mrmm-search-focus);
	outline-offset: 2px;
}

/* Categories & items */
.mrmm-category {
	margin-bottom: var(--mrmm-section-spacing);
	scroll-margin-top: 80px;
}
.mrmm-category:focus { outline: none; }
.mrmm-category-title {
	color: var(--mrmm-heading-color);
	font-size: var(--mrmm-heading-size);
	font-weight: var(--mrmm-heading-weight);
	margin: 0 0 4px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--mrmm-border-color);
	line-height: 1.25;
}
.mrmm-category-desc {
	color: var(--mrmm-muted-color);
	font-size: var(--mrmm-description-size);
	margin: 4px 0 12px;
}

/* --- Theme hardening ---------------------------------------------------
   Themes (Enfold/Divi/etc.) style content-area <ul>/<li> with bullets and
   indents at high specificity. These scoped resets neutralize that inside the
   menu only. !important is used solely on list mechanics — the one case where
   it is genuinely necessary to override unknown theme rules. */
.mrmm-menu .mrmm-item-list,
.mrmm-menu .mrmm-price-options,
.mrmm-menu .mrmm-choice-list,
.mrmm-menu .mrmm-addon-list,
.mrmm-menu .mrmm-labels {
	list-style: none !important;
	margin: 0;
	padding: 0;
}
.mrmm-menu .mrmm-item-list > li,
.mrmm-menu .mrmm-price-options > li,
.mrmm-menu .mrmm-choice-list > li,
.mrmm-menu .mrmm-addon-list > li,
.mrmm-menu .mrmm-labels > li {
	list-style: none !important;
	text-indent: 0;
	background-image: none;
}
.mrmm-menu .mrmm-price-options > li::before,
.mrmm-menu .mrmm-price-options > li::marker,
.mrmm-menu .mrmm-choice-list > li::before,
.mrmm-menu .mrmm-choice-list > li::marker,
.mrmm-menu .mrmm-addon-list > li::before,
.mrmm-menu .mrmm-addon-list > li::marker,
.mrmm-menu .mrmm-labels > li::before,
.mrmm-menu .mrmm-labels > li::marker {
	content: none !important;
	display: none !important;
}

.mrmm-item-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Two-column menu view: items flow down column 1, then column 2. Each item
   stays intact (never splits across columns). Collapses to 1 column on mobile. */
.mrmm-cols-2 .mrmm-item-list {
	column-count: 2;
	column-gap: 44px;
}
.mrmm-cols-2 .mrmm-item {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
}
@media (max-width: 768px) {
	.mrmm-cols-2 .mrmm-item-list { column-count: 1; }
}

/* One item = one horizontal list row. Never a card grid. */
.mrmm-item {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: var(--mrmm-item-padding, 22px) 0;
	border-bottom: var(--mrmm-divider-thickness) solid var(--mrmm-border-color);
}
.mrmm-item:last-child { border-bottom: none; }

.mrmm-menu.mrmm-thumb-right .mrmm-item { flex-direction: row-reverse; }

.mrmm-item-thumb {
	flex: 0 0 auto;
	width: var(--mrmm-thumb-width);
	height: var(--mrmm-thumb-height);
	border-radius: var(--mrmm-thumb-radius);
	overflow: hidden;
	background: var(--mrmm-nav-btn-bg);
}
.mrmm-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: var(--mrmm-thumb-fit);
	display: block;
}

.mrmm-item-body {
	flex: 1 1 auto;
	min-width: 0;
}
.mrmm-item-top {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: space-between;
}
.mrmm-menu .mrmm-item-heading {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	min-width: 0;
}
.mrmm-item-name {
	color: var(--mrmm-text-color);
	font-size: var(--mrmm-item-name-size);
	font-weight: var(--mrmm-item-name-weight);
	overflow-wrap: break-word;
	word-wrap: break-word;
	min-width: 0;
}
.mrmm-item-price {
	flex: 0 0 auto;
	color: var(--mrmm-price-color);
	font-size: var(--mrmm-price-size);
	font-weight: 700;
	white-space: nowrap;
}
.mrmm-item-desc {
	color: var(--mrmm-muted-color);
	font-size: var(--mrmm-description-size);
	margin: 6px 0 0;
	overflow-wrap: break-word;
}

/* Price options */
.mrmm-price-options {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 8px 0 0;
	padding: 0;
}
.mrmm-menu .mrmm-price-option {
	display: inline-flex;
	gap: 6px;
	font-size: var(--mrmm-description-size);
}
.mrmm-po-label { color: var(--mrmm-muted-color); }
.mrmm-po-value { color: var(--mrmm-price-color); font-weight: 600; }

/* Choices & add-ons — label sits on the same centered row as the pills. */
.mrmm-menu .mrmm-choices,
.mrmm-menu .mrmm-addons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: 10px 0 0;
	font-size: var(--mrmm-description-size);
}
.mrmm-choices-label,
.mrmm-addons-label {
	color: var(--mrmm-text-color);
	font-weight: 600;
}
.mrmm-menu .mrmm-choice-list,
.mrmm-menu .mrmm-addon-list {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin: 0;
	vertical-align: middle;
}
.mrmm-menu .mrmm-choice,
.mrmm-menu .mrmm-addon {
	display: inline-block;
	background: var(--mrmm-nav-btn-bg);
	color: var(--mrmm-nav-btn-text);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: calc(var(--mrmm-description-size) - 1px);
	line-height: 1.5;
}
.mrmm-choice-price,
.mrmm-addon-price { font-weight: 700; }

/* Dietary / indicator labels — icons next to the item name.
   Color + an accessible tooltip/screen-reader label (never color alone). */
.mrmm-menu .mrmm-labels {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
}
.mrmm-menu .mrmm-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}
.mrmm-menu .mrmm-label .mrmm-icon {
	width: 18px;
	height: 18px;
	display: block;
}
.mrmm-label-spicy { color: var(--mrmm-label-spicy); }
.mrmm-label-vegetarian { color: var(--mrmm-label-vegetarian); }
.mrmm-label-vegan { color: var(--mrmm-label-vegan); }
.mrmm-label-gluten_free { color: var(--mrmm-label-gluten-free); }
.mrmm-label-popular { color: var(--mrmm-label-popular); }
.mrmm-label-chefs_choice { color: var(--mrmm-label-chefs-choice); }

/* Sold-out badge — kept as visible text since availability matters. */
.mrmm-menu .mrmm-sold-out-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--mrmm-label-sold-out);
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 2px 7px;
	line-height: 1.4;
}

/* Sold out state */
.mrmm-item.is-sold-out .mrmm-item-name,
.mrmm-item.is-sold-out .mrmm-item-price { opacity: 0.6; }
.mrmm-item.is-sold-out .mrmm-item-thumb { opacity: 0.7; }

/* States */
.mrmm-no-results {
	padding: 24px 0;
	text-align: center;
	color: var(--mrmm-muted-color);
	font-size: var(--mrmm-item-name-size);
}
.mrmm-empty {
	padding: 24px 0;
	text-align: center;
	color: var(--mrmm-muted-color);
}
.mrmm-item[hidden],
.mrmm-category[hidden] { display: none !important; }

/* Short-menu limit: hide overflow items until "Load more" (or on the teaser
   that links to the full menu page). Removing .mrmm-limited reveals them. */
.mrmm-menu.mrmm-limited .mrmm-item-hidden { display: none; }

/* "View Full Menu" / "Load more" button */
.mrmm-more-wrap {
	text-align: center;
	margin-top: var(--mrmm-section-spacing);
}
.mrmm-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 28px;
	background: var(--mrmm-more-btn-bg);
	color: var(--mrmm-more-btn-text);
	font-size: var(--mrmm-more-btn-size);
	font-weight: 700;
	font-family: inherit;
	line-height: 1.2;
	border: none;
	border-radius: var(--mrmm-more-btn-radius);
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.mrmm-more-btn:hover { filter: brightness(1.08); color: var(--mrmm-more-btn-text); }
.mrmm-more-btn:focus-visible { outline: 2px solid var(--mrmm-search-focus); outline-offset: 2px; }

.mrmm-notice {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
}
.mrmm-notice-error {
	background: #fdecea;
	color: #611a15;
	border: 1px solid #f5c6cb;
}

/* Screen reader only */
.mrmm-menu .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}

/* Responsive */
@media (max-width: 600px) {
	.mrmm-menu {
		padding: calc(var(--mrmm-outer-padding) * 0.66);
	}
	.mrmm-item { gap: 12px; }
	.mrmm-item-top { flex-wrap: wrap; }
}

/* Very small screens — optional image stacking handled via body class hook. */
@media (max-width: 360px) {
	.mrmm-menu.mrmm-stack-image .mrmm-item { flex-direction: column; }
	.mrmm-menu.mrmm-stack-image.mrmm-thumb-right .mrmm-item { flex-direction: column; }
}

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

/* ===========================================================================
   Theme hardening.
   Themes like Enfold/Divi style content-area headings, text, inputs, and
   buttons with ID-prefixed selectors (e.g. `#top .entry-content input`) that
   outrank single-class rules. The overrides below re-assert the plugin's own
   look. Values come from the plugin's Appearance settings (CSS variables), so
   you still control every color here — this only stops the *theme* from
   winning. !important is used deliberately: it is the only reliable way to
   beat an ID-prefixed theme rule without adding an ID of our own.
   =========================================================================== */

/* Headings & text */
.mrmm-menu .mrmm-menu-title { color: var(--mrmm-heading-color) !important; }
.mrmm-menu .mrmm-menu-intro,
.mrmm-menu .mrmm-menu-intro p { color: var(--mrmm-muted-color) !important; }
.mrmm-menu .mrmm-category-title {
	color: var(--mrmm-heading-color) !important;
	border-bottom-color: var(--mrmm-border-color) !important;
}
.mrmm-menu .mrmm-category-desc { color: var(--mrmm-muted-color) !important; }
.mrmm-menu .mrmm-item-name { color: var(--mrmm-text-color) !important; }
.mrmm-menu .mrmm-item-price { color: var(--mrmm-price-color) !important; }
.mrmm-menu .mrmm-item-desc,
.mrmm-menu .mrmm-po-label { color: var(--mrmm-muted-color) !important; }
.mrmm-menu .mrmm-po-value,
.mrmm-menu .mrmm-choice-price,
.mrmm-menu .mrmm-addon-price { color: var(--mrmm-price-color) !important; }

/* Dividers / borders */
.mrmm-menu .mrmm-item { border-bottom-color: var(--mrmm-border-color) !important; }

/* Search field */
.mrmm-menu .mrmm-search {
	background: var(--mrmm-search-bg) !important;
	color: var(--mrmm-search-text) !important;
	border: 1px solid var(--mrmm-search-border) !important;
	border-radius: var(--mrmm-search-radius) !important;
	height: var(--mrmm-search-height) !important;
}
.mrmm-menu .mrmm-search:focus { border-color: var(--mrmm-search-focus) !important; }

/* Category navigation buttons */
.mrmm-menu .mrmm-cat-btn {
	background: var(--mrmm-nav-btn-bg) !important;
	color: var(--mrmm-nav-btn-text) !important;
	border: none !important;
	border-radius: var(--mrmm-nav-btn-radius) !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
}
.mrmm-menu .mrmm-cat-btn.is-active {
	background: var(--mrmm-nav-active-bg) !important;
	color: var(--mrmm-nav-active-text) !important;
}

/* Choice / add-on chips */
.mrmm-menu .mrmm-choice,
.mrmm-menu .mrmm-addon {
	background: var(--mrmm-nav-btn-bg) !important;
	color: var(--mrmm-nav-btn-text) !important;
}

/* "View Full Menu" / "Load more" button */
.mrmm-menu .mrmm-more-btn {
	background: var(--mrmm-more-btn-bg) !important;
	color: var(--mrmm-more-btn-text) !important;
	border: none !important;
	border-radius: var(--mrmm-more-btn-radius) !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
}
