/**
 * FoodOrd Product Modal Styles
 *
 * @package FoodOrd
 */

/* Modal Base Styles */
:root {
	--background-color: #f7f7f7;
	--primary-color: #c9386f;
	--primary-hover: #b92a61;
	--text-color: #323232;
	--text-hover: #313131;
	--secondary-text: #6b6b6b;
	--button-bg: #c9386f;
	--button-text-color: #ffffff;
	--button-on-hover: #b92a61;
	--header-bg: #ffffff;
	--footer-bg: #ffffff;
	--border-color: #f4f4f4;
}



.foodord-allergy-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	color: #94a3b8;
	margin-left: 6px;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 0;
	outline: none;
	border-radius: 50%;
}

.foodord-allergy-trigger:hover {
	color: #0f172a;
	transform: scale(1.15);
	background: #f1f5f9;
}

.foodord-allergy-trigger:focus-visible {
	outline: 2px solid #0f172a;
	outline-offset: 2px;
}

.foodord-allergy-trigger__icon {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.foodord-allergy-trigger__icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.foodord-modal * {
	box-sizing: border-box;
}

.foodord-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	display: none;
}

/* Visibility helper classes */
.foodord-modal.visible {
	display: block;
}

.foodord-modal-product-content.visible {
	display: block;
}

.foodord-modal.hidden,
.foodord-modal-loading.hidden,
.foodord-modal-product-content.hidden {
	display: none;
}

.foodord-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
	overflow-x: hidden;
	max-width: 100vw;
}

.foodord-modal-container {
	position: relative;
	width: 100%;
	max-width: 540px;
	pointer-events: auto;
}

.foodord-modal-content {
	position: relative;
	width: 100%;
	max-height: 90vh;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	overflow-x: hidden;
	transform: translateY(30px);
	opacity: 0;
	transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.foodord-modal[aria-hidden="false"] .foodord-modal-content {
	transform: translateY(0);
	opacity: 1;
}

/* Modal Close Button */
.foodord-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	/*display: flex;*/
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
	outline: none;
}

.foodord-modal-close:hover {
	background: #ffffff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.foodord-modal-close svg {
	width: 20px;
	height: 20px;
	color: #000000;
}

/* Modal Body */
.foodord-modal-body {
	position: relative;
	max-height: calc(90vh - 40px);
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

/* Loading State */
.foodord-modal-loading {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 40px;
	text-align: center;
}

.foodord-modal-loading.visible {
	display: flex;
}

.foodord-loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #c9386f;
	border-radius: 50%;
	animation: foodord-spin 1s linear infinite;
	margin-bottom: 20px;
}

@keyframes foodord-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.foodord-modal-loading p {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: #323232;
}

/* Error State */
.foodord-modal-error {
	padding: 40px;
	text-align: center;
}

.foodord-modal-error p {
	margin-bottom: 20px;
}

