/**
 * Store Locator Styles
 *
 * @package HelloBiz
 */

.store-locator-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Search Section */
.store-locator-search {
	margin-bottom: 20px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.search-input-wrapper {
	flex: 1;
	min-width: 300px;
	display: flex;
	gap: 10px;
}

#store-search-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.3s;
}

#store-search-input:focus {
	outline: none;
	border-color: #4D71D9;
}

.search-btn,
.geolocation-btn {
	padding: 12px 24px;
	background-color: #4D71D9;
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s;
	white-space: nowrap;
}

.search-btn:hover,
.geolocation-btn:hover {
	background-color: #3a5bb8;
	color: #fff;
}

.geolocation-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background-color: #AB5BF7;
}

.geolocation-btn:hover {
	background-color: #9345d6;
	color: #fff;
}

.geolocation-btn svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.geolocation-btn.loading {
	opacity: 0.7;
	cursor: wait;
}

/* Content Section */
.store-locator-content {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 20px;
	min-height: 600px;
}

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

/* Map Section */
.store-locator-map {
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#store-locator-map {
	width: 100%;
	height: 600px;
	min-height: 400px;
}

/* List Section */
.store-locator-list {
	background: #fff;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.store-locator-list h3 {
	margin: 0 0 20px 0;
	padding: 0;
	font-size: 20px;
	color: #565F71;
	border-bottom: 2px solid #4D71D9;
	padding-bottom: 10px;
}

#stores-list {
	flex: 1;
	overflow-y: auto;
	max-height: 540px;
}

#stores-list::-webkit-scrollbar {
	width: 8px;
}

#stores-list::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

#stores-list::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

#stores-list::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Store Item */
.store-item {
	display: flex;
	gap: 15px;
	padding: 15px;
	margin-bottom: 15px;
	border: 1px solid #e0e0e0;
	border-left: 4px solid #4D71D9;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
	background: #fff;
}

.store-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.store-item.active {
	background-color: #f0f4ff;
	border-left-color: #AB5BF7;
	box-shadow: 0 2px 8px rgba(171, 91, 247, 0.2);
}

.store-number {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	background-color: #4D71D9;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 14px;
}

.store-details {
	flex: 1;
}

.store-details h4 {
	margin: 0 0 8px 0;
	font-size: 16px;
	color: #565F71;
	display: flex;
	align-items: center;
	gap: 10px;
}

.store-details p {
	margin: 4px 0;
	font-size: 14px;
	color: #666;
}

.store-address {
	color: #565F71 !important;
	font-weight: 500;
}

.store-distance {
	background-color: #AB5BF7;
	color: white;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.store-details a {
	color: #4D71D9;
	text-decoration: none;
}

.store-details a:hover {
	text-decoration: underline;
}

/* Contact Icons */
.contact-icons {
	display: flex;
	gap: 12px;
	margin-top: 12px;
	align-items: center;
}

.contact-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: #f5f7fa;
	color: #4D71D9;
	transition: all 0.3s ease;
	text-decoration: none !important;
	position: relative;
}

.contact-icon:hover {
	background-color: #4D71D9;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(77, 113, 217, 0.2);
}

.contact-icon:hover svg {
	color: #fff;
}

.contact-icon svg {
	width: 20px;
	height: 20px;
}

/* MUI-style Tooltips */
.contact-icon-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) scale(0.9);
	background-color: rgba(97, 97, 97, 0.95);
	color: #fff;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1000;
	box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

.contact-icon-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 4px solid transparent;
	border-top-color: rgba(97, 97, 97, 0.95);
}

.contact-icon:hover .contact-icon-tooltip {
	opacity: 1;
	transform: translateX(-50%) scale(1);
}

/* Info Window specific styles */
.store-info-window .contact-icons {
	margin-top: 8px;
	gap: 8px;
}

.store-info-window .contact-icon {
	width: 32px;
	height: 32px;
}

.store-info-window .contact-icon svg {
	width: 18px;
	height: 18px;
}

.directions-btn {
	display: inline-block;
	margin-top: 8px;
	padding: 6px 12px;
	background-color: #4D71D9;
	color: white !important;
	border-radius: 4px;
	font-size: 13px;
	text-decoration: none !important;
	transition: background-color 0.3s;
}

.directions-btn:hover {
	background-color: #3a5bb8;
	color: #fff !important;
}

/* No stores message */
.no-stores {
	text-align: center;
	color: #999;
	padding: 40px 20px;
	font-size: 16px;
}

/* Info Window */
.store-info-window {
	padding: 10px;
	max-width: 300px;
}

.store-info-window h3 {
	margin: 0 0 10px 0;
	font-size: 18px;
	color: #333;
}

.store-info-window p {
	margin: 5px 0;
	font-size: 14px;
	color: #666;
}

.store-info-window a {
	color: #0066cc;
	text-decoration: none;
}

.store-info-window a:hover {
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
	.store-locator-search {
		flex-direction: column;
	}

	.search-input-wrapper {
		width: 100%;
		min-width: 100%;
	}

	#store-search-input,
	.search-btn,
	.geolocation-btn {
		width: 100%;
	}

	.search-input-wrapper {
		flex-direction: column;
	}

	#store-locator-map {
		height: 400px;
	}

	.store-locator-content {
		gap: 15px;
	}

	.store-item {
		padding: 12px;
	}

	.store-details h4 {
		font-size: 15px;
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Loading state */
@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.loading::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 0.6s linear infinite;
	margin-left: 8px;
}
