/**
 * Night Service.
 *
 * The moves the token set cannot carry: plates lifted from the dark by a
 * warm glow, outlined brass chips and add rings, panels one depth lighter
 * than the page, and a bottom bar that reads as the counter's edge. Scoped
 * to body.fm-style-night and to any element carrying the class; the class is
 * doubled so these rules outrank the loop sheets that load later.
 */

.fm-style-night.fm-style-night,
.fm-style-night.fm-style-night .foodmaster-menu-layout,
.fm-style-night.fm-style-night .foodmaster-menu-container {
	color: var(--fm-black);
}

/* Panels: one depth lighter than the page */
.fm-style-night.fm-style-night .foodmaster-mini-cart-wrapper,
.fm-style-night.fm-style-night .foodmaster-element-card,
.fm-style-night.fm-style-night .foodmaster-deal-combo,
.fm-style-night.fm-style-night .foodmaster-availability-modal,
.fm-style-night.fm-style-night .foodmaster-modern-modal-container,
.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-card .wf-template-product {
	background: var(--fm-card);
	border: var(--fm-card-border);
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-card-shadow);
	color: var(--fm-black);
}

.fm-style-night.fm-style-night .foodmaster-accordion-header,
.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product {
	border-color: color-mix(in oklab, var(--fm-paper) 84%, #ffffff);
}

/* Plates: no keyline, a warm glow that brightens on hover */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-image img,
.fm-style-night.fm-style-night .foodmaster-mini-cart-item .item-thumbnail img,
.fm-style-night.fm-style-night .foodmaster-product-image img,
.fm-style-night.fm-style-night .foodmaster-featured-product-image img,
.fm-style-night.fm-style-night .foodmaster-daily-dish-image img {
	border: 0;
	outline: 0;
	border-radius: var(--fm-image-radius);
	box-shadow: var(--fm-image-shadow);
	background: var(--fm-paper-2);
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product:hover .product-image img {
	box-shadow: 0 12px 30px color-mix(in oklab, var(--fm-ink) 36%, transparent), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product {
	padding-top: calc(var(--fm-m) * 1.5);
	padding-bottom: calc(var(--fm-m) * 1.5);
}

.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product .product-image,
.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product .product-image img {
	width: 72px;
	height: 72px;
}

.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product .product-image img {
	object-fit: cover;
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-short-descr,
.fm-style-night.fm-style-night .foodmaster-modern-description {
	font-weight: 400;
	color: var(--fm-n6);
}

/* The add ring: brass outline that fills on press */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button button,
.fm-style-night.fm-style-night .foodmaster-add-to-cart {
	width: 36px;
	height: 36px;
	background: transparent;
	border: 1px solid var(--fm-ink);
	border-radius: var(--fm-add-radius);
	color: var(--fm-ink);
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button::before,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button::after,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button::before,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button::after {
	background: var(--fm-ink);
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:hover,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button:hover,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button button:hover,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:active {
	background: var(--fm-ink);
	color: var(--fm-on-ink);
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:hover::before,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:hover::after,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button:hover::before,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button:hover::after {
	background: var(--fm-on-ink);
}

/* Tags */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-tag,
.fm-style-night.fm-style-night .product-tag {
	border-color: var(--fm-n3);
	border-radius: 4px;
	background: transparent;
	color: var(--fm-n6);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-tag--deal,
.fm-style-night.fm-style-night .product-tag--deal {
	background: var(--fm-ink-2);
	border-color: var(--fm-ink-2);
	color: var(--fm-on-ink-2);
}

/* Chips come from the chip tokens; the strip sits on the room */
.fm-style-night.fm-style-night .foodmaster-tabs-nav {
	gap: var(--fm-m);
	padding-top: var(--fm-m);
	padding-bottom: var(--fm-m);
	border-bottom: 1px solid var(--fm-n2);
	background: var(--fm-paper);
}

/* Controls and inputs on the dark */
.fm-style-night.fm-style-night input,
.fm-style-night.fm-style-night textarea,
.fm-style-night.fm-style-night select,
.fm-style-night.fm-style-night .foodmaster-qty-btn,
.fm-style-night.fm-style-night .foodmaster-quantity-btn,
.fm-style-night.fm-style-night .modern-qty-input,
.fm-style-night.fm-style-night .foodmaster_additional_comments {
	background: var(--fm-paper);
	color: var(--fm-black);
	border-color: var(--fm-n3);
}

.fm-style-night.fm-style-night .foodmaster-cart-button,
.fm-style-night.fm-style-night .foodmaster-element-button,
.fm-style-night.fm-style-night .single_add_to_cart_button,
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .foodmaster-cart-button.checkout-sticky {
	border-radius: var(--fm-control-radius);
}

.fm-style-night.fm-style-night .foodmaster-cart-button.view-cart,
.fm-style-night.fm-style-night .foodmaster-element-button--secondary {
	background: transparent;
	border-color: var(--fm-n4);
	color: var(--fm-black);
}

/* The counter's edge: the bottom bar one depth lighter */
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar {
	background: var(--fm-paper-2);
	color: var(--fm-black);
	border-top: 1px solid var(--fm-n2);
	box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
}

.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .cart-info,
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .cart-count,
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .foodmaster-sticky-toggle {
	color: var(--fm-black);
}

/* Modal */
.fm-style-night.fm-style-night .foodmaster-modern-modal-overlay {
	background: rgba(0, 0, 0, 0.7);
}

.fm-style-night.fm-style-night .foodmaster-modern-modal-header,
.fm-style-night.fm-style-night .foodmaster-modal-cart-form,
.fm-style-night.fm-style-night .foodmaster-mini-cart-header,
.fm-style-night.fm-style-night .foodmaster-mini-cart-item {
	border-color: var(--fm-n2);
}

.fm-style-night.fm-style-night .foodmaster-modern-modal-close {
	border-color: var(--fm-n3);
	color: var(--fm-black);
}

/* Theme shell */
.fm-style-night.fm-style-night .modern-header {
	border-bottom: 1px solid var(--fm-n2);
}

.fm-style-night.fm-style-night .modern-header .cart-link,
.fm-style-night.fm-style-night .modern-header .header-cart-count {
	color: var(--fm-ink);
}

.fm-style-night.fm-style-night ::selection {
	background: var(--fm-ink);
	color: var(--fm-on-ink);
}

/* Narrow screens: the photo keeps its column, price and add control stack at the right */
@media (max-width: 480px) {
	.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product.has-thumb {
		grid-template-columns: 56px minmax(0, 1fr) auto;
		grid-template-areas: "image title price" "image title button";
		align-items: start;
	}

	.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product.has-thumb .product-image,
	.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product.has-thumb .product-image img {
		width: 56px;
		height: 56px;
	}

	.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product .product-price {
		flex-direction: column;
		align-items: flex-end;
		gap: 2px;
		min-width: 0;
	}

	.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product .product-button {
		justify-self: end;
		margin-top: 6px;
	}
}

/* The bar's total is the brightest number on the page */
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .cart-total,
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .cart-total .woocommerce-Price-amount {
	color: var(--fm-ink);
}

.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar.is-empty .cart-total,
.fm-style-night.fm-style-night .foodmaster-sticky-cart-bar .cart-count {
	color: var(--fm-n6);
}

/* Sold out: the control stays and cancels; the tag is an outlined pill; the price rests, not struck */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-tag--out,
.fm-style-night.fm-style-night .product-tag--out {
	border-radius: 999px;
	border-color: var(--fm-n4);
	color: var(--fm-n6);
	background: transparent;
}

.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product.unavailable .product-button,
.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-card .wf-template-product.unavailable .product-button {
	visibility: visible;
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product.unavailable .product-button .button,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product.unavailable .product-button .foodmaster-quickview-button {
	border-color: var(--fm-n4);
	color: var(--fm-n4);
	pointer-events: none;
}

.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-default-grid .wf-template-product.unavailable .product-price,
.fm-style-night.fm-style-night .wf-template-wrapper.wf-template-card .wf-template-product.unavailable .product-price {
	color: var(--fm-n6);
	text-decoration: none;
}

/* Wrapped names breathe */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-title > span {
	line-height: 1.15;
}

.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product.unavailable .product-image img {
	filter: grayscale(1) brightness(0.6);
	box-shadow: none;
}

/* WooCommerce blocks on the dark: inputs, selects, radios, badges, buttons */
.fm-style-night.fm-style-night .wc-block-components-text-input input,
.fm-style-night.fm-style-night .wc-block-components-select select,
.fm-style-night.fm-style-night .wc-block-components-select .wc-block-components-select__select,
.fm-style-night.fm-style-night .wc-block-components-textarea textarea,
.fm-style-night.fm-style-night .wc-block-components-combobox input,
.fm-style-night.fm-style-night .wc-block-components-form input,
.fm-style-night.fm-style-night .woocommerce input.input-text,
.fm-style-night.fm-style-night .woocommerce select,
.fm-style-night.fm-style-night .woocommerce textarea {
	background: var(--fm-paper-2);
	color: var(--fm-black);
	border-color: var(--fm-n3);
}

.fm-style-night.fm-style-night .wc-block-components-text-input input::placeholder,
.fm-style-night.fm-style-night .wc-block-components-textarea textarea::placeholder,
.fm-style-night.fm-style-night .woocommerce input::placeholder {
	color: var(--fm-n5);
}

.fm-style-night.fm-style-night .wc-block-components-text-input label,
.fm-style-night.fm-style-night .wc-block-components-select label,
.fm-style-night.fm-style-night .wc-block-components-select .wc-block-components-select__label,
.fm-style-night.fm-style-night .wc-block-components-textarea label,
.fm-style-night.fm-style-night .wc-block-components-checkbox label,
.fm-style-night.fm-style-night .wc-block-components-radio-control__label,
.fm-style-night.fm-style-night .wc-block-components-radio-control__description,
.fm-style-night.fm-style-night .wc-block-components-totals-item,
.fm-style-night.fm-style-night .wc-block-components-order-summary-item__description,
.fm-style-night.fm-style-night .wc-block-components-product-name,
.fm-style-night.fm-style-night .wc-block-components-checkout-step__title,
.fm-style-night.fm-style-night .wc-block-components-title {
	color: var(--fm-black);
}

.fm-style-night.fm-style-night .wc-block-components-text-input label,
.fm-style-night.fm-style-night .wc-block-components-select .wc-block-components-select__label,
.fm-style-night.fm-style-night .wc-block-components-radio-control__description,
.fm-style-night.fm-style-night .wc-block-components-order-summary-item__description {
	color: var(--fm-n6);
}

.fm-style-night.fm-style-night .wc-block-components-sale-badge,
.fm-style-night.fm-style-night .wc-block-components-product-badge {
	background: var(--fm-ink-2);
	border-color: var(--fm-ink-2);
	color: var(--fm-on-ink-2);
}

.fm-style-night.fm-style-night .wc-block-components-radio-control__option,
.fm-style-night.fm-style-night .wc-block-components-panel,
.fm-style-night.fm-style-night .wc-block-components-order-summary,
.fm-style-night.fm-style-night .wc-block-components-sidebar,
.fm-style-night.fm-style-night .wc-block-components-totals-wrapper,
.fm-style-night.fm-style-night .wc-block-components-checkout-order-summary__title {
	border-color: var(--fm-n2);
	background: transparent;
	color: var(--fm-black);
}

.fm-style-night.fm-style-night .wc-block-components-checkout-step,
.fm-style-night.fm-style-night .wc-block-components-sidebar-layout .wc-block-components-sidebar {
	background: transparent;
}

/* Focus on the dark: every control, including the theme's and WooCommerce's */
.fm-style-night.fm-style-night .foodmaster-accordion-header:focus-visible,
.fm-style-night.fm-style-night .wc-block-components-button:focus-visible,
.fm-style-night.fm-style-night .wc-block-components-checkout-place-order-button:focus-visible,
.fm-style-night.fm-style-night .woocommerce .button:focus-visible,
.fm-style-night.fm-style-night .foodmaster_additional_comments:focus-visible,
.fm-style-night.fm-style-night .modern-qty-input:focus-visible {
	outline: none;
	box-shadow: var(--fm-focus);
}

/* WooCommerce inputs: a boundary that reads (n4 clears 3:1) and the style's ring */
.fm-style-night.fm-style-night .wc-block-components-text-input input,
.fm-style-night.fm-style-night .wc-block-components-select select,
.fm-style-night.fm-style-night .wc-block-components-select .wc-block-components-select__select,
.fm-style-night.fm-style-night .wc-block-components-textarea textarea,
.fm-style-night.fm-style-night .wc-block-components-combobox input,
.fm-style-night.fm-style-night .woocommerce input.input-text,
.fm-style-night.fm-style-night .woocommerce select,
.fm-style-night.fm-style-night .woocommerce textarea {
	border: 1px solid var(--fm-n4);
	border-radius: calc(var(--fm-radius) * 0.75);
}

.fm-style-night.fm-style-night .wc-block-components-text-input input:focus,
.fm-style-night.fm-style-night .wc-block-components-select select:focus,
.fm-style-night.fm-style-night .wc-block-components-textarea textarea:focus,
.fm-style-night.fm-style-night .woocommerce input.input-text:focus,
.fm-style-night.fm-style-night .woocommerce select:focus {
	outline: none;
	border-color: var(--fm-ink);
	box-shadow: var(--fm-focus);
}

.fm-style-night.fm-style-night .wc-block-components-button,
.fm-style-night.fm-style-night .wc-block-components-checkout-place-order-button,
.fm-style-night.fm-style-night .woocommerce .button,
.fm-style-night.fm-style-night .foodmaster-order-type-toggle,
.fm-style-night.fm-style-night .foodmaster-order-type-toggle button,
.fm-style-night.fm-style-night .foodmaster-order-type-option {
	border-radius: var(--fm-control-radius);
}

/* Theme shell: the header's own cart outline and wordmark take the room's colours */
.fm-style-night.fm-style-night .modern-header .cart-link,
.fm-style-night.fm-style-night .modern-header .search-toggle,
.fm-style-night.fm-style-night .modern-header .menu-toggle {
	border-color: var(--fm-n3);
	border-radius: var(--fm-control-radius);
	color: var(--fm-black);
}

.fm-style-night.fm-style-night .modern-header .cart-link {
	color: var(--fm-ink);
	border-color: var(--fm-ink);
}

.fm-style-night.fm-style-night .modern-header .logo-text,
.fm-style-night.fm-style-night .modern-footer .logo-text {
	color: var(--fm-black);
}

/* Plates: the glow brightens under the hand, and the ring fills on press */
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:active,
.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button:active {
	background: var(--fm-ink);
	color: var(--fm-on-ink);
	transform: scale(0.94);
	transition: transform 120ms var(--fm-ease), background 120ms var(--fm-ease);
}

@media (prefers-reduced-motion: reduce) {
	.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .button:active,
	.fm-style-night.fm-style-night .wf-template-wrapper .wf-template-product .product-button .foodmaster-quickview-button:active {
		transform: none;
		transition: none;
	}
}

/* The accordion's open head: a hairline, not a second accent */
.fm-style-night.fm-style-night .foodmaster-accordion-item.active .foodmaster-accordion-header {
	box-shadow: inset 0 -1px 0 var(--fm-n3);
}

.fm-style-night.fm-style-night .foodmaster-accordion-item.active .foodmaster-accordion-header:focus-visible {
	box-shadow: var(--fm-focus), inset 0 -1px 0 var(--fm-n3);
}

/* The sheet surfaces out of the dark: it rises a little and its glow blooms as it lands */
.fm-style-night.fm-style-night .foodmaster-modern-modal-container {
	animation: fm-sheet-in var(--fm-slow) var(--fm-ease-out, var(--fm-ease)) both, fm-night-bloom var(--fm-slow) var(--fm-ease-out, var(--fm-ease)) both;
}

.fm-style-night.fm-style-night .foodmaster-modern-modal.is-closing .foodmaster-modern-modal-container {
	animation: fm-sheet-out var(--fm-fast) var(--fm-ease-out, var(--fm-ease)) both;
}

@keyframes fm-night-bloom {
	from { box-shadow: 0 0 0 0 transparent; }
	to { box-shadow: var(--fm-card-shadow); }
}
