/* CWS ZIP Code Search v1.0
   Colours are custom properties — override them in Elementor's Custom CSS
   (or your theme) without touching the plugin. */

.cws-zip {
	--cws-zip-bg: #343c7a;
	--cws-zip-accent: #c2a3e9;
	--cws-zip-accent-text: #ffffff;
	--cws-zip-text: #ffffff;
	--cws-zip-focus: rgba(217, 159, 255, 0.37);
	--cws-zip-cta: #ffd065;
	--cws-zip-cta-hover: #d99fff;
	--cws-zip-radius: 100px;
	--cws-zip-max: 650px;
	--cws-zip-font: inherit;

	max-width: var(--cws-zip-max);
	margin: 0 auto;
	font-family: var(--cws-zip-font);
}

/* The hidden label relies on a class most themes define — but not all. If the
   theme is missing it, "ZIP code" would render visibly inside the pill. */
.cws-zip .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.cws-zip__bar {
	display: flex;
	align-items: center;
	position: relative;
	padding: 4px;
	background: var(--cws-zip-bg);
	border-radius: var(--cws-zip-radius);
}

/* Themes and Elementor style bare `input[type="text"]` with higher specificity
   than a single class, so these selectors are deliberately specific and the
   visual properties are forced. Without this the input renders with the
   theme's white field background sitting inside the navy pill. */
.cws-zip .cws-zip__bar input.cws-zip__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 53px;
	margin: 0;
	padding: 16px 25px;
	border: none !important;
	border-radius: var(--cws-zip-radius) !important;
	background: var(--cws-zip-bg) !important;
	background-image: none !important;
	color: var(--cws-zip-text) !important;
	caret-color: var(--cws-zip-text);
	box-shadow: none !important;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
}

.cws-zip .cws-zip__bar input.cws-zip__input::placeholder {
	color: var(--cws-zip-text) !important;
	opacity: 0.85;
}

.cws-zip .cws-zip__bar input.cws-zip__input:focus {
	background: var(--cws-zip-focus) !important;
	border: none !important;
	box-shadow: none !important;
	outline: none;
}

/* Chrome paints autofilled fields with its own background. On a field marked
   autocomplete="postal-code" that fires often, so override it the only way
   Chrome allows: a giant inset shadow. */
.cws-zip .cws-zip__bar input.cws-zip__input:-webkit-autofill,
.cws-zip .cws-zip__bar input.cws-zip__input:-webkit-autofill:hover,
.cws-zip .cws-zip__bar input.cws-zip__input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--cws-zip-text);
	-webkit-box-shadow: 0 0 0 1000px var(--cws-zip-bg) inset !important;
	caret-color: var(--cws-zip-text);
	transition: background-color 9999s ease-in-out 0s;
}

.cws-zip .cws-zip__bar button.cws-zip__btn {
	flex: 0 0 auto;
	margin-left: 4px;
	padding: 16px 25px;
	border: 1.5px solid var(--cws-zip-accent) !important;
	border-radius: var(--cws-zip-radius) !important;
	background: var(--cws-zip-accent) !important;
	background-image: none !important;
	color: var(--cws-zip-accent-text) !important;
	box-shadow: none !important;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
}

.cws-zip .cws-zip__bar button.cws-zip__btn:hover {
	background: #fff !important;
	border-color: #fff !important;
	color: var(--cws-zip-accent) !important;
}

.cws-zip .cws-zip__bar button.cws-zip__btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

.cws-zip.is-loading .cws-zip__input {
	opacity: 0.7;
}

.cws-zip__msg {
	margin: 12px 0 0;
	min-height: 1em;
	font-size: 16px;
	line-height: 1.4;
	text-align: center;
}

.cws-zip__msg:empty {
	margin: 0;
	min-height: 0;
}

.cws-zip__msg a {
	color: inherit;
	text-decoration: underline;
	white-space: nowrap;
}

.cws-zip__msg.is-info { opacity: 0.7; }
.cws-zip__msg.is-success { color: #1a7f4b; font-weight: 600; }
.cws-zip__msg.is-warn { color: #8a5b00; font-weight: 600; }
.cws-zip__msg.is-error { color: #b32d2e; font-weight: 600; }

.cws-zip__map {
	display: none;
	width: 100%;
	height: 225px;
	margin-top: 30px;
	border-radius: 10px;
	overflow: hidden;
}

.cws-zip__map.is-visible {
	display: block;
}

/* InfoWindow bubble */
.cws-zip__iw {
	background: var(--cws-zip-bg, #343c7a);
	color: #fff;
	padding: 15px;
	padding-top: 0;
	border-radius: 10px;
	text-align: center;
	max-width: 220px;
	font-size: 16px;
	font-weight: 600;
}

.cws-zip__iw p {
	margin: 0;
	padding-bottom: 10px;
}

.cws-zip__cta {
	display: inline-block;
	background: var(--cws-zip-cta, #ffd065);
	color: var(--cws-zip-bg, #343c7a);
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 100px;
	transition: background 0.3s ease;
}

.cws-zip__cta:hover {
	background: var(--cws-zip-cta-hover, #d99fff);
	color: var(--cws-zip-bg, #343c7a);
}

/* Google's InfoWindow chrome, scoped to maps this plugin created */
.cws-zip__map .gm-style .gm-style-iw-c {
	background: var(--cws-zip-bg, #343c7a) !important;
	border-radius: 10px !important;
	padding: 0 !important;
}

.cws-zip__map .gm-style .gm-style-iw-d {
	overflow: hidden !important;
}

.cws-zip__map .gm-style .gm-style-iw-tc::after {
	background: var(--cws-zip-bg, #343c7a) !important;
}

.cws-zip__map .gm-ui-hoverable .gm-ui-hoverable-close {
	color: #fff !important;
}

.cws-zip__map .gm-style .gm-style-iw-c .gm-style-iw-chr button {
	height: 34px !important;
}

.cws-zip__map .gm-style .gm-style-iw-c .gm-style-iw-chr button > span {
	margin: 4px 12px !important;
	margin-bottom: 0 !important;
	background-color: #fff;
	opacity: 1 !important;
}

@media screen and (max-width: 767px) {
	.cws-zip .cws-zip__bar button.cws-zip__btn {
		font-size: 14px;
		padding: 14px 18px;
	}

	.cws-zip .cws-zip__bar input.cws-zip__input {
		padding-left: 18px;
		padding-right: 10px;
	}
}
