/*
 * Side panel and slide-in card, from the /widget-ideas/ recipes in the Asklet app. Loaded only
 * on pages that use one. Buttons reset the properties themes commonly set on `button`.
 * z-index stays under the admin bar (99999).
 */

.asklet-tab,
.asklet-close {
	margin: 0;
	min-height: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	cursor: pointer;
}

.asklet-tab {
	position: fixed;
	right: 0;
	top: 50%;
	z-index: 99990;
	translate: 0 -50%;
	writing-mode: vertical-rl;
	padding: 16px 10px;
	border: 0;
	border-radius: 10px 0 0 10px;
	background: var(--asklet-accent, #0f766e);
	color: #fff;
	font: 600 14px/1 system-ui, sans-serif;
}

.asklet-drawer {
	position: fixed;
	right: 0;
	top: 50%;
	z-index: 99991;
	width: 380px;
	max-width: 100vw;
	translate: 100% -50%;
	overflow: hidden;
	background: #fff;
	color: #111827;
	border-radius: 16px 0 0 16px;
	box-shadow: -16px 0 48px rgb(0 0 0 / 0.18);
	transition: translate 0.25s ease;
	font: 600 15px/1.2 system-ui, sans-serif;
}

.asklet-drawer.is-open {
	translate: 0 -50%;
}

.asklet-drawer__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px 10px 16px;
	border-bottom: 1px solid #e5e7eb;
}

.asklet-close {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: #111827;
	font: 400 22px/1 system-ui, sans-serif;
}

.asklet-slidein {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	width: 360px;
	max-width: calc(100vw - 40px);
	overflow: hidden;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgb(0 0 0 / 0.22);
	opacity: 0;
	translate: 0 24px;
	visibility: hidden;
	transition: opacity 0.3s ease, translate 0.3s ease, visibility 0.3s;
}

.asklet-slidein.is-open {
	opacity: 1;
	translate: 0 0;
	visibility: visible;
}

.asklet-slidein .asklet-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.9);
	font-size: 20px;
}

.asklet-slidein iframe {
	height: 400px;
}

.asklet-tab:focus-visible,
.asklet-close:focus-visible {
	outline: 2px solid var(--asklet-accent, #0f766e);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.asklet-drawer {
		border-radius: 0;
	}

	.asklet-drawer iframe {
		height: min(480px, 80vh);
	}

	.asklet-slidein {
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		border-radius: 16px 16px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asklet-drawer,
	.asklet-slidein {
		transition: none;
	}
}
