/* ============================================================
   Store Locator Pro — Frontend Styles
   Theme color: #7c1e28
   ============================================================ */

/* Critical animation — referenced by inline loader styles */
@-webkit-keyframes slp-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes slp-spin          { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }


/* ---- CSS Custom Properties ---- */
.slp-search-wrapper,
.slp-filter-wrapper,
.slp-map-wrapper,
.slp-store-listing,
.slp-store-card,
.slp-loader {
	--slp-primary:       #7c1e28;
	--slp-primary-dark:  #5e161e;
	--slp-primary-light: #9e2634;
	--slp-primary-bg:    #fdf2f3;
	--slp-border:        #e2e8f0;
	--slp-text:          #1a202c;
	--slp-muted:         #6b7280;
	--slp-bg:            #ffffff;
	--slp-radius:        10px;
	--slp-trans:         all 0.22s ease;
	--slp-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   1. STORE SEARCH
   ============================================================ */

.slp-search-wrapper {
	margin-bottom: 22px;
}

.slp-search-form {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	gap: 10px;
	flex-wrap: nowrap;
}

/* ---- Input row ---- */
.slp-search-input-wrap {
	position: relative;
	-webkit-box-flex: 1;
	-ms-flex: 1 1 auto;
	flex: 1 1 auto;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
	min-width: 0;
}

/* Magnifier icon — left side of input */
.slp-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	-webkit-transform: translateY(-50%);
	transform: translateY(-50%);
	width: 17px;
	height: 17px;
	color: #6b7280;
	pointer-events: none;
	flex-shrink: 0;
	z-index: 1;
}

.slp-search-input {
	width: 100%;
	padding: 13px 145px 13px 44px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1a202c;
	background: #ffffff;
	-webkit-transition: border-color 0.22s ease, box-shadow 0.22s ease;
	transition: border-color 0.22s ease, box-shadow 0.22s ease;
	outline: none;
	box-sizing: border-box;
}

.slp-search-input:focus {
	border-color: #7c1e28;
	box-shadow: 0 0 0 3px rgba(124, 30, 40, 0.12);
}

