/* Find a store: search bar, map pins, popups and card states.
   Layout and typography of the page itself live in Bricks; this file only
   styles what stores-map.js injects and the Leaflet overlays. */

/* ---------- search toolbar (injected into #store-search, cream section) ---------- */
#store-search {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 28px;
	width: 100%;
	background: #FFFFFF;
	border-radius: 16px;
	padding: 20px 24px 18px;
	box-shadow: 0 10px 30px -10px rgba(15, 44, 82, 0.25);
	margin-bottom: 28px;
}
#store-search .st-search { flex: 1 1 360px; max-width: 620px; min-width: 0; }
.st-search-label {
	display: block;
	font-family: 'Outfit', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #E40017;
	margin: 0 0 10px;
}
.st-search-row {
	display: flex;
	gap: 8px;
	background: #FFF8E7;
	border-radius: 999px;
	padding: 5px;
	border: 2px solid #E9E1CC;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.st-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	font-family: 'Outfit', system-ui, sans-serif;
	font-size: 18px;
	font-weight: 500;
	color: #0F2C52;
	padding: 11px 18px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.st-search-input::placeholder { color: #7A8798; }
.st-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.st-search-row:focus-within { border-color: #1B4E8E; box-shadow: 0 0 0 4px rgba(27, 78, 142, 0.18); }
.st-search-btn {
	flex: 0 0 auto;
	border: 0;
	border-radius: 999px;
	background: #E40017;
	color: #FFFFFF;
	font-family: 'Outfit', system-ui, sans-serif;
	font-size: 16px;
	font-weight: 700;
	padding: 11px 24px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.st-search-btn:hover { background: #B3000F; }
.st-search-btn:active { transform: translateY(1px); }
.st-search-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	padding-bottom: 12px;
}
.st-locate,
.st-clear {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: transparent;
	padding: 6px 0;
	font-family: 'Outfit', system-ui, sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #1B4E8E;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: rgba(27, 78, 142, 0.4);
	text-underline-offset: 4px;
}
.st-locate:hover,
.st-clear:hover { color: #E40017; text-decoration-color: currentColor; }
.st-clear[hidden] { display: none; }
.st-locate-ico {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid currentColor;
	position: relative;
	flex: 0 0 auto;
}
.st-locate-ico::after {
	content: '';
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: currentColor;
}
.st-search-msg {
	flex-basis: 100%;
	margin: 0;
	font-family: 'Outfit', system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: #4B5563;
}
.st-search-msg:empty { display: none; }
.st-search-msg.is-error { color: #E40017; font-weight: 600; }
#store-search.is-busy .st-search-btn,
#store-search.is-busy .st-locate { opacity: 0.6; pointer-events: none; }

@media (max-width: 767px) {
	#store-search { padding: 16px 16px 14px; gap: 8px 20px; margin-bottom: 20px; }
	.st-search-tools { padding-bottom: 0; }
}
@media (max-width: 478px) {
	.st-search-row { border-radius: 20px; flex-direction: column; padding: 8px; }
	.st-search-input { font-size: 17px; padding: 10px 12px; }
	.st-search-btn { width: 100%; padding: 14px 20px; }
}

/* ---------- map ---------- */
#smash-store-map { border-radius: 16px; overflow: hidden; background: #E9EEF3; }
#smash-store-map.st-map-failed::after {
	content: 'The map could not load. The store list below still works.';
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	text-align: center;
	font-family: 'Outfit', system-ui, sans-serif;
	color: #0F2C52;
}
.leaflet-container { font-family: 'Outfit', system-ui, sans-serif; }
.leaflet-control-zoom a { color: #0F2C52 !important; }

/* pins are div icons so they take brand colors without image uploads */
.st-pin-wrap { background: transparent; border: 0; }
.st-pin {
	display: block;
	width: 34px;
	height: 34px;
	margin: 4px 0 0;
	border-radius: 50% 50% 50% 0;
	background: #E40017;
	border: 3px solid #FFFFFF;
	box-shadow: 0 8px 18px -6px rgba(15, 44, 82, 0.6);
	transform: rotate(-45deg);
	transform-origin: center;
	transition: transform 0.15s ease, background 0.15s ease;
	position: relative;
}
.st-pin-dot {
	position: absolute;
	inset: 8px;
	border-radius: 50%;
	background: #FFFFFF;
}
.st-pin-wrap:hover .st-pin { transform: rotate(-45deg) scale(1.08); }
.st-pin-wrap.is-active .st-pin { background: #1B4E8E; transform: rotate(-45deg) scale(1.18); }
.st-pin-wrap.is-active .st-pin-dot { background: #FFD400; }

.st-origin-wrap { background: transparent; border: 0; }
.st-origin {
	display: block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #1F8BE8;
	border: 4px solid #FFFFFF;
	box-shadow: 0 0 0 6px rgba(31, 139, 232, 0.28);
}

/* popup */
.st-popup .leaflet-popup-content-wrapper {
	border-radius: 12px;
	padding: 4px 2px;
	box-shadow: 0 16px 40px -14px rgba(15, 44, 82, 0.45);
}
.st-popup .leaflet-popup-content { margin: 12px 16px; line-height: 1.4; }
.st-popup-name { display: block; font-size: 16px; font-weight: 700; color: #0F2C52; margin-bottom: 4px; }
.st-popup-addr { display: block; font-size: 14px; color: #4B5563; }
.st-popup-dist { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: #E40017; }
.st-popup-dir {
	display: inline-block;
	margin-top: 10px;
	font-size: 14px;
	font-weight: 700;
	color: #1B4E8E !important;
	text-decoration: none;
}
.st-popup-dir:hover { text-decoration: underline; }

/* ---------- cards (states driven by the script) ---------- */
.st-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.st-card.is-active { box-shadow: 0 0 0 3px #1B4E8E, 0 18px 40px -14px rgba(15, 44, 82, 0.35) !important; }
.st-card .st-dist[hidden] { display: none; }
.st-card.is-nearest .st-dist { background: #E40017; color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
	.st-pin, .st-card, .st-search-btn { transition: none; }
}
