/* =========================================================
   CRX Location Map — Leaflet map styles
   ========================================================= */

/* --- Wrapper ------------------------------------------------ */
.crx-map-wrap {
	position: relative;
	width: 100%;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Page builders (e.g. Elementor's flex Containers/Tabs) can wrap the
   shortcode output in a flex item that sizes itself to shrink-to-fit
   content. Since the map starts out as an empty <div>, it has no
   intrinsic width to shrink to and collapses to 0 — invisible on
   breakpoints where the wrapping container switches to flex/column
   layout (this is what was hiding the map on tablet/mobile). Force
   that wrapper to take the full width available to it. */
.elementor-widget-shortcode:has( .crx-map-wrap ) {
	width: 100%;
	flex: 1 1 100%;
}

.crx-map-container {
	width: 100%;
	min-width: 100%;
	box-sizing: border-box;
	border-radius: 12px;
	overflow: hidden;
	background: #e8e0d5;
	/* height is set inline from shortcode attribute */
}

/* --- Custom pin icon --------------------------------------- */
.crx-leaflet-pin {
	background: none;
	border: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.crx-leaflet-pin:hover,
.crx-leaflet-pin:focus {
	filter: drop-shadow( 0 4px 10px rgba( 28, 58, 107, 0.5 ) );
	transform: translateY( -2px );
	z-index: 1000 !important;
}

/* --- Marker cluster ---------------------------------------- */
.crx-cluster {
	background: transparent;
	border: none;
}

.crx-cluster-inner {
	width: 40px;
	height: 40px;
	background: #1C3A6B;
	color: #fff;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 3px 12px rgba( 28, 58, 107, 0.45 );
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

/* Leaflet cluster overrides (remove default styles) */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
	background: transparent !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
	background: transparent !important;
}

/* --- Popup card -------------------------------------------- */
.crx-map-popup .leaflet-popup-content-wrapper {
	border-radius: 14px;
	padding: 0;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.16 );
	border: none;
}

.crx-map-popup .leaflet-popup-content {
	margin: 0;
	line-height: 1;
}

.crx-map-popup .leaflet-popup-tip-container {
	margin-top: -1px;
}

.crx-map-popup .leaflet-popup-tip {
	box-shadow: none;
}

.crx-popup-inner {
	padding: 16px 20px 14px;
	min-width: 220px;
}

.crx-popup-name {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	color: #0f1d3b;
	margin: 0 0 6px;
}

.crx-popup-address {
	font-size: 13px;
	line-height: 1.5;
	color: #555e6d;
	margin: 0 0 10px;
}

.crx-popup-phone {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #0f1d3b;
	margin: 0;
}

.crx-popup-phone svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #1C3A6B;
}

/* --- Leaflet control overrides ----------------------------- */
.crx-map-container .leaflet-bar a {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
}

.crx-map-container .leaflet-bar {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.18 );
	border: none;
}

.crx-map-container .leaflet-bar a:first-child {
	border-radius: 8px 8px 0 0;
}

.crx-map-container .leaflet-bar a:last-child {
	border-radius: 0 0 8px 8px;
}

/* Attribution */
.crx-map-container .leaflet-control-attribution {
	font-size: 10px;
	background: rgba( 255, 255, 255, 0.75 );
	border-radius: 4px 0 0 0;
	padding: 2px 6px;
}

/* --- Responsive -------------------------------------------- */
@media ( max-width: 600px ) {
	.crx-map-container {
		border-radius: 8px;
	}

	.crx-popup-inner {
		padding: 12px 14px 10px;
	}

	.crx-popup-name    { font-size: 14px; }
	.crx-popup-address { font-size: 12px; }
	.crx-popup-phone   { font-size: 13px; }
}