.slp-search-input::-webkit-input-placeholder { color: #6b7280; }
.slp-search-input::-moz-placeholder         { color: #6b7280; }
.slp-search-input::placeholder               { color: #6b7280; }

/* ---- Near Me button — absolute inside input ---- */
.slp-near-me-inline-btn {
	position: absolute;
	right: 8px;
	top: 50%;
	-webkit-transform: translateY(-50%);
	transform: translateY(-50%);
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 11px;
	border: 1.5px solid #7c1e28;
	border-radius: 7px;
	background: #fdf2f3;
	color: #7c1e28;
	font-size: 12px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	-webkit-transition: all 0.22s ease;
	transition: all 0.22s ease;
	white-space: nowrap;
	line-height: 1;
}

.slp-near-me-inline-btn svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	display: block;
}

.slp-near-me-inline-btn:hover {
	background: #7c1e28;
	color: #ffffff;
}

.slp-near-me-inline-btn.slp-locating {
	opacity: 0.65;
	cursor: wait;
}

/* ---- Search button ---- */
.slp-search-btn {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 13px 22px;
	border: none;
	background: #7c1e28;
	color: #ffffff;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	-webkit-transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
	transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
	white-space: nowrap;
	flex-shrink: 0;
	box-shadow: 0 3px 10px rgba(124, 30, 40, 0.28);
}

.slp-search-btn svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
	display: block;
}

.slp-search-btn:hover {
	background: #5e161e;
	box-shadow: 0 5px 16px rgba(124, 30, 40, 0.38);
	-webkit-transform: translateY(-1px);
	transform: translateY(-1px);
}

.slp-search-btn:active {
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

/* ============================================================
   2. STORE FILTER
   ============================================================ */

.slp-filter-wrapper {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	padding: 18px 22px 16px;
	margin-bottom: 22px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Header */
.slp-filter-header {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1.5px solid #e2e8f0;
}

.slp-filter-icon {
	width: 17px;
	height: 17px;
	color: #7c1e28;
	flex-shrink: 0;
	display: block;
}

.slp-filter-label {
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #7c1e28;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Filter grid */
.slp-filter-grid {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
}

.slp-filter-group {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	gap: 5px;
	min-width: 140px;
	flex: 1 1 140px;
}

/* Group label with icon */
.slp-filter-group-label {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.slp-filter-group-label svg {
	width: 12px;
	height: 12px;
	color: #7c1e28;
	flex-shrink: 0;
	display: block;
}

/* Select wrapper */
.slp-select-wrap {
	position: relative;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
}

.slp-filter-select {
	width: 100%;
	padding: 9px 32px 9px 11px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1a202c;
	background: #ffffff;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	-webkit-transition: border-color 0.22s ease, box-shadow 0.22s ease;
	transition: border-color 0.22s ease, box-shadow 0.22s ease;
	outline: none;
	box-sizing: border-box;
}

.slp-filter-select:focus {
	border-color: #7c1e28;
	box-shadow: 0 0 0 3px rgba(124, 30, 40, 0.10);
}

.slp-select-arrow {
	position: absolute;
	right: 9px;
	top: 50%;
	-webkit-transform: translateY(-50%);
	transform: translateY(-50%);
	width: 13px;
	height: 13px;
	color: #6b7280;
	pointer-events: none;
	flex-shrink: 0;
	display: block;
}

/* Open Now toggle group */
.slp-filter-group--toggle {
	-webkit-box-orient: horizontal;
	-webkit-box-direction: normal;
	-ms-flex-direction: row;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	background: #fdf2f3;
	border: 1.5px solid rgba(124, 30, 40, 0.18);
	border-radius: 8px;
	padding: 9px 13px;
	gap: 10px;
}

.slp-filter-group--toggle .slp-filter-group-label {
	color: #7c1e28;
}

/* Toggle switch */
.slp-toggle-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}

.slp-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.slp-toggle-slider {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #cbd5e0;
	border-radius: 22px;
	cursor: pointer;
	-webkit-transition: background 0.22s ease;
	transition: background 0.22s ease;
}

.slp-toggle-slider::before {
	content: '';
	position: absolute;
	left: 3px;
	top: 3px;
	width: 16px;
	height: 16px;
	background: #ffffff;
	border-radius: 50%;
	-webkit-transition: -webkit-transform 0.22s ease;
	transition: transform 0.22s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slp-toggle-switch input:checked + .slp-toggle-slider {
	background: #7c1e28;
}

.slp-toggle-switch input:checked + .slp-toggle-slider::before {
	-webkit-transform: translateX(18px);
	transform: translateX(18px);
}

/* Reset button */
.slp-filter-reset-btn {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	padding: 7px 15px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	background: transparent;
	color: #6b7280;
	font-size: 12.5px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	-webkit-transition: all 0.22s ease;
	transition: all 0.22s ease;
}

.slp-filter-reset-btn svg {
	width: 13px;
	height: 13px;
	display: block;
	flex-shrink: 0;
}

.slp-filter-reset-btn:hover {
	border-color: #7c1e28;
	color: #7c1e28;
	background: #fdf2f3;
}

/* ============================================================
   3. STORE LOCATOR MAP
   ============================================================ */

.slp-map-wrapper {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
	border: 1.5px solid #e2e8f0;
}

.slp-map-container {
	width: 100%;
	background: #e8eaed;
	display: block;
}

/* Controls overlay */
.slp-map-controls {
	position: absolute;
	bottom: 20px;
	right: 14px;
	z-index: 10;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* My Location button */
.slp-map-my-location-btn {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 15px;
	background: #ffffff;
	color: #7c1e28;
	border: 1.5px solid #7c1e28;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	-webkit-transition: all 0.22s ease;
	transition: all 0.22s ease;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
	white-space: nowrap;
}

.slp-map-my-location-btn svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
	display: block;
}

.slp-map-my-location-btn:hover {
	background: #7c1e28;
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(124, 30, 40, 0.30);
	-webkit-transform: translateY(-1px);
	transform: translateY(-1px);
}

.slp-map-my-location-btn.slp-locating svg {
	-webkit-animation: slp-spin 1s linear infinite;
	animation: slp-spin 1s linear infinite;
}

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

/* Info Window */
.slp-info-window {
	padding: 4px 2px;
	min-width: 170px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.slp-info-window h3 {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
}

.slp-info-window h3 a {
	color: #7c1e28;
	text-decoration: none;
}

.slp-info-window p {
	margin: 3px 0;
	font-size: 12.5px;
	color: #6b7280;
}

/* ============================================================
   4. STORE LISTING & CARDS
   ============================================================ */

.slp-store-listing {
	display: grid;
	gap: 18px;
}

.slp-layout-grid.slp-columns-2 { grid-template-columns: repeat(2, 1fr); }
.slp-layout-grid.slp-columns-3 { grid-template-columns: repeat(3, 1fr); }
.slp-layout-grid.slp-columns-4 { grid-template-columns: repeat(4, 1fr); }
.slp-layout-list { grid-template-columns: 1fr; }

.slp-store-card {
	border: 1.5px solid #e2e8f0;
	padding: 18px;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	-webkit-transition: -webkit-transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.slp-store-card:hover {
	-webkit-transform: translateY(-4px);
	transform: translateY(-4px);
	box-shadow: 0 8px 28px rgba(124, 30, 40, 0.12);
	border-color: rgba(124, 30, 40, 0.22);
}

.slp-store-title {
	margin: 0 0 9px 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.slp-store-title a {
	text-decoration: none;
	color: #1a202c;
	-webkit-transition: color 0.2s;
	transition: color 0.2s;
}

.slp-store-title a:hover { color: #7c1e28; }

.slp-store-address {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: flex-start;
	gap: 5px;
	color: #6b7280;
	margin-bottom: 9px;
	font-size: 0.875rem;
	line-height: 1.5;
}

.slp-store-address svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	margin-top: 2px;
	color: #7c1e28;
	display: block;
}

.slp-distance {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fdf2f3;
	color: #7c1e28;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.76rem;
	font-weight: 700;
	margin-bottom: 13px;
	border: 1px solid rgba(124, 30, 40, 0.15);
}

.slp-store-actions {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.slp-btn {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-decoration: none;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	-webkit-box-flex: 1;
	-ms-flex: 1;
	flex: 1;
	text-align: center;
	-webkit-transition: all 0.22s ease;
	transition: all 0.22s ease;
}

.slp-btn svg {
	width: 13px;
	height: 13px;
	display: block;
	flex-shrink: 0;
}

.slp-btn-call {
	background: #7c1e28;
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(124, 30, 40, 0.24);
}

.slp-btn-call:hover {
	background: #5e161e;
	-webkit-transform: translateY(-1px);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(124, 30, 40, 0.34);
	color: #ffffff;
}

.slp-btn-view {
	background: #fdf2f3;
	color: #7c1e28;
	border: 1.5px solid rgba(124, 30, 40, 0.2);
}

.slp-btn-view:hover {
	background: #7c1e28;
	color: #ffffff;
}

/* ---- Loader ---- */
.slp-loader {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 40px 20px;
	color: #6b7280;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
}

.slp-loader-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(124, 30, 40, 0.18);
	border-top-color: #7c1e28;
	border-radius: 50%;
	-webkit-animation: slp-spin 0.8s linear infinite;
	animation: slp-spin 0.8s linear infinite;
	flex-shrink: 0;
}

.slp-no-results {
	text-align: center;
	padding: 40px 20px;
	color: #6b7280;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   5. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
	.slp-search-form {
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-ms-flex-direction: column;
		flex-direction: column;
		align-items: stretch;
	}

	.slp-search-input-wrap {
		width: 100%;
	}

	.slp-search-btn {
		justify-content: center;
		width: 100%;
	}

	.slp-filter-grid {
		gap: 10px;
	}

	.slp-filter-group {
		min-width: 120px;
	}

	.slp-layout-grid[class*="slp-columns-"] {
		grid-template-columns: 1fr;
	}

	.slp-map-controls {
		bottom: 12px;
		right: 10px;
	}
}

@media (max-width: 480px) {
	.slp-filter-group {
		-webkit-box-flex: 1;
		-ms-flex: 1 1 100%;
		flex: 1 1 100%;
	}

	/* On tiny screens, put near-me below the input */
	.slp-near-me-inline-btn {
		position: static;
		-webkit-transform: none;
		transform: none;
		width: 100%;
		justify-content: center;
		margin-top: 8px;
		padding: 10px;
		border-radius: 8px;
		font-size: 13px;
	}

	.slp-search-input {
		padding-right: 14px;
	}

	.slp-search-input-wrap {
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
	}
}
