/**
 * HD Google Maps Widget — Frontend CSS
 */

.hd-google-maps__wrap {
	width: 100%;
	position: relative;
	overflow: hidden;
}

.hd-google-maps__canvas {
	width: 100%;
	height: 450px; /* fallback — overridden by Elementor responsive control */
	display: block;
	position: relative;
	overflow: hidden;
	background-color: #e5e3df;
}

/* ---- Skeleton loader ---- */
/* Shimmer while map hasn't been initialised yet */
.hd-google-maps__canvas:not([data-hd-initialised]),
.hd-google-maps__canvas.hd-gmaps-loading {
	background: linear-gradient( 90deg, #e5e3df 25%, #d4d1cb 50%, #e5e3df 75% );
	background-size: 200% 100%;
	animation: hd-gmaps-shimmer 1.4s infinite;
}

@keyframes hd-gmaps-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Fade in once tiles are loaded */
.hd-google-maps__canvas.hd-gmaps-loaded {
	animation: hd-gmaps-fadein 0.4s ease both;
}

@keyframes hd-gmaps-fadein {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---- Tap-to-activate overlay ---- */
.hd-gmaps-tap-overlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	background: rgba( 0, 0, 0, 0.35 );
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

.hd-gmaps-tap-overlay--hidden {
	opacity: 0;
	pointer-events: none;
}

.hd-gmaps-tap-overlay__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	text-align: center;
	padding: 20px;
	background: rgba( 0, 0, 0, 0.5 );
	border-radius: 8px;
	backdrop-filter: blur( 4px );
	-webkit-backdrop-filter: blur( 4px );
}

.hd-gmaps-tap-overlay__inner svg {
	width: 36px;
	height: 36px;
	opacity: 0.9;
}

/* ---- Outer widget wrapper ---- */
.hd-gmaps-widget {
	width: 100%;
	display: block;
}

/* ---- Get Directions button ---- */
.hd-gmaps-directions-wrap {
	display: block !important;
	width: 100%;
	text-align: center !important;
	padding-top: 12px;
	padding-bottom: 2px;
	box-sizing: border-box;
	float: none;
	clear: both;
}

/* Higher specificity via wrapper to beat theme global link styles */
.hd-gmaps-directions-wrap .hd-gmaps-directions {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 0;
	padding: 11.5px 20.7px;
	background-color: #1a73e8;
	color: #fff !important;      /* override theme link colour */
	font-size: 16.1px;
	font-weight: 500;
	text-decoration: none !important;
	border-radius: 4px;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
	line-height: 1;
	box-sizing: border-box;
	cursor: pointer;
}

.hd-gmaps-directions-wrap .hd-gmaps-directions:hover,
.hd-gmaps-directions-wrap .hd-gmaps-directions:focus {
	background-color: #1558b0;
	box-shadow: 0 2px 8px rgba( 26, 115, 232, 0.4 );
	color: #fff !important;
	text-decoration: none !important;
	outline: none;
}

.hd-gmaps-directions-wrap .hd-gmaps-directions:focus-visible {
	outline: 2px solid #1a73e8;
	outline-offset: 2px;
}

/* ---- Info Window ---- */
.hd-gmaps-info-window {
	font-family: inherit;
	max-width: 220px;
	padding: 2px 4px;
}

.hd-gmaps-info-window__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #1a1a1a;
}

.hd-gmaps-info-window__content {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #444;
}

/* ---- Editor notice (no API key) ---- */
.hd-google-maps__notice {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	background: #f4f4f4;
	border: 2px dashed #ccc;
	border-radius: 4px;
	color: #888;
	font-size: 13px;
	text-align: center;
	padding: 20px;
}
