/**
 * Store Locator — front-end styles.
 * Theme: white / black with a configurable accent (default #A89D74).
 */

.stlc-wrapper {
	--stlc-accent: #A89D74;
	--stlc-black: #121212;
	--stlc-white: #ffffff;
	--stlc-gray-50: #fafaf9;
	--stlc-gray-100: #f4f3f1;
	--stlc-gray-200: #e8e6e1;
	--stlc-gray-300: #d8d5cd;
	--stlc-gray-500: #948d7f;
	--stlc-gray-600: #6f6a5e;
	--stlc-radius-lg: 18px;
	--stlc-radius-md: 12px;
	--stlc-radius-sm: 8px;
	--stlc-shadow-sm: 0 1px 2px rgba(18, 18, 18, 0.06);
	--stlc-shadow-md: 0 10px 30px -12px rgba(18, 18, 18, 0.18);
	--stlc-shadow-lg: 0 20px 45px -18px rgba(18, 18, 18, 0.28);
	--stlc-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--stlc-map-height: 600px;

	position: relative;
	box-sizing: border-box;
	background: var(--stlc-white);
	color: var(--stlc-black);
	border: 1px solid var(--stlc-gray-200);
	border-radius: var(--stlc-radius-lg);
	box-shadow: var(--stlc-shadow-md);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	animation: stlc-fade-in 0.5s var(--stlc-ease);
}

.stlc-wrapper *,
.stlc-wrapper *::before,
.stlc-wrapper *::after {
	box-sizing: border-box;
}

@keyframes stlc-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ---------- Controls bar ---------- */

.stlc-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 18px 20px;
	background: var(--stlc-white);
	border-bottom: 1px solid var(--stlc-gray-200);
}

.stlc-search-field {
	position: relative;
	flex: 1 1 240px;
	min-width: 200px;
}

.stlc-icon-search {
	position: absolute;
	left: 14px;
	top: 50%;
	width: 17px;
	height: 17px;
	transform: translateY(-50%);
	fill: var(--stlc-gray-500);
	pointer-events: none;
	transition: fill 0.2s var(--stlc-ease);
}

.stlc-keyword-input {
	width: 100%;
	height: 44px;
	padding: 0 38px 0 40px;
	border: 1.5px solid var(--stlc-gray-200);
	border-radius: 999px;
	background: var(--stlc-gray-50);
	color: var(--stlc-black);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s var(--stlc-ease), background 0.2s var(--stlc-ease), box-shadow 0.2s var(--stlc-ease);
}

.stlc-keyword-input::placeholder {
	color: var(--stlc-gray-500);
}

.stlc-keyword-input:focus {
	border-color: var(--stlc-accent);
	background: var(--stlc-white);
	box-shadow: 0 0 0 4px rgba(168, 157, 116, 0.18);
}

.stlc-search-field:focus-within .stlc-icon-search {
	fill: var(--stlc-accent);
}

.stlc-clear-btn {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%) scale(0.7);
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: var(--stlc-gray-200);
	color: var(--stlc-black);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s var(--stlc-ease), transform 0.18s var(--stlc-ease), background 0.18s var(--stlc-ease);
}

.stlc-search-field.has-value .stlc-clear-btn {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) scale(1);
}

.stlc-clear-btn:hover {
	background: var(--stlc-accent);
	color: var(--stlc-white);
}

.stlc-filter-select {
	appearance: none;
	-webkit-appearance: none;
	height: 44px;
	padding: 0 34px 0 16px;
	border: 1.5px solid var(--stlc-gray-200);
	border-radius: 999px;
	background-color: var(--stlc-gray-50);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236f6a5e'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%236f6a5e' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 14px;
	color: var(--stlc-black);
	font-size: 13.5px;
	cursor: pointer;
	transition: border-color 0.2s var(--stlc-ease), box-shadow 0.2s var(--stlc-ease), opacity 0.2s var(--stlc-ease);
}

.stlc-filter-select:focus {
	outline: none;
	border-color: var(--stlc-accent);
	box-shadow: 0 0 0 4px rgba(168, 157, 116, 0.18);
}

