/* Mundo Milo – Booking Grid
 * All colours are CSS variables so they can be overridden from Elementor
 * (Style tab) or from the theme.
 */
.mmbg {
	/* Mundo Milo palette: background #64ac8c, available #23ca0d, booked #b33636, selection #165e0d, group suggestion #29a21a, selection pointer #a5caa0 */
	--mmbg-accent: #165e0d;
	--mmbg-accent-ink: #ffffff;
	--mmbg-free: #23ca0d;
	--mmbg-booked: #b33636;
	--mmbg-hover: #a5caa0;
	--mmbg-candidate: #29a21a;
	--mmbg-past: #78b79b;
	--mmbg-text: #ffffff;
	--mmbg-muted: rgba(255, 255, 255, 0.82);
	--mmbg-surface: #64ac8c;
	--mmbg-line: rgba(255, 255, 255, 0.28);
	--mmbg-error: #ffe1da;
	--mmbg-label: 210px;
	--mmbg-cell: 42px;
	--mmbg-row: 46px;
	--mmbg-radius: 10px;

	position: relative;
	color: var(--mmbg-text);
	background: var(--mmbg-surface);
	font-size: 14px;
	line-height: 1.35;
}
.mmbg *,
.mmbg *::before,
.mmbg *::after {
	box-sizing: border-box;
}

/* ---------- toolbar ---------- */
.mmbg-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 20px;
	margin-bottom: 12px;
}
.mmbg-nav {
	display: flex;
	align-items: center;
	gap: 6px;
}
.mmbg-range {
	margin-left: 8px;
	font-weight: 600;
	text-transform: capitalize;
}
.mmbg .mmbg-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	min-width: 36px;
	padding: 0 14px;
	margin: 0;
	border: 1px solid var(--mmbg-line);
	border-radius: 999px;
	background: var(--mmbg-surface);
	color: var(--mmbg-text);
	font: inherit;
	font-size: 14px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: border-color 0.15s, background-color 0.15s;
}
.mmbg .mmbg-prev,
.mmbg .mmbg-next {
	padding: 0;
	font-size: 22px;
}
.mmbg .mmbg-btn:hover:not(:disabled) {
	border-color: var(--mmbg-accent);
	background: var(--mmbg-surface);
	color: var(--mmbg-text);
}
.mmbg .mmbg-btn:disabled {
	opacity: 0.4;
	cursor: default;
}
.mmbg .mmbg-btn:focus-visible,
.mmbg-cell:focus-visible {
	outline: 2px solid var(--mmbg-accent);
	outline-offset: 2px;
}
.mmbg .mmbg-book {
	background: var(--mmbg-accent);
	border-color: var(--mmbg-accent);
	color: var(--mmbg-accent-ink);
	font-weight: 600;
	padding: 0 22px;
	min-height: 42px;
}
.mmbg .mmbg-book:hover:not(:disabled) {
	background: var(--mmbg-accent);
	color: var(--mmbg-accent-ink);
	filter: brightness(1.08);
}

.mmbg-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--mmbg-muted);
	font-size: 13px;
}
.mmbg-legend li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}
.mmbg-legend i {
	display: inline-block;
	width: 18px;
	height: 12px;
	border-radius: 4px;
	/* thin dark outline + soft shadow so the swatches stand out on the green background */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.175);
}
.mmbg-legend .is-free { background: var(--mmbg-free); }
.mmbg-legend .is-booked { background: var(--mmbg-booked); }
.mmbg-legend .is-selected { background: var(--mmbg-accent); }
.mmbg-legend .is-suggested { background: var(--mmbg-candidate); }

/* ---------- grid ---------- */
.mmbg-scroll {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--mmbg-line);
	border-radius: var(--mmbg-radius);
	background: var(--mmbg-surface);
}
.mmbg-grid {
	display: grid;
	grid-template-columns: var(--mmbg-label) repeat(var(--mmbg-days, 21), minmax(var(--mmbg-cell), 1fr));
	min-width: min-content;
}

.mmbg-corner,
.mmbg-label {
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--mmbg-surface);
	border-right: 1px solid var(--mmbg-line);
}
.mmbg-month {
	padding: 8px 8px 2px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mmbg-muted);
	white-space: nowrap;
	overflow: hidden;
	border-left: 1px solid var(--mmbg-line);
}
.mmbg-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2px 0 8px;
	border-bottom: 1px solid var(--mmbg-line);
	color: var(--mmbg-muted);
	font-size: 11px;
	text-transform: capitalize;
}
.mmbg-hd {
	border-bottom: 1px solid var(--mmbg-line);
}
.mmbg-day .mmbg-dn {
	margin-top: 2px;
	font-size: 15px;
	font-weight: 600;
	color: var(--mmbg-text);
	width: 28px;
	height: 28px;
	line-height: 28px;
	text-align: center;
	border-radius: 50%;
}
.mmbg-day.is-weekend {
	background: rgba(255, 255, 255, 0.07);
}
.mmbg-day.is-today .mmbg-dn {
	background: var(--mmbg-text);
	color: var(--mmbg-surface);
}

