/* ECX Booking popup — Eco Experience Costa Maya.
 * Uses the site's own type (Nunito) and greens. Desktop: two-column dialog with a
 * step sidebar that fills in with the customer's choices. Mobile: full-screen sheet. */

.ecx-booking,
.ecx-dialog {
	--ecx-green: #32b541;
	--ecx-green-dark: #469121;
	--ecx-green-hover: #2ea83c;
	--ecx-lime: #89d300;
	--ecx-ink: #333333;
	--ecx-muted: #6b6b6b;
	--ecx-line: #e4e4e4;
	--ecx-surface: #f6f6f6;
	--ecx-tint: #eef8ef;
	--ecx-white: #ffffff;
	--ecx-radius: 8px;
	--ecx-font: 'Nunito', 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Trigger (product page) ---------- */

/* Same gap the theme leaves between sidebar blocks (.block-after-indent). */
.ecx-booking { margin: 0 0 40px; }

.ecx-trigger {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 0 28px;
	border: 0;
	border-radius: 5px;
	background: var(--ecx-green);
	color: var(--ecx-white);
	font: 700 15px/1 var(--ecx-font);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.ecx-trigger:hover { background: var(--ecx-green-hover); }
.ecx-trigger:focus-visible { outline: 3px solid var(--ecx-lime); outline-offset: 2px; }

/* ---------- Dialog shell ---------- */

html.ecx-lock, html.ecx-lock body { overflow: hidden; }

.ecx-dialog {
	box-sizing: border-box;
	width: min(840px, calc(100vw - 32px));
	max-width: none;
	height: min(580px, calc(100vh - 48px));
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--ecx-white);
	color: var(--ecx-ink);
	font: 400 14px/1.5 var(--ecx-font);
	box-shadow: 0 24px 60px rgba(20, 40, 20, 0.28);
	overflow: hidden;
}
.ecx-dialog *, .ecx-dialog *::before, .ecx-dialog *::after { box-sizing: border-box; }
.ecx-dialog::backdrop { background: rgba(28, 38, 28, 0.55); }

.ecx-dialog--fallback {
	position: fixed;
	inset: 0;
	z-index: 100001;
}
.ecx-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(28, 38, 28, 0.55);
}

:where(.ecx-dialog) :where(p, h2, h3, ul, ol, dl, dd, li) { margin: 0; padding: 0; }
.ecx-dialog button { font-family: var(--ecx-font); }
/* Fast taps on + / − must add guests, not trigger the phone's double-tap zoom. */
.ecx-dialog, .ecx-dialog button, .ecx-dialog a, .ecx-trigger { touch-action: manipulation; }

.ecx-panel {
	display: grid;
	grid-template-columns: 232px 1fr;
	height: 100%;
}

/* ---------- Sidebar: the booking fills in as you go ---------- */

.ecx-side {
	overflow-y: auto;
	padding: 20px 16px;
	background: var(--ecx-tint);
	border-right: 1px solid #dcefdf;
}
.ecx-side__tour {
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--ecx-ink);
	margin: 0 4px 14px;
}
.ecx-side__img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: var(--ecx-radius);
	margin: 0 0 16px;
}
.ecx-hero { display: none; }
/* Steps as rows: icon · label (+ chosen value) · status */
.ecx-steps { list-style: none; display: grid; gap: 6px; }
.ecx-steps li {
	display: grid;
	grid-template-columns: 20px 1fr 22px;
	align-items: center;
	gap: 10px;
	padding: 10px 10px 10px 12px;
	border-radius: var(--ecx-radius);
	border: 1px solid transparent;
	color: var(--ecx-muted);
}
.ecx-steps li.is-current {
	background: var(--ecx-white);
	border-color: #cfe9d3;
	color: var(--ecx-ink);
	box-shadow: 0 1px 2px rgba(20, 60, 25, 0.06);
}
.ecx-steps li.is-done { color: var(--ecx-ink); }
.ecx-steps__icon { display: grid; place-items: center; color: inherit; }
.ecx-steps li.is-current .ecx-steps__icon,
.ecx-steps li.is-done .ecx-steps__icon { color: var(--ecx-green-dark); }
.ecx-steps__text { display: flex; flex-direction: column; min-width: 0; }
.ecx-steps__label { font-size: 14px; font-weight: 700; line-height: 1.3; }
.ecx-steps__value { font-size: 12px; color: var(--ecx-muted); line-height: 1.35; margin-top: 1px; }
.ecx-steps__state {
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 2px solid #cfd8d0;
}
.ecx-steps__state svg { width: 13px; height: 13px; stroke-width: 3; }
.ecx-steps li.is-current .ecx-steps__state { border-color: var(--ecx-green); }
.ecx-steps li.is-done .ecx-steps__state { border-color: var(--ecx-green); background: var(--ecx-green); color: var(--ecx-white); }

