/* ==========================================================================
   Ryde Store Locator — Modal Styles
   ========================================================================== */

/* Body scroll lock when modal is open */
.ryde-sl-body-lock {
	overflow: hidden;
}

/* ==========================================================================
   Modal shell
   ========================================================================== */

.ryde-sl-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.ryde-sl-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.ryde-sl-container {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 16px;
	width: 100%;
	max-width: 960px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

/* Legacy anchor used by the original BigCommerce implementation */
.ryde-sl-legacy-anchor {
	display: none;
}

/* ==========================================================================
   Header
   ========================================================================== */

.ryde-sl-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.125rem 1.5rem;
	border-bottom: 1px solid #e5e5e5;
	flex-shrink: 0;
}

.ryde-sl-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	color: #111111;
	line-height: 1.2;
}

.ryde-sl-close-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #666666;
	padding: 0.375rem;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
	line-height: 1;
}

.ryde-sl-close-btn:hover {
	color: #111111;
	background: #f0f0f0;
}

/* ==========================================================================
   Search bar
   ========================================================================== */

.ryde-sl-search-bar {
	padding: 0.875rem 1.5rem;
	border-bottom: 1px solid #e5e5e5;
	flex-shrink: 0;
}

.ryde-sl-search-row {
	display: flex;
	gap: 0.5rem;
}

.ryde-sl-address-input {
	flex: 1;
	min-width: 0;
	padding: 0.625rem 1rem;
	border: 1px solid #cccccc;
	border-radius: 8px;
	font-size: 0.9375rem;
	color: #111111;
	background: #ffffff;
	outline: none;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.ryde-sl-address-input:focus {
	border-color: #111111;
}

.ryde-sl-search-btn {
	padding: 0 1.25rem;
	background: #111111;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s;
}

.ryde-sl-search-btn:hover {
	background: #333333;
}

.ryde-sl-geo-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	background: #ffffff;
	border: 1px solid #cccccc;
	border-radius: 8px;
	cursor: pointer;
	color: #444444;
	flex-shrink: 0;
	transition: background 0.15s, border-color 0.15s;
}

.ryde-sl-geo-btn:hover {
	background: #f5f5f5;
	border-color: #999999;
}

/* Google Places autocomplete dropdown — keep it above the modal overlay */
.pac-container {
	z-index: 100000 !important;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	border: 1px solid #e0e0e0;
	font-family: inherit;
}

.pac-item {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	cursor: pointer;
}

.pac-item:hover {
	background: #f5f5f5;
}

/* ==========================================================================
   Modal body
   ========================================================================== */

.ryde-sl-body {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* ==========================================================================
   Loading state
   ========================================================================== */

.ryde-sl-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 3rem 1.5rem;
	flex: 1;
	color: #555555;
	font-size: 0.9rem;
}

.ryde-sl-spinner {
	width: 38px;
	height: 38px;
	border: 3px solid #e5e5e5;
	border-top-color: #111111;
	border-radius: 50%;
	animation: ryde-sl-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   Empty / error states
   ========================================================================== */

.ryde-sl-empty {
	padding: 3rem 1.5rem;
	text-align: center;
	color: #666666;
	font-size: 0.9375rem;
}

.ryde-sl-error {
	padding: 1rem 1.25rem;
	color: #cc0000;
	font-size: 0.875rem;
	margin: 0;
}

/* ==========================================================================
   Results layout (list + map side-by-side)
   ========================================================================== */

.ryde-sl-results-layout {
	display: flex;
	flex: 1;
	overflow: hidden;
	min-height: 0;
}

/* ---- Results list ---- */

.ryde-sl-list {
	width: 340px;
	flex-shrink: 0;
	overflow-y: auto;
	border-right: 1px solid #e5e5e5;
	scroll-behavior: smooth;
}

/* ---- Map ---- */

.ryde-sl-map {
	flex: 1;
	min-width: 0;
	min-height: 420px;
	background: #e8e8e8; /* placeholder colour while map tiles load */
}

/* ==========================================================================
   Individual result item
   ========================================================================== */

.ryde-sl-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background 0.12s;
	outline: none;
}

.ryde-sl-item:hover,
.ryde-sl-item:focus {
	background: #f8f8f8;
}

.ryde-sl-item--active {
	background: #f3f3f3;
	border-left: 3px solid #111111;
}

.ryde-sl-item-num {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #111111;
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.ryde-sl-item--active .ryde-sl-item-num {
	background: #111111;
}

.ryde-sl-item-info {
	flex: 1;
	min-width: 0;
}

.ryde-sl-item-name {
	font-size: 0.875rem;
	font-weight: 600;
	color: #111111;
	margin-bottom: 2px;
	line-height: 1.3;
}

.ryde-sl-item-banner {
	font-size: 0.75rem;
	color: #888888;
	margin-bottom: 2px;
}

.ryde-sl-item-address {
	font-size: 0.8125rem;
	color: #555555;
	margin-bottom: 2px;
	line-height: 1.4;
}

.ryde-sl-item-phone a {
	font-size: 0.8125rem;
	color: #333333;
	text-decoration: none;
}

.ryde-sl-item-phone a:hover {
	text-decoration: underline;
}

.ryde-sl-item-hours {
	font-size: 0.75rem;
	color: #777777;
	margin-top: 3px;
}

.ryde-sl-item-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}

/* Product availability tags */
.ryde-sl-tag {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: #111111;
	background: #f0f0f0;
}

.ryde-sl-tag--focus {
	background: #FFC845;
	color: #111111;
}

.ryde-sl-tag--energize {
	background: #EE3831;
	color: #ffffff;
}

.ryde-sl-tag--relax {
	background: #6A9EF0;
	color: #ffffff;
}

/* Directions button */
.ryde-sl-btn-directions {
	display: inline-block;
	margin-top: 6px;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: #ffffff;
	background: #111111;
	text-decoration: none;
	line-height: 1.6;
	transition: background 0.15s;
}

.ryde-sl-btn-directions:hover {
	background: #333333;
	color: #ffffff;
	text-decoration: none;
}

/* Distance badge */
.ryde-sl-item-dist {
	flex-shrink: 0;
	font-size: 0.8rem;
	font-weight: 700;
	color: #111111;
	white-space: nowrap;
	padding-top: 2px;
}

/* ==========================================================================
   Google Maps info window
   ========================================================================== */

.ryde-sl-iw {
	font-size: 0.8125rem;
	line-height: 1.5;
	min-width: 160px;
}

.ryde-sl-iw-banner {
	color: #888888;
	font-size: 0.75rem;
}

.ryde-sl-iw a {
	color: #ffffff;
	text-decoration: none;
}

.ryde-sl-iw a:hover {
	text-decoration: none;
}

/* ==========================================================================
   Responsive — tablet & mobile
   ========================================================================== */

@media (max-width: 768px) {
	.ryde-sl-modal {
		padding: 0;
		align-items: flex-end;
	}

	.ryde-sl-container {
		border-radius: 20px 20px 0 0;
		max-height: 96vh;
	}

	.ryde-sl-results-layout {
		flex-direction: column-reverse; /* map on top, list below on mobile */
	}

	.ryde-sl-list {
		width: 100%;
		max-height: 260px;
		border-right: none;
		border-top: 1px solid #e5e5e5;
	}

	.ryde-sl-map {
		min-height: 240px;
		flex: none;
		height: 240px;
	}
}

@media (max-width: 480px) {
	.ryde-sl-header {
		padding: 1rem;
	}

	.ryde-sl-search-bar {
		padding: 0.75rem 1rem;
	}

	.ryde-sl-search-btn {
		padding: 0 0.875rem;
	}
}