.mmbg-label {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: var(--mmbg-row);
	padding: 6px 12px;
	overflow: hidden;
}
.mmbg-label.is-first,
.mmbg-cell.is-first {
	border-top: 1px solid var(--mmbg-line);
}
.mmbg-grid > .mmbg-label:nth-of-type(1) {
	border-top: 0;
}
.mmbg .mmbg-room {
	color: var(--mmbg-text);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mmbg .mmbg-room:hover {
	color: var(--mmbg-accent);
	text-decoration: underline;
}
.mmbg-cap {
	font-size: 12px;
	color: var(--mmbg-muted);
	white-space: nowrap;
}

/* ---------- cells: two half-days ---------- */
.mmbg .mmbg-cell {
	appearance: none;
	position: relative;
	display: block;
	height: var(--mmbg-row);
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: default;
	color: inherit;
	font: inherit;
}
.mmbg .mmbg-cell:hover,
.mmbg .mmbg-cell:focus {
	background: transparent;
}
.mmbg-cell::before,
.mmbg-cell::after {
	content: '';
	position: absolute;
	top: 9px;
	bottom: 9px;
	width: calc(50% + 1px); /* 1px overlap hides sub-pixel seams between halves/cells */
	background: var(--mmbg-free);
	transition: background-color 0.12s;
}
.mmbg-cell::before { left: -0.5px; }
.mmbg-cell::after { right: -0.5px; }

/* free */
.mmbg-cell[data-l='f']::before,
.mmbg-cell[data-rt='f']::after { background: var(--mmbg-free); }
/* past / unknown */
.mmbg-cell[data-l='past']::before,
.mmbg-cell[data-rt='past']::after,
.mmbg-cell[data-l='u']::before,
.mmbg-cell[data-rt='u']::after { background: var(--mmbg-past); }
/* booked & blocked */
.mmbg-cell[data-l='b']::before,
.mmbg-cell[data-rt='b']::after { background: var(--mmbg-booked); }
.mmbg-cell[data-l='x']::before,
.mmbg-cell[data-rt='x']::after {
	background: repeating-linear-gradient(-45deg, var(--mmbg-booked) 0 4px, var(--mmbg-past) 4px 8px);
}
/* selection */
.mmbg-cell[data-l='s']::before,
.mmbg-cell[data-rt='s']::after { background: var(--mmbg-accent); }
.mmbg-cell[data-l='p']::before,
.mmbg-cell[data-rt='p']::after {
	background: var(--mmbg-hover);
}
/* candidate (can be added to the current selection) */
.mmbg-cell[data-l='c']::before,
.mmbg-cell[data-rt='c']::after {
	background: var(--mmbg-candidate);
}

/* rounded ends where a bar starts (afternoon) or ends (morning) */
.mmbg-cell:not([data-l='b'])[data-rt='b']::after,
.mmbg-cell:not([data-l='s'])[data-rt='s']::after,
.mmbg-cell:not([data-l='p'])[data-rt='p']::after,
.mmbg-cell:not([data-l='x'])[data-rt='x']::after,
.mmbg-cell:not([data-l='f'])[data-rt='f']::after,
.mmbg-cell:not([data-l='c'])[data-rt='c']::after {
	border-radius: 999px 0 0 999px;
	left: 50%;
	right: 0;
	width: auto;
	margin-left: 2px;
}
.mmbg-cell[data-l='b']:not([data-rt='b'])::before,
.mmbg-cell[data-l='s']:not([data-rt='s'])::before,
.mmbg-cell[data-l='p']:not([data-rt='p'])::before,
.mmbg-cell[data-l='x']:not([data-rt='x'])::before,
.mmbg-cell[data-l='f']:not([data-rt='f'])::before,
.mmbg-cell[data-l='c']:not([data-rt='c'])::before {
	border-radius: 0 999px 999px 0;
	margin-right: 2px;
	width: calc(50% - 2px);
}

/* interaction */
.mmbg .mmbg-cell.is-clickable {
	cursor: pointer;
}
.mmbg-cell.is-clickable:hover::before,
.mmbg-cell.is-clickable:hover::after {
	filter: brightness(0.94);
}
/* hover on free / addable days: celeste */
.mmbg-cell.is-clickable:hover[data-l='f']::before,
.mmbg-cell.is-clickable:hover[data-rt='f']::after,
.mmbg-cell.is-clickable:hover[data-l='c']::before,
.mmbg-cell.is-clickable:hover[data-rt='c']::after {
	background: var(--mmbg-hover);
	filter: none;
}
.mmbg-cell:disabled {
	cursor: default;
}

/* loading */
.mmbg-cell.is-skeleton::before,
.mmbg-cell.is-skeleton::after {
	background: linear-gradient(90deg, var(--mmbg-past) 20%, var(--mmbg-line) 50%, var(--mmbg-past) 80%);
	background-size: 200% 100%;
	animation: mmbg-shimmer 1.4s infinite linear;
}
@keyframes mmbg-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
.mmbg.is-loading .mmbg-grid,
.mmbg.is-submitting {
	opacity: 0.7;
	pointer-events: none;
}
.mmbg-loading {
	min-height: 220px;
	border-radius: var(--mmbg-radius);
	background: linear-gradient(90deg, var(--mmbg-past) 20%, var(--mmbg-line) 50%, var(--mmbg-past) 80%);
	background-size: 200% 100%;
	animation: mmbg-shimmer 1.4s infinite linear;
}

/* ---------- booking bar ---------- */
.mmbg-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 12px;
	padding: 14px 16px;
	border: 1px solid var(--mmbg-line);
	border-radius: var(--mmbg-radius);
	background: var(--mmbg-surface);
}
.mmbg-bar p {
	margin: 0;
}
.mmbg-bar.is-hint {
	color: var(--mmbg-muted);
}
.mmbg-bar.is-hint strong {
	color: var(--mmbg-text);
}
.mmbg-bar.is-error {
	color: var(--mmbg-error);
}
.mmbg-bar.is-ready {
	position: sticky;
	bottom: 12px;
	z-index: 5;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	border-color: color-mix(in srgb, var(--mmbg-accent) 35%, var(--mmbg-line));
}
.mmbg-summary {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.mmbg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mmbg-chips li {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--mmbg-accent) 12%, var(--mmbg-surface));
	color: var(--mmbg-text);
	font-weight: 600;
	font-size: 13px;
}
.mmbg .mmbg-x {
	appearance: none;
	margin: 0 -4px 0 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--mmbg-muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.mmbg-dates {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}
.mmbg-note {
	color: var(--mmbg-muted);
	font-size: 13px;
}
.mmbg-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
}
.mmbg-total {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-right: 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
}
.mmbg-total small {
	font-size: 12px;
	font-weight: 400;
	color: var(--mmbg-muted);
}
.mmbg-total.is-loading {
	font-size: 13px;
	font-weight: 400;
	color: var(--mmbg-muted);
}
.mmbg-total.is-error {
	max-width: 320px;
	font-size: 13px;
	font-weight: 400;
	color: var(--mmbg-error);
	align-items: flex-start;
}