/* ---------- Main column ---------- */

.ecx-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.ecx-header {
	display: grid;
	grid-template-columns: 36px 1fr 36px;
	align-items: center;
	gap: 12px;
	padding: 14px 18px 12px;
	border-bottom: 1px solid var(--ecx-line);
}
.ecx-header__text { text-align: left; }
.ecx-eyebrow { display: none; }
.ecx-heading {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--ecx-ink);
	outline: none;
}
.ecx-progress { font-size: 12px; color: var(--ecx-muted); margin-top: 2px; }

.ecx-icon-btn {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ecx-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.ecx-icon-btn:hover:not(:disabled) { background: var(--ecx-surface); }
.ecx-header .ecx-icon-btn { width: 36px; height: 36px; font-size: 22px; }
/* Back: small outlined square in the brand green */
.ecx-header .ecx-icon-btn--back {
	border: 1.5px solid var(--ecx-green);
	border-radius: 8px;
	color: var(--ecx-green-dark);
}
.ecx-header .ecx-icon-btn--back:hover:not(:disabled) { background: var(--ecx-tint); }
.ecx-icon-btn:disabled { color: #c9c9c9; cursor: default; }
.ecx-icon-btn[hidden] { display: grid; visibility: hidden; }

.ecx-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 24px;
}

.ecx-footer {
	display: flex;
	justify-content: flex-end;
	padding: 12px 24px 14px;
	border-top: 1px solid var(--ecx-line);
	background: var(--ecx-white);
}
.ecx-footer[hidden] { display: none; }
.ecx-footer .ecx-btn { width: auto; min-width: 190px; }

.ecx-bar { display: none; }

/* ---------- Shared text ---------- */

.ecx-context {
	font-size: 14px;
	font-weight: 700;
	color: var(--ecx-ink);
	margin-bottom: 18px;
}
.ecx-muted { font-size: 13px; color: var(--ecx-muted); margin-top: 14px; }
.ecx-note { font-size: 13px; color: var(--ecx-muted); text-align: center; margin-top: 14px; }

/* Info callouts (start time, cruise ship): small cards with an icon, below the content */
.ecx-callouts { display: grid; gap: 8px; margin-top: 16px; }
.ecx-callout {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #dcefdf;
	border-radius: var(--ecx-radius);
	background: #f7fbf7;
}
.ecx-callout__icon {
	flex: 0 0 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--ecx-white);
	color: var(--ecx-green-dark);
	box-shadow: inset 0 0 0 1px #cfe9d3;
}
.ecx-callout__icon svg { width: 16px; height: 16px; }
.ecx-callout__text { font-size: 13px; line-height: 1.45; color: var(--ecx-muted); padding-top: 4px; text-align: left; }
.ecx-callout__text strong { display: block; color: var(--ecx-ink); font-weight: 700; margin-bottom: 1px; }

.ecx-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Buttons ---------- */