.stlc-radius-select:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.stlc-locate-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 20px;
	border: 1.5px solid var(--stlc-black);
	border-radius: 999px;
	background: var(--stlc-black);
	color: var(--stlc-white);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.22s var(--stlc-ease), color 0.22s var(--stlc-ease), transform 0.15s var(--stlc-ease), box-shadow 0.22s var(--stlc-ease);
}

.stlc-locate-btn:hover {
	background: var(--stlc-accent);
	border-color: var(--stlc-accent);
	box-shadow: var(--stlc-shadow-sm);
}

.stlc-locate-btn:active {
	transform: scale(0.96);
}

.stlc-icon-locate {
	width: 16px;
	height: 16px;
	fill: currentColor;
	transition: transform 0.4s var(--stlc-ease);
}

.stlc-locate-btn.is-locating .stlc-icon-locate {
	animation: stlc-spin 1s linear infinite;
}

.stlc-locate-btn:disabled {
	cursor: progress;
	opacity: 0.85;
}

@keyframes stlc-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Results summary ---------- */

.stlc-results-summary {
	margin: 0;
	padding: 10px 20px;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--stlc-gray-600);
	background: var(--stlc-gray-50);
	border-bottom: 1px solid var(--stlc-gray-200);
	min-height: 14px;
}

.stlc-results-summary.stlc-flash {
	animation: stlc-summary-flash 0.4s var(--stlc-ease);
}

@keyframes stlc-summary-flash {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- Body: list (left) + map (right) ---------- */

.stlc-body {
	display: flex;
	align-items: stretch;
	min-height: 320px;
}

.stlc-list-panel {
	position: relative;
	flex: 0 0 380px;
	max-width: 380px;
	max-height: var(--stlc-map-height);
	overflow-y: auto;
	border-right: 1px solid var(--stlc-gray-200);
	background: var(--stlc-white);
	scrollbar-width: thin;
	scrollbar-color: var(--stlc-gray-300) transparent;
}

.stlc-list-panel::-webkit-scrollbar {
	width: 6px;
}

.stlc-list-panel::-webkit-scrollbar-thumb {
	background: var(--stlc-gray-300);
	border-radius: 6px;
}

.stlc-list-panel::-webkit-scrollbar-thumb:hover {
	background: var(--stlc-gray-500);
}

.stlc-map-panel {
	position: relative;
	flex: 1 1 auto;
	height: var(--stlc-map-height);
}

.stlc-map {
	position: absolute;
	inset: 0;
	background: var(--stlc-gray-100);
}

.stlc-map-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.55);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s var(--stlc-ease);
	z-index: 500;
}

.stlc-map-panel.is-loading .stlc-map-loading {
	opacity: 1;
	visibility: visible;
}

.stlc-spinner {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 3px solid var(--stlc-gray-200);
	border-top-color: var(--stlc-accent);
	animation: stlc-spin 0.7s linear infinite;
}

/* ---------- Store list ---------- */

.stlc-list {
	display: flex;
	flex-direction: column;
}

.stlc-store-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 20px 16px 22px;
	border-bottom: 1px solid var(--stlc-gray-100);
	cursor: pointer;
	background: var(--stlc-white);
	transition: background 0.2s var(--stlc-ease);
	animation: stlc-card-in 0.4s var(--stlc-ease) both;
}

@keyframes stlc-card-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.stlc-store-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 3px;
	background: var(--stlc-accent);
	transform: scaleY(0);
	transform-origin: center;
	transition: transform 0.22s var(--stlc-ease);
}

.stlc-store-card:hover {
	background: var(--stlc-gray-50);
}

.stlc-store-card:hover::before,
.stlc-store-card.is-active::before {
	transform: scaleY(1);
}

.stlc-store-card.is-active {
	background: rgba(168, 157, 116, 0.09);
}

.stlc-store-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.stlc-store-name {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--stlc-black);
	line-height: 1.3;
}

.stlc-distance-badge {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--stlc-black);
	color: var(--stlc-white);
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.stlc-store-address {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--stlc-gray-600);
}

