// Areas We Serve — Mobile Accordion Fix
add_action('wp_head', function() {
    echo '<style>
/* ---- Areas We Serve mobile fix ---- */
.ernies-areas-section { background:#0B1B2B; }

/* County tabs container — horizontal scroll on mobile */
.ernies-county-tabs {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0;
    padding-bottom: 4px;
}
.ernies-county-tabs::-webkit-scrollbar { height: 3px; }
.ernies-county-tabs::-webkit-scrollbar-thumb { background: #C8972A; border-radius: 2px; }

/* Each county tab button */
.ernies-county-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: #C8972A;
    color: #0B1B2B;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 16px;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.15);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ernies-county-tab.active { background: #0B1B2B; color: #C8972A; }
.ernies-county-tab .tab-count { font-size: 11px; opacity: 0.75; }

/* Town panels */
.ernies-town-panel {
    display: none;
    background: #1a2744;
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0;
}
.ernies-town-panel.active { display: block; }
.ernies-town-panel::-webkit-scrollbar { width: 4px; }
.ernies-town-panel::-webkit-scrollbar-thumb { background: rgba(200,151,42,0.5); border-radius: 2px; }

.ernies-town-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    column-count: 2;
    column-gap: 0;
}
.ernies-town-panel ul li a,
.ernies-town-panel ul li span {
    display: block;
    padding: 8px 18px;
    color: #dde6f0;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ernies-town-panel ul li a:hover { color: #C8972A; background: rgba(200,151,42,0.1); }

/* Desktop: show all as columns side by side */
@media(min-width:768px) {
    .ernies-county-tabs { flex-wrap: wrap; overflow: visible; }
    .ernies-county-tab { font-size: 14px; padding: 12px 20px; }
    .ernies-town-panel { max-height: 500px; }
    .ernies-town-panel ul { column-count: 3; }
}
</style>';
}, 50);

add_action('wp_footer', function() {
    // Only inject the JS — the HTML is in Elementor, this handles any
    // .ernies-areas-section the theme outputs, OR we inject a standalone widget
    echo '<script>
(fun
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//erniesandyorktowncarservice.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://erniesandyorktowncarservice.com/post-sitemap.xml</loc>
		<lastmod>2026-04-22T23:41:07+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://erniesandyorktowncarservice.com/page-sitemap.xml</loc>
		<lastmod>2026-04-24T23:41:22+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://erniesandyorktowncarservice.com/category-sitemap.xml</loc>
		<lastmod>2026-04-22T23:41:07+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->