/**
 * PWA install UI — fully isolated under #pwa-install-root.
 * Loaded separately via wp_enqueue_style; not part of theme.css.
 */

#pwa-install-root {
	--pwa-accent-color: #6ac847;
	--pwa-bottom-offset: 0px;
}

#pwa-install-root .pwa-install-bar {
	position: fixed;
	right: 0;
	left: 0;
	bottom: var(--pwa-bottom-offset);
	z-index: 9998;
	background: #ffffff;
	border-top: 1px solid #e5e7eb;
	box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
	transform: translateY(100%);
	transition: transform 0.25s ease;
	padding-bottom: env(safe-area-inset-bottom, 0);
	isolation: isolate;
}

#pwa-install-root .pwa-install-bar.show {
	transform: translateY(0);
}

#pwa-install-root .pwa-install-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 64px;
	padding: 10px 16px;
	direction: rtl;
}

#pwa-install-root .pwa-install-bar__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

#pwa-install-root .pwa-install-bar__logo {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	object-fit: contain;
}

#pwa-install-root .pwa-install-bar__copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#pwa-install-root .pwa-install-bar__title {
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.4;
}

#pwa-install-root .pwa-install-bar__subtitle {
	font-size: 12px;
	font-weight: 400;
	color: #6b7280;
	line-height: 1.45;
}

#pwa-install-root .pwa-install-bar__action {
	flex-shrink: 0;
	min-width: 88px;
	height: 40px;
	padding: 0 20px;
	border: 0;
	border-radius: 8px;
	background: var(--pwa-accent-color);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

#pwa-install-root .pwa-install-bar__action:hover {
	background: #5aaf3a;
}

#pwa-install-root .pwa-install-bar__action:active {
	transform: scale(0.98);
}

#pwa-install-root .pwa-install-bar__action:focus-visible {
	outline: 2px solid var(--pwa-accent-color);
	outline-offset: 2px;
}

#pwa-install-root .pwa-install-bar__action.loading {
	opacity: 0.75;
	cursor: wait;
}

#pwa-install-root .pwa-ios-sheet {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	isolation: isolate;
}

#pwa-install-root .pwa-ios-sheet.show {
	opacity: 1;
	visibility: visible;
}

#pwa-install-root .pwa-ios-sheet__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

#pwa-install-root .pwa-ios-sheet__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	background: #ffffff;
	border-radius: 16px 16px 0 0;
	padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0));
	transform: translateY(100%);
	transition: transform 0.25s ease;
}

#pwa-install-root .pwa-ios-sheet.show .pwa-ios-sheet__panel {
	transform: translateY(0);
}

#pwa-install-root .pwa-ios-sheet__brand {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

#pwa-install-root .pwa-ios-sheet__logo {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: contain;
}

#pwa-install-root .pwa-ios-sheet__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	direction: rtl;
}

#pwa-install-root .pwa-ios-sheet__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
}

#pwa-install-root .pwa-ios-sheet__subtitle {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.6;
	color: #6b7280;
	direction: rtl;
}

#pwa-install-root .pwa-ios-sheet__note {
	margin: 16px 0 0;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
	font-size: 13px;
	line-height: 1.6;
	color: #6b7280;
	direction: rtl;
}

#pwa-install-root .pwa-ios-sheet__close {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: #f3f4f6;
	color: #6b7280;
	font-size: 22px;
	line-height: 1;
	font-family: inherit;
	cursor: pointer;
}

#pwa-install-root .pwa-ios-sheet__steps {
	margin: 0;
	padding: 0 20px 0 0;
	list-style: decimal;
	display: flex;
	flex-direction: column;
	gap: 12px;
	direction: rtl;
}

#pwa-install-root .pwa-ios-sheet__step {
	font-size: 14px;
	line-height: 1.6;
	color: #374151;
}

#pwa-install-root .pwa-ios-sheet__step-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

#pwa-install-root .pwa-ios-sheet__step-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
}

#pwa-install-root .pwa-ios-sheet__step-icon svg {
	display: block;
	width: 28px;
	height: 28px;
}

#pwa-install-root .pwa-ios-sheet__step-text {
	flex: 1;
	direction: rtl;
	text-align: right;
}

#pwa-install-root .pwa-ios-sheet__step-em {
	color: var(--pwa-accent-color);
	font-weight: 700;
}

#pwa-install-root .pwa-ios-sheet__confirm {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 12px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--pwa-accent-color);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}

@media (prefers-color-scheme: dark) {
	#pwa-install-root .pwa-install-bar {
		background: #111827;
		border-top-color: #374151;
		box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
	}

	#pwa-install-root .pwa-install-bar__title {
		color: #f9fafb;
	}

	#pwa-install-root .pwa-install-bar__subtitle {
		color: #9ca3af;
	}

	#pwa-install-root .pwa-ios-sheet__panel {
		background: #1f2937;
	}

	#pwa-install-root .pwa-ios-sheet__title {
		color: #f9fafb;
	}

	#pwa-install-root .pwa-ios-sheet__close {
		background: #374151;
		color: #d1d5db;
	}

	#pwa-install-root .pwa-ios-sheet__step {
		color: #d1d5db;
	}

	#pwa-install-root .pwa-ios-sheet__subtitle,
	#pwa-install-root .pwa-ios-sheet__note {
		color: #9ca3af;
	}

	#pwa-install-root .pwa-ios-sheet__note {
		border-top-color: #374151;
	}
}

@media (max-width: 480px) {
	#pwa-install-root .pwa-install-bar__inner {
		padding-inline: 12px;
	}

	#pwa-install-root .pwa-install-bar__title {
		font-size: 14px;
	}

	#pwa-install-root .pwa-install-bar__action {
		min-width: 76px;
		height: 38px;
		padding-inline: 16px;
		font-size: 14px;
	}
}
