/*
 * Gabarit CSS : Bottom Sheet
 * 
 * Directive 2 : Reproduit fidèlement le comportement d'un Bottom Sheet iOS/Android.
 * Animation fluide (cubic-bezier) et coins supérieurs fortement arrondis.
 */

.saasbuilder-bottomsheet-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background-color: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	
	display: flex;
	align-items: flex-end; /* Colle le panneau au bas de l'écran */
	justify-content: center; /* Centre le panneau sur grand écran */
}

.saasbuilder-bottomsheet-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.saasbuilder-bottomsheet-panel {
	width: 100%;
	max-width: 600px; /* Largeur max sur Desktop/Tablette */
	max-height: 90vh; /* Ne couvre jamais tout l'écran */
	background-color: var(--color-bg);
	border-radius: 20px 20px 0 0; /* Coins arrondis uniquement en haut */

	/* Translation hors écran (vers le bas) */
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
	
	display: flex;
	flex-direction: column;
}

.saasbuilder-bottomsheet-overlay.is-open .saasbuilder-bottomsheet-panel {
	transform: translateY(0);
}

/* Indicateur visuel de swipe */
.saasbuilder-bottomsheet-drag {
	display: flex;
	justify-content: center;
	padding: 12px 0 4px 0;
	cursor: grab;
}

.saasbuilder-bottomsheet-drag-handle {
	width: 40px;
	height: 5px;
	border-radius: 3px;
	background-color: var(--color-border);
}

.saasbuilder-bottomsheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-md) var(--spacing-lg);
	border-bottom: 1px solid var(--color-border);
}

.saasbuilder-bottomsheet-title {
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
}

.saasbuilder-bottomsheet-body {
	flex-grow: 1;
	overflow-y: auto;
	padding: var(--spacing-lg);
	-webkit-overflow-scrolling: touch;
}

/* 
 * Skeleton Loading 100% CSS 
 */
.saasbuilder-bottomsheet-body.is-loading .saasbuilder-bottomsheet-dynamic-content {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

.saasbuilder-bottomsheet-body.is-loading .saasbuilder-bottomsheet-dynamic-content::before,
.saasbuilder-bottomsheet-body.is-loading .saasbuilder-bottomsheet-dynamic-content::after {
	content: '';
	display: block;
	border-radius: var(--border-radius);
	background: var(--skeleton-bg);
	background-image: linear-gradient(90deg, var(--skeleton-bg) 0px, var(--skeleton-shine) 40px, var(--skeleton-bg) 80px);
	background-size: 200vw 100%;
	animation: saasbuilder-skeleton-shine 1.5s infinite linear;
}

.saasbuilder-bottomsheet-body.is-loading .saasbuilder-bottomsheet-dynamic-content::before {
	height: 40px;
	width: 100%;
}

.saasbuilder-bottomsheet-body.is-loading .saasbuilder-bottomsheet-dynamic-content::after {
	height: 120px;
	width: 80%;
}
