/* at8-online-contact front-end styles */

.at8-oc-bar {
	--at8-oc-size: 48px;
	--at8-oc-bg: #fff;
	--at8-oc-color: #666;
	--at8-oc-hover-bg: #06c;
	--at8-oc-hover-color: #fff;
	--at8-oc-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25);
	--at8-oc-radius: 24px;
	--at8-oc-offset-x: 0px;
	--at8-oc-offset-y: 0px;

	position: fixed;
	z-index: 99999;
	width: var(--at8-oc-size);
	display: flex;
	flex-direction: column;
	background: var(--at8-oc-bg);
	border-radius: var(--at8-oc-radius);
	box-shadow: var(--at8-oc-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 12px;
	line-height: 1.2;
}

.at8-oc-bar.at8-oc-lt { top: calc(50px + var(--at8-oc-offset-y)); left: calc(20px + var(--at8-oc-offset-x)); }
.at8-oc-bar.at8-oc-lc { top: 50%; transform: translateY(-50%); left: calc(20px + var(--at8-oc-offset-x)); }
.at8-oc-bar.at8-oc-lb { bottom: calc(50px + var(--at8-oc-offset-y)); left: calc(20px + var(--at8-oc-offset-x)); }
.at8-oc-bar.at8-oc-rt { top: calc(50px + var(--at8-oc-offset-y)); right: calc(20px + var(--at8-oc-offset-x)); }
.at8-oc-bar.at8-oc-rc { top: 50%; transform: translateY(-50%); right: calc(20px + var(--at8-oc-offset-x)); }
.at8-oc-bar.at8-oc-rb { bottom: calc(50px + var(--at8-oc-offset-y)); right: calc(20px + var(--at8-oc-offset-x)); }

.at8-oc-item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--at8-oc-size);
	background: var(--at8-oc-bg);
	transition: background-color 0.3s ease;
}

.at8-oc-item:first-child {
	border-radius: var(--at8-oc-radius) var(--at8-oc-radius) 0 0;
}

.at8-oc-item:last-child {
	border-radius: 0 0 var(--at8-oc-radius) var(--at8-oc-radius);
}

.at8-oc-item:not(:last-child)::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background: #ececec;
	z-index: 1;
}

.at8-oc-item:hover::after {
	visibility: hidden;
}

.at8-oc-bar .at8-oc-btn,
.at8-oc-bar .at8-oc-item > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	background: transparent;
	border: none;
	color: var(--at8-oc-color);
	cursor: pointer;
	text-decoration: none;
	appearance: none;
	-webkit-appearance: none;
}

.at8-oc-bar .at8-oc-item:hover {
	background: var(--at8-oc-hover-bg);
}

.at8-oc-bar .at8-oc-item:hover > .at8-oc-btn,
.at8-oc-bar .at8-oc-item:hover > a {
	color: var(--at8-oc-hover-color);
}

.at8-oc-bar .at8-oc-btn:focus-visible,
.at8-oc-bar .at8-oc-item > a:focus-visible {
	outline: 2px solid rgba(0, 0, 0, 0.2);
	outline-offset: -2px;
}

/* Click/active/focus must not introduce a persistent background color; only hover does. */
.at8-oc-bar .at8-oc-btn:focus,
.at8-oc-bar .at8-oc-btn:active,
.at8-oc-bar .at8-oc-item > a:focus,
.at8-oc-bar .at8-oc-item > a:active {
	background: transparent;
	color: var(--at8-oc-color);
}

.at8-oc-bar .at8-oc-item:focus-within:not(:hover) {
	background: var(--at8-oc-bg);
}

.at8-oc-bar .at8-oc-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	stroke: currentColor;
	fill: none;
	pointer-events: none;
	object-fit: contain;
}

.at8-oc-bar .at8-oc-icon .at8-oc-icon-dot,
.at8-oc-bar .at8-oc-icon circle[fill="currentColor"] {
	fill: currentColor;
}

.at8-oc-bar .at8-oc-icon-custom,
.at8-oc-bar img.at8-oc-icon-custom {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
}

.at8-oc-bar .at8-oc-text {
	margin-top: 2px;
	font-size: 11px;
	color: var(--at8-oc-color);
	white-space: nowrap;
}

.at8-oc-bar:not(.at8-oc-labels) .at8-oc-text {
	display: none;
}

/* Popover */
.at8-oc-popover {
	position: absolute;
	z-index: 100000;
	visibility: hidden;
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
}

.at8-oc-item:hover .at8-oc-popover,
.at8-oc-popover.is-visible {
	visibility: visible;
	opacity: 1;
	transform: translateX(0);
	pointer-events: auto;
}

