@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

.spl-locator { font-family: 'Hanken Grotesk', system-ui, sans-serif; color: #211C19; box-sizing: border-box; }
.spl-locator *, .spl-locator *::before, .spl-locator *::after { box-sizing: border-box; }
.spl-locator button { font: inherit; }

@keyframes spl-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---- Count shortcode ([sp_locations_count]) ---- */
.spl-count-shortcode { font-family: 'Hanken Grotesk', system-ui, sans-serif; }
.spl-count-shortcode .spl-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(210,59,38,0.10); border: 1px solid rgba(210,59,38,0.28); padding: 5px 12px; border-radius: 999px; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #B22F1C; }
.spl-count-shortcode .spl-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #D23B26; }

/* ---- Shell (mobile-first: stacked column matching DOM order) ---- */
.spl-shell { max-width: 1500px; margin: 0 auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---- Controls ---- */
.spl-controls { padding: 18px; background: #F4F0E8; border: 1px solid rgba(0,0,0,0.08); border-radius: 18px; }

.spl-search { position: relative; }
.spl-search-icon, .spl-search > .spl-svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.spl-search-input { width: 100%; height: 50px; padding: 0 16px 0 42px; border-radius: 13px; border: 1.5px solid rgba(0,0,0,0.1); background: #fff; font-family: 'Hanken Grotesk', sans-serif; font-size: 15px; color: #211C19; outline: none; }
.spl-search-input::placeholder { color: #A89F97; }
.spl-search-input:focus-visible { border-color: #D23B26; box-shadow: 0 0 0 3px rgba(210,59,38,0.18); }

.spl-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.spl-chip { cursor: pointer; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; padding: 9px 15px; border-radius: 999px; transition: background .15s, border-color .15s; border: 1.5px solid rgba(0,0,0,0.14); background: transparent; color: #5A524B; }
.spl-chip.is-active { background: #211C19; color: #F5F1E9; border-color: #211C19; }
.spl-chip:focus-visible { outline: 2px solid #D23B26; outline-offset: 2px; }

.spl-count { margin-top: 14px; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 13px; letter-spacing: 0.03em; text-transform: uppercase; color: #8A817A; }

.spl-search-note { margin-top: 10px; font-size: 13px; line-height: 1.35; color: #B22F1C; }
.spl-search-note[hidden] { display: none; }

.spl-locator button:hover { background: inherit; color: inherit; }

/* ---- List (single-column grid; matches mobile/tablet/desktop) ---- */
.spl-list { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0; }

/* ---- Card ---- */
.spl-card { position: relative; overflow: hidden; background: #fff; border-radius: 18px; border: 1.5px solid rgba(0,0,0,0.08); box-shadow: 0 8px 22px -18px rgba(0,0,0,0.5); transition: border-color .15s, box-shadow .15s, transform .15s; }
.spl-card.is-active { border-color: #D23B26; box-shadow: 0 14px 34px -16px rgba(210,59,38,0.55); transform: translateY(-2px); }
.spl-card.is-active::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 5px; border-radius: 0 5px 5px 0; background: #D23B26; z-index: 1; }

.spl-card-summary { width: 100%; text-align: left; background: none; border: none; padding: 20px 22px 6px; cursor: pointer; display: block; color: inherit; }
.spl-card-summary:focus-visible { outline: 2px solid #D23B26; outline-offset: -3px; border-radius: 16px; }
.spl-card-media { margin: -20px -22px 16px; aspect-ratio: 16 / 9; overflow: hidden; background: #EFEAE0; border-radius: 16px 16px 0 0; }
.spl-card-media img, .spl-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

.spl-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spl-card-name { margin: 0; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 25px; letter-spacing: -0.01em; line-height: 1.02; color: #211C19; text-transform: uppercase; }
.spl-card-newbadge { flex: none; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #7A4E00; background: #F4D27A; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }

.spl-card-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14.5px; line-height: 1.4; color: #3C3631; }
.spl-card-row > .spl-svg { flex: none; margin-top: 2px; }

.spl-hours { display: flex; flex-direction: column; gap: 3px; }
.spl-hours-row { display: flex; gap: 8px; font-size: 14px; line-height: 1.35; }
.spl-hours-label { color: #8A817A; min-width: 108px; }
.spl-hours-value { color: #3C3631; font-weight: 600; }

/* ---- Card actions (stacked, fill width) ---- */
.spl-card-actions { padding: 14px 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.spl-card-actions > a { width: 100%; box-sizing: border-box; }

.spl-card-phone { display: flex; gap: 10px; align-items: center; text-decoration: none; font-size: 14px; color: #3C3631; font-weight: 600; padding: 4px 0 6px; }
.spl-card-phone:focus-visible { outline: 2px solid #D23B26; outline-offset: 2px; border-radius: 6px; }

.spl-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; text-decoration: none; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14.5px; letter-spacing: 0.02em; text-transform: uppercase; transition: background .15s, color .15s, filter .15s; border: 1.5px solid transparent; }
.spl-btn:focus-visible { outline: 2px solid #D23B26; outline-offset: 2px; }
.spl-btn-primary { background: #D23B26; color: #fff; }
.spl-btn-ghost { background: #fff; color: #211C19; border-color: #211C19; height: 44px; font-size: 14px; }

.spl-delivery-header { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #A89F97; }
.spl-delivery-header > span { white-space: nowrap; }
.spl-delivery-rule { flex: 1; height: 1px; background: rgba(0,0,0,0.08); }
.spl-delivery-row { display: flex; gap: 8px; }
.spl-delivery-row > a { flex: 1 1 0; }
.spl-locator .spl-btn-uber { height: 40px; border-radius: 10px; background: #000; color: #EFEAE0; font-weight: 800; font-size: 12.5px; text-transform: none; }
.spl-btn-deliveroo { height: 40px; border-radius: 10px; background: #00CCBC; color: #04302d; font-weight: 800; font-size: 12.5px; text-transform: none; }

/* ---- Hover (only on pointers that actually hover; never sticks on touch) ---- */
@media (hover: hover) {
	.spl-card:hover { border-color: rgba(0,0,0,0.18); box-shadow: 0 14px 30px -18px rgba(0,0,0,0.45); transform: translateY(-2px); }
	.spl-card.is-active:hover { border-color: #D23B26; box-shadow: 0 14px 34px -16px rgba(210,59,38,0.55); }
	.spl-chip:not(.is-active):hover { background: rgba(0,0,0,0.04); border-color: #211C19; }
	.spl-btn-primary:hover { background: #B22F1C; color: #fff; }
	.spl-btn-ghost:hover { background: #211C19; color: #fff; }
	.spl-btn-uber:hover { background: #06C167; color: #000; }
	.spl-btn-deliveroo:hover { filter: brightness(0.94); }
	.spl-mapbtn:hover { filter: brightness(0.96); }
}

/* ---- Empty state ---- */
.spl-empty { padding: 40px 20px; text-align: center; background: #fff; border-radius: 16px; border: 1.5px solid rgba(0,0,0,0.08); }
.spl-empty-title { margin: 0 0 4px; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 17px; color: #211C19; }
.spl-empty-sub { margin: 0; font-size: 14px; color: #8A817A; }

/* ---- Map ---- */
.spl-map-pane { position: relative; min-height: 320px; height: 320px; }
.spl-map { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); background: #e9e5db; }
.leaflet-popup-content { font-family: 'Hanken Grotesk', sans-serif; font-size: 13px; line-height: 1.4; margin: 10px 12px; }
.leaflet-popup-content strong { font-family: 'Archivo', sans-serif; font-size: 14px; letter-spacing: 0.01em; }
.leaflet-container { font-family: 'Hanken Grotesk', sans-serif; background: #e9e5db; }
.spl-pin { background: none; border: none; }

.spl-mapbadge { position: absolute; top: 14px; left: 14px; z-index: 500; display: flex; align-items: center; gap: 8px; background: rgba(20,16,13,0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.1); padding: 8px 13px; border-radius: 999px; pointer-events: none; box-shadow: 0 6px 18px -8px rgba(0,0,0,0.6); }
.spl-mapbadge-text { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.03em; color: #F5F1E9; }

.spl-pulse { position: relative; display: inline-flex; width: 9px; height: 9px; }
.spl-pulse-ping { position: absolute; inset: 0; border-radius: 50%; background: #3B82F6; opacity: 0.45; animation: spl-ping 1.8s cubic-bezier(0,0,0.2,1) infinite; }
.spl-pulse-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

.spl-map-actions { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; gap: 6px; }
.spl-mapbtn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: 'Hanken Grotesk', sans-serif; font-size: 12.5px; font-weight: 600; color: #211C19; background: #F5F1E9; border: 1px solid rgba(0,0,0,0.08); padding: 8px 13px; border-radius: 999px; box-shadow: 0 6px 18px -8px rgba(0,0,0,0.6); transition: filter .15s; }
.spl-mapbtn:focus-visible { outline: 2px solid #D23B26; outline-offset: 2px; }

.spl-user-pin { position: relative; display: block; width: 20px; height: 20px; }
.spl-user-ping { position: absolute; inset: 0; border-radius: 50%; background: #3B82F6; opacity: 0.35; animation: spl-ping 1.8s cubic-bezier(0,0,0.2,1) infinite; }
.spl-user-dot { position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #3B82F6; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(59,130,246,0.4); }

@media (prefers-reduced-motion: reduce) {
	.spl-pulse-ping, .spl-user-ping { animation: none; }
	.spl-card, .spl-btn, .spl-chip, .spl-mapbtn { transition: none; }
}

/* ---- Tablet (>= 768px): two-column grid for cards, taller map ---- */
@media (min-width: 768px) {
	.spl-shell { padding: 0 28px 48px; }
	.spl-list { grid-template-columns: 1fr 1fr; gap: 16px; }
	.spl-map-pane { height: 420px; }
}

/* ---- Desktop (>= 1024px): sidebar + map split via named grid areas ----
   Grid areas position visually without touching DOM order, so tab/SR order
   stays controls -> map -> list. List scrolls within its own cell. */
@media (min-width: 1024px) {
	.spl-shell {
		display: grid;
		grid-template-columns: 430px 1fr;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"controls map"
			"list     map";
		gap: 0;
		padding: 0 40px 56px;
		height: clamp(760px, 88vh, 1080px);
		max-width: 1500px;
	}
	.spl-controls {
		grid-area: controls;
		border: none;
		border-radius: 22px 0 0 0;
		border-bottom: 1px solid rgba(0,0,0,0.07);
		border-top: 1px solid rgba(0,0,0,0.08);
		border-left: 1px solid rgba(0,0,0,0.08);
		padding: 20px 22px 16px;
	}
	.spl-locator .spl-list {
		grid-auto-rows: max-content;   /* rows take content height, never distributed */
		align-content: start;          /* never stretch rows to fill the cell */
	}
	.spl-list {
		grid-area: list;
		padding: 16px 22px 26px;
		background: #F4F0E8;
		border-left: 1px solid rgba(0,0,0,0.08);
		border-bottom: 1px solid rgba(0,0,0,0.08);
		border-radius: 0 0 0 22px;
		overflow-y: auto;
		min-height: 0; /* ponytail: lets the 1fr track constrain the list so it scrolls instead of inflating */
		grid-template-columns: 1fr;
	}
	.spl-map-pane {
		grid-area: map;
		height: auto;
		background: #fff;
		border: 1px solid rgba(0,0,0,0.08);
		border-radius: 0 22px 22px 0;
		padding: 18px;
	}
	.spl-map { inset: 18px; }
}