.ecx-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 46px;
	padding: 0 24px;
	border: 2px solid transparent;
	border-radius: 5px;
	font: 700 14px/1.2 var(--ecx-font);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ecx-btn--primary { background: var(--ecx-green); color: var(--ecx-white); }
.ecx-btn--primary:hover:not(:disabled) { background: var(--ecx-green-hover); }
.ecx-btn--primary:disabled { background: var(--ecx-green); opacity: 0.55; cursor: default; }
.ecx-btn--ghost { background: var(--ecx-white); border-color: var(--ecx-line); color: var(--ecx-ink); width: auto; margin-top: 16px; }
.ecx-btn--ghost:hover { border-color: var(--ecx-green); }
.ecx-btn--whatsapp { background: #25d366; color: var(--ecx-white); }
.ecx-btn--whatsapp:hover { background: #1fb457; color: var(--ecx-white); }

.ecx-dialog button:focus-visible,
.ecx-dialog a:focus-visible {
	outline: 3px solid var(--ecx-lime);
	outline-offset: 2px;
}

/* ---------- Calendar ---------- */

.ecx-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.ecx-cal__picks { display: flex; gap: 8px; min-width: 0; }
.ecx-pick {
	height: 38px;
	min-width: 0;
	padding: 0 32px 0 12px;
	border: 1px solid var(--ecx-line);
	border-radius: var(--ecx-radius);
	background: var(--ecx-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
	-webkit-appearance: none;
	appearance: none;
	color: var(--ecx-ink);
	font: 700 14px/1 var(--ecx-font);
	cursor: pointer;
}
.ecx-pick:hover { border-color: var(--ecx-green); }
.ecx-pick:focus-visible { outline: 3px solid var(--ecx-lime); outline-offset: 1px; }
.ecx-cal__nav { display: flex; flex: 0 0 auto; }
.ecx-nav {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border: 1.5px solid var(--ecx-green);
	background: var(--ecx-white);
	color: var(--ecx-green-dark);
	cursor: pointer;
}
.ecx-nav:first-child { border-radius: 8px 0 0 8px; }
.ecx-nav:last-child { border-radius: 0 8px 8px 0; margin-left: -1.5px; }
.ecx-nav:hover:not(:disabled) { background: var(--ecx-tint); }
.ecx-nav:disabled { border-color: var(--ecx-line); color: #c4c4c4; cursor: default; position: relative; z-index: 0; }
.ecx-nav:not(:disabled) { position: relative; z-index: 1; }
.ecx-cal__title { font-size: 15px; font-weight: 700; text-align: center; color: var(--ecx-ink); }
.ecx-dialog .ecx-cal__grid { border: 0; background: none; border-collapse: separate; border-spacing: 5px; table-layout: fixed; margin: 0 -5px; width: calc(100% + 10px); }
.ecx-dialog .ecx-cal__grid tr { border: 0; background: none; }
.ecx-dialog .ecx-cal__grid th {
	font-size: 12px;
	font-weight: 700;
	color: var(--ecx-muted);
	text-align: center;
	padding: 0 0 4px;
	border: 0;
	background: none;
}
.ecx-dialog .ecx-cal__grid td { padding: 0; border: 0; background: none; text-align: center; }
.ecx-day {
	width: 100%;
	height: 38px;
	border: 1px solid #cfe9d3;
	border-radius: var(--ecx-radius);
	background: var(--ecx-tint);
	color: var(--ecx-ink);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.ecx-day:hover:not(:disabled) { border-color: var(--ecx-green); color: var(--ecx-green-dark); }
.ecx-day:disabled {
	border-color: transparent;
	background: #f3f3f3;
	color: #b9b9b9;
	font-weight: 400;
	text-decoration: none;
	cursor: default;
}
.ecx-day.is-selected { background: var(--ecx-green); border-color: var(--ecx-green); color: var(--ecx-white); }

/* ---------- Time slots ---------- */

.ecx-slots {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}
.ecx-slot {
	width: 100%;
	min-height: 64px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	border: 1px solid var(--ecx-line);
	border-radius: var(--ecx-radius);
	background: var(--ecx-white);
	color: var(--ecx-ink);
	cursor: pointer;
}
.ecx-slot:hover { border-color: var(--ecx-green); }
.ecx-slot__time { font-size: 14px; font-weight: 700; }
.ecx-slot.is-selected { background: var(--ecx-green); border-color: var(--ecx-green); color: var(--ecx-white); }
.ecx-badge { font-size: 12px; font-weight: 700; color: #b26a00; }
.ecx-slot.is-selected .ecx-badge { color: var(--ecx-white); }

/* ---------- Guests ---------- */

.ecx-stepper {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	margin: 12px 0 4px;
}
.ecx-stepper__btn {
	width: 56px;
	height: 56px;
	border: 2px solid var(--ecx-green);
	border-radius: 50%;
	background: var(--ecx-white);
	color: var(--ecx-green-dark);
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.ecx-stepper__btn:hover:not(:disabled) { background: var(--ecx-tint); }
.ecx-stepper__btn:disabled { border-color: var(--ecx-line); color: #c4c4c4; cursor: default; }
.ecx-stepper__value { min-width: 64px; text-align: center; font-size: 26px; font-weight: 700; color: var(--ecx-ink); }

/* Age categories (one compact counter per row) */
.ecx-tickets { list-style: none; border: 1px solid var(--ecx-line); border-radius: var(--ecx-radius); }
.ecx-ticket {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}
.ecx-ticket + .ecx-ticket { border-top: 1px solid var(--ecx-line); }
.ecx-ticket__text { display: flex; flex-direction: column; min-width: 0; }
.ecx-ticket__label { font-size: 14px; font-weight: 700; color: var(--ecx-ink); }
.ecx-ticket__price { font-size: 13px; color: var(--ecx-muted); }
.ecx-mini { display: flex; align-items: center; gap: 12px; }
.ecx-mini__btn {
	width: 38px;
	height: 38px;
	border: 2px solid var(--ecx-green);
	border-radius: 50%;
	background: var(--ecx-white);
	color: var(--ecx-green-dark);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.ecx-mini__btn:hover:not(:disabled) { background: var(--ecx-tint); }
.ecx-mini__btn:disabled { border-color: var(--ecx-line); color: #c4c4c4; cursor: default; }
.ecx-mini__value { min-width: 22px; text-align: center; font-size: 17px; font-weight: 700; color: var(--ecx-ink); }
.ecx-sublabel { font-size: 13px; font-weight: 700; color: var(--ecx-muted); text-align: center; margin-top: 10px; }

.ecx-price,
.ecx-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 22px;
	padding: 16px 18px;
	border-radius: var(--ecx-radius);
	background: var(--ecx-surface);
	font-size: 14px;
}
.ecx-price strong,
.ecx-total strong { font-size: 18px; font-weight: 700; color: var(--ecx-ink); }

/* ---------- Review ---------- */

.ecx-summary { border: 1px solid var(--ecx-line); border-radius: var(--ecx-radius); }
.ecx-summary div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	font-size: 14px;
}
.ecx-summary div + div { border-top: 1px solid var(--ecx-line); }
.ecx-summary dt { color: var(--ecx-muted); }
.ecx-summary dd { font-weight: 700; text-align: right; }

.ecx-lines { list-style: none; margin-top: 18px; }
.ecx-lines li {
	display: flex;
	justify-content: space-between;
	padding: 6px 18px;
	font-size: 14px;
	color: var(--ecx-ink);
}

/* ---------- States ---------- */

.ecx-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px 0;
	font-size: 14px;
	color: var(--ecx-muted);
}
.ecx-spinner {
	width: 20px;
	height: 20px;
	border: 3px solid rgba(50, 181, 65, 0.25);
	border-top-color: var(--ecx-green);
	border-radius: 50%;
	animation: ecx-spin 0.8s linear infinite;
}
.ecx-btn--primary .ecx-spinner { border-color: rgba(255, 255, 255, 0.4); border-top-color: var(--ecx-white); }
@keyframes ecx-spin { to { transform: rotate(360deg); } }

.ecx-error {
	padding: 14px 16px;
	border-radius: var(--ecx-radius);
	background: #fdf1ef;
	border: 1px solid #f3c9c2;
	color: #8a2b1d;
	font-size: 13px;
	margin-bottom: 16px;
}
.ecx-error .ecx-btn--ghost { margin-top: 12px; }

/* ---------- Mobile: full-screen sheet ---------- */

@media (max-width: 767px) {
	.ecx-dialog {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
	}
	.ecx-panel { grid-template-columns: 1fr; }
	.ecx-side { display: none; }
	.ecx-header { padding: 8px 8px 8px; grid-template-columns: 40px 1fr 40px; }
	.ecx-eyebrow {
		display: block;
		font-size: 12px;
		font-weight: 700;
		color: var(--ecx-green-dark);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.ecx-heading { font-size: 17px; }
	.ecx-progress { display: none; }
	.ecx-bar {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 4px;
		order: -1;
		padding: 0;
	}
	/* On phones the whole column scrolls: the photo scrolls away with the content,
	   while the header and the action button stay put. */
	.ecx-main { overflow-y: auto; }
	.ecx-header { position: sticky; top: 0; z-index: 2; background: var(--ecx-white); }
	.ecx-footer { position: sticky; bottom: 0; z-index: 2; }
	.ecx-body { overflow: visible; flex: 1 0 auto; }
	.ecx-bar {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 3;
	}
	.ecx-bar span { height: 4px; background: var(--ecx-line); }
	.ecx-dialog[data-ecx-step="1"] .ecx-bar span:nth-child(-n+1),
	.ecx-dialog[data-ecx-step="2"] .ecx-bar span:nth-child(-n+2),
	.ecx-dialog[data-ecx-step="3"] .ecx-bar span:nth-child(-n+3),
	.ecx-dialog[data-ecx-step="4"] .ecx-bar span { background: var(--ecx-green); }
	.ecx-dialog .ecx-main .ecx-hero {
		display: block;
		flex: 0 0 auto;
		width: calc(100% - 36px);
		height: auto;
		aspect-ratio: 1.85 / 1;
		object-fit: cover;
		max-width: none;
		margin: 12px 16px 0;
		border-radius: var(--ecx-radius);
	}
	.ecx-body { padding: 14px 16px 16px; }
	.ecx-footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
	.ecx-footer .ecx-btn { width: 100%; }
	.ecx-header__text { text-align: center; }
	.ecx-slots { grid-template-columns: repeat(2, 1fr); }
	/* Compact calendar so the month and both notes fit one phone screen */
	.ecx-cal__head { margin-bottom: 6px; }
	.ecx-pick, .ecx-nav { height: 36px; }
	.ecx-nav { width: 36px; }
	.ecx-dialog .ecx-cal__grid { border-spacing: 4px; margin: 0 -4px; width: calc(100% + 8px); }
	.ecx-dialog .ecx-cal__grid th { padding: 0 0 2px; font-size: 11px; }
	.ecx-day { height: 38px; font-size: 14px; }
	.ecx-callouts { gap: 8px; margin-top: 12px; }
	.ecx-callout { padding: 9px 11px; gap: 9px; }
	.ecx-callout__icon { flex-basis: 24px; height: 24px; }
	.ecx-callout__icon svg { width: 14px; height: 14px; }
	.ecx-callout__text { font-size: 12.5px; line-height: 1.4; padding-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
	.ecx-spinner { animation-duration: 2s; }
	.ecx-trigger, .ecx-btn { transition: none; }
}

/* Price hint under the theme's "From $169" on tour pages. */
.ecx-price-hint {
	font-family: 'Nunito', sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #6b6b6b;
	margin: 0 0 2px;
}
