/* Andersens store finder (v1.5) — styled to the "Where to find us" Figma.
   Deploy to child theme css/store-finder.css.
   Swap --asf-serif when the redesign's brand font is confirmed (Prata is a placeholder). */

/* Hoisted to :root so the Elementor wrappers around the widget can use it too
   (see the gap-fill rule below). Kept off `.asf` deliberately: a rule guarded by
   :has() would fail to parse on a browser without :has() support, taking the
   band's own background down with it. */
:root { --asf-cream: #f4f2ea; }

.asf {
	--asf-green: #14683e;
	--asf-green-dark: #0f5230;
	--asf-mint: #82dba4;
	--asf-gold: #d9973b;
	--asf-ink: #3a3a3a;
	--asf-line: #e6e2d6;
	--asf-field: #f4f4f2;
	--asf-serif: 'Prata', Georgia, 'Times New Roman', serif;

	/* Full-bleed cream band — escapes the boxed Elementor container.
	   --asf-vw is set by store-finder.js to the real viewport width
	   (clientWidth, i.e. minus scrollbar) so the bleed never overshoots
	   and clips the right edge; 100vw is only the pre-JS fallback. */
	width: var(--asf-vw, 100vw);
	margin-left: calc(50% - (var(--asf-vw, 100vw) / 2));
	background: var(--asf-cream);
	color: var(--asf-ink);
	font-size: 15px;
	line-height: 1.5;
	text-align: left; /* theme centres text at mobile widths — Figma is left-aligned */
}

/* The 100vw breakout can add ~15px of horizontal scroll on scrollbar-ed
   viewports unless the page clips it. */
body:has(.asf) { overflow-x: clip; }

/* Page 139 wraps the shortcode in two nested Elementor columns, each of which
   gets the default `.elementor-element-populated { padding: 10px }`. The .asf
   breakout is horizontal only, so that padding rendered as a 20px white strip
   above and below the cream band. Painting the outermost containing section
   cream fills it — every wrapper in between sits inside that section, so this
   holds regardless of how many levels Elementor nests or what the padding is.
   Scoped by :has(.asf), so it only ever applies where the locator is embedded. */
.elementor-section:has(.asf) { background-color: var(--asf-cream); }

.asf-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 44px 30px 90px;
}

.asf-layout {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 36px;
	align-items: start;
}

/* Sidebar */
.asf-side-card {
	background: #fff;
	border-radius: 16px;
	padding: 26px 24px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	position: sticky;
	top: 20px;
}
.asf-side-title {
	font-family: var(--asf-serif);
	font-weight: 400;
	font-size: 30px;
	line-height: 1.15;
	color: var(--asf-green);
	margin: 0 0 14px;
}
.asf-side-title em { font-style: normal; color: var(--asf-mint); display: block; }
.asf-side-text { margin: 0 0 18px; color: #555; }

/* Filter block (options are mocked until real store data exists) */
.asf-filter { margin: 0 0 18px; }
.asf-filter-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--asf-green);
	padding: 0 0 7px;
	margin: 0 0 12px;
	color: var(--asf-green);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
}
.asf-filter-head span { font-size: 15px; font-weight: 400; line-height: 1; }
.asf-filter[data-collapsed="1"] .asf-filter-body { display: none; }
/* Theme/Elementor form styles set fixed heights + line-heights on selects
   that clip the option text — pin every metric so they can't. */
.asf .asf-filter select {
	display: block;
	width: 100% !important;
	height: 44px !important;
	min-height: 44px !important;
	max-height: none !important;
	line-height: 1.3 !important;
	margin: 0 0 10px !important;
	padding: 0 34px 0 12px !important;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	background-color: var(--asf-field) !important;
	color: #444 !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-indent: 0 !important;
	box-shadow: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23444' stroke-width='1.5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 11px 7px !important;
	cursor: pointer;
}
.asf .asf-filter select option {
	font-size: 14px;
	text-transform: none;
	color: #444;
}

.asf-search { position: relative; }
.asf-input-wrap {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--asf-green);
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
}
.asf-input-wrap input {
	flex: 1;
	border: 0;
	outline: none;
	padding: 13px 14px;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--asf-green);
	background: transparent;
	min-width: 0;
}
.asf-input-wrap input::placeholder { color: var(--asf-green); opacity: 0.85; }
.asf-search-btn {
	border: 0;
	background: transparent;
	color: var(--asf-green);
	padding: 10px 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
}

.asf-suggestions {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--asf-line);
	border-radius: 10px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	max-height: 320px;
	overflow-y: auto;
}
.asf-suggestions li { padding: 10px 14px; cursor: pointer; }
.asf-suggestions li:hover, .asf-suggestions li.asf-active { background: var(--asf-cream); }