.foodord-modal-error .button {
	background: #c9386f;
	border: none;
	padding: 12px 24px;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.foodord-modal-error .button:hover {
	background: #b92a61;
}

/* Product Content Styles */
.foodord-modal-product-content {
	display: none;
}

/* Variation form inside modal */
.foodord-product-purchase .variations_form {
	margin: 10px 0 0 0;
}

/* Hide WooCommerce variation reset link and default add-to-cart button inside modal */
.foodord-product-purchase .reset_variations,
.foodord-product-purchase .single_add_to_cart_button,
.foodord-product-modal-wrapper .reset_variations,
.foodord-modal-body .reset_variations,
.foodord-modal .reset_variations,
.variations_form .reset_variations,
.foodord-product-purchase .variations .reset_variations,
.foodord-product-purchase .variations .value .reset_variations {
	display: none;
	visibility: hidden;
	opacity: 0;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Hide entire variation add-to-cart container in modal */
.foodord-product-purchase .woocommerce-variation-add-to-cart.variations_button,
.foodord-product-purchase .woocommerce-variation-add-to-cart.woocommerce-variation-add-to-cart-enabled {
	display: none;
}

/* Convert WooCommerce variations table to class-based layout */
.foodord-product-purchase .variations {
	display: block;
	width: 100%;
	margin-bottom: 10px;
	border-collapse: initial;
}

.foodord-product-purchase .variations tbody {
	display: block;
}

.foodord-product-purchase .variations tr {
	display: block;
	margin-bottom: 8px;
}

.foodord-product-purchase .variations th.label {
	display: none;
}

.foodord-product-purchase .variations td.value {
	display: block;
	width: 100%;
	padding: 0;
}

.foodord-product-purchase .variations td.value select {
	display: none;
}

.foodord-original-select {
	display: none;
}

.foodord-product-purchase .single_variation_wrap {
	margin-top: 10px;
}

.foodord-product-purchase .single_add_to_cart_button {
	width: 100%;
}

.foodord-attr-wrapper>select {
	display: none;
}

.foodord-attr-wrapper {
	border: none;
	background: rgba(248, 249, 250, 0.6);
	padding: 16px 16px 16px 16px;
}

.foodord-attr-radio {
	display: block;
}

.foodord-attr-legend {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	gap: 8px;
	margin-bottom: 8px;
	padding: 0 16px;
	position: relative;
	box-sizing: border-box;
}

.foodord-attr-legend-title {
	margin: 0;
	display: block;
	flex: 1;
	order: -1;
	font-size: 14px;
	font-weight: 600;
}

.foodord-product-toppings {
	margin: 10px 0 0 0;
}

.foodord-attr-legend .foodord-product-toppings__badge {
	flex-shrink: 0;
	order: 1;
}

.foodord-attr-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 0;
}

.foodord-attr-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	gap: 12px;
	padding: 12px 14px;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background-color: #ffffff;
	margin: 0;
}

