Same-Day Courier for Orders Placed Mon-Fri by Noon EST! Weekend orders ship on Monday!
- Guest checkout has been disabled. Please log in first.
(function () {
// Run only on your COA page
if (!/\/service\/coas(\/|$)/.test(location.pathname)) return;
/* --- Inject brand CSS late so it overrides the theme --- */
var css = `
.coa-hub{
--text:#133D1F; /* deep green text */
--link:#4ED92B; /* bright green */
--hover:#6A1B9A; /* purple hover */
--visited:#350950; /* deep purple visited */
--divider:rgba(19,61,31,.18);
--muted:rgba(19,61,31,.55);
--headerbg:rgba(53,9,80,.05);
}
.coa-hub, .coa-hub *{ font:inherit; color:var(--text) !important; }
.coa-hub .coa-list a{ color:var(--link) !important; text-decoration:underline; }
.coa-hub .coa-list a:hover{ color:var(--hover) !important; }
.coa-hub .coa-list a:visited{ color:var(--visited) !important; }
.coa-hub input[type="search"]{
background:transparent; color:var(--text) !important;
border:1px solid var(--muted) !important; outline:none;
}
.coa-hub input[type="search"]::placeholder{ color:var(--muted) !important; }
.coa-hub .coa-list [role="row"]{ border-bottom:1px solid var(--divider) !important; }
.coa-hub .coa-list [role="row"]:first-child{
background:var(--headerbg) !important; border-bottom:1px solid var(--divider) !important;
}
`;
var style = document.createElement('style');
style.id = 'coa-brand-css';
style.appendChild(document.createTextNode(css));
(document.head || document.documentElement).appendChild(style);
/* --- Enhance table: A–Z sort + live search --- */
function enhance() {
var hub = document.querySelector('.coa-hub');
var list = hub && hub.querySelector('.coa-list');
if (!hub || !list) return false;
// Collect rows (skip header)
var rows = Array.from(list.querySelectorAll('.coa-item'));
// Sort rows A–Z by Product (first [role="cell"])
rows.sort(function(a,b){
var aName = (a.querySelector('[role="cell"]') || {}).innerText || '';
var bName = (b.querySelector('[role="cell"]') || {}).innerText || '';
return aName.trim().localeCompare(bName.trim(), undefined, {sensitivity:'base'});
}).forEach(function(r){ list.appendChild(r); });
// Search
var input = document.getElementById('coaSearch');
var empty = document.getElementById('coaEmpty');
if (!empty) {
empty = document.createElement('div');
empty.id = 'coaEmpty';
empty.style.cssText = 'padding:10px;opacity:.8;display:none;';
empty.textContent = 'No matches. Try a different search.';
list.appendChild(empty);
}
function applyFilter(){
var q = (input && input.value || '').toLowerCase().trim();
var shown = 0;
rows.forEach(function(el){
var hay = (el.getAttribute('data-search') || el.innerText).toLowerCase();
var visible = !q || hay.indexOf(q) > -1;
el.style.display = visible ? 'flex' : 'none';
if (visible) shown++;
});
empty.style.display = shown ? 'none' : 'block';
}
if (input) input.addEventListener('input', applyFilter);
applyFilter(); // initial
return true;
}
// Run after DOM is ready; retry briefly in case the theme mounts late
function ready(fn){
if (document.readyState !== 'loading') fn();
else document.addEventListener('DOMContentLoaded', fn);
}
ready(function tryInit(){
if (enhance()) return;
var tries = 0, max = 20;
var t = setInterval(function(){
if (enhance() || ++tries >= max) clearInterval(t);
}, 150);
});
})();