/*
 * Coastal Supply — header "Find store near me" widget.
 *
 * Subtle inline layout that blends into the header. Two text-link options
 * in idle state; small floating popup for postcode entry; plain label + link
 * once a store is resolved.
 */

.coastal-nearest-store {
	position: relative;
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.3;
	color: #4b5563;
}

/* Location-arrow icon shown in idle state */
.coastal-nearest-store__find-icon {
	display: inline-block;
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	color: #2c2c75;
	vertical-align: middle;
}

/* Muted label text ("Nearest location:", "Find your store:") */
.coastal-nearest-store__label {
	color: #4b5563;
}

/* Clickable store address */
.coastal-nearest-store__address {
	color: #1f2937;
	font-weight: 600;
	text-decoration: none;
}

.coastal-nearest-store__address:hover,
.coastal-nearest-store__address:focus-visible {
	color: #2c2c75;
	text-decoration: underline;
	outline: none;
}

/* Text-link buttons (use my location, enter postcode, Change) */
.coastal-nearest-store__link {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	font-family: inherit !important;
	font-size: inherit !important;
	color: #2c2c75 !important;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 2px;
}

.coastal-nearest-store__link:hover,
.coastal-nearest-store__link:focus-visible {
	background: none !important;
	color: #1f1f5a !important;
	text-decoration-style: solid;
	outline: none;
}

/* Inline error message */
.coastal-nearest-store__error {
	color: #b91c1c;
	font-size: 12px;
}

/* Spinning icon while locating */
.coastal-nearest-store--busy .coastal-nearest-store__find-icon {
	animation: csns-spin 900ms linear infinite;
}

@keyframes csns-spin {
	from { transform: rotate( 0deg ); }
	to   { transform: rotate( 360deg ); }
}

/* ---- Postcode popup ---- */

.coastal-nearest-store__popup {
	position: absolute;
	top: calc( 100% + 8px );
	left: 0;
	z-index: 9999;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.12 );
	padding: 14px 14px 12px;
	min-width: 260px;
}

.coastal-nearest-store__popup-close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: none;
	color: #9ca3af;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

.coastal-nearest-store__popup-close:hover {
	color: #4b5563;
}

.coastal-nearest-store__popup-label {
	margin: 0 0 8px;
	font-size: 12px;
	color: #6b7280;
	font-weight: 500;
}

.coastal-nearest-store__popup-row {
	display: flex;
	gap: 6px;
}

.coastal-nearest-store__popup-input {
	flex: 1;
	min-width: 0;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
	color: #1f2937;
	outline: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.coastal-nearest-store__popup-input:focus {
	border-color: #2c2c75;
	box-shadow: 0 0 0 2px rgba( 44, 44, 117, 0.1 );
}

.coastal-nearest-store__popup-submit {
	padding: 7px 14px;
	background: #2c2c75;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 120ms ease;
}

.coastal-nearest-store__popup-submit:hover {
	background: #565691;
}

.coastal-nearest-store__popup-submit:disabled {
	opacity: 0.7;
	cursor: progress;
}
