/* DG Call & Mail Button – front-end. Colors, size, offsets and the breakpoint come from inline CSS variables. */

.dgcb,
.dgcb *,
.dgcb *::before,
.dgcb *::after {
	box-sizing: border-box;
}

/* ---------- Floating container ---------- */

.dgcb .dgcb-widget {
	position: fixed;
	z-index: var(--dgcb-z, 99999);
	display: flex;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.3;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(18px) scale(.92);
	transition: opacity .35s ease, transform .35s cubic-bezier(.2, .9, .3, 1.25), visibility 0s linear .35s;
	-webkit-tap-highlight-color: transparent;
}

.dgcb .dgcb-widget.dgcb-v-top {
	transform: translateY(-18px) scale(.92);
}

.dgcb.is-visible .dgcb-widget {
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .35s ease, transform .35s cubic-bezier(.2, .9, .3, 1.25), visibility 0s;
}

.dgcb .dgcb-v-bottom { bottom: calc(var(--dgcb-y, 20px) + env(safe-area-inset-bottom, 0px)); }
.dgcb .dgcb-v-top    { top: calc(var(--dgcb-y, 20px) + env(safe-area-inset-top, 0px)); }
.dgcb .dgcb-h-left   { left: calc(var(--dgcb-x, 20px) + env(safe-area-inset-left, 0px)); }
.dgcb .dgcb-h-right  { right: calc(var(--dgcb-x, 20px) + env(safe-area-inset-right, 0px)); }

/* Keep top positions clear of the WordPress admin bar for logged-in users. */
.admin-bar .dgcb .dgcb-v-top { top: calc(var(--dgcb-y, 20px) + 32px); }

@media (max-width: 782px) {
	.admin-bar .dgcb .dgcb-v-top { top: calc(var(--dgcb-y, 20px) + 46px); }
}

/* ---------- Trigger (round button + label) ---------- */

.dgcb .dgcb-trigger {
	display: flex;
	align-items: center;
	gap: 14px;
	/* !important: many themes style every <button>/<a> with high-specificity selectors. */
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: inherit;
	font: inherit;
	letter-spacing: normal !important;
	text-align: left;
	text-decoration: none !important;
	text-transform: none !important;
	cursor: pointer;
}

.dgcb .dgcb-h-right .dgcb-trigger {
	flex-direction: row-reverse;
}

.dgcb .dgcb-btn {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--dgcb-size, 60px);
	height: var(--dgcb-size, 60px);
	border-radius: 50%;
	color: var(--dgcb-icon, #fff);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
	transition: transform .2s ease, box-shadow .2s ease;
}

.dgcb .dgcb-btn--mobile  { background: var(--dgcb-mobile-btn, #00be00); }
.dgcb .dgcb-btn--desktop { background: var(--dgcb-desktop-btn, #00be00); }

.dgcb .dgcb-btn .dgcb-icon {
	display: block;
	width: 46%;
	height: 46%;
}

.dgcb .dgcb-trigger:hover .dgcb-btn {
	transform: scale(1.06);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
}

.dgcb .dgcb-trigger:active .dgcb-btn {
	transform: scale(.96);
}

/* Pulsing ring */
.dgcb.dgcb--pulse .dgcb-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: inherit;
	animation: dgcb-pulse 2.4s ease-out infinite;
}

@keyframes dgcb-pulse {
	0%       { transform: scale(1);   opacity: .55; }
	75%, 100% { transform: scale(1.6); opacity: 0; }
}

.dgcb .dgcb-label {
	display: block;
	max-width: calc(100vw - var(--dgcb-size, 60px) - 2 * var(--dgcb-x, 20px) - 24px);
	overflow: hidden;
	padding: 8px 12px;
	border-radius: 5px;
	background: var(--dgcb-label-bg, #555);
	color: var(--dgcb-label-text, #fff);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	text-overflow: ellipsis;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}

/* ---------- Desktop popup ---------- */

.dgcb .dgcb-panel {
	position: absolute;
	width: 320px;
	max-width: calc(100vw - 2 * var(--dgcb-x, 20px));
	padding: 20px 18px 18px;
	border-radius: 14px;
	background: var(--dgcb-panel-bg, #fff);
	color: var(--dgcb-panel-text, #222);
	box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .08);
	text-align: left;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(.97);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.dgcb .dgcb-v-bottom .dgcb-panel { bottom: calc(100% + 14px); }
.dgcb .dgcb-v-top .dgcb-panel    { top: calc(100% + 14px); transform: translateY(-10px) scale(.97); }
.dgcb .dgcb-h-left .dgcb-panel   { left: 0; transform-origin: left bottom; }
.dgcb .dgcb-h-right .dgcb-panel  { right: 0; transform-origin: right bottom; }

.dgcb .dgcb-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.dgcb .dgcb-panel__title {
	margin: 0 32px 4px 0;
	padding: 0;
	color: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.dgcb .dgcb-panel__text {
	margin: 0 0 14px;
	padding: 0;
	color: inherit;
	font-size: 14px;
	line-height: 1.45;
	opacity: .75;
}

.dgcb .dgcb-panel__title + .dgcb-options {
	margin-top: 12px;
}

.dgcb .dgcb-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	opacity: .6;
	cursor: pointer;
	transition: opacity .15s, background-color .15s;
}

.dgcb .dgcb-close:hover {
	opacity: 1;
	background: rgba(127, 127, 127, .15) !important;
}

.dgcb .dgcb-close .dgcb-icon {
	width: 20px;
	height: 20px;
}

.dgcb .dgcb-options {
	display: grid;
	gap: 10px;
}

.dgcb .dgcb-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--dgcb-option-bg, #00be00);
	color: var(--dgcb-option-text, #fff);
	text-decoration: none;
	transition: filter .15s ease, transform .15s ease;
}

.dgcb .dgcb-option:hover,
.dgcb .dgcb-option:focus {
	color: var(--dgcb-option-text, #fff);
	text-decoration: none;
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.dgcb .dgcb-option__icon {
	display: flex;
	flex: 0 0 38px;
	align-items: center;
	justify-content: center;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	background: color-mix(in srgb, currentColor 20%, transparent);
}

.dgcb .dgcb-option__icon .dgcb-icon {
	display: block;
	width: 20px;
	height: 20px;
}

.dgcb .dgcb-option__body {
	display: block;
	min-width: 0;
}

.dgcb .dgcb-option__label {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

.dgcb .dgcb-option__value {
	display: block;
	overflow-wrap: anywhere;
	font-size: 13px;
	line-height: 1.35;
	opacity: .9;
}

/* ---------- Focus, motion, print ---------- */

.dgcb a:focus-visible,
.dgcb button:focus-visible {
	outline: 3px solid var(--dgcb-label-bg, #555);
	outline-offset: 3px;
}

.dgcb .dgcb-panel a:focus-visible,
.dgcb .dgcb-panel button:focus-visible {
	outline-color: var(--dgcb-panel-text, #222);
}

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

	.dgcb.dgcb--pulse .dgcb-btn::before {
		display: none;
	}
}

@media print {
	.dgcb {
		display: none !important;
	}
}
