/* RealMember Engage bell: trigger, badge, popup, rows. */

.rme-bell {
	--rme-accent: #bb212c;
	--rme-bell-color: #fff;
	--rme-text: #1a1a1a;
	--rme-muted: rgba(26, 26, 26, 0.55);
	--rme-border: rgba(0, 0, 0, 0.08);
	position: relative;
	display: inline-flex;
}

.rme-bell [hidden] {
	display: none !important;
}

/* Themes and Elementor kits style every a, h3 and nav descendant with more weight
   than one class. What they smash is pinned here, scoped under .rme-bell. */
.rme-bell .rme-popup {
	/* Elementor's global text font if there is one; a shortcode widget does not get it by itself. */
	font-family: var(--e-global-typography-text-font-family, inherit);
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.4;
	text-transform: none;
	white-space: normal;
}

.rme-bell .rme-popup *,
.rme-bell .rme-popup *::before,
.rme-bell .rme-popup *::after {
	box-sizing: border-box;
}

.rme-bell .rme-popup__title {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--rme-text) !important;
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	letter-spacing: normal !important;
	line-height: 1.3 !important;
	text-transform: none !important;
}

.rme-bell .rme-item,
.rme-bell .rme-item:hover,
.rme-bell .rme-item:focus,
.rme-bell .rme-item:visited {
	color: var(--rme-text) !important;
	font-family: inherit !important;
	font-weight: 400 !important;
	text-decoration: none !important;
	box-shadow: none !important;
}

.rme-bell .rme-popup__all,
.rme-bell .rme-popup__all:visited {
	color: var(--rme-muted) !important;
	font-family: inherit !important;
	font-weight: inherit !important;
	text-decoration: none !important;
	box-shadow: none !important;
}

.rme-bell .rme-popup__all:hover,
.rme-bell .rme-popup__all:focus {
	color: var(--rme-text) !important;
}

.rme-bell .rme-bell__icon,
.rme-bell .rme-item__avatar--icon svg {
	max-width: none;
	fill: currentColor;
}

/* Trigger */
.rme-bell__trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--rme-bell-color);
	cursor: pointer;
	user-select: none;
}

.rme-bell__trigger:focus-visible,
.rme-popup__close:focus-visible,
.rme-popup__mark-read:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.rme-bell__icon {
	display: block;
	width: 18px;
	height: 20px;
}

.rme-bell__badge {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: 9px;
	background: var(--rme-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
}

/* Popup */
.rme-popup {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 10000;
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: 480px;
	overflow: hidden;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	color: var(--rme-text);
	text-align: left;
}

.rme-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--rme-border);
}

.rme-popup__title {
	margin: 0;
	color: var(--rme-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.rme-popup__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--rme-text);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	user-select: none;
}

.rme-popup__close:hover {
	background: rgba(0, 0, 0, 0.05);
}

.rme-popup__list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.rme-popup__note {
	padding: 32px 20px;
	color: var(--rme-muted);
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

.rme-popup__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
	border-top: 1px solid var(--rme-border);
	font-size: 13px;
	font-weight: 500;
}

.rme-popup__footer > :only-child {
	margin: 0 auto;
}

.rme-popup__mark-read {
	color: var(--rme-accent);
	cursor: pointer;
	user-select: none;
}

.rme-popup__all,
.rme-popup__all:visited {
	color: var(--rme-muted);
	text-decoration: none;
}

.rme-popup__mark-read:hover,
.rme-popup__all:hover {
	color: var(--rme-text);
}

/* Rows */
.rme-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	color: var(--rme-text);
	text-decoration: none;
}

.rme-item:hover {
	background: rgba(0, 0, 0, 0.03);
}

.rme-item.is-unread {
	background: color-mix(in srgb, var(--rme-accent) 5%, transparent);
}

.rme-item.is-unread:hover {
	background: color-mix(in srgb, var(--rme-accent) 9%, transparent);
}

.rme-item__avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
}

.rme-item__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rme-item__letter {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--rme-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
}

/* The site's own icon on product updates: the whole logo, with soft corners. */
.rme-bell .rme-item__avatar--site {
	border-radius: 22%;
	background: none;
}

.rme-bell .rme-item__avatar--site img {
	object-fit: contain;
}

/* Product updates carry an icon, so they stand apart from members' avatars. */
.rme-item__avatar--icon {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rme-accent);
	color: #fff;
}

.rme-item__avatar--icon svg {
	width: 18px;
	height: 18px;
}

.rme-item__content {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rme-item__message {
	color: var(--rme-text);
	font-size: 14px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.rme-item__time {
	color: var(--rme-muted);
	font-size: 12px;
}

.rme-item__dot {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rme-accent);
}

.rme-backdrop {
	display: none;
}

/* Phones: bottom sheet over a backdrop. */
@media (max-width: 480px) {
	.rme-popup {
		position: fixed;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: 100%;
		max-height: 70vh;
		border-radius: 16px 16px 0 0;
	}

	.rme-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 9999;
		background: rgba(0, 0, 0, 0.5);
	}
}

/* Bell popup: one line offering browser notifications */
.rme-bell .rme-popup__push {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	border-top: 1px solid var(--rme-border);
	color: var(--rme-muted);
	font-size: 13px;
	line-height: 1.4;
}

.rme-bell .rme-popup__push-btn {
	flex: 0 0 auto;
	color: var(--rme-accent);
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.rme-bell .rme-popup__push-btn[aria-disabled="true"] {
	opacity: 0.5;
	pointer-events: none;
}
