/* ===========================================
   Yacht Booking Button – Frontend Styles
   Elementor-Kit-Variablen als Standard, mit sinnvollen Fallbacks.
   =========================================== */

:root {
	--ycbb-radius: 4px;
	--ycbb-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

/* --- Wrapper: zentriert den Button unabhängig von der Elementor-Widget-Ausrichtung --- */
.ycbb-shortcode-wrap {
	display: block;
	width: 100%;
	text-align: center;
}

/*
 * Spezifität bewusst mit Element + Klasse (button.ycbb-open-btn) und !important,
 * da viele Themes (u. a. Hello Theme) globale button:hover / [type="button"]:hover
 * Regeln mit derselben Spezifität mitbringen, die sonst je nach Ladereihenfolge
 * gewinnen und z. B. eine theme-eigene Akzentfarbe (z. B. Pink) erzwingen.
 */
button.ycbb-open-btn {
	display: inline-block;
	padding: .85em 2em;
	background: var(--e-global-color-primary, #1b3a57) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--ycbb-radius);
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: .02em;
	cursor: pointer;
	transition: background .2s ease, transform .15s ease;
}
button.ycbb-open-btn:hover,
button.ycbb-open-btn:focus-visible {
	background: var(--e-global-color-secondary, #0d1b2a) !important;
	transform: translateY(-1px);
	color: #fff !important;
}
button.ycbb-open-btn:focus-visible {
	outline: 2px solid var(--e-global-color-primary, #1b3a57);
	outline-offset: 3px;
}
button.ycbb-open-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
	transform: none !important;
}

/* --- Modal --- */
.ycbb-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
}
.ycbb-modal.is-open {
	display: block;
}
.ycbb-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(13, 27, 42, .65);
}
.ycbb-modal__box {
	position: relative;
	margin: 3vh auto;
	/* Breiter als üblich, weil der Booking-Manager-Kalender im Buchungs-Tab
	   bis zu drei Monate nebeneinander anzeigt und bei zu wenig Breite rechts
	   abgeschnitten wird (deren Widget ist nicht responsive/umbruchfähig). */
	width: min(1400px, 96vw);
	height: 94vh;
	height: 94dvh; /* dvh passt sich der tatsächlich sichtbaren Höhe an (siehe mobile Anmerkung unten) */
	background: #fff;
	border-radius: 8px;
	box-shadow: var(--ycbb-shadow);
	/* Fallback: falls der Kalender selbst auf sehr schmalen Desktop-Fenstern
	   trotzdem noch breiter ist, kann wenigstens horizontal gescrollt werden
	   statt hart abgeschnitten zu werden. */
	overflow-x: auto;
	overflow-y: hidden;
	display: flex;
	flex-direction: column;
}
.ycbb-modal__iframe {
	flex: 1;
	width: 100%;
	min-width: 1180px;
	height: 100%;
	border: 0;
	/* iFrame-eigenes Scrolling erlauben, damit Inhalte, die höher oder breiter
	   als das Modal sind, erreichbar bleiben (statt bei scrolling=no
	   abgeschnitten zu werden). */
	overflow: auto;
}
button.ycbb-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 40px;
	height: 40px;
	line-height: 1;
	border-radius: 50%;
	background: #fff !important;
	border: 1px solid #ddd !important;
	font-size: 22px;
	color: var(--e-global-color-secondary, #0d1b2a) !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, transform .15s ease;
}
button.ycbb-modal__close:hover,
button.ycbb-modal__close:focus-visible {
	background: #f0f0f1 !important;
	color: var(--e-global-color-secondary, #0d1b2a) !important;
	transform: scale(1.06);
}

/* Ladeindikator, solange der iFrame noch nicht gerendert hat */
.ycbb-modal__loading {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42px;
	height: 42px;
	margin: -21px 0 0 -21px;
	border: 4px solid #e2e2e2;
	border-top-color: var(--e-global-color-primary, #1b3a57);
	border-radius: 50%;
	animation: ycbb-spin .8s linear infinite;
	pointer-events: none;
}
.ycbb-modal.is-loaded .ycbb-modal__loading {
	display: none;
}
@keyframes ycbb-spin {
	to { transform: rotate(360deg); }
}

/* --- Responsive: Vollbild auf Mobilgeräten --- */
@media (max-width: 768px) {
	.ycbb-modal__box {
		width: 100vw;
		height: 100vh;
		/* iOS Safari: 100vh ist die Höhe OHNE die ein-/ausblendbare untere
		   Adressleiste, dadurch ragte "Buchen" unten aus dem sichtbaren
		   Bereich heraus. 100dvh folgt der tatsächlich sichtbaren Höhe. */
		height: 100dvh;
		margin: 0;
		border-radius: 0;
		/* Auf dem Handy soll die normale Yacht-Ansicht immer die volle Breite
		   ohne Herauszoomen nutzen. Die Desktop-Mindestbreite für den
		   mehrspaltigen Buchungskalender (siehe oben) wird hier bewusst
		   wieder aufgehoben. */
		overflow-x: hidden;
	}
	.ycbb-modal__iframe {
		min-width: 0;
	}
	button.ycbb-open-btn {
		width: 100%;
		text-align: center;
		padding: 1em 1.5em;
	}
}

/* Body-Scroll sperren, solange ein Modal offen ist */
body.ycbb-modal-open {
	overflow: hidden;
}

/* --- Flottensuche (Shortcode [ycbb_fleet_search]) - direkt inline, ohne
   Button/Popup, im Gegensatz zum Yacht-Buchungsbutton oben. --- */
.ycbb-fleet-search-wrap {
	width: 100%;
	max-width: 100%;
}
.ycbb-fleet-search-loading {
	font-size: .9rem;
	font-style: italic;
	color: #6b7280;
	text-align: center;
	margin: 0 0 .6rem;
	padding: .6rem 1rem;
	border: 1px dashed #dcdcde;
	border-radius: var(--ycbb-radius);
}
.ycbb-fleet-search-iframe {
	display: block;
	width: 100%;
	height: 140px;
	border: 0;
	border-radius: var(--ycbb-radius);
}
@media (max-width: 600px) {
	.ycbb-fleet-search-iframe {
		height: 260px;
	}
}
