/**
 * Replyr WhatsApp Hours Widget
 * Scoped to .replyr-wa so it cannot leak into the client's theme.
 */

.replyr-wa {
	position: fixed;
	bottom: var( --replyr-wa-bottom, 20px );
	z-index: 99998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
}

.replyr-wa--right {
	right: var( --replyr-wa-side, 20px );
	align-items: flex-end;
}

.replyr-wa--left {
	left: var( --replyr-wa-side, 20px );
	align-items: flex-start;
}

.replyr-wa[hidden] {
	display: none;
}

/* Floating action button ------------------------------------------------ */

.replyr-wa__fab {
	position: relative;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.22 );
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.replyr-wa__fab:hover,
.replyr-wa__fab:focus-visible {
	transform: translateY( -2px );
	box-shadow: 0 10px 26px rgba( 0, 0, 0, 0.28 );
}

.replyr-wa__fab:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.replyr-wa__fab svg {
	display: block;
}

/* Live status dot on the button */

.replyr-wa__dot {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: #9aa3ad;
}

.replyr-wa[data-state="human"] .replyr-wa__dot {
	background: #34d058;
	animation: replyr-wa-pulse 2.4s ease-out infinite;
}

@keyframes replyr-wa-pulse {
	0% { box-shadow: 0 0 0 0 rgba( 52, 208, 88, 0.55 ); }
	70% { box-shadow: 0 0 0 8px rgba( 52, 208, 88, 0 ); }
	100% { box-shadow: 0 0 0 0 rgba( 52, 208, 88, 0 ); }
}

/* Card ------------------------------------------------------------------ */

.replyr-wa__card {
	width: 288px;
	max-width: calc( 100vw - 40px );
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 16px 44px rgba( 0, 0, 0, 0.2 );
	animation: replyr-wa-rise 0.18s ease-out;
}

.replyr-wa__card[hidden] {
	display: none;
}

@keyframes replyr-wa-rise {
	from { opacity: 0; transform: translateY( 8px ); }
	to { opacity: 1; transform: translateY( 0 ); }
}

.replyr-wa__card-head {
	position: relative;
	padding: 16px 40px 16px 16px;
	background: var( --replyr-wa-accent, #128c7e );
	color: #fff;
}

.replyr-wa__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
}

.replyr-wa__status {
	margin: 0;
	font-size: 12.5px;
	color: rgba( 255, 255, 255, 0.88 );
	padding-left: 15px;
	position: relative;
}

.replyr-wa__status::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #cfd6dc;
}

.replyr-wa[data-state="human"] .replyr-wa__status::before {
	background: #5ef08a;
}

.replyr-wa__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
}

.replyr-wa__close:hover {
	opacity: 1;
	background: rgba( 255, 255, 255, 0.15 );
}

/* Branch list ----------------------------------------------------------- */

.replyr-wa__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
}

.replyr-wa__row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	border: 1px solid #e4e8ec;
	border-radius: 10px;
	background: #fff;
	color: #1f2429 !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.replyr-wa__row[hidden] {
	display: none;
}

.replyr-wa__row:hover,
.replyr-wa__row:focus-visible {
	border-color: #25d366;
	background: #f4fdf7;
	color: #1f2429 !important;
}

.replyr-wa__glyph {
	flex: 0 0 auto;
	color: #25d366;
}

.replyr-wa__row-label {
	flex: 1 1 auto;
	min-width: 0;
}

.replyr-wa__row-pill {
	flex: 0 0 auto;
	padding: 3px 8px;
	border-radius: 99px;
	background: #eef1f4;
	color: #5b636b;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.replyr-wa__row-pill[hidden] {
	display: none;
}

.replyr-wa__row-pill.is-live {
	background: #e4f9ec;
	color: #157a3c;
}

.replyr-wa__row--single {
	justify-content: center;
	background: #25d366;
	border-color: #25d366;
	color: #fff !important;
}

.replyr-wa__row--single .replyr-wa__glyph {
	color: #fff;
}

.replyr-wa__row--single:hover {
	background: #1fb957;
	border-color: #1fb957;
	color: #fff !important;
}

.replyr-wa__row--single .replyr-wa__row-label {
	flex: 0 1 auto;
}

/* Nudge bubble ---------------------------------------------------------- */

.replyr-wa__bubble {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 210px;
	padding: 9px 12px;
	border-radius: 12px;
	background: #fff;
	color: #1f2429;
	font-size: 13px;
	box-shadow: 0 8px 22px rgba( 0, 0, 0, 0.16 );
}

.replyr-wa__bubble[hidden] {
	display: none;
}

.replyr-wa__bubble-close {
	border: 0;
	background: transparent;
	color: #8b939b;
	font-size: 16px;
	line-height: 1;
	padding: 0 2px;
	cursor: pointer;
}

.replyr-wa.is-open .replyr-wa__bubble {
	display: none;
}

/* Inline shortcode button ----------------------------------------------- */

.replyr-wa-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 9px;
	background: #25d366;
	color: #fff !important;
	font-weight: 600;
	text-decoration: none !important;
}

.replyr-wa-inline:hover {
	background: #1fb957;
	color: #fff !important;
}

.replyr-wa-inline .replyr-wa__glyph {
	color: #fff;
}

/* Small screens --------------------------------------------------------- */

@media ( max-width: 480px ) {
	.replyr-wa__fab {
		width: 54px;
		height: 54px;
	}

	.replyr-wa__bubble {
		max-width: 180px;
		font-size: 12.5px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.replyr-wa__card,
	.replyr-wa__fab,
	.replyr-wa[data-state="human"] .replyr-wa__dot {
		animation: none;
		transition: none;
	}
}
