/**
 * ID Restaurant Menu — Online Ordering Modal
 *
 * Site-wide pop-up that lets customers choose an online ordering provider.
 * Colours are driven by the Ordering tab's own --idrm-order-* variables
 * (set inline on the modal root). Each falls back to a clean default here.
 *
 * @package ID_Restaurant_Menu
 * @since   1.5.0
 */

.idrm-order-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: inherit;
}

.idrm-order-modal[hidden] {
	display: none;
}

.idrm-order-modal *,
.idrm-order-modal *::before,
.idrm-order-modal *::after {
	box-sizing: border-box;
}

.idrm-order-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.6);
	cursor: pointer;
}

.idrm-order-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
	padding: 36px 32px 30px;
	text-align: center;
	animation: idrm-order-in 0.2s ease-out;
}

@keyframes idrm-order-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.idrm-order-modal__dialog {
		animation: none;
	}
}

/* Close button */
.idrm-order-modal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--idrm-order-muted, #98a2ad);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	transition: color 0.15s, background 0.15s;
}

.idrm-order-modal__close:hover,
.idrm-order-modal__close:focus {
	color: var(--idrm-order-heading, #1f2937);
	background: rgba(0, 0, 0, 0.06);
}

/* Header (centered) */
.idrm-order-modal__title {
	margin: 0 8px 8px;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--idrm-order-heading, #18202b);
}

.idrm-order-modal__intro {
	margin: 0 auto 26px;
	max-width: 32ch;
	font-size: 0.98em;
	line-height: 1.45;
	color: var(--idrm-order-muted, #6b7280);
}

/* Options list */
.idrm-order-options {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-align: left;
}

.idrm-order-option-item {
	margin: 0;
	padding: 0;
}

.idrm-order-option,
.idrm-order-option:link,
.idrm-order-option:visited {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	background: var(--idrm-order-card-bg, #fff);
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	text-decoration: none;
	color: var(--idrm-order-text, #1f2937);
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.06s;
}

.idrm-order-option:hover,
.idrm-order-option:focus {
	border-color: var(--idrm-order-accent, #c9a96e);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	text-decoration: none;
}

.idrm-order-option:active {
	transform: translateY(1px);
}

/* Icon — outlined, square (rounded) or circle */
.idrm-order-option__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	padding: 6px;
	background: #fff;
	border: 2px solid var(--idrm-order-icon-outline, #e5e7eb);
	overflow: hidden;
}

.idrm-order-modal--icon-square .idrm-order-option__icon {
	border-radius: 10px;
}

.idrm-order-modal--icon-circle .idrm-order-option__icon {
	border-radius: 50%;
}

.idrm-order-option__icon img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* Option text */
.idrm-order-option__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.idrm-order-option__label {
	font-weight: 600;
	font-size: 1.06em;
	line-height: 1.25;
	color: var(--idrm-order-text, #1f2937);
}

.idrm-order-option__desc {
	font-size: 0.88em;
	line-height: 1.4;
	color: var(--idrm-order-muted, #6b7280);
}

/* An option with no icon: nudge the text to align with iconned rows. */
.idrm-order-option:not(:has(.idrm-order-option__icon)) {
	padding-left: 20px;
}

/* Prevent background scroll while the modal is open. */
body.idrm-order-open {
	overflow: hidden;
}
