/* Mongkung Menu — menu browser (homepage POS, mobile-first).
   Grid density is fluid (auto-fill), so cards reflow at any viewport width
   without hard breakpoints. Also styles the shop archive, which reuses
   the same cards via patterns/product-archive-menu.php. */

/* Archive pagination (shop/category pages). */
.mk-archive-pager .nav-links {
	display: flex;
	gap: 0.375rem;
	justify-content: center;
	margin-top: 2rem;
}

.mk-archive-pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 0.5rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--radius--sm);
	color: var(--wp--preset--color--text);
	font-weight: 600;
}

.mk-archive-pager .page-numbers.current {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

.mk-archive-pager .page-numbers:not(.current):hover {
	border-color: var(--wp--preset--color--primary-dark);
}

/* Category filter bar — sticks below the header with the same breathing room
   as the order panel. Its own background hides cards scrolling underneath. */
.mk-menu-categories {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	padding: 1.5rem 0 0.5rem;
	scrollbar-width: none;
	position: sticky;
	top: var(--mk-header-h);
	z-index: 40;
	background: var(--wp--preset--color--background);
}

.mk-menu-categories::-webkit-scrollbar {
	display: none;
}

.mk-cat {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0.5rem 1.125rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
	.mk-cat {
		transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	}
}

.mk-cat:hover {
	border-color: var(--wp--preset--color--muted);
}

.mk-cat.is-active {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	box-shadow: var(--wp--preset--shadow--card);
}

/* Desktop: one uniform, evenly filled tab row. Slightly tighter padding so
   all nine tabs fit inside the menu column without scrolling. */
@media (min-width: 600px) {
	.mk-cat {
		flex: 1 0 auto;
		text-align: center;
		white-space: nowrap;
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}
}

/* Product grid — reflows automatically: 2 columns on phones, denser as it widens. */
.mk-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
	gap: 0.75rem;
	margin-top: 1.5rem;
}

@media (min-width: 600px) {
	.mk-products {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
		gap: 1rem;
	}
}

/* Product card. */
.mk-product-card {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--radius--md);
	overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.mk-product-card {
		transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	}

	.mk-product-card:hover {
		transform: translateY(-2px);
		border-color: var(--wp--preset--color--primary-dark);
		box-shadow: var(--wp--preset--shadow--raised);
	}
}

/* Dish image — warm placeholder until the owner uploads a photo. */
.mk-product-image {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background: linear-gradient(145deg, var(--wp--preset--color--surface-raised), var(--wp--preset--color--surface));
}

.mk-product-image::after {
	content: '🍲';
	font-size: 2rem;
	opacity: 0.4;
}

.mk-product-image:has(img) {
	background: none;
}

.mk-product-image:has(img)::after {
	content: none;
}

.mk-product-image img {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mk-product-body {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	flex: 1;
	padding: 0.875rem;
}

.mk-product-name {
	font-size: 1.0625rem;
	line-height: 1.3;
	margin: 0;
}

.mk-product-name a {
	color: inherit;
	text-decoration: none;
}

.mk-product-name a:hover,
.mk-product-name a:focus {
	text-decoration: underline;
}

.mk-product-desc {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mk-product-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 0.5rem;
}

.mk-product-price {
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	white-space: nowrap;
}

/* Add button — amber pill with a plus, touch-friendly. */
.mk-add {
	min-width: 44px;
	min-height: 44px;
	padding: 0.5rem 1.25rem;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--wp--preset--shadow--card);
}

.mk-add:not(.mk-add-choose)::before {
	content: '+ ';
}

@media (prefers-reduced-motion: no-preference) {
	.mk-add {
		transition: background 0.15s ease, transform 0.1s ease;
	}

	.mk-add:active {
		transform: translateY(1px);
	}
}

.mk-add:hover:not(:disabled) {
	background: var(--wp--preset--color--primary-dark);
}

.mk-add-choose {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	border: 1px solid var(--wp--preset--color--primary);
}

.mk-add:disabled {
	opacity: 0.5;
	cursor: default;
}

.mk-sold-out {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--muted);
}

/* Menu states. */
.mk-menu-notice {
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--preset--radius--md);
}

.mk-menu-notice p {
	margin: 0;
}

/* Featured recipes grid (same card language as the menu). */
.mk-recipes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 1rem;
}

.mk-recipe-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--radius--md);
	overflow: hidden;
}

.mk-recipe-image {
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--border);
}

.mk-recipe-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mk-recipe-body {
	padding: 0.875rem;
}

.mk-recipe-name {
	font-size: 1rem;
	margin: 0 0 0.25rem;
}

.mk-recipe-name a {
	color: inherit;
	text-decoration: none;
}

.mk-recipe-name a:hover,
.mk-recipe-name a:focus {
	text-decoration: underline;
}

.mk-recipe-desc {
	margin: 0;
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
}