.foodord-attr-option:hover {
	border-color: var(--primary-color, #c9386f);
	background-color: color-mix(in srgb, var(--primary-color, #c9386f), white 90%);
}

.foodord-attr-option.is-selected {
	border-color: var(--primary-color, #c9386f);
	background-color: color-mix(in srgb, var(--primary-color, #c9386f), white 90%);
}

.foodord-attr-option.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.foodord-attr-wrapper.has-variation-error {
	background-color: rgba(201, 56, 111, 0.1);
	border-color: rgba(201, 56, 111, 0.4);
	animation: toppings-shake 0.5s ease-in-out;
}

.foodord-attr-wrapper.has-variation-error .foodord-attr-option {
	border-color: rgba(201, 56, 111, 0.4);
}

/* Left side - radio and label */
.foodord-attr-option-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.foodord-attr-input {
	appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid var(--primary-color, #c9386f);
	border-radius: 50%;
	position: relative;
	flex-shrink: 0;
}

.foodord-attr-input:checked::after {
	content: '';
	position: absolute;
	inset: 3px;
	background: var(--primary-color, #c9386f);
	border-radius: 50%;
}

.foodord-attr-input:focus-visible {
	outline: 2px solid #c9386f;
	outline-offset: 2px;
}

/* Right side - price display */
.foodord-attr-price {
	white-space: nowrap;
	margin-left: auto;
}

.foodord-product-modal-wrapper {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto auto;
	padding: 0;
}

/* Add top spacing when there are no images */
.foodord-product-modal-wrapper:not(:has(.foodord-product-images)) .foodord-product-details {
	padding-top: 20px;
}

/* Alternative selector for older browsers that don't support :has() */
@supports not (selector(:has(.foodord-product-images))) {
	.foodord-product-modal-wrapper>.foodord-product-details:first-child {
		padding-top: 20px;
	}
}

.foodord-product-images {
	position: relative;
	width: 100%;
}

.foodord-product-main-image {
	position: relative;
	aspect-ratio: 16/9;
	margin-bottom: 1rem;
	overflow: hidden;
	background: #f8f9fa;
	width: 100%;
	max-height: 300px;
}

.foodord-product-main-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.foodord-product-thumbnails {
	display: flex;
	gap: 12px;
	margin-top: 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0 40px 4px 40px;
}

.foodord-product-thumbnail {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
}

.foodord-product-thumbnail:hover,
.foodord-product-thumbnail.active {
	border-color: #c9386f;
}

.foodord-product-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.foodord-product-title-row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 14px;
	margin-bottom: 0.5rem;
	position: sticky;
	top: 0;
	z-index: 5;
	transition: padding 0.2s ease, margin 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.foodord-product-title {
	font-size: 16px;
	margin: 0;
	flex: 0 1 auto;
	min-width: 0;
}

.foodord-product-title-row.sticky-active {
	background-color: #ffffff;
	padding: 20px 1.2rem 20px 2.4rem;
	margin: 10px -1.2rem 0 -1.2rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border-bottom-color: #e5e5e5;
}

.foodord-product-price {
	font-size: 16px;
	font-weight: 600;
	padding: 0 1rem;
	margin-bottom: 0.5rem;
}

.foodord-product-description {
	font-size: 14px;
	border-bottom: 1px solid #ebebeb;
	padding: 0 1rem;
	padding-bottom: 20px;
}

.foodord-product-toppings__set {
	border: none;
	background: rgba(248, 249, 250, 0.6);
	padding: 16px 16px 16px 16px;
	margin: 0 0 8px 0;
}

.foodord-product-toppings__set-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	gap: 8px;
	margin-bottom: 8px;
	padding: 0 16px;
	position: relative;
	box-sizing: border-box;
}

.foodord-product-toppings__set-title {
	font-size: 15px;
	padding-bottom: 0;
	margin: 0;
	display: block;
	flex: 1;
	order: -1;
	font-weight: 600;
}

/* Required Badge */
.foodord-product-toppings__badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 4px;
	height: 20px;
	border-radius: 5px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border: 1.5px solid currentColor;
	transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	white-space: nowrap;
	line-height: 1;
	font-variant-numeric: lining-nums;
	justify-content: center;
	position: relative;
	gap: 0;
	overflow: hidden;
	backface-visibility: hidden;
	transform-style: preserve-3d;
	will-change: transform;
}

.foodord-product-toppings__badge::before {
	content: '';
	display: inline-flex;
	width: 0;
	height: 4px;
	opacity: 0;
	margin-right: 0;
	transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg) translate(0, 0);
	transform-origin: center;
	flex-shrink: 0;
}

.foodord-product-toppings__badge--required {
	color: #f43f5e;
	background-color: rgba(244, 63, 94, 0.04);
}

.foodord-product-toppings__badge--optional {
	color: #555555;
	background-color: rgba(148, 163, 184, 0.04);
}

/* Selected State */
.has-selection>.foodord-product-toppings__badge {
	color: #059669;
	background-color: #ecfdf5;
	border-color: #059669;
	padding-left: 8px;
}

.has-selection>.foodord-product-toppings__badge::before {
	width: 8px;
	opacity: 1;
	margin-right: 8px;
	transform: rotate(-45deg) translate(0, -1px);
}

/* Success Animation */
@keyframes badge-success {
	0% {
		transform: scale(1);
	}

	40% {
		transform: scale(1.12);
	}

	70% {
		transform: scale(0.94);
	}

	100% {
		transform: scale(1);
	}
}

.just-selected>.foodord-product-toppings__badge {
	animation: badge-success 0.4s ease-out;
}


.foodord-product-toppings__description {
	margin: 0 0 14px;
}

/* Options Container */
.foodord-product-toppings__control,
.foodord-product-toppings__options {
	margin: 0;
	padding: 0;
}

/* Dropdown Style */
.foodord-product-toppings__select {
	width: 100%;
	padding: 14px;
	border: 1.5px solid #dedede;
	border-radius: 8px;
	background: #ffffff;
	transition: all 0.2s ease;
	appearance: none;
	font-size: 13px;
	color: var(--text-color);
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b6b6b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 12px center;
	background-repeat: no-repeat;
	background-size: 16px;
	padding-right: 40px;
}

.foodord-product-toppings__select:focus {
	outline: none;
	border-color: var(--primary-color, #c9386f);
	box-shadow: 0 0 0 2px rgba(201, 56, 111, 0.12);
}

.foodord-product-toppings__select:hover {
	border-color: #d0d0d0;
}

/* Error States */
.foodord-product-toppings__set.has-error {
	background-color: rgba(225, 29, 72, 0.04);
	border-color: rgba(225, 29, 72, 0.3);
	animation: toppings-error-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.foodord-product-toppings__set.has-error .foodord-product-toppings__select {
	border-color: rgba(225, 29, 72, 0.5);
}

.foodord-product-toppings__set.has-error .foodord-product-toppings__option {
	border-color: rgba(225, 29, 72, 0.2);
}

@keyframes toppings-error-shake {

	0%,
	100% {
		transform: translateX(0);
	}

	10%,
	30%,
	50%,
	70%,
	90% {
		transform: translateX(-4px);
	}

	20%,
	40%,
	60%,
	80% {
		transform: translateX(4px);
	}
}

/* Radio/Checkbox Options */
.foodord-product-toppings__options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.foodord-product-toppings__option.is-hidden-by-toggle {
	display: none;
}

.foodord-product-toppings__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #ffffff;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	margin: 0;
}

.foodord-modal .foodord-product-toppings__toggle,
.foodord-modal button.foodord-product-toppings__toggle,
.foodord-product-toppings .foodord-product-toppings__toggle,
.foodord-product-toppings button.foodord-product-toppings__toggle {
	margin-top: 20px;
	border: none;
	background: none;
	letter-spacing: 0.02em;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
}

.foodord-modal .foodord-product-toppings__toggle .foodord-product-toppings__toggle-text,
.foodord-modal .foodord-product-toppings__toggle .foodord-product-toppings__toggle-icon,
.foodord-product-toppings .foodord-product-toppings__toggle .foodord-product-toppings__toggle-text,
.foodord-product-toppings .foodord-product-toppings__toggle .foodord-product-toppings__toggle-icon {
	color: #3147ad;
	font-size: 0.75rem;
	font-weight: 400;
}

.foodord-modal .foodord-product-toppings__toggle:focus-visible,
.foodord-product-toppings .foodord-product-toppings__toggle:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--primary-color, #c9386f), white 60%);
	outline-offset: 2px;
}

.foodord-modal .foodord-product-toppings__toggle:hover,
.foodord-product-toppings .foodord-product-toppings__toggle:hover {
	color: var(--primary-hover, #b92a61);
	text-decoration: underline;
	text-decoration-color: #3147ad;
}

.foodord-product-toppings__toggle-icon {
	width: 0.5em;
	height: 0.5em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	display: inline-block;
	transform: rotate(45deg) translateY(-0.2em);
	transform-origin: center;
	transition: transform 0.2s ease;
}

.foodord-product-toppings__toggle.is-expanded .foodord-product-toppings__toggle-icon {
	transform: rotate(-135deg) translateY(-0.2em);
	margin-left: 2px;
}

.foodord-product-toppings__option:hover {
	border-color: var(--primary-color, #c9386f);
	background-color: color-mix(in srgb, var(--primary-color, #c9386f), white 90%);
}

.foodord-product-toppings__option.is-checked {
	border-color: var(--primary-color, #c9386f);
	background-color: color-mix(in srgb, var(--primary-color, #c9386f), white 90%);
}

/* Option Content */
.foodord-product-toppings__option-content {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
}

.foodord-product-toppings__input {
	position: relative;
	width: 18px;
	height: 18px;
	border: 2px solid var(--primary-color, #c9386f);
	background: #ffffff;
	transition: all 0.2s ease;
	cursor: pointer;
	margin: 0;
	flex-shrink: 0;
	appearance: none;
}

.foodord-product-toppings__input[type="radio"] {
	border-radius: 50%;
}

.foodord-product-toppings__input[type="checkbox"] {
	border-radius: 4px;
}

.foodord-product-toppings__input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	inset: 3px;
	background: var(--primary-color, #c9386f);
	border-radius: 50%;
}

.foodord-product-toppings__input[type="checkbox"]:checked {
	border-color: var(--primary-color, #c9386f);
	background: var(--primary-color, #c9386f);
}

.foodord-product-toppings__input[type="checkbox"]::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 4px;
	border: 2px solid #ffffff;
	border-top: 0;
	border-right: 0;
	transform: translate(-50%, -60%) rotate(-45deg) scale(0.6);
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.foodord-product-toppings__input[type="checkbox"]:checked::after {
	opacity: 1;
	transform: translate(-50%, -60%) rotate(-45deg) scale(1);
}

.foodord-product-toppings__option-label {
	font-size: 14px;
	font-weight: 400;
	cursor: pointer;
	flex: 1;
}

.foodord-product-toppings__option-price {
	font-size: 14px;
	white-space: nowrap;
	margin-left: 8px;
}

/* Disabled checkbox states */
.foodord-product-toppings__input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.foodord-product-toppings__option:has(.foodord-product-toppings__input:disabled) {
	opacity: 0.6;
	cursor: not-allowed;
}

.foodord-product-toppings__option:has(.foodord-product-toppings__input:disabled):hover {
	border-color: #e2e2e2;
	background: #ffffff;
}


.foodord-product-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.foodord-add-to-cart-btn {
	background: var(--button-bg);
	border: none;
	padding: 16px 32px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.foodord-modal-footer .foodord-add-to-cart-btn {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 45px;
	border-radius: 5px;
	justify-content: space-between;
	padding: 0 12px;
	text-align: left;
}

/* Match card CTA structure inside modal */
.foodord-modal-footer .foodord-add-to-cart-left {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.foodord-modal-footer .foodord-add-to-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.6);
}

.foodord-modal-footer .foodord-add-to-cart-btn .foodord-add-to-cart-count {
	color: #323232;
}

.foodord-modal-footer .foodord-add-to-cart-label {
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
}

.foodord-modal-footer .foodord-add-to-cart-total {
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	font-size: 14px;
	font-weight: 600;

}

.foodord-modal-footer .foodord-add-to-cart-btn .loading-text {
	color: #ffffff;
}

.foodord-add-to-cart-btn:hover {
	background: var(--button-on-hover);
	box-shadow: 0 4px 12px rgba(201, 56, 111, 0.25);
}

.foodord-view-product-btn {
	background: transparent;
	border: 2px solid #c9386f;
	padding: 14px 28px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.foodord-view-product-btn:hover {
	background: #c9386f;
	transform: translateY(-1px);
}

/* Modal Footer */
.foodord-modal-footer {
	position: sticky;
	bottom: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	border-top: 1px solid #e5e5e5;
	padding: 10px 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
	z-index: 10;
}

.foodord-modal-footer .foodord-product-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	margin: 0;
	padding: 0 10px;
	gap: 0.7rem;
}

/* Quantity Controls */
.foodord-quantity-controls {
	display: flex;
	align-items: center;
	gap: 5px;
	border-radius: 8px;
	padding: 4px;
}

.foodord-quantity-btn {
	position: relative;
	width: 36px;
	height: 36px;
	color: #323232;
	background: rgb(240, 240, 240);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 0;
	line-height: 1;
}

.foodord-quantity-btn::before,
.foodord-quantity-btn::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background-color: currentColor;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.foodord-quantity-btn::before {
	width: 14px;
	height: 2px;
}

#foodord-quantity-plus::after {
	width: 2px;
	height: 14px;
}

#foodord-quantity-minus::after {
	display: none;
}

.foodord-quantity-btn:hover {
	background: var(--button-bg);
	color: #ffffff;
}

.foodord-quantity-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.foodord-quantity-btn:disabled:hover {
	background: #ffffff;
	transform: none;
}

.foodord-quantity-input {
	width: 40px;
	height: 36px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-size: 13px;
	text-align: center;
	background: #ffffff;
	margin: 0 4px;
	appearance: textfield;
}

.foodord-quantity-input:focus {
	outline: 2px solid #c9386f;
	outline-offset: 1px;
}

.foodord-quantity-input::-webkit-outer-spin-button,
.foodord-quantity-input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}


/* Body Modal Open State */
body.foodord-modal-open {
	overflow: hidden;
}

body.foodord-allergy-info-open {
	overflow: hidden;
}

/* Small Desktop and Tablet Styles - 786px and below */
@media (max-width: 786px) {
	.foodord-modal-overlay {
		padding: 0;
	}

	.foodord-modal-container {
		max-width: 100%;
		height: 100%;
	}

	.foodord-modal-content {
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		margin: 0;
		width: 100%;
	}

	.foodord-modal-body {
		max-height: 100%;
		height: 100%;
		padding: 0;
		display: flex;
		flex-direction: column;
	}

	.foodord-modal-product-content.visible {
		display: flex;
		flex-direction: column;
		flex: 1;
		min-height: 100%;
	}

	.foodord-product-modal-wrapper {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 0;
	}

	.foodord-product-main-image {
		max-height: 250px;
		margin-bottom: 0.5rem;
	}

	.foodord-product-thumbnails {
		padding: 0 16px 4px 16px;
		gap: 8px;
		margin-top: 12px;
	}

	.foodord-product-thumbnail {
		width: 60px;
		height: 60px;
	}

	.foodord-product-title-row {
		padding: 0 14px;
		margin-bottom: 0.3rem;
		gap: 4px;
		transition: padding 0.2s ease, margin 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	}

	.foodord-product-title-row.sticky-active {
		padding: 20px 16px 20px 30px;
		margin: 8px -16px 0 -16px;
	}

	.foodord-product-price {
		padding: 0 16px;
		margin-bottom: 0.3rem;
	}

	.foodord-product-description {
		padding: 0 16px 16px 16px;
	}

	/* Attribute/Variation sections */
	.foodord-attr-wrapper {
		padding: 12px 12px 12px 12px;
		margin: 0 0 16px 0;
	}

	.foodord-attr-legend {
		margin-bottom: 8px;
		padding-bottom: 0;
	}

	.foodord-attr-option {
		padding: 10px 12px;
	}

	/* Toppings sections */
	.foodord-product-toppings__set {
		padding: 12px 12px 12px 12px;
		margin: 0 0 16px 0;
	}

	.foodord-product-toppings__set-header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		margin-bottom: 8px;
		padding: 0 16px;
	}

	.foodord-product-toppings__option {
		padding: 12px;
	}

	.foodord-product-toppings__option-content {
		gap: 8px;
	}

	.foodord-product-toppings__select {
		padding: 12px;
		padding-right: 32px;
	}

	/* Modal footer adjustments */
	.foodord-modal-footer {
		padding: 12px 16px;
		position: sticky;
		bottom: 0;
		margin-top: auto;
	}

	.foodord-modal-footer .foodord-product-actions {
		flex-direction: row;
		gap: 8px;
		padding: 0;
		align-items: center;
	}

	.foodord-modal-footer .foodord-add-to-cart-btn {
		padding: 10px 12px;
		height: 50px;
	}

	.foodord-quantity-controls {
		gap: 3px;
		padding: 2px;
	}

	.foodord-quantity-btn {
		width: 36px;
		height: 36px;
	}

	.foodord-quantity-input {
		width: 36px;
		height: 28px;
		margin: 0 2px;
	}

	/* Close button adjustments */
	.foodord-modal-close {
		top: 15px;
		right: 12px;
		width: 28px;
		height: 28px;
	}

	.foodord-modal-close svg {
		width: 16px;
		height: 16px;
	}
}

/* Tablet Styles - 768px and below */
@media (max-width: 768px) {

	.foodord-product-main-image {
		max-height: 220px;
	}

	.foodord-product-thumbnails {
		padding: 0 12px 4px 12px;
	}

	.foodord-product-toppings__set {
		padding: 10px 10px 10px 10px;
		margin: 0 0 16px 0;
	}

	.foodord-product-toppings__set-header {
		padding: 0 10px;
		margin-bottom: 8px;
	}
}




/* Mobile & Tablet Styles - 786px and below */
@media (max-width: 786px) {
	.foodord-modal-container {
		padding: 0;
		max-width: 100vw;
		height: 100%;
		margin: 0;
	}

	.foodord-modal-container .foodord-modal-content {
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		margin: 0;
		width: 100%;
		animation: foodord-modal-mobile-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	}

	.foodord-modal-body {
		max-height: 100%;
		height: 100%;
		padding: 0;
	}

	.foodord-product-modal-wrapper {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 0;
	}

	.foodord-product-main-image {
		max-height: 200px;
		margin-bottom: 0.25rem;
	}

	.foodord-product-thumbnails {
		padding: 0 12px 4px 12px;
		gap: 6px;
		margin-top: 8px;
	}

	.foodord-product-thumbnail {
		width: 50px;
		height: 50px;
	}

	.foodord-product-title-row {
		padding: 0 12px;
		margin-bottom: 0.5rem;
		gap: 4px;
		transition: padding 0.2s ease, margin 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	}

	.foodord-product-title-row.sticky-active {
		padding: 20px 10px 20px 22px;
		margin: 6px -12px 0 -12px;
	}

	.foodord-product-price {
		padding: 0 12px;
		margin-bottom: 0.5rem;
	}

	.foodord-product-description {
		padding: 0 12px 12px 12px;
	}

	/* Attribute/Variation sections */
	.foodord-attr-wrapper {
		margin: 0 0 12px 0;
		padding: 12px 12px 12px 12px;
	}

	.foodord-attr-legend {
		margin-bottom: 8px;
		padding-bottom: 0;
	}

	.foodord-attr-option {
		padding: 8px 10px;
	}

	/* Toppings sections */
	.foodord-product-toppings__set {
		margin: 0 0 12px 0;
		padding: 12px 12px 12px 12px;
	}

	.foodord-product-toppings__set-header {
		padding: 0 12px;
		margin-bottom: 8px;
	}

	.foodord-product-toppings__badge {
		min-width: 50px;
	}

	.foodord-product-toppings__select {
		padding: 12px 10px;
		padding-right: 30px;
	}

	/* Modal footer adjustments */
	.foodord-modal-footer {
		padding: 8px 12px;
		position: sticky;
		bottom: 0;
	}

	.foodord-modal-footer .foodord-product-actions {
		flex-direction: row;
		gap: 6px;
		padding: 0;
		align-items: center;
	}

	.foodord-modal-footer .foodord-add-to-cart-btn {
		padding: 10px;
		height: 50px;
	}

	.foodord-quantity-controls {
		gap: 2px;
		padding: 1px;
	}

	.foodord-quantity-btn {
		width: 42px;
		height: 42px;
	}

	.foodord-quantity-input {
		width: 34px;
		height: 34px;
		margin: 0 5px;
	}

	/* Close button adjustments */
	.foodord-modal-close {
		top: 15px;
		right: 10px;
		width: 32px;
		height: 32px;
	}

	.foodord-modal-close svg {
		width: 24px;
		height: 24px;
		color: #000000;
	}

	/* Loading state */
	.foodord-modal-loading {
		padding: 30px 15px;
	}

	.foodord-loading-spinner {
		width: 28px;
		height: 28px;
	}
}

.foodord-allergy-info-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.foodord-allergy-info-modal.is-open {
	display: flex;
}

.foodord-allergy-info-modal__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.foodord-allergy-info-modal__dialog {
	position: relative;
	background: #ffffff;
	border-radius: 14px;
	width: 100%;
	max-width: 390px;
	max-height: min(80vh, 560px);
	box-shadow: 0 20px 35px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 1;
	box-sizing: border-box;
	margin: 0 auto;
	align-self: center;
}

.foodord-allergy-info-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 12px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.foodord-allergy-info-modal__title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #2b2b2b;
}

.foodord-allergy-info-modal__close {
	position: relative;
	background: none;
	border: none;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	border-radius: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: color 0.2s ease;
}

.foodord-allergy-info-modal__close:hover,
.foodord-allergy-info-modal__close:focus {
	outline: none;
}

.foodord-allergy-info-modal__close::before {
	content: '\00d7';
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	color: #555555;
	transition: color 0.2s ease;
	position: static;
}


.foodord-allergy-info-modal__close:hover::before,
.foodord-allergy-info-modal__close:focus-visible::before {
	color: #c9386f;
}

.foodord-allergy-info-modal__content {
	padding: 16px 24px 24px;
	overflow-y: auto;
	color: #4c4c4c;
	font-size: 15px;
	line-height: 1.6;
}

@media (max-width: 480px) {
	.foodord-allergy-info-modal {
		padding: 0;
		align-items: center;
		justify-content: center;
	}

	.foodord-allergy-info-modal__dialog {
		width: 100%;
		max-width: calc(100% - 32px);
		margin: 0 auto;
		border-radius: 12px;
		box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
		align-self: center;
	}

	.foodord-allergy-info-modal__header {
		padding: 16px 18px 8px;
	}

	.foodord-allergy-info-modal__content {
		padding: 14px 18px 18px;
	}

	.foodord-allergy-info-modal__icon {
		margin: 0 0 16px;
	}
}

.foodord-allergy-info-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 4px 0 18px;
}

.foodord-allergy-info-modal__icon img {
	display: block;
	width: 64px;
	height: auto;
}

.foodord-allergy-info-modal__content p {
	margin: 0 0 12px;
}

.foodord-allergy-info-modal__content p:last-child {
	margin-bottom: 0;
}

.foodord-allergens-item {
	margin-bottom: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	background-color: var(--foodord-allergy-item-bg, #f8f8f8);
	font-size: 14px;
	line-height: 1.5;
}

.foodord-allergens-item strong {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	color: var(--foodord-allergy-item-label, #333333);
}

.foodord-allergens-item--contains {
	border-left: 3px solid var(--foodord-allergens-contains-color, #dc3545);
}

.foodord-allergens-item--not-contain {
	border-left: 3px solid var(--foodord-allergens-not-contain-color, #28a745);
}

.foodord-allergens-item--may-contain {
	border-left: 3px solid var(--foodord-allergens-may-contain-color, #ffc107);
}

.foodord-allergens-item:last-child {
	margin-bottom: 0;
}

/* Animation for modal entrance */
@media (prefers-reduced-motion: no-preference) {
	.foodord-modal-content {
		animation: foodord-modal-enter 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
	}
}

@keyframes foodord-modal-enter {
	0% {
		transform: translateY(30px);
		opacity: 0;
	}

	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes foodord-modal-mobile-slide-up {
	0% {
		transform: translateY(100%);
		opacity: 1;
	}

	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.foodord-modal-overlay {
		background: rgba(0, 0, 0, 0.8);
	}

	.foodord-modal-content {
		border: 2px solid #000000;
	}

}

/* Product Modal Toast Notification */
.foodord-toast-container {
	position: absolute;
	bottom: 85px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	z-index: 100;
	pointer-events: none;
}

@media (max-width: 786px) {
	.foodord-toast-container {
		bottom: 75px;
		width: 100%;
		padding: 0 20px;
		box-sizing: border-box;
	}
}

.foodord-toast {
	min-width: 220px;
	max-width: min(400px, 90vw);
	padding: 10px 14px;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
	background: #323232;
	color: #ffffff;
	font-size: 12px;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: auto;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.foodord-toast--error {
	background: #323232;
}

.foodord-toast--success {
	background: rgba(32, 148, 84, 0.95);
}

.foodord-toast--info {
	background: rgba(51, 51, 51, 0.95);
}

.foodord-toast.is-hiding {
	opacity: 0;
	transform: translateY(-6px);
}

@keyframes toppings-shake {

	0%,
	100% {
		transform: translateX(0);
	}

	15%,
	45%,
	75% {
		transform: translateX(-4px);
	}

	30%,
	60%,
	90% {
		transform: translateX(4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.foodord-product-title-row {
		transition: none;
	}
}