.asf-result { margin-top: 16px; }
.asf-pick-label { margin: 0 0 8px; font-weight: 600; }
.asf-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.asf-pick button {
	padding: 7px 12px;
	border: 1px solid var(--asf-green);
	border-radius: 999px;
	background: #fff;
	color: var(--asf-green);
	cursor: pointer;
	font-size: 13px;
}
.asf-pick button:hover { background: var(--asf-green); color: #fff; }

.asf-miss h3 { font-family: var(--asf-serif); font-weight: 400; color: var(--asf-green); margin: 0 0 8px; font-size: 20px; }
.asf-miss p { margin: 0 0 10px; }

/* State pills */
.asf-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.asf-pill {
	border: 1.5px solid var(--asf-gold);
	background: transparent;
	color: var(--asf-gold);
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}
.asf-pill-on, .asf-pill:hover { background: var(--asf-gold); color: #fff; }

/* Result banner */
.asf-banner-text { margin: 0 0 14px; font-size: 16px; }
.asf-reset {
	border: 0;
	background: none;
	color: var(--asf-green);
	text-decoration: underline;
	cursor: pointer;
	font-size: 14px;
	margin-left: 10px;
	padding: 0;
}

/* Sidebar copy of the reset, under the search field — the banner version
   scrolls out of view on mobile once the result cards fill the screen.
   Shown only while a search is active; [hidden] handles the rest. */
.asf-side-reset {
	margin: 12px 0 0;
	text-align: left;
}
.asf-side-reset .asf-reset {
	margin-left: 0;
}
.asf-side-reset[hidden] {
	display: none;
}

/* Page header (replaces the old Elementor heading + intro) */
.asf-hero { text-align: center; margin: 8px 0 40px; }
.asf-eyebrow {
	color: var(--asf-gold);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	margin: 0 0 10px;
}
.asf-hero-title {
	font-family: var(--asf-serif);
	font-weight: 400;
	font-size: clamp(40px, 6vw, 64px);
	line-height: 1.05;
	color: var(--asf-green);
	margin: 0;
}
.asf-hero-title em { font-style: normal; color: var(--asf-mint); }

/* Card grid — 3 across on desktop to match the design */
.asf-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
@media (max-width: 1023px) { .asf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .asf-grid { grid-template-columns: 1fr; } }
.asf-card {
	background: #fff;
	border-radius: 16px;
	padding: 12px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.asf-card-hit { outline: 2px solid var(--asf-green); }
.asf-card-map {
	width: 100%;
	height: 170px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}
.asf-card-body { padding: 14px 10px 8px; }
.asf-card-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 8px;
}
.asf-card-name {
	font-family: var(--asf-serif);
	font-weight: 400;
	font-size: 24px;
	color: var(--asf-green);
	margin: 0;
}
.asf-card-dist {
	color: var(--asf-gold);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	white-space: nowrap;
}
.asf-card-addr { margin: 0 0 10px; }
.asf-card-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	color: var(--asf-green);
	overflow-wrap: anywhere;
}
.asf-card-row a { color: var(--asf-green); text-decoration: underline; font-weight: 600; }
.asf-card-cta {
	margin: 14px 0 6px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

/* Secondary to the "Store page" pill — the store page is the conversion path,
   directions are for customers who have already chosen. */
.asf-card-dir {
	color: var(--asf-green);
	font-weight: 600;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.asf-card-dir:hover { color: var(--asf-green-dark); }

.asf-empty {
	background: #fff;
	border-radius: 16px;
	padding: 30px;
	text-align: center;
	color: #555;
}

.asf-pill-link {
	display: inline-block;
	border: 1.5px solid var(--asf-green);
	border-radius: 999px;
	padding: 8px 20px;
	color: var(--asf-green);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	background: #fff;
}
.asf-pill-link:hover { background: var(--asf-green); color: #fff; }

.asf-attrib { margin: 16px 0 0; font-size: 11px; color: #999; }

/* The theme centres headings/paragraphs at mobile widths — Figma is
   left-aligned everywhere except the desktop hero, so pin each element. */
.asf .asf-side-title,
.asf .asf-side-text,
.asf .asf-card-addr,
.asf .asf-card-name,
.asf .asf-pick-label,
.asf .asf-banner-text,
.asf .asf-miss h3,
.asf .asf-miss p {
	text-align: left !important;
}

@media (max-width: 900px) {
	.asf-inner { padding: 32px 18px 60px; }
	.asf-layout { grid-template-columns: 1fr; gap: 24px; }
	.asf-side-card { position: static; }
}

/* Mobile — match the Figma mobile frames (393px design width) */
@media (max-width: 767px) {
	.asf-inner { padding: 20px 16px 56px; }
	.asf-hero { text-align: left; margin: 0 0 22px; }
	.asf-hero-title { font-size: 36px; }
	.asf-eyebrow { font-size: 11px; margin: 0 0 8px; }
	.asf-side-card { padding: 22px 18px; }
	.asf-pill { padding: 6px 14px; font-size: 11px; }
	.asf-pills { gap: 8px; margin: 0 0 14px; }
	.asf-card-map { height: 190px; }
}
