/**
 * WP Contact Hera — frontend
 * Fonts inherit from theme. Colors via CSS variables.
 */

.wch-root {
	--wch-radius: 20px;
	--wch-radius-sm: 14px;
	--wch-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
	--wch-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--wch-width: min(360px, calc(100vw - 32px));

	position: fixed !important;
	right: 20px !important;
	bottom: 20px !important;
	left: auto !important;
	top: auto !important;
	width: var(--wch-width) !important;
	max-width: var(--wch-width) !important;
	z-index: 99999 !important;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--wch-text, #1a1a1a);
	box-sizing: border-box;
	overflow: visible;
	pointer-events: none;
}

.wch-root *,
.wch-root *::before,
.wch-root *::after {
	box-sizing: border-box;
}

/* —— FAB —— */
.wch-fab {
	position: relative;
	flex-shrink: 0;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: var(--wch-fab-bg, #0f172a);
	color: var(--wch-fab-icon, #fff);
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
	transition: transform 0.25s var(--wch-ease), box-shadow 0.25s ease;
	padding: 0;
	margin: 0;
	outline: none;
	pointer-events: auto;
	align-self: flex-end;
	-webkit-user-select: none;
	user-select: none;
	overflow: visible;
	z-index: 2;
}

/* Dalga / ripple animasyonu */
.wch-fab::before,
.wch-fab::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--wch-fab-bg, #0f172a);
	opacity: 0;
	z-index: -1;
	pointer-events: none;
	animation: wch-ripple 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.wch-fab::after {
	animation-delay: 1.2s;
}

@keyframes wch-ripple {
	0% {
		transform: scale(1);
		opacity: 0.45;
	}
	70% {
		opacity: 0.12;
	}
	100% {
		transform: scale(1.9);
		opacity: 0;
	}
}

.wch-root.is-open .wch-fab::before,
.wch-root.is-open .wch-fab::after {
	animation: none;
	opacity: 0;
}

.wch-fab:hover {
	transform: scale(1.05);
	box-shadow: 0 14px 32px rgba(15, 23, 42, 0.32);
}

.wch-fab:focus-visible {
	outline: 2px solid var(--wch-accent, #0f172a);
	outline-offset: 3px;
}

.wch-fab-icon {
	position: absolute;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	transition: opacity 0.2s ease, transform 0.25s var(--wch-ease);
	z-index: 1;
}

.wch-fab-icon svg {
	width: 28px;
	height: 28px;
	display: block;
}

.wch-fab-icon--chat .wch-chat-dot {
	fill: var(--wch-fab-bg, #0f172a);
}

.wch-fab-icon--close {
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

.wch-root.is-open .wch-fab-icon--chat {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

.wch-root.is-open .wch-fab-icon--close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

.wch-online {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* —— Panel —— */
.wch-panel {
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	float: none !important;
	background: var(--wch-bg, #ffffff);
	border: 1px solid var(--wch-border, #e5e5e5);
	border-radius: var(--wch-radius);
	box-shadow: var(--wch-shadow);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: none !important;
	transition: opacity 0.25s var(--wch-ease), visibility 0.25s;
}

.wch-root.is-open .wch-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.wch-panel-inner {
	padding: 20px 18px 18px;
	width: 100%;
	position: relative;
}

.wch-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.wch-brand {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wch-muted, #6b7280);
	margin-bottom: 6px;
}

.wch-heading {
	margin: 0;
	padding: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wch-text, #1a1a1a);
	font-family: inherit;
}

.wch-minimize {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--wch-border, #e5e5e5);
	background: var(--wch-box, #f5f5f7);
	color: var(--wch-text, #1a1a1a);
	cursor: pointer;
	display: grid;
	place-items: center;
	padding: 0;
	transition: background 0.2s ease;
}

.wch-minimize:hover {
	background: var(--wch-border, #e5e5e5);
}

.wch-minimize svg {
	width: 18px;
	height: 18px;
}

/* —— Menu items —— */
.wch-menu {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 0;
}

.wch-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 14px 14px;
	border-radius: var(--wch-radius-sm);
	border: 1px solid var(--wch-border, #e5e5e5);
	background: var(--wch-box, #f5f5f7);
	color: inherit;
	text-decoration: none;
	text-align: left;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	font: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	transition: background 0.2s ease, border-color 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	left: auto;
	right: auto;
	float: none;
	transform: none !important;
}

.wch-item:hover {
	border-color: color-mix(in srgb, var(--wch-border, #e5e5e5) 60%, var(--wch-text, #1a1a1a));
}

.wch-item:focus-visible {
	outline: 2px solid var(--wch-accent, #0f172a);
	outline-offset: 2px;
}

.wch-item-icon {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--wch-bg, #fff);
	border: 1px solid var(--wch-border, #e5e5e5);
	display: grid;
	place-items: center;
	color: var(--wch-accent, #0f172a);
}

.wch-item-icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.wch-item-icon--wa {
	color: #25d366;
	background: #ecfdf3;
	border-color: #bbf7d0;
}

.wch-item-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wch-item-title {
	font-weight: 600;
	font-size: 0.98rem;
	color: var(--wch-text, #1a1a1a);
	text-transform: none !important;
	letter-spacing: normal !important;
}

.wch-item-sub {
	font-size: 0.8rem;
	color: var(--wch-muted, #6b7280);
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: 400 !important;
}

.wch-item-chevron {
	flex-shrink: 0;
	color: var(--wch-muted, #6b7280);
	opacity: 0.7;
	display: grid;
	place-items: center;
}

.wch-item-chevron svg {
	width: 18px;
	height: 18px;
}

/* —— Views / form: aynı panel içinde overlay —— */
.wch-views {
	position: relative;
	width: 100%;
	overflow: hidden;
	min-height: 1px;
}

.wch-view-menu {
	display: block;
	width: 100%;
	position: relative;
}

.wch-view-form {
	display: none;
	width: 100%;
	max-height: min(420px, 55vh);
	overflow-x: hidden;
	overflow-y: auto;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	float: none !important;
	margin: 0 !important;
	transform: none !important;
}

.wch-root.is-form .wch-view-menu {
	display: none !important;
}

.wch-root.is-form .wch-view-form {
	display: block !important;
	animation: wch-form-in 0.3s var(--wch-ease) both;
}

@keyframes wch-form-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.wch-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: transparent;
	color: var(--wch-muted, #6b7280);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0 0 12px;
	margin: 0;
}

.wch-back:hover {
	color: var(--wch-text, #1a1a1a);
}

.wch-back svg {
	width: 16px;
	height: 16px;
}

.wch-form-wrap {
	font: inherit;
	color: var(--wch-text, #1a1a1a);
	width: 100%;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	float: none !important;
	transform: none !important;
}

.wch-form-wrap .wpcf7,
.wch-form-wrap .wpcf7-form,
.wch-form-wrap form {
	margin: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	float: none !important;
	transform: none !important;
}

.wch-form-wrap .wpcf7-form p {
	margin: 0 0 12px;
}

.wch-form-wrap input[type="text"],
.wch-form-wrap input[type="email"],
.wch-form-wrap input[type="tel"],
.wch-form-wrap input[type="url"],
.wch-form-wrap input[type="number"],
.wch-form-wrap textarea,
.wch-form-wrap select {
	width: 100% !important;
	max-width: 100% !important;
	font: inherit;
	color: var(--wch-text, #1a1a1a);
	background: var(--wch-box, #f5f5f7);
	border: 1px solid var(--wch-border, #e5e5e5);
	border-radius: 10px;
	padding: 10px 12px;
	position: relative !important;
	float: none !important;
	left: auto !important;
}

.wch-form-wrap textarea {
	min-height: 90px;
	resize: vertical;
}

.wch-form-wrap input[type="submit"],
.wch-form-wrap button[type="submit"],
.wch-form-wrap .wpcf7-submit {
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border: 0;
	border-radius: 10px;
	padding: 11px 18px;
	background: var(--wch-accent, #0f172a);
	color: #fff;
	width: 100%;
	transition: opacity 0.2s ease;
	position: relative !important;
	float: none !important;
	left: auto !important;
}

.wch-form-wrap input[type="submit"]:hover,
.wch-form-wrap .wpcf7-submit:hover {
	opacity: 0.9;
}

/* CF7 spinner / response panel kırılmasını engelle */
.wch-form-wrap .wpcf7-spinner,
.wch-form-wrap .wpcf7-response-output {
	position: relative !important;
	left: auto !important;
	right: auto !important;
	float: none !important;
}

@media (max-width: 480px) {
	.wch-root {
		right: 14px !important;
		bottom: 14px !important;
		--wch-width: calc(100vw - 28px);
	}
}
