/**
 * WooCommerce WhatsApp Pro — floating widget.
 *
 * Every themable value is a CSS custom property injected from the plugin
 * settings, so this file stays static and fully cacheable.
 */

.wcwap-widget {
	--wcwap-button-color: #25d366;
	--wcwap-icon-color: #ffffff;
	--wcwap-size: 60px;
	--wcwap-radius: 50%;
	--wcwap-offset-bottom: 24px;
	--wcwap-offset-side: 24px;
	--wcwap-panel-width: 320px;

	position: fixed;
	bottom: var(--wcwap-offset-bottom);
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: inherit;
	line-height: 1.45;
}

.wcwap-widget--right {
	right: var(--wcwap-offset-side);
	align-items: flex-end;
}

.wcwap-widget--left {
	left: var(--wcwap-offset-side);
	align-items: flex-start;
}

/* ---- Device visibility -------------------------------------------------- */

@media (max-width: 782px) {
	.wcwap-widget--device-desktop {
		display: none;
	}
}

@media (min-width: 783px) {
	.wcwap-widget--device-mobile {
		display: none;
	}
}

/* ---- Theme button reset -------------------------------------------------
   Themes commonly style every <button> (e.g. WoodMart's
   :is(.btn,.button,button){background:#F3F3F3;border-radius:0}), which has the
   same specificity as a single class and would override the widget. Resetting
   the widget's own buttons — and giving the styled rules a two-class
   specificity — keeps the widget looking correct under any theme. */
.wcwap-widget button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: normal;
	letter-spacing: normal;
	text-transform: none;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
}

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

.wcwap-widget .wcwap-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wcwap-size);
	height: var(--wcwap-size);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: var(--wcwap-radius);
	background-color: var(--wcwap-button-color);
	color: var(--wcwap-icon-color);
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.wcwap-widget .wcwap-button:hover,
.wcwap-widget .wcwap-button:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.wcwap-widget .wcwap-button:focus-visible {
	outline: 3px solid var(--wcwap-button-color);
	outline-offset: 3px;
}

.wcwap-button__icon {
	display: inline-flex;
	pointer-events: none;
}

.wcwap-button__icon svg {
	width: 55%;
	height: 55%;
	min-width: 24px;
	min-height: 24px;
}

/* ---- Notification bubble ------------------------------------------------ */

.wcwap-button__badge {
	position: absolute;
	top: -4px;
	inset-inline-end: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #e02d3c;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	pointer-events: none;
}

.wcwap-widget.is-open .wcwap-button__badge {
	display: none;
}

/* ---- Pulse -------------------------------------------------------------- */

.wcwap-widget--pulse .wcwap-button::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-color: var(--wcwap-button-color);
	opacity: 0.65;
	z-index: -1;
	animation: wcwap-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.wcwap-widget.is-open .wcwap-button::after {
	animation: none;
	opacity: 0;
}

@keyframes wcwap-pulse {
	0% {
		transform: scale(1);
		opacity: 0.6;
	}
	70% {
		transform: scale(1.7);
		opacity: 0;
	}
	100% {
		transform: scale(1.7);
		opacity: 0;
	}
}

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

.wcwap-panel {
	width: min(var(--wcwap-panel-width), calc(100vw - 32px));
	border-radius: 14px;
	background: #fff;
	color: #1f2937;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
	overflow: hidden;
	transform-origin: bottom right;
	animation: wcwap-panel-in 0.22s ease both;
}

.wcwap-widget--left .wcwap-panel {
	transform-origin: bottom left;
}

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

@keyframes wcwap-panel-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.wcwap-panel__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px 12px;
	background: var(--wcwap-button-color);
	color: var(--wcwap-icon-color);
}

.wcwap-panel__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.25);
	flex: 0 0 auto;
}

.wcwap-panel__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.wcwap-panel__title {
	font-size: 15px;
	font-weight: 700;
}

.wcwap-panel__subtitle {
	font-size: 12px;
	opacity: 0.9;
}

.wcwap-widget .wcwap-panel__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: var(--wcwap-icon-color);
	cursor: pointer;
	opacity: 0.9;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.wcwap-widget .wcwap-panel__close:hover,
.wcwap-widget .wcwap-panel__close:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.32);
	outline: none;
}

.wcwap-widget .wcwap-panel__close svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	pointer-events: none;
}

.wcwap-panel__status {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 12px;
	background: #f6f7f9;
	color: #4b5563;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wcwap-panel__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9ca3af;
	flex: 0 0 auto;
}

.wcwap-panel__status.is-online .wcwap-panel__dot {
	background: #22c55e;
}

.wcwap-panel__body {
	padding: 16px 14px;
	background: #eae6df;
}

.wcwap-panel__bubble {
	margin: 0;
	padding: 10px 12px;
	max-width: 90%;
	border-radius: 0 10px 10px 10px;
	background: #fff;
	font-size: 14px;
	color: #1f2937;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wcwap-panel__footer {
	padding: 12px 14px 14px;
	background: #fff;
}

.wcwap-panel__cta {
	display: block;
	padding: 11px 16px;
	border-radius: 8px;
	background: var(--wcwap-button-color);
	color: var(--wcwap-icon-color);
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.wcwap-panel__cta:hover,
.wcwap-panel__cta:focus-visible {
	filter: brightness(0.94);
	color: var(--wcwap-icon-color);
}

/* ---- Entrance animations ------------------------------------------------ */

.wcwap-widget--anim-fade .wcwap-button {
	animation: wcwap-fade 0.4s ease both;
}

.wcwap-widget--anim-slide .wcwap-button {
	animation: wcwap-slide 0.4s ease both;
}

.wcwap-widget--anim-zoom .wcwap-button {
	animation: wcwap-zoom 0.35s ease both;
}

@keyframes wcwap-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes wcwap-slide {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes wcwap-zoom {
	from {
		opacity: 0;
		transform: scale(0.6);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ---- Accessibility ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.wcwap-widget *,
	.wcwap-widget *::after {
		animation: none !important;
		transition: none !important;
	}
}

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

@media (max-width: 480px) {
	.wcwap-widget {
		--wcwap-panel-width: calc(100vw - 32px);
	}
}

/* ---- Clear the theme's fixed mobile bottom toolbar (WoodMart .wd-toolbar,
        ~55px tall, shown at <=1024px) so the floating button never overlaps
        the Shop / Warenkorb / Mein Konto bar. --------------------------------- */

@media (max-width: 1024px) {
	.wcwap-widget {
		/* !important so it beats the plugin's inline offset from settings. */
		--wcwap-offset-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
	}
}
