/* ===========================================================
   Clearfield Enhancements — WhatsApp FAB, scroll animations,
   and the near-3D property photo viewer.
   =========================================================== */

/* Guards against page-wide horizontal overflow, a common cause of
   mis-centered "position: fixed" overlays on mobile browsers. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ---------- Top bar: phone + address ---------- */
.cf-topbar {
	width: 100%;
	min-height: 40px;
	background: linear-gradient(180deg, #e9ebee 0%, #cfd2d6 100%);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
	position: relative;
	z-index: 9000;
}

.cf-topbar__inner {
	max-width: 1400px;
	margin: 0 auto;
	min-height: 40px;
	padding: 8px 24px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	gap: 28px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.cf-topbar__inner::-webkit-scrollbar { display: none; }

.cf-topbar__item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #2b2f33;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

.cf-topbar__item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #4a4f54;
}

.cf-topbar__address span {
	white-space: nowrap;
}

.cf-topbar__phone {
	font-weight: 700;
	color: #1a1c1e;
	transition: color 0.2s ease, transform 0.2s ease;
}
.cf-topbar__phone:hover {
	color: #0a7d3b;
	transform: translateY(-1px);
}

.cf-topbar__visit {
	display: none;
	background: none;
	border: none;
	font: inherit;
	padding: 0;
	cursor: pointer;
	color: #1a1c1e;
	font-weight: 600;
}
.cf-topbar__visit:hover { color: #0a7d3b; }

@media (max-width: 782px) {
	.cf-topbar { min-height: 0; }
	.cf-topbar__inner {
		justify-content: flex-start;
		padding: 8px 16px;
		gap: 20px;
	}
	.cf-topbar__address { display: none; }
	.cf-topbar__visit { display: inline-flex; }
}

@media (max-width: 480px) {
	.cf-topbar__item { font-size: 13px; }
}

/* ---------- Office visit modal (mobile) ---------- */
.cf-office-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
}
.cf-office-modal.cf-open { opacity: 1; visibility: visible; }

.cf-office-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 12, 0.55);
}

.cf-office-modal__panel {
	position: relative;
	width: min(90vw, 380px);
	background: #fff;
	border-radius: 16px;
	padding: 32px 24px 24px;
	text-align: center;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
	transform: translateY(16px) scale(0.97);
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-office-modal.cf-open .cf-office-modal__panel { transform: translateY(0) scale(1); }

.cf-office-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: #f1f2f3;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	transition: background 0.2s ease, transform 0.2s ease;
}
.cf-office-modal__close:hover { background: #e4e5e7; transform: scale(1.06); }

.cf-office-modal__icon {
	width: 40px;
	height: 40px;
	color: #0a7d3b;
	margin-bottom: 8px;
}

.cf-office-modal__panel h3 {
	margin: 0 0 10px;
	font-size: 18px;
}

.cf-office-modal__panel p {
	margin: 0 0 20px;
	color: #4a4f54;
	font-size: 14px;
	line-height: 1.5;
}

.cf-office-modal__directions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #0a7d3b;
	color: #fff !important;
	font-weight: 600;
	text-decoration: none;
	padding: 12px 22px;
	border-radius: 999px;
	transition: background 0.2s ease, transform 0.2s ease;
}
.cf-office-modal__directions svg { width: 16px; height: 16px; }
.cf-office-modal__directions:hover { background: #086530; transform: translateY(-1px); }

/* Any blue-background button (e.g. "Get a Quote") keeps white text on
   hover, instead of falling back to a dark/default hover color. */
.elementor-button:hover,
.elementor-button-link:hover,
a.elementor-button:hover,
.wp-block-button__link:hover,
.ast-button:hover,
button.cf-blue-btn:hover,
a.cf-blue-btn:hover {
	color: #ffffff !important;
}
.elementor-button:hover .elementor-button-text,
.elementor-button:hover span {
	color: #ffffff !important;
}

/* Hide the default theme page-title banner (e.g. "About") on pages that
   don't use a dedicated Elementor hero, so every page is as clean as the
   Home/Contact pages. */
body.page .entry-header,
body.page .page-header,
body.page .ast-archive-title,
body.page header.entry-header {
	display: none !important;
}

/* Hide the CookieAdmin consent banner/icon (blue, bottom-left) site-wide */
.cookieadmin_law_container,
.cookieadmin_cookie_modal,
[class*="cookieadmin"],
[id*="cookieadmin"] {
	display: none !important;
}

/* Hide the old "Call us" item that used to sit beside the logo —
   common Astra/Elementor header patterns. If it still shows, add its
   exact class/ID here. */
.ast-header-call-us,
.site-header .call-us,
.elementor-location-header .cf-legacy-call-us {
	display: none !important;
}

/* ---------- Floating WhatsApp button ---------- */
.cf-whatsapp-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
	z-index: 99999;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cf-whatsapp-fab:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 10px 26px rgba(37, 211, 102, 0.55);
	color: #fff;
}

