/* Farmers Gate Map – front end. Change the colours via these variables in your theme or Pagelayer custom CSS. */
.fgm {
	--fgm-green: #1f4d36;
	--fgm-green-dark: #123222;
	--fgm-green-soft: #e3efe6;
	--fgm-accent: #e3b341;
	--fgm-ink: #1b1f1c;
	--fgm-muted: #4f5a52;
	--fgm-line: #dde3d7;
	--fgm-bg: #f5f7f2;
	--fgm-radius: 14px;
	color: var(--fgm-ink);
	box-sizing: border-box;
}
.fgm *, .fgm *::before, .fgm *::after { box-sizing: inherit; }
.fgm h2, .fgm h3 { margin: 0; line-height: 1.2; }
.fgm-muted { color: var(--fgm-muted); font-size: .9rem; }

/* Buttons */
.fgm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--fgm-green);
	background: var(--fgm-green); color: #fff !important; font-weight: 600; font-size: .95rem;
	text-decoration: none !important; cursor: pointer; line-height: 1.2;
}
.fgm-btn:hover { background: var(--fgm-green-dark); }
.fgm-btn:focus-visible, .fgm-chip:focus-visible, .fgm-locate:focus-visible, .fgm-result__select:focus-visible { outline: 3px solid var(--fgm-accent); outline-offset: 2px; }
.fgm-btn--ghost { background: #fff; color: var(--fgm-ink) !important; border-color: #c9d1c4; }
.fgm-btn--ghost:hover { background: var(--fgm-bg); }
.fgm-btn--accent { background: var(--fgm-accent); border-color: var(--fgm-accent); color: var(--fgm-ink) !important; }
.fgm-btn--accent:hover { background: #d4a32f; }
.fgm-btn--small { min-height: 40px; padding: 0 14px; font-size: .875rem; }
.fgm-btn--disabled { background: #eef0ec; border-color: #eef0ec; color: var(--fgm-muted) !important; cursor: default; }
.fgm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tags & status */
.fgm-tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef0ec; color: var(--fgm-muted); white-space: nowrap; }
.fgm-tag--live { background: var(--fgm-green-soft); color: var(--fgm-green); }
.fgm-status { font-weight: 600; color: var(--fgm-muted); }
.fgm-status.is-open { color: #1f6b3a; }

/* Search band */
.fgm-search { background: var(--fgm-green); color: #fff; border-radius: var(--fgm-radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.fgm-search__title { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.01em; }
.fgm-search__form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0; }
.fgm-search__field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }
.fgm-search__field--wide { flex: 2 1 300px; }
.fgm-search__field label { font-size: .8rem; font-weight: 600; color: #dce8df; }
.fgm-search__field input { height: 50px; border-radius: 10px; border: 0; padding: 0 14px; font-size: 1rem; color: var(--fgm-ink); background: #fff; width: 100%; margin: 0; }
.fgm-search__near { display: flex; gap: 6px; }
.fgm-locate { flex: 0 0 50px; height: 50px; border-radius: 10px; border: 0; background: #fff; color: var(--fgm-green); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.fgm-search__form .fgm-btn { height: 50px; padding: 0 26px; }
.fgm-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fgm-chips__sep { width: 1px; height: 26px; background: rgba(255,255,255,.3); margin: 0 4px; }
.fgm-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; font-weight: 500; font-size: .9rem; cursor: pointer; }
.fgm-chip[aria-pressed="true"] { background: var(--fgm-accent); border-color: var(--fgm-accent); color: var(--fgm-ink); }

/* Results + map */
.fgm-body { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; align-items: flex-start; }
.fgm-results { flex: 1 1 360px; min-width: 0; }
.fgm-mapbox { flex: 999 1 520px; min-width: 0; position: relative; }
.fgm-results__count { font-weight: 700; font-size: 1.1rem; margin: 0 0 12px; }
.fgm-results__list { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 12px; max-height: 720px; overflow-y: auto; position: relative; }
.fgm-result { margin: 0; }
.fgm-result__card { background: #fff; border: 1px solid var(--fgm-line); border-radius: var(--fgm-radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.fgm-result__card.is-selected { border-color: var(--fgm-green); box-shadow: 0 0 0 2px var(--fgm-green); }
.fgm-result__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fgm-result__head > div { display: flex; flex-direction: column; gap: 2px; }
.fgm-result__name { font-size: 1.1rem; }
.fgm-result__select { all: unset; cursor: pointer; font-weight: 700; color: var(--fgm-ink); }
.fgm-result__select:hover { text-decoration: underline; }
.fgm-result__sells { margin: 0; }
.fgm-result__info { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--fgm-muted); }
.fgm-empty { padding: 20px; background: #fff; border: 1px dashed #c9d1c4; border-radius: var(--fgm-radius); color: var(--fgm-muted); }
.fgm.is-loading .fgm-results__list { opacity: .5; }
.fgm-map { width: 100%; border-radius: var(--fgm-radius); border: 1px solid var(--fgm-line); overflow: hidden; z-index: 0; }
.fgm-legend { position: absolute; left: 12px; bottom: 28px; z-index: 500; background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 6px; font-size: .8rem; }
.fgm-legend span { display: flex; align-items: center; gap: 8px; }
.fgm-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.fgm-dot--live { background: var(--fgm-green); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--fgm-green); }
.fgm-dot--basic { background: #fff; border: 2px solid var(--fgm-green); }

/* Pins (Leaflet divIcons) */
.fgm-pin { border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: flex !important; align-items: center; justify-content: center; }
.fgm-pin--live { background: var(--fgm-green, #1f4d36); border: 3px solid #fff; }
.fgm-pin--basic { background: #fff; border: 3px solid var(--fgm-green, #1f4d36); }
.fgm-pin--sel { background: var(--fgm-accent, #e3b341); border: 3px solid var(--fgm-ink, #1b1f1c); }
.fgm-pin__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.fgm-pin--basic .fgm-pin__dot { background: var(--fgm-green, #1f4d36); }
.fgm-pin--sel .fgm-pin__dot { background: var(--fgm-ink, #1b1f1c); }
.fgm-pin:focus-visible { outline: 3px solid var(--fgm-accent, #e3b341); outline-offset: 2px; }
.fgm-popup { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.fgm-popup strong { font-size: 1rem; }
.fgm-popup a { font-weight: 600; color: #1f4d36; }

/* Listing page */
.fgm-listing { display: flex; flex-direction: column; gap: 24px; }
.fgm-back { font-weight: 600; text-decoration: none; color: var(--fgm-green); }
.fgm-listing__head { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.fgm-listing__head p { margin: 0; }
.fgm-listing__town { font-size: 1.05rem; color: var(--fgm-muted); }
.fgm-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fgm-badges li { font-size: .85rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: #eef3ea; color: var(--fgm-green); margin: 0; }
.fgm-owner a { font-weight: 600; color: var(--fgm-green); }
.fgm-card { background: #fff; border: 1px solid var(--fgm-line); border-radius: var(--fgm-radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.fgm-card h2 { font-size: 1.35rem; font-weight: 800; }
.fgm-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.fgm-cols { display: flex; flex-wrap: wrap; gap: 24px; }
.fgm-cols > .fgm-card { flex: 1 1 300px; }
.fgm-products { list-style: none; margin: 0; padding: 0; }
.fgm-product { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 0; border-top: 1px solid #eef0ec; margin: 0; }
.fgm-product__name { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.fgm-product__name a { color: var(--fgm-ink); text-decoration: none; }
.fgm-product__name small { font-weight: 400; color: var(--fgm-muted); font-size: .85rem; }
.fgm-product__price { min-width: 72px; text-align: right; font-weight: 600; }
.fgm-stock { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.fgm-stock--in { background: var(--fgm-green-soft); color: var(--fgm-green); }
.fgm-stock--low { background: #fbefd0; color: #6b4a00; }
.fgm-stock--out { background: #eef0ec; color: var(--fgm-muted); }
.fgm-hours { border-collapse: collapse; width: 100%; margin: 0; }
.fgm-hours th, .fgm-hours td { text-align: left; padding: 5px 0; border: 0; font-weight: 400; background: none; }
.fgm-hours td { text-align: right; }
.fgm-findus { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; }
.fgm-findus > div:last-child { flex: 1 1 240px; }
.fgm-findus p { margin: 0 0 6px; }
.fgm-findus__map { flex: 1 1 280px; height: 200px; border-radius: 12px; overflow: hidden; z-index: 0; }
.fgm-claim { background: var(--fgm-green); color: #fff; border-radius: var(--fgm-radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.fgm-claim h2 { color: #fff; font-size: 1.6rem; font-weight: 800; }
.fgm-claim p { margin: 0; color: #e4eee7; }
.fgm-claim__small { font-size: .85rem; }
.fgm-report summary { cursor: pointer; color: var(--fgm-muted); font-size: .95rem; }
.fgm-report__form { display: flex; flex-direction: column; gap: 6px; max-width: 520px; margin-top: 12px; }
.fgm-report__form label { font-weight: 600; font-size: .9rem; }
.fgm-report__form textarea, .fgm-report__form input { border: 1px solid #c9d1c4; border-radius: 8px; padding: 10px; font: inherit; }
.fgm-report__form .fgm-btn { align-self: flex-start; margin-top: 6px; }
.fgm-hp { position: absolute !important; left: -9999px; }
.fgm .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Stock manager */
.fgm-stockmgr { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.fgm-stockmgr__intro { margin: 0; color: var(--fgm-muted); }
.fgm-stockrow { background: #fff; border: 1px solid var(--fgm-line); border-radius: var(--fgm-radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.fgm-stockrow__name { font-weight: 700; font-size: 1.05rem; }
.fgm-stockrow__fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.fgm-stockrow__fields label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--fgm-muted); }
.fgm-stockrow__fields input[type="number"] { width: 120px; height: 48px; border: 1px solid #c9d1c4; border-radius: 10px; padding: 0 12px; font-size: 1.05rem; }
.fgm-stepper { display: flex; gap: 6px; align-items: center; }
.fgm-stepper button { width: 48px; height: 48px; border-radius: 10px; border: 1px solid #c9d1c4; background: #fff; font-size: 1.4rem; font-weight: 600; cursor: pointer; color: var(--fgm-ink); }
.fgm-stepper input[type="number"] { width: 80px !important; text-align: center; }
.fgm-soldout { flex-direction: row !important; align-items: center; gap: 8px !important; min-height: 48px; font-size: .95rem !important; color: var(--fgm-ink) !important; }
.fgm-soldout input { width: 22px; height: 22px; }
.fgm-stockrow__save { display: flex; align-items: center; gap: 12px; }
.fgm-stockrow__msg { font-size: .9rem; font-weight: 600; color: #1f6b3a; }
.fgm-stockrow__msg.is-error { color: #a1260d; }
.fgm-stockrow.is-soldout { background: var(--fgm-bg); }

@media (max-width: 600px) {
	.fgm-search { padding: 20px; border-radius: 0; }
	.fgm-results__list { max-height: none; }
	.fgm-mapbox { order: -1; }
	.fgm-map { height: 360px !important; }
}

/* Sign-up and contact forms */
.fgm-form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.fgm-form fieldset { border: 1px solid var(--fgm-line); border-radius: var(--fgm-radius); padding: 20px 22px 8px; margin: 0; background: #fff; }
.fgm-form legend { font-weight: 700; font-size: 1.1rem; color: var(--fgm-green); padding: 0 6px; }
.fgm-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.fgm-form__field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.fgm-form__field label { font-weight: 600; font-size: .95rem; }
.fgm-form__field input, .fgm-form__field textarea { width: 100%; border: 1px solid #c9d1c4; border-radius: 10px; padding: 11px 14px; font: inherit; min-height: 48px; background: #fff; color: var(--fgm-ink); }
.fgm-form__checks { border: 0 !important; padding: 0 !important; margin: 0 0 16px !important; display: flex; flex-wrap: wrap; gap: 10px 22px; background: none !important; }
.fgm-form__checks legend { font-size: .95rem; font-weight: 600; color: var(--fgm-ink); padding: 0; margin-bottom: 8px; }
.fgm-form__checks label, .fgm-form__check label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.fgm-form__checks input, .fgm-form__check input { width: 20px; height: 20px; accent-color: var(--fgm-green); }
.fgm-form__check { margin: 0 0 16px; }
.fgm-form__note { background: var(--fgm-green-soft); color: var(--fgm-green); border-radius: 10px; padding: 12px 16px; margin: 0; font-weight: 600; }
.fgm-form__privacy { margin: 0; }
.fgm-form .fgm-btn { align-self: flex-start; min-height: 52px; padding: 0 28px; font-size: 1rem; }
.fgm-form__errors { background: #fdecea; border: 1px solid #f3b8b0; color: #7a1d10; border-radius: 10px; padding: 14px 18px; }
.fgm-form__errors p, .fgm-form__errors ul { margin: 0; }
.fgm-form__errors ul { padding-left: 20px; margin-top: 6px; }
.fgm-form--done { background: var(--fgm-green-soft); border-radius: var(--fgm-radius); padding: 28px; }
.fgm-form--done h2 { color: var(--fgm-green); margin: 0 0 8px; }
.fgm-form--done p { margin: 0; }

.fgm-lost { margin: 0; font-size: .95rem; }
.fg-content > .fgm-stockmgr { max-width: 760px; }
.fgm-stockmgr #loginform p { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.fgm-stockmgr #loginform .login-remember { flex-direction: row; align-items: center; }
.fgm-stockmgr #loginform input[type="text"], .fgm-stockmgr #loginform input[type="password"] { max-width: 420px; }
.fgm-stockmgr #loginform input[type="submit"] { align-self: flex-start; min-height: 48px; padding: 0 26px; border-radius: 10px; border: 0; background: var(--fgm-green); color: #fff; font-weight: 600; cursor: pointer; }
