/**
 * Store Locator Widget Styles
 * BEM Naming Convention: .flx-block__element--modifier
 *
 * Ported directly from the site's existing store-locator shortcode CSS
 * (colors confirmed by pixel-sampling the reference screenshot: search/
 * directions buttons and markers are all #24B5EB, matching exactly).
 *
 * @package Flolynx_Elementor
 */

.flx-store-locator {
	--flx-marker-color: #24B5EB;
	--flx-marker-hover: #187BA0;
	--flx-button-color: #24B5EB;
	--flx-button-hover: #187BA0;
	--flx-map-br: 12px;
	--flx-card-bg: #ffffff;
	--flx-card-border: #ebebeb;
	--flx-map-border: #ebebeb;

	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	box-sizing: border-box;
	color: #111111;
}

/* ======================================================================
   SEARCH BAR
   ====================================================================== */

.flx-store-search-wrap {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.flx-store-search-input {
	flex: 1;
	min-width: 200px;
	padding: 11px 16px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.flx-store-search-input:focus {
	border-color: var(--flx-button-color);
}

.flx-store-locate-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 11px 20px;
	min-height: 44px;
	background: var(--flx-button-color);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.flx-store-locate-btn:hover {
	background: var(--flx-button-hover);
}

.flx-store-locate-btn:focus-visible {
	outline: 2px solid var(--flx-button-hover);
	outline-offset: 2px;
}

.flx-store-locate-icon {
	font-size: 13px;
	line-height: 1;
}

/* ======================================================================
   LAYOUT: LIST (LEFT) + MAP (RIGHT)
   ====================================================================== */

.flx-store-locator-container {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 16px;
}

/* Visual order matches the reference (list left, map right) regardless of
   DOM order, so the map — which needs to exist before the list for some
   JS init timing reasons — can stay first in markup. */
.flx-store-locator-list {
	order: 1;
}

.flx-store-locator-map {
	order: 2;
}

/* ======================================================================
   STORE LIST
   ====================================================================== */

.flx-store-locator-list {
	display: flex;
	flex-direction: column;
}

.flx-store-list-items {
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	max-height: 540px;
	padding-inline-end: 4px;
}

.flx-store-list-items::-webkit-scrollbar {
	width: 4px;
}

.flx-store-list-items::-webkit-scrollbar-track {
	background: #f5f5f5;
	border-radius: 4px;
}

.flx-store-list-items::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 4px;
}

.flx-store-item {
	background: var(--flx-card-bg);
	border: 1px solid var(--flx-card-border);
	border-radius: 10px;
	padding: 14px 16px;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.flx-store-item:hover {
	border-color: var(--flx-button-color);
	box-shadow: 0 4px 16px rgba(36, 181, 235, 0.1);
}

.flx-store-item.active {
	border-color: var(--flx-button-color);
	border-width: 2px;
}

.flx-store-item-name {
	font-size: 14px;
	font-weight: 600;
	color: #111111;
	margin: 0 0 8px;
}

.flx-store-item-address,
.flx-store-item-phone {
	font-size: 12px;
	color: #888888;
	margin: 0 0 4px;
}

.flx-store-item-distance {
	font-size: 12px;
	color: #888888;
	margin: 0 0 8px;
}

.flx-store-item-btn {
	display: block;
	width: 100%;
	padding: 8px 12px;
	background: var(--flx-button-color);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	box-sizing: border-box;
	transition: background 0.15s ease;
}

.flx-store-item-btn:hover {
	background: var(--flx-button-hover);
	color: #ffffff;
}

.flx-store-locator-empty {
	padding: 40px 20px;
	text-align: center;
	color: #888888;
	font-size: 14px;
}

.flx-store-locator-empty-icon {
	font-size: 28px;
	margin-bottom: 8px;
}

.flx-store-list-info {
	font-size: 12px;
	color: #888888;
	text-align: center;
	padding: 8px 4px 4px;
}

/* ======================================================================
   MAP
   ====================================================================== */

.flx-store-locator-map {
	border-radius: var(--flx-map-br);
	border: 1px solid var(--flx-map-border);
	overflow: hidden;
	background: #f5f5f5;
	position: relative;
	z-index: 1;
}

.flx-store-locator-map .leaflet-container {
	font-family: 'Segoe UI', sans-serif;
	background: #f5f5f5;
}

.flx-store-locator-map.flx-map-unavailable {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #8a8a8a;
	font-size: 14px;
	padding: 20px;
}

.flx-store-locator-map.flx-map-unavailable::before {
	content: 'Map is temporarily unavailable — see the store list for locations.';
}

/* ======================================================================
   MAP POPUP CONTENT
   ====================================================================== */

.flx-popup-content {
	font-family: 'Segoe UI', sans-serif;
	min-width: 180px;
}

.flx-popup-title {
	font-size: 13px;
	font-weight: 700;
	color: #111111;
	margin: 0 0 4px;
}

.flx-popup-address,
.flx-popup-phone {
	font-size: 12px;
	color: #888888;
	margin: 0 0 4px;
}

.flx-popup-directions {
	margin-top: 8px;
}

.flx-popup-directions-btn {
	display: inline-block;
	padding: 6px 12px;
	background: var(--flx-button-color);
	color: #ffffff;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease;
}

.flx-popup-directions-btn:hover {
	background: var(--flx-button-hover);
	color: #ffffff;
}

/* ======================================================================
   RESPONSIVE BREAKPOINTS
   ====================================================================== */

@media (max-width: 720px) {
	.flx-store-locator-container {
		grid-template-columns: 1fr;
	}

	.flx-store-locator-list {
		max-height: 280px;
	}

	.flx-store-locator-map {
		height: 350px !important;
	}
}

@media (max-width: 480px) {
	.flx-store-search-wrap {
		flex-direction: column;
		align-items: stretch;
	}

	.flx-store-locate-btn {
		justify-content: center;
	}
}

/* ======================================================================
   ACCESSIBILITY / MOTION / CONTRAST
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
	.flx-store-locator * {
		transition: none !important;
	}
}

@media (prefers-contrast: more) {
	.flx-store-item,
	.flx-store-search-input {
		border-width: 2px;
	}
}
