/**
 * Store Locator Frontend Styles
 */

.store-locator-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem;
}

.store-locator-title {
	font-size: 2rem;
	margin-bottom: 1.5rem;
	color: #333;
	text-align: center;
}

.store-locator-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: end;
}

.store-locator-field {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 200px;
}

.store-locator-field:last-child {
	flex-basis: 100%;
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.store-locator-field label {
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #555;
	font-size: 0.9rem;
}

.store-locator-select {
	padding: 0.5rem 2rem 0.5rem 0;
	border: none;
	border-bottom: 1px solid #ddd;
	border-radius: 0;
	font-size: 1rem;
	background: transparent;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right center;
	background-size: 12px 8px;
	cursor: pointer;
	transition: border-color 0.3s ease;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	position: relative;
	z-index: 1;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	width: 100%;
	min-height: 44px; /* Minimum touch target size for mobile */
}

.store-locator-select:focus {
	outline: none;
	border-bottom-color: #333;
}

.store-locator-select:disabled {
	background-color: transparent;
	cursor: not-allowed;
	opacity: 0.6;
	pointer-events: none;
}

.store-locator-select:not(:disabled) {
	pointer-events: auto;
	cursor: pointer;
}

.store-locator-submit {
	padding: 12px 32px;
	background-color: #9A0056 !important;
	color: #ffffff !important;
	border: none;
	border-radius: 10px !important;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease-in-out;
	white-space: nowrap;
	display: inline-block;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
  min-width: 150px;
}

.store-locator-submit:hover {
	background-color: #7d0047;
}

.store-locator-submit:active {
	transform: translateY(1px);
}

.store-locator-loading {
	text-align: center;
	padding: 2rem;
	font-size: 1.1rem;
	color: #666;
}

.store-locator-results {
	margin-top: 2rem;
}

.store-locator-no-results {
	text-align: center;
	padding: 2rem;
	font-size: 1.1rem;
	color: #666;
	background: #f9f9f9;
	border-radius: 8px;
}

.store-locator-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ========== Card styling matching the design ========== */
.store-card {
	background: #FFF9F6;
	border: 1px solid #E0D5D0;
	border-radius: 12px;
	box-shadow: none;
	overflow: visible;
	transition: none;
	flex-shrink: 0;
	min-width: 280px;
}

.store-card:hover {
	transform: none;
	box-shadow: none;
	border-color: #D0C5C0;
}

.store-card-image {
	display: none;
}

.store-card-content {
	padding: 16px 18px;
}

.store-card-title {
	font-size: 18px;
	line-height: 1.3;
	margin: 0 0 12px 0;
	color: #1f1f1f;
	font-weight: 600;
}

/* Store card line with icon and text */
.store-card-line {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 8px 0;
	color: #5A5A5A;
	line-height: 1.5;
}

.store-icon {
	width: 16px;
	min-width: 16px;
	height: 16px;
	margin-top: 2px;
	color: #6B6B6B;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.store-icon svg {
	width: 100%;
	height: 100%;
}

.store-text {
	flex: 1;
	font-size: 14px;
	color: #5A5A5A;
	line-height: 1.5;
}

/* Phone links in pink/magenta */
.store-card-phone a,
.store-card a[href^="tel:"] {
	color: #9A0056;
	text-decoration: none;
	font-weight: 500;
}

.store-card-phone a:hover,
.store-card a[href^="tel:"]:hover {
	text-decoration: underline;
}

/* Grid container for results */
#store-locator-results {
	display: block;
	width: 100%;
}


/* Responsive */
@media (max-width: 768px) {
	.store-locator-wrapper {
		padding: 1rem;
	}

	.store-locator-fields {
		grid-template-columns: 1fr;
	}

	.store-locator-cards {
		display: flex;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		gap: 1rem;
		padding-bottom: 10px;
		scrollbar-width: thin;
	}

	.store-locator-cards::-webkit-scrollbar {
		height: 6px;
	}

	.store-locator-cards::-webkit-scrollbar-track {
		background: #f1f1f1;
		border-radius: 10px;
	}

	.store-locator-cards::-webkit-scrollbar-thumb {
		background: #9A0056;
		border-radius: 10px;
	}

	.store-card {
		scroll-snap-align: start;
		flex: 0 0 85%;
		max-width: 85%;
		min-width: 85%;
	}

	.store-locator-title {
		font-size: 1.5rem;
	}

	.store-locator-field {
		min-width: 100%;
		position: relative;
		z-index: 1;
	}

	/* Mobile-specific fixes for select dropdowns */
	.store-locator-select {
		min-height: 44px;
		padding: 0.75rem 1rem 0.75rem 0.5rem;
		font-size: 16px; /* Prevents zoom on iOS */
		position: relative;
		z-index: 10;
		background-color: #fff;
		width: 100%;
		box-sizing: border-box;
		/* Remove custom arrow on mobile, use native */
		background-image: none;
		/* Use native dropdown on mobile for better compatibility */
		-webkit-appearance: menulist;
		-moz-appearance: menulist;
		appearance: menulist;
		/* Ensure enabled selects are clickable */
		pointer-events: auto;
		touch-action: manipulation;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
	}

	/* Explicitly enable pointer events for non-disabled selects on mobile */
	.store-locator-select:not(:disabled) {
		pointer-events: auto;
		cursor: pointer;
		opacity: 1;
	}

	.store-locator-select:disabled {
		pointer-events: none;
		opacity: 0.6;
	}

	/* Ensure the select is above other elements */
	.store-locator-field {
		z-index: 1;
	}

	.store-locator-field:focus-within {
		z-index: 10;
	}
}

/* Additional mobile fixes for iOS Safari */
@supports (-webkit-touch-callout: none) {
	.store-locator-select {
		-webkit-appearance: menulist;
		appearance: menulist;
		background-image: none;
	}
}