/* chosen cabin label on the MotoPress checkout page */
.mmbg-checkout-room {
	margin: 0 0 1em;
	padding: 8px 12px;
	border-left: 3px solid #2f6b4f;
	background: #f2f7f1;
}
.mmbg-checkout-room.is-warning {
	border-left-color: #c58a1b;
	background: #fbf5e8;
}

/* ---------- small screens ---------- */
@media (max-width: 767px) {
	.mmbg {
		--mmbg-label: 128px;
		--mmbg-cell: 40px;
		font-size: 13px;
	}
	.mmbg-label {
		padding: 6px 8px;
	}
	.mmbg .mmbg-room {
		white-space: normal;
		line-height: 1.2;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.mmbg-cap {
		display: none;
	}
	.mmbg-range {
		display: none;
	}
	.mmbg-bar.is-ready {
		bottom: 0;
		border-radius: var(--mmbg-radius) var(--mmbg-radius) 0 0;
	}
	.mmbg-actions {
		width: 100%;
		justify-content: flex-end;
	}
	.mmbg-total {
		margin-right: auto;
		align-items: flex-start;
	}
}

/* guests */
.mmbg-guests {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}
.mmbg-guests label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	color: var(--mmbg-muted);
}
.mmbg .mmbg-guests select {
	width: auto;
	min-width: 64px;
	height: 34px;
	margin: 0;
	padding: 0 28px 0 10px;
	border: 1px solid var(--mmbg-line);
	border-radius: 8px;
	background-color: var(--mmbg-surface);
	color: var(--mmbg-text);
	font: inherit;
	font-size: 14px;
}

.mmbg .mmbg-guests select option {
	color: #2b2a28;
	background: #ffffff;
}
.mmbg .mmbg-btn:hover:not(:disabled) {
	border-color: #ffffff;
}
.mmbg-scroll {
	scrollbar-color: rgba(255, 255, 255, 0.55) transparent;
	scrollbar-width: thin;
}