.stlc-store-meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 2px;
	font-size: 12.5px;
}

.stlc-store-meta-row a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--stlc-black);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid transparent;
	transition: color 0.18s var(--stlc-ease), border-color 0.18s var(--stlc-ease);
}

.stlc-store-meta-row a:hover {
	color: var(--stlc-accent);
	border-color: var(--stlc-accent);
}

.stlc-store-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.stlc-category-chip {
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--stlc-gray-100);
	color: var(--stlc-gray-600);
	font-size: 11px;
	font-weight: 600;
}

.stlc-deal-price {
	margin: 2px 0 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--stlc-black);
}

.stlc-deal-dates {
	margin: 0;
	font-size: 12px;
	color: var(--stlc-gray-500);
}

/* ---------- Empty state ---------- */

.stlc-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 60px 30px;
	text-align: center;
	color: var(--stlc-gray-500);
	animation: stlc-fade-in 0.4s var(--stlc-ease);
}

.stlc-empty-state svg {
	width: 40px;
	height: 40px;
	fill: var(--stlc-gray-300);
}

.stlc-empty-state p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	max-width: 220px;
}

/* ---------- Leaflet overrides ---------- */

.stlc-map .leaflet-popup-content-wrapper {
	border-radius: var(--stlc-radius-md);
	box-shadow: var(--stlc-shadow-lg);
	padding: 0;
	overflow: hidden;
}

.stlc-map .leaflet-popup-content {
	margin: 0;
	min-width: 220px;
}

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

.stlc-popup {
	padding: 14px 16px;
	border-top: 3px solid var(--stlc-accent);
}

.stlc-popup h4 {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--stlc-black);
}

.stlc-popup p {
	margin: 0 0 8px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--stlc-gray-600);
}

.stlc-popup a {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--stlc-accent);
	text-decoration: none;
}

.stlc-popup a:hover {
	text-decoration: underline;
}

/* Custom marker pin */

.stlc-marker {
	position: relative;
	width: 30px;
	height: 40px;
	transform-origin: bottom center;
	animation: stlc-marker-drop 0.5s var(--stlc-ease) both;
}

@keyframes stlc-marker-drop {
	0% { opacity: 0; transform: translateY(-16px) scale(0.7); }
	60% { opacity: 1; }
	100% { opacity: 1; transform: translateY(0) scale(1); }
}

.stlc-marker svg {
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 4px 6px rgba(18, 18, 18, 0.3));
	transition: transform 0.2s var(--stlc-ease);
}

.stlc-marker.is-active svg,
.stlc-marker:hover svg {
	transform: scale(1.15);
}

.stlc-marker.stlc-pulse svg {
	animation: stlc-marker-pulse 0.6s var(--stlc-ease);
}

@keyframes stlc-marker-pulse {
	0% { transform: scale(1); }
	40% { transform: scale(1.3); }
	100% { transform: scale(1.15); }
}

.stlc-user-marker {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #2b7de1;
	border: 3px solid #fff;
	box-shadow: 0 0 0 4px rgba(43, 125, 225, 0.25), var(--stlc-shadow-sm);
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
	.stlc-body {
		flex-direction: column;
	}

	.stlc-list-panel {
		flex: 1 1 auto;
		max-width: 100%;
		max-height: 340px;
		border-right: 0;
		border-bottom: 1px solid var(--stlc-gray-200);
	}

	.stlc-map-panel {
		height: min(var(--stlc-map-height), 380px);
	}

	.stlc-controls {
		gap: 8px;
	}

	.stlc-locate-btn span {
		display: none;
	}

	.stlc-locate-btn {
		width: 44px;
		padding: 0;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stlc-wrapper,
	.stlc-store-card,
	.stlc-marker,
	.stlc-empty-state,
	.stlc-results-summary.stlc-flash {
		animation: none !important;
	}

	.stlc-wrapper *,
	.stlc-wrapper *::before,
	.stlc-wrapper *::after {
		transition-duration: 0.001ms !important;
	}
}
