.fdoe-template-2025 {
	--fdoe-template-color: #f78da7;
	padding: 3rem 2rem;
}

.fdoe-template-2025 .fdoe-category__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: minmax(128px, auto);
	grid-auto-rows: minmax(170px, auto);
	grid-auto-flow: row;
	align-items: start;
	justify-content: space-between;
	align-content: start;
	column-gap: 1.1rem;
	row-gap: 1.1rem;
}

.fdoe-template-2025 .fdoe-category__grid--has-image {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.fdoe-template-2025 .fdoe-category__grid:not(.fdoe-category__grid--has-image) {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fdoe-template-2025 .fdoe-category__grid-title {
	grid-column: 1 / -1;
	grid-row: 1;
	margin: 0 0 0.25rem;
	font-weight: inherit;
	align-self: start;
	line-height: 1.1;
}

.fdoe-template-2025 .fdoe-category__image-block {
	align-self: start;
	justify-self: stretch;
	display: flex;
	padding: 0.75rem;
	grid-row: 2 / span 2;
}

.fdoe-template-2025 .fdoe-category__grid--image-left .fdoe-category__image-block {
	grid-column: 1 / 2;
}

.fdoe-template-2025 .fdoe-category__grid--image-right .fdoe-category__image-block {
	grid-column: 2 / 3;
}

.fdoe-template-2025 .fdoe-category__image-block img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 1.1rem;
}

.fdoe-template-2025 .fdoe-category__grid .fdoe-category__product {
	grid-column: auto;
}

.fdoe-template-2025 .fdoe-category__product {
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, inherit);
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
	border-radius: 1rem;
	padding: 1rem 1.25rem;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 150px;
	grid-template-rows: auto auto 1fr;
	column-gap: 1.5rem;
	row-gap: 0.5rem;
	align-items: stretch;
	align-self: stretch;
	min-height: 150px;
	box-shadow: none;
	transition: background-color 0.15s ease;
	text-align: left;
	cursor: default;
	position: relative;
	min-width: 0;
}

.fdoe-template-2025.fdoe-modal-enabled .fdoe-category__product {
	cursor: pointer;
}

.fdoe-template-2025 .fdoe-category__product > * {
	min-width: 0;
}

.fdoe-template-2025 .fdoe-category__product:hover {
	background-color: color-mix(in srgb, var(--fdoe-template-color, currentColor) 12%, transparent);
}

.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-image,
.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-image {
	grid-column: 2 / 3;
	grid-row: 1 / 4;
	align-self: start;
	justify-self: center;
	margin: 0;
	border-radius: 0.9rem;
	overflow: hidden;
	width: min(150px, var(--fdoe-image-size, 150px));
	aspect-ratio: 1 / 1;
}

.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-image img,
.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain !important;
}

.fdoe-template-2025 .fdoe-category__product .wp-block-post-title,
.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-title {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	margin: 0;
	text-align: left;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.2;
	align-self: start;
}

.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-price,
.fdoe-template-2025 .fdoe-category__product .price {
	grid-column: 1 / 2;
	grid-row: 2 / 3;
	align-self: start;
	justify-self: flex-start;
	text-align: left;
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--fdoe-template-color, currentColor);
}

.fdoe-template-2025 .fdoe-category__product .wc-block-product-summary,
.fdoe-template-2025 .fdoe-category__product .woocommerce-product-details__short-description,
.fdoe-template-2025 .fdoe-category__product .wp-block-post-excerpt {
	grid-column: 1 / 2;
	grid-row: 3 / 4;
	margin: 0;
	text-align: left;
	justify-self: flex-start;
	font-size: 0.9rem;
	line-height: 1.45;
	color: color-mix(in srgb, currentColor 65%, transparent);
}

.fdoe-template-2025 .fdoe-category__product .wc-block-product-summary *,
.fdoe-template-2025 .fdoe-category__product .woocommerce-product-details__short-description *,
.fdoe-template-2025 .fdoe-category__product .wp-block-post-excerpt * {
	text-align: left;
}

.fdoe-template-2025 .fdoe-category__product .wp-block-button,
.fdoe-template-2025 .fdoe-category__product .wc-block-product-add-to-cart {
	display: none !important;
}

.fdoe-in-cart-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--fdoe-template-color, currentColor) 15%, #000);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.fdoe-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.fdoe-modal.is-open {
	display: flex;
}

.fdoe-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	-webkit-backdrop-filter: blur(1px);
	backdrop-filter: blur(1px);
}

.fdoe-modal__dialog {
	position: relative;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, inherit);
	border-radius: 14px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
	padding: 1.5rem;
	max-width: 520px;
	width: min(520px, 92vw);
	max-height: min(88vh, 760px);
	overflow-y: auto;
	overscroll-behavior: contain;
	z-index: 1;
}

.fdoe-modal__body {
	display: grid;
	/* One spacing source: the gap. Blocks inside carry no outer margins. */
	gap: var(--fdoe-modal-gap, 0.6rem);
	min-width: 0;
}

.fdoe-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 1.4rem;
	cursor: pointer;
}

.fdoe-modal__title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
}

.fdoe-modal__media {
	margin: 0;
}

.fdoe-modal__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	object-fit: cover;
	max-height: 38vh;
}

