/* OC Webapp – download-app banner. Scoped to #oc-app-banner so theme styles
 * for links, buttons and images don't leak in. RTL/LTR follow the page. */

#oc-app-banner[hidden] {
	display: none !important;
}

/* Top: part of the page flow (no z-index), so the theme's menus, drawers and
 * popups always open above it. It opens by sliding down from above the page,
 * pushing the page down (margin-top is animated by banner.js). */
#oc-app-banner {
	box-sizing: border-box;
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	background: #fff;
	color: #111;
	border-bottom: 1px solid #e6e6e6;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.3;
	text-align: start;
}

#oc-app-banner * {
	box-sizing: border-box;
}

/* Bottom: floats above the page, but below cookie bars (typically 10000+),
 * popups and modals so it never hides a consent or checkout button. It opens
 * by sliding up from below the screen. */
#oc-app-banner.oc-ab--bottom {
	position: fixed;
	z-index: 9990;
	left: 0;
	right: 0;
	bottom: 0;
	border-bottom: 0;
	border-top: 1px solid #e6e6e6;
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

#oc-app-banner .oc-ab__icon {
	flex: 0 0 54px;
	width: 54px;
	height: 54px;
	max-width: none;
	margin: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	object-fit: cover;
}

#oc-app-banner .oc-ab__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

#oc-app-banner .oc-ab__title {
	margin: 0;
	color: #111;
	font-size: 16px;
	font-weight: 600;
}

#oc-app-banner .oc-ab__text {
	overflow: hidden;
	color: #6b6b6b;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Store rating: 5 stars filled to the average, then (number of ratings).
 * Each phone shows its own store's rating; desktop shows the one with more. */
#oc-app-banner .oc-ab__rating {
	display: none;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
	line-height: 1;
}

#oc-app-banner.oc-ab--ios .oc-ab__rating--ios,
#oc-app-banner.oc-ab--android .oc-ab__rating--android,
#oc-app-banner.oc-ab--desktop .oc-ab__rating--desktop {
	display: flex;
}

#oc-app-banner .oc-ab__stars {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 70px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d9d9d9' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") repeat-x 0 0 / 14px 14px;
}

#oc-app-banner .oc-ab__stars-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffb400' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") repeat-x 0 0 / 14px 14px;
}

/* Hebrew/RTL: fill from the right. */
html[dir="rtl"] #oc-app-banner .oc-ab__stars-fill {
	right: 0;
	left: auto;
	background-position: 100% 0;
}

#oc-app-banner .oc-ab__count {
	color: #8a8a8a;
	font-size: 12px;
}

/* Download button: outlined pill in the chosen color, text only. */
#oc-app-banner .oc-ab__btn {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	height: 34px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid var(--oc-ab-color, #007aff);
	border-radius: 999px;
	background: transparent;
	color: var(--oc-ab-color, #007aff);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	box-shadow: none;
}

#oc-app-banner .oc-ab__btn:hover,
#oc-app-banner .oc-ab__btn:focus-visible {
	background: var(--oc-ab-color, #007aff);
	color: #fff;
}

/* Phone: one "Download" button for its own store. Desktop: both stores,
 * labelled by store name. */
#oc-app-banner.oc-ab--ios .oc-ab__btn--ios,
#oc-app-banner.oc-ab--android .oc-ab__btn--android,
#oc-app-banner.oc-ab--desktop .oc-ab__btn {
	display: inline-flex;
}

#oc-app-banner .oc-ab__store,
#oc-app-banner.oc-ab--desktop .oc-ab__label {
	display: none;
}

#oc-app-banner.oc-ab--desktop .oc-ab__store {
	display: inline;
}

/* Close (X). */
#oc-app-banner .oc-ab__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #8a8a8a;
	box-shadow: none;
	cursor: pointer;
}

#oc-app-banner .oc-ab__close:hover,
#oc-app-banner .oc-ab__close:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	color: #111;
}

#oc-app-banner .oc-ab__close svg {
	width: 13px;
	height: 13px;
}

/* Desktop: content centred, X pinned to the end. */
#oc-app-banner.oc-ab--desktop {
	justify-content: center;
	gap: 14px;
	padding-inline: 52px;
}

#oc-app-banner.oc-ab--desktop .oc-ab__body {
	flex: 0 1 auto;
}

#oc-app-banner.oc-ab--desktop .oc-ab__close {
	position: absolute;
	top: 50%;
	inset-inline-end: 14px;
	transform: translateY(-50%);
}

/* Narrow phones (≤ 380px, e.g. iPhone SE): a little more compact so the
 * title stays on one line. */
@media (max-width: 380px) {
	#oc-app-banner {
		gap: 9px;
		padding-inline: 10px;
	}

	#oc-app-banner .oc-ab__icon {
		flex-basis: 48px;
		width: 48px;
		height: 48px;
		border-radius: 11px;
	}

	#oc-app-banner .oc-ab__title {
		font-size: 15px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	#oc-app-banner .oc-ab__btn {
		padding: 0 13px;
		font-size: 14px;
	}

	#oc-app-banner .oc-ab__close {
		width: 24px;
		height: 24px;
	}
}

@media print {
	#oc-app-banner {
		display: none !important;
	}
}
