/**
 * Call Now CTA Bar - Frontend Styles
 *
 * @package CallNowCTABar
 */

/* Base Bar */
.cncb-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	display: flex;
	gap: 6px;
	transition: transform 0.35s ease, opacity 0.35s ease;
	box-sizing: border-box;
}

.cncb-position-bottom {
	bottom: 0;
}

.cncb-position-top {
	top: 0;
}

/* Hidden state for scroll behavior */
.cncb-bar.cncb-hidden.cncb-position-bottom {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

.cncb-bar.cncb-hidden.cncb-position-top {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

/* Button Base */
.cncb-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	padding: 12px 8px;
	color: inherit;
	box-sizing: border-box;
	transition: filter 0.2s ease, transform 0.2s ease;
	cursor: pointer;
	border: none;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.cncb-btn:hover {
	filter: brightness(1.1);
	text-decoration: none !important;
}

.cncb-btn:active {
	transform: scale(0.97);
}

.cncb-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -2px;
}

/* Horizontal layout: 1-2 buttons - icon left, text right */
.cncb-layout-horizontal .cncb-btn {
	flex-direction: row;
	gap: 8px;
}

.cncb-layout-horizontal .cncb-btn-icon {
	flex-shrink: 0;
}

.cncb-layout-horizontal .cncb-btn-icon svg,
.cncb-layout-horizontal .cncb-btn-icon i {
	width: 22px;
	height: 22px;
	font-size: 22px;
	display: block;
}

.cncb-layout-horizontal .cncb-btn-label {
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Vertical layout: 3+ buttons - icon top, text bottom */
.cncb-layout-vertical .cncb-btn {
	flex-direction: column;
	gap: 4px;
	padding: 10px 4px;
}

.cncb-layout-vertical .cncb-btn-icon svg,
.cncb-layout-vertical .cncb-btn-icon i {
	width: 20px;
	height: 20px;
	font-size: 20px;
	display: block;
}

.cncb-layout-vertical .cncb-btn-label {
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Icon styling */
.cncb-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.cncb-btn-icon svg {
	fill: currentColor;
}

/* ========== ANIMATIONS ========== */

/* Pulse */
.cncb-anim-pulse .cncb-btn {
	animation: cncb-pulse 2.5s ease-in-out infinite;
}

@keyframes cncb-pulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.03);
	}
}

/* Glow */
.cncb-anim-glow .cncb-btn {
	animation: cncb-glow 2.5s ease-in-out infinite;
}

@keyframes cncb-glow {
	0%, 100% {
		box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
	}
	50% {
		box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.1);
	}
}

/* Bounce */
.cncb-anim-bounce .cncb-btn {
	animation: cncb-bounce 2s ease-in-out infinite;
}

@keyframes cncb-bounce {
	0%, 100% {
		transform: translateY(0);
	}
	30% {
		transform: translateY(-4px);
	}
	50% {
		transform: translateY(0);
	}
	70% {
		transform: translateY(-2px);
	}
}

/* Shake */
.cncb-anim-shake .cncb-btn {
	animation: cncb-shake 4s ease-in-out infinite;
}

@keyframes cncb-shake {
	0%, 88%, 100% {
		transform: translateX(0);
	}
	90% {
		transform: translateX(-3px);
	}
	92% {
		transform: translateX(3px);
	}
	94% {
		transform: translateX(-3px);
	}
	96% {
		transform: translateX(3px);
	}
	98% {
		transform: translateX(-1px);
	}
}

/* Slide Up */
.cncb-anim-slide_up {
	animation: cncb-slide-up 0.6s ease-out;
}

@keyframes cncb-slide-up {
	0% {
		transform: translateY(100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

.cncb-position-top.cncb-anim-slide_up {
	animation: cncb-slide-down 0.6s ease-out;
}

@keyframes cncb-slide-down {
	0% {
		transform: translateY(-100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

/* ========== TRIGGER HIDDEN STATE ========== */
.cncb-bar.cncb-trigger-hidden {
	opacity: 0;
	pointer-events: none;
}

.cncb-position-bottom.cncb-trigger-hidden {
	transform: translateY(100%);
}

.cncb-position-top.cncb-trigger-hidden {
	transform: translateY(-100%);
}

/* ========== DEVICE-SPECIFIC CLASSES ========== */
.cncb-bar.cncb-mobile-only {
	display: none;
}

.cncb-bar.cncb-desktop-only {
	display: flex;
}

@media (max-width: 768px) {
	.cncb-bar.cncb-mobile-only {
		display: flex;
	}
	.cncb-bar.cncb-desktop-only {
		display: none !important;
	}
}

/* ========== SAFE AREA for notched devices ========== */
.cncb-position-bottom {
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cncb-position-top {
	padding-top: env(safe-area-inset-top, 0px);
}

/* ========== PRINT ========== */
@media print {
	.cncb-bar {
		display: none !important;
	}
}
