/**
 * Odoo Booking Modal — Styles
 *
 * Uses the native <dialog> element:
 *   - renders in the Top Layer (above everything, no z-index conflicts),
 *   - focus trap and Esc-to-close are built in,
 *   - ::backdrop controls the overlay background.
 */

/* Reset browser defaults for <dialog>. */
.odoo-booking-dialog {
	width: min(1200px, 95vw);
	max-width: 95vw;
	height: min(820px, 92vh);
	max-height: 92vh;
	padding: 0;
	margin: auto;
	border: 0;
	border-radius: 10px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	background: #ffffff;
	color: inherit;
}

.odoo-booking-dialog[open] {
	display: flex;
	flex-direction: column;
}

.odoo-booking-dialog::backdrop {
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* Header */
.odoo-booking-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	border-bottom: 1px solid #e5e7eb;
	background: #f9fafb;
	flex-shrink: 0;
}

.odoo-booking-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
}

.odoo-booking-close {
	appearance: none;
	background: transparent;
	border: 0;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	padding: 2px 10px;
	border-radius: 6px;
	color: #4b5563;
	transition: background-color 120ms ease, color 120ms ease;
}

.odoo-booking-close:hover,
.odoo-booking-close:focus-visible {
	background: #e5e7eb;
	color: #111827;
	outline: none;
}

/* Body */
.odoo-booking-body {
	flex: 1 1 auto;
	min-height: 0;
	position: relative;
	background: #ffffff;
}

.odoo-booking-iframe-container {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.odoo-booking-iframe-container iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #ffffff;
}

/* Loading placeholder sits behind the iframe. Hidden once the iframe fires
   its load event. */
.odoo-booking-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6b7280;
	font-size: 0.95rem;
	background: #ffffff;
	z-index: 0;
}

/* Prevent page scroll while the dialog is open.
   (<dialog> does not block scrolling on all browsers automatically.) */
body.odoo-booking-open {
	overflow: hidden;
}

/* Small screens: dialog fills almost the entire viewport. */
@media (max-width: 640px) {
	.odoo-booking-dialog {
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}
}

/* Optional helper class for trigger buttons — applied only when the trigger
   has the .odoo-booking-button class. Does not affect other button styles. */
.odoo-booking-button {
	cursor: pointer;
}
