/**
 * Animated Phone Widget — frontend styles.
 * All selectors are namespaced with .apw- so Contact Form 7's auto-injected
 * markup can never collide with theme styles.
 */

.apw-widget {
	position: fixed;
	bottom: var(--apw-bottom, 30px);
	z-index: 99990;
	font-family: inherit;
	line-height: 1.45;
}

.apw-widget--right { right: var(--apw-side, 30px); }
.apw-widget--left  { left: var(--apw-side, 30px); }

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

.apw-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--apw-btn-w, 65px);
	height: var(--apw-btn-h, 65px);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--apw-btn-bg, transparent);
	color: var(--apw-icon-color, #25d366);
	cursor: pointer;
	overflow: visible;
	box-shadow: none;
	transition: transform .4s ease!important;
	-webkit-appearance: none;
	appearance: none;
}
.apw-toggle:hover { transform: rotate(20deg); }
.apw-toggle:active { transform: rotate(0deg); }
.apw-toggle:focus-visible { outline: 2px solid var(--apw-submit-color, #25d366); outline-offset: 2px; }

/* ------------------------------------------------------------- animation */

.apw-icon {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.apw-icon--svg { width: 60%; height: 60%; color: var(--apw-icon-color, #25d366); }

.apw-icon-svg { width: 100%; height: 100%; display: block; }

.apw-video,
.apw-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: transparent;
}

/* SVG ring waves */
.apw-icon-svg--ring .apw-wave { opacity: 0; transform-origin: 12px 12px; animation: apw-wave 1.8s infinite; }
.apw-icon-svg--ring .apw-wave--2 { animation-delay: .35s; }

@keyframes apw-wave {
	0%   { opacity: 0; }
	40%  { opacity: 1; }
	100% { opacity: 0; }
}

/* ----------------------------------------------------------------- panel */

.apw-panel {
	position: absolute;
	bottom: calc(var(--apw-btn-h, 65px) + 18px);
	width: min(330px, calc(100vw - 40px));
	padding: 22px 20px 18px;
	border-radius: 16px;
	background: #fff;
	color: #1c1e21;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(.97);
	transform-origin: bottom right;
	transition:
		opacity var(--apw-speed, 300ms) ease,
		transform var(--apw-speed, 300ms) cubic-bezier(.22, 1, .36, 1),
		visibility var(--apw-speed, 300ms);
}

.apw-widget--right .apw-panel { right: 0; }
.apw-widget--left  .apw-panel { left: 0; transform-origin: bottom left; }

.apw-widget.apw-is-open .apw-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.apw-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 30px;
	/*height: 30px;*/
	border: 0;
	background: #ffffff00;
	color: #8a8f98;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}

.apw-close:hover { color: #1c1e21; }

.apw-panel-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 24px 4px 0;
}

.apw-panel-message {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 14px;
}

/* ------------------------------------------- Contact Form 7 inside panel */
/* CF7 injects its own wrappers; every rule below is scoped to .apw-form so
   the widget layout does not depend on the theme or on CF7's <p> tags. */

.apw-form .wpcf7 { margin: 0; padding: 0; }

.apw-form .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.apw-form .wpcf7-form > p,
.apw-form .wpcf7-form br { display: none; }

.apw-form .apw-field-label,
.apw-form label {
	display: block;
	width: 100%;
	font-size: 12px;
	font-weight: 600;
	color: #4b5563;
	margin: 0;
}

.apw-form .apw-field-wrap,
.apw-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
	margin-top: 4px;
}

.apw-form input[type="text"],
.apw-form input[type="tel"],
.apw-form input[type="email"],
.apw-form input[type="url"],
.apw-form input[type="date"],
.apw-form input[type="number"],
.apw-form select,
.apw-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d9dde3;
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	color: #1c1e21;
	line-height: 1.3;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.apw-form textarea { min-height: 84px; resize: vertical; }

.apw-form input:focus,
.apw-form select:focus,
.apw-form textarea:focus {
   	outline: none!important;
	border-color: var(--apw-submit-color, #3d3d3d00)!important;
	/*box-shadow: 0 0 0 3px color-mix(in srgb, var(--apw-submit-color, #25d366) 22%, transparent);*/
}

.apw-form input[type="submit"],
.apw-form .wpcf7-submit {
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--apw-submit-color, #25d366);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.apw-form input[type="submit"]:hover { filter: brightness(1.06); }

.apw-form .wpcf7-spinner { display: block; margin: 6px auto 0; }

.apw-form .wpcf7-not-valid-tip {
	display: block;
	font-size: 11px;
	color: #dc2626;
	margin-top: 4px;
}

.apw-form .wpcf7-response-output {
	margin: 10px 0 0 !important;
	padding: 8px 10px !important;
	border-width: 1px !important;
	border-radius: 8px;
	font-size: 12px;
}

.apw-form .wpcf7-acceptance .wpcf7-list-item { margin: 0; }

.apw-form .wpcf7-acceptance .wpcf7-list-item-label {
	font-size: 11px;
	font-weight: 400;
	color: #6b7280;
}

.apw-form .wpcf7-list-item { display: inline-flex; align-items: flex-start; gap: 6px; }

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

@media (prefers-reduced-motion: reduce) {
	.apw-icon-svg--ring .apw-wave { animation: none; }
	.apw-panel {
		transition:
			opacity var(--apw-speed, 300ms) ease,
			transform var(--apw-speed, 300ms) cubic-bezier(.22, 1, .36, 1),
			visibility var(--apw-speed, 300ms) !important;
	}
}