.cf-whatsapp-fab__icon {
	width: 32px;
	height: 32px;
	position: relative;
	z-index: 2;
}

.cf-whatsapp-fab__ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #25d366;
	opacity: 0.55;
	animation: cf-pulse 2.2s ease-out infinite;
}

@keyframes cf-pulse {
	0% { transform: scale(1); opacity: 0.55; }
	80% { transform: scale(1.8); opacity: 0; }
	100% { transform: scale(1.8); opacity: 0; }
}

@media (max-width: 600px) {
	.cf-whatsapp-fab {
		right: 16px;
		bottom: 16px;
		width: 52px;
		height: 52px;
	}
	.cf-whatsapp-fab__icon { width: 28px; height: 28px; }
}

/* ---------- Scroll reveal animations ---------- */
.cf-animate {
	opacity: 0;
	will-change: transform, opacity;
	transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.cf-animate.cf-visible { opacity: 1; transform: none !important; }

.cf-fade-up { transform: translateY(48px); }
.cf-fade-down { transform: translateY(-48px); }
.cf-fade-left { transform: translateX(-56px); }
.cf-fade-right { transform: translateX(56px); }
.cf-zoom-in { transform: scale(0.85); }
.cf-zoom-out { transform: scale(1.12); }

/* "Section overlap" — next section slides up and over the previous one */
.cf-overlap {
	position: relative;
	z-index: 1;
	background: inherit;
	border-radius: 28px 28px 0 0;
	box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.08);
	transform: translateY(90px);
	opacity: 0;
	transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-overlap.cf-visible { transform: translateY(0); opacity: 1; }

/* Stagger helper applied via inline style (--cf-delay) from JS */
.cf-animate { transition-delay: var(--cf-delay, 0s); }

@media (prefers-reduced-motion: reduce) {
	.cf-animate, .cf-overlap {
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ---------- Near-3D property photo viewer ---------- */
.cf-3d-wrap {
	position: relative;
	overflow: hidden;
	cursor: grab;
	perspective: 1000px;
	border-radius: 12px;
	margin: 10px;
	aspect-ratio: 4 / 3;
}
.cf-3d-wrap:active { cursor: grabbing; }

.cf-3d-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.15s ease-out;
	transform-style: preserve-3d;
}

.cf-3d-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 6px 10px;
	border-radius: 999px;
	pointer-events: none;
	opacity: 0.9;
	backdrop-filter: blur(2px);
}
.cf-3d-badge svg { width: 14px; height: 14px; }

.cf-3d-hint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 40%);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}
.cf-3d-wrap:hover .cf-3d-hint { opacity: 1; }
.cf-3d-hint span {
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	background: rgba(0,0,0,0.45);
	padding: 8px 14px;
	border-radius: 999px;
	transform: translateY(10px);
}

/* Fullscreen lightbox with drag-to-rotate / scroll-to-zoom */
.cf-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 12, 0.92);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}
.cf-lightbox.cf-open { opacity: 1; visibility: visible; }

.cf-lightbox__scene {
	width: min(92vw, 1100px);
	height: min(82vh, 720px);
	perspective: 1400px;
}

.cf-lightbox__stage {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 16px;
	cursor: grab;
	touch-action: none;
	-ms-touch-action: none;
	overscroll-behavior: contain;
	transform-style: preserve-3d;
	background: #16181b;
}
.cf-lightbox__stage:active { cursor: grabbing; }

.cf-lightbox__stage img {
	position: absolute;
	top: 50%;
	left: 50%;
	max-width: none;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: none;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(1);
	transition: transform 0.08s linear;
	transform-style: preserve-3d;
	backface-visibility: hidden;
}

.cf-lightbox__nav {
	position: absolute;
	background: rgba(255,255,255,0.12);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}
.cf-lightbox__nav:hover { background: rgba(255,255,255,0.25); }
.cf-lightbox__nav--prev { left: 18px; top: 50%; transform: translateY(-50%); }
.cf-lightbox__nav--next { right: 18px; top: 50%; transform: translateY(-50%); }
.cf-lightbox__nav svg { width: 20px; height: 20px; }

.cf-lightbox__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #111;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	line-height: 1;
	font-weight: 400;
	padding: 0;
	transition: background 0.2s ease, transform 0.2s ease;
}
.cf-lightbox__close:hover { background: #fff; transform: scale(1.08); }

.cf-lightbox__caption {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.75;
}