.fdoe-modal__price {
	margin: 0;
	font-weight: 700;
	color: var(--fdoe-template-color, currentColor);
}

.fdoe-modal__description {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: color-mix(in srgb, currentColor 75%, transparent);
}

.fdoe-modal__quantity {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.fdoe-modal__quantity label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.95rem;
	margin: 0;
}

.fdoe-modal__quantity input[type="number"] {
	width: 80px;
	padding: 0.4rem 0.55rem;
	border-radius: 8px;
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
}

.fdoe-modal__variations {
	margin: 0.4rem 0 0;
	display: grid;
	gap: 0.75rem;
}

.fdoe-modal__field {
	display: grid;
	gap: 0.35rem;
	font-size: 0.95rem;
	color: color-mix(in srgb, currentColor 85%, transparent);
}

.fdoe-modal__field select {
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
}

.fdoe-modal__actions {
	margin-top: 0.4rem;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-start;
}

.fdoe-modal__buttons {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.fdoe-modal__actions .fdoe-modal__button {
	margin: 0;
}

.fdoe-modal__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 1.25rem;
	border-radius: 999px;
	background: var(--fdoe-template-color, #111);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	border: none;
	font-size: 1rem;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.fdoe-modal__button:disabled,
.fdoe-modal__button[aria-disabled="true"] {
	cursor: not-allowed;
}

.fdoe-modal__button:hover {
	transform: translateY(-1px);
	opacity: 0.95;
}

@media (max-width: 980px) {
	.fdoe-template-2025 .fdoe-category__product {
		grid-template-columns: minmax(0, 1fr) 120px;
		column-gap: 1rem;
		padding: 0.95rem 1rem;
	}

	.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-image,
	.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-image {
		width: min(120px, var(--fdoe-image-size, 120px));
	}
}

@media (max-width: 700px) {
	.fdoe-modal {
		padding: 0.75rem;
	}

	.fdoe-modal__dialog {
		width: min(100%, calc(100vw - 1.5rem));
		max-height: calc(100dvh - 1.5rem);
		padding: 1rem;
	}

	.fdoe-modal__close {
		top: 0.65rem;
		right: 0.65rem;
		z-index: 2;
	}

	.fdoe-modal__title {
		padding-right: 2rem;
		font-size: 1.1rem;
	}

	.fdoe-modal__media img {
		max-height: 32vh;
	}

	.fdoe-modal__actions,
	.fdoe-modal__buttons,
	.fdoe-modal__quantity,
	.fdoe-modal__quantity label {
		width: 100%;
	}

	.fdoe-modal__actions,
	.fdoe-modal__buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.fdoe-modal__quantity label {
		justify-content: space-between;
	}

	.fdoe-modal__button {
		width: 100%;
	}

	.fdoe-modal__quantity input[type="number"] {
		width: min(110px, 100%);
	}
}

@media (max-width: 760px) {
	.fdoe-template-2025 {
		padding: 2rem 1rem;
	}

	.fdoe-template-2025 .fdoe-category__grid {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 1.25rem;
	}

	.fdoe-template-2025 .fdoe-category__image-block,
	.fdoe-template-2025 .fdoe-category__image--header,
	.fdoe-template-2025 .fdoe-category__image-full {
		display: none !important;
	}

	.fdoe-template-2025 .fdoe-category__product {
		grid-template-columns: minmax(84px, var(--fdoe-image-mobile-size, 104px)) minmax(0, 1fr);
		grid-template-rows: auto auto auto;
		column-gap: 1rem;
		row-gap: 0.6rem;
		min-height: 0;
	}

	.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-image,
	.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-image {
		grid-column: 1 / 2;
		grid-row: 1 / 4;
		width: min(100%, var(--fdoe-image-mobile-size, 104px));
		max-width: min(100%, var(--fdoe-image-mobile-size, 104px));
		justify-self: start;
		align-self: start;
	}

	.fdoe-template-2025 .fdoe-category__product .wp-block-post-title,
	.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-title {
		grid-column: 2 / 3;
		grid-row: 1 / 2;
	}

	.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-price,
	.fdoe-template-2025 .fdoe-category__product .price {
		grid-column: 2 / 3;
		grid-row: 2 / 3;
	}

	.fdoe-template-2025 .fdoe-category__product .wc-block-product-summary,
	.fdoe-template-2025 .fdoe-category__product .woocommerce-product-details__short-description,
	.fdoe-template-2025 .fdoe-category__product .wp-block-post-excerpt {
		grid-column: 2 / 3;
		grid-row: 3 / 4;
	}
}

/* 48a: on phones the image column shrinks so product names keep whole words. */
@media (max-width: 480px) {
	.fdoe-food-menu.fdoe-template-2025 .fdoe-category__product {
		grid-template-columns: min(var(--fdoe-image-mobile-size, 104px), 72px) minmax(0, 1fr);
		column-gap: 0.75rem;
	}

	.fdoe-food-menu.fdoe-template-2025 .fdoe-category__product .wp-block-woocommerce-product-image,
	.fdoe-food-menu.fdoe-template-2025 .fdoe-category__product .wc-block-components-product-image {
		width: 100%;
		max-width: 72px;
	}
}
