/* 365 WhatsApp Chat & Orders — front end */

:root {
	--wa365-color: #25d366;
	--wa365-text: #ffffff;
	--wa365-radius: 6px;
	--wa365-offset-x: 20px;
	--wa365-offset-y: 20px;
	--wa365-ink: #101828;
	--wa365-muted: #667085;
	--wa365-line: rgba(16, 24, 40, 0.1);
	--wa365-surface: #ffffff;
}

/* ---------- Buttons ---------- */

.wa365-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: var(--wa365-radius);
	background: var(--wa365-color);
	color: var(--wa365-text);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	border: 1px solid transparent;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.wa365-btn:hover,
.wa365-btn:focus {
	filter: brightness(0.94);
	color: var(--wa365-text);
	text-decoration: none;
}

.wa365-btn:active {
	transform: translateY(1px);
}

.wa365-btn--outline {
	background: transparent;
	color: var(--wa365-color);
	border-color: var(--wa365-color);
}

.wa365-btn--text {
	background: transparent;
	color: var(--wa365-color);
	padding: 4px 0;
	border: 0;
}

.wa365-btn--card {
	background: var(--wa365-surface);
	color: var(--wa365-ink);
	border: 1px solid var(--wa365-line);
	padding: 12px 14px;
	width: 100%;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.wa365-btn--card .wa365-btn__icon {
	color: var(--wa365-color);
}

.wa365-btn__icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.wa365-btn__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.wa365-btn__text {
	display: flex;
	flex-direction: column;
	text-align: left;
}

.wa365-btn__meta {
	font-weight: 400;
	font-size: 0.82em;
	opacity: 0.75;
}

.wa365-loop,
.wa365-single,
.wa365-cart,
.wa365-thankyou {
	margin: 12px 0;
}

.wa365-single {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wa365-single--card {
	flex-direction: column;
}

.wa365-cart .wa365-btn,
.wa365-thankyou .wa365-btn {
	width: 100%;
	justify-content: center;
}

/* ---------- Shortcode lists ---------- */

.wa365-agents {
	display: grid;
	gap: 10px;
	margin: 16px 0;
}

.wa365-agents--list {
	grid-template-columns: 1fr;
}

.wa365-agents--grid {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wa365-agents--inline {
	display: flex;
	flex-wrap: wrap;
}

/* ---------- Floating widget ---------- */

.wa365-float {
	position: fixed;
	z-index: 99990;
	bottom: var(--wa365-offset-y);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.wa365-float--right {
	right: var(--wa365-offset-x);
}

.wa365-float--left {
	left: var(--wa365-offset-x);
	align-items: flex-start;
}

.wa365-float__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--wa365-color);
	color: var(--wa365-text);
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.22);
	padding: 0;
	text-decoration: none;
	transition: transform 0.18s ease;
}

.wa365-float__btn:hover {
	transform: scale(1.05);
	color: var(--wa365-text);
}

.wa365-float__icon {
	width: 30px;
	height: 30px;
}

.wa365-float__img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.wa365-float__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #e02424;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.wa365-float__tooltip {
	position: absolute;
	bottom: 12px;
	right: 68px;
	white-space: nowrap;
	background: var(--wa365-ink);
	color: #fff;
	font-size: 13px;
	padding: 7px 11px;
	border-radius: 6px;
	opacity: 0;
	pointer-events: none;
	transform: translateX(6px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.wa365-float--left .wa365-float__tooltip {
	right: auto;
	left: 68px;
	transform: translateX(-6px);
}

.wa365-float__btn:hover + .wa365-float__tooltip,
.wa365-float__btn:focus + .wa365-float__tooltip {
	opacity: 1;
	transform: translateX(0);
}

.wa365-float--open .wa365-float__tooltip {
	display: none;
}

/* Pulse */

.wa365-float--pulse .wa365-float__btn::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--wa365-color);
	opacity: 0.55;
	animation: wa365-pulse 2.2s cubic-bezier(0.66, 0, 0, 1) infinite;
	z-index: -1;
}

@keyframes wa365-pulse {
	0% { transform: scale(1); opacity: 0.55; }
	70% { transform: scale(1.9); opacity: 0; }
	100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.wa365-float--pulse .wa365-float__btn::before { animation: none; }
	.wa365-btn, .wa365-float__btn { transition: none; }
}

/* ---------- Panel ---------- */

.wa365-panel {
	order: -1;
	width: min(330px, calc(100vw - 32px));
	margin-bottom: 14px;
	background: var(--wa365-surface);
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
	overflow: hidden;
	color: var(--wa365-ink);
}

.wa365-panel[hidden] {
	display: none;
}

.wa365-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding: 16px 16px 14px;
	background: var(--wa365-color);
	color: var(--wa365-text);
}

.wa365-panel__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.wa365-panel__desc {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.45;
	opacity: 0.9;
}

.wa365-panel__close {
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	opacity: 0.85;
}

.wa365-panel__close:hover {
	opacity: 1;
}

.wa365-panel__offline {
	margin: 0;
	padding: 10px 16px;
	font-size: 12.5px;
	background: #fff8e6;
	color: #7a5a00;
	border-bottom: 1px solid var(--wa365-line);
}

.wa365-panel__list {
	list-style: none;
	margin: 0;
	padding: 6px;
	max-height: 320px;
	overflow-y: auto;
}

.wa365-agent__link {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
}

.wa365-agent__link:hover {
	background: rgba(16, 24, 40, 0.05);
	color: inherit;
}

.wa365-agent__avatar {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
}

.wa365-agent__avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.wa365-agent__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wa365-color);
	color: var(--wa365-text);
	font-weight: 700;
	text-transform: uppercase;
}

.wa365-agent__dot {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 2px solid var(--wa365-surface);
}

.wa365-agent__dot--on { background: #12b76a; }
.wa365-agent__dot--off { background: #98a2b3; }

.wa365-agent__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.wa365-agent__name {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
}

.wa365-agent__role,
.wa365-agent__status {
	font-size: 11.5px;
	color: var(--wa365-muted);
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wa365-agent__icon {
	width: 18px;
	height: 18px;
	color: var(--wa365-color);
	flex: 0 0 auto;
}

/* Panel entrance animations */

.wa365-panel--anim-fade { animation: wa365-fade 0.2s ease both; }
.wa365-panel--anim-slide-up { animation: wa365-slide 0.24s cubic-bezier(0.16, 1, 0.3, 1) both; }
.wa365-panel--anim-zoom { animation: wa365-zoom 0.2s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes wa365-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wa365-slide { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wa365-zoom { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
	.wa365-float__btn { width: 52px; height: 52px; }
	.wa365-float__tooltip { display: none; }
}