.at8-oc-bar.at8-oc-rt .at8-oc-popover,
.at8-oc-bar.at8-oc-rc .at8-oc-popover,
.at8-oc-bar.at8-oc-rb .at8-oc-popover {
	right: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
}

.at8-oc-bar.at8-oc-rt .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-rc .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-rb .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-rt .at8-oc-popover.is-visible,
.at8-oc-bar.at8-oc-rc .at8-oc-popover.is-visible,
.at8-oc-bar.at8-oc-rb .at8-oc-popover.is-visible {
	transform: translateY(-50%) translateX(0);
}

.at8-oc-bar.at8-oc-lt .at8-oc-popover,
.at8-oc-bar.at8-oc-lc .at8-oc-popover,
.at8-oc-bar.at8-oc-lb .at8-oc-popover {
	left: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(-6px);
}

.at8-oc-bar.at8-oc-lt .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-lc .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-lb .at8-oc-item:hover .at8-oc-popover,
.at8-oc-bar.at8-oc-lt .at8-oc-popover.is-visible,
.at8-oc-bar.at8-oc-lc .at8-oc-popover.is-visible,
.at8-oc-bar.at8-oc-lb .at8-oc-popover.is-visible {
	transform: translateY(-50%) translateX(0);
}

.at8-oc-popover-inner {
	min-width: 140px;
	max-width: 220px;
	padding: 12px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.at8-oc-sub-item {
	padding: 6px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.at8-oc-sub-item:last-child {
	border-bottom: none;
}

.at8-oc-sub-with-icon {
	display: flex;
	align-items: center;
	gap: 10px;
}

.at8-oc-sub-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.1);
	color: #22c55e;
}

.at8-oc-sub-icon svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: currentColor;
}

.at8-oc-sub-body {
	min-width: 0;
}

.at8-oc-sub-label {
	font-size: 11px;
	color: #888;
	margin-bottom: 2px;
	line-height: 1.2;
}

.at8-oc-sub-value {
	font-size: 14px;
	color: #222;
	text-decoration: none;
	white-space: nowrap;
}

.at8-oc-sub-value:hover {
	color: #0066cc;
}

.at8-oc-bar .at8-oc-more-link {
	display: inline-block;
	margin-top: 2px;
	font-weight: 600;
}

/* WeChat QR */
.at8-oc-wx-item {
	text-align: center;
}

.at8-oc-wx-item img {
	max-width: 120px;
	border-radius: 6px;
}

.at8-oc-copy {
	margin: 8px 0 0;
	padding: 6px 10px;
	background: #f7f7f7;
	border-radius: 4px;
	font-size: 13px;
	color: #333;
	cursor: pointer;
}

.at8-oc-copy small {
	display: block;
	font-size: 11px;
	color: #999;
}

.at8-oc-wx-label {
	margin-top: 6px;
	font-size: 12px;
	color: #666;
}

/* Form */
.at8-oc-form-title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 12px;
	color: #222;
}

.at8-oc-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	font-size: 13px;
	box-sizing: border-box;
}

.at8-oc-input:focus {
	outline: none;
	border-color: #0066cc;
}

.at8-oc-submit {
	width: 100%;
	padding: 9px;
	background: #222;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.at8-oc-submit:hover {
	background: #444;
}

.at8-oc-reply {
	margin-top: 10px;
	padding: 10px;
	background: #f0f8ff;
	border-radius: 6px;
	font-size: 13px;
	color: #333;
}

/* Modal (mobile / form click) */
.at8-oc-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.at8-oc-modal.is-open {
	display: flex;
}

.at8-oc-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.at8-oc-modal-content {
	position: relative;
	width: 100%;
	max-width: 360px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 20px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.at8-oc-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: #888;
	cursor: pointer;
}

.at8-oc-modal-close:hover {
	color: #222;
}

/* Mobile */
@media (max-width: 768px) {
	.at8-oc-bar {
		--at8-oc-size: 44px;
	}

	.at8-oc-bar .at8-oc-icon {
		width: 18px;
		height: 18px;
	}

	.at8-oc-bar .at8-oc-icon-custom {
		width: 22px;
		height: 22px;
	}

	.at8-oc-bar .at8-oc-popover {
		display: none;
	}

	.at8-oc-modal .at8-oc-popover.at8-oc-popover {
		display: block;
		visibility: visible;
		opacity: 1;
		position: static;
		transform: none;
	}

	.at8-oc-modal .at8-oc-popover-inner {
		box-shadow: none;
		border: none;
		padding: 0;
	}
}
