/**
 * hm-sl-leaflet.css — minimal styling layer on top of leaflet.css.
 *
 * Loaded only on pages that render [hm_sl_map_leaflet]. Keeps the map
 * container responsive, ensures RTL popups read correctly, and gives the
 * map a soft border that matches the rest of hm-store-locator chrome.
 */

.hm-sl-leaflet-wrap {
	width: 100%;
	max-width: 100%;
	margin: 0 0 1.25rem;
}

.hm-sl-leaflet-map {
	width: 100%;
	min-height: 320px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	background: #eef2f5;
}

.hm-sl-leaflet-popup {
	font-size: 0.95rem;
	line-height: 1.4;
	max-width: 260px;
}

.hm-sl-leaflet-popup strong {
	display: block;
	margin-bottom: 4px;
	font-size: 1rem;
}

.hm-sl-leaflet-popup a {
	color: inherit;
	text-decoration: none;
}

.hm-sl-leaflet-popup a:hover,
.hm-sl-leaflet-popup a:focus {
	text-decoration: underline;
}

/* Leaflet's default attribution sits flush against the corner — give it a
   little breathing room and ensure RTL pages render it on the left. */
.leaflet-container .leaflet-control-attribution {
	font-size: 11px;
	background: rgba(255, 255, 255, 0.85);
}

/* ---------------------------------------------------------------------------
 * Single-store interactive map ([hm_sl_single_map])
 * ------------------------------------------------------------------------- */

.hm-sl-single-map-wrap {
	margin: 24px 0;
}

.hm-sl-single-leaflet {
	width: 100%;
	min-height: 320px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	background: #eef2f5;
}

.hm-sl-single-leaflet:fullscreen,
.hm-sl-single-leaflet:-webkit-full-screen {
	border-radius: 0;
	height: 100vh !important;
}

.hm-sl-no-map {
	padding: 40px;
	text-align: center;
	color: #666;
	background: #f5f5f5;
	border-radius: 8px;
	font-size: 0.95rem;
}

.hm-sl-map-actions {
	margin-top: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.hm-sl-directions-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 22px;
	background: #5a6cf3;
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 0.95rem;
	transition: background-color 0.2s ease, transform 0.1s ease;
	border: none;
	cursor: pointer;
	line-height: 1.2;
}

.hm-sl-directions-btn:hover,
.hm-sl-directions-btn:focus {
	background: #4856d6;
	transform: translateY(-1px);
	text-decoration: none !important;
}

.hm-sl-directions-btn:focus-visible {
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

.hm-sl-directions-btn.hm-sl-directions-waze {
	background: #33ccff;
}

.hm-sl-directions-btn.hm-sl-directions-waze:hover,
.hm-sl-directions-btn.hm-sl-directions-waze:focus {
	background: #1bb5e8;
}

.hm-sl-directions-btn.hm-sl-directions-view {
	background: #6c757d;
}

.hm-sl-directions-btn.hm-sl-directions-view:hover,
.hm-sl-directions-btn.hm-sl-directions-view:focus {
	background: #545b62;
}

/* Custom Leaflet controls (fullscreen + locate) */
.hm-sl-fs-btn,
.hm-sl-locate-btn {
	background: #fff;
	width: 30px;
	height: 30px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: #333 !important;
	font-size: 18px;
	font-weight: bold;
	cursor: pointer;
	text-decoration: none !important;
}

.hm-sl-fs-btn:hover,
.hm-sl-locate-btn:hover {
	background: #f4f4f4;
}

.hm-sl-locate-btn.is-loading {
	opacity: 0.5;
	cursor: wait;
}

@media (max-width: 600px) {
	.hm-sl-map-actions {
		flex-direction: column;
	}
	.hm-sl-directions-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ---------------------------------------------------------------------------
 * Stores index search bar (2026-05-31, sprint 052 addendum)
 * Top-of-page free-text filter that narrows down the visible markers.
 * Lives above the Leaflet map on page 10768 (אינדקס גני ילדים).
 * ------------------------------------------------------------------------- */

.hm-stores-search-bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #f7f9fc;
	border: 1px solid #e0e6ee;
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	direction: rtl;
}

.hm-stores-search-input {
	flex: 1;
	min-width: 0;
	padding: 12px 16px;
	font-size: 1rem;
	line-height: 1.4;
	border: 1px solid #d0d7e2;
	border-radius: 8px;
	background: #fff;
	color: #222;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hm-stores-search-input:focus {
	outline: none;
	border-color: #5a6cf3;
	box-shadow: 0 0 0 3px rgba(90, 108, 243, 0.18);
}

.hm-stores-search-input::placeholder {
	color: #8a93a4;
}

.hm-stores-search-clear {
	display: none;
	background: #e8ecf2;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	color: #555;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.hm-stores-search-clear:hover,
.hm-stores-search-clear:focus {
	background: #d0d7e2;
	outline: none;
}

.hm-stores-search-status {
	font-size: 0.9rem;
	color: #666;
	min-width: 130px;
	text-align: end;
}

@media (max-width: 600px) {
	.hm-stores-search-bar {
		flex-wrap: wrap;
	}
	.hm-stores-search-status {
		width: 100%;
		text-align: center;
	}
}

/* ---------------------------------------------------------------------------
 * Belt-and-suspenders: ensure legacy WPSL chrome never appears inside .hm-v2
 * (in case any future post_content edit re-introduces [wpsl] before the regex
 * swap runs, or a plugin injects WPSL widgets via wp_footer). This hides only
 * the legacy WPSL UI, never the new Leaflet (.hm-sl-leaflet-*).
 * ------------------------------------------------------------------------- */
.hm-v2 #wpsl-gmap,
.hm-v2 #wpsl-search-wrap,
.hm-v2 .wpsl-store-list,
.hm-v2 #wpsl-stores-grid,
.hm-v2 .wpsl-grid-wrap {
	display: none !important;
}
