document.addEventListener("DOMContentLoaded", () => {
// Loop through each mega-menu
document.querySelectorAll(".mega-menu").forEach(menu => {
// Count subsections inside the left .collection-list
const tabs = menu.querySelectorAll(".collection-list .collection-tab");
// If only ONE subsection exists → hide entire left column
if (tabs.length <= 1) {
const collectionList = menu.querySelector(".collection-list");
if (collectionList) {
collectionList.style.display = "none"; // hide tabs
}
const productsPanel = menu.querySelector(".collection-products");
if (productsPanel) {
productsPanel.style.paddingLeft = "0"; // remove empty left gap
productsPanel.style.width = "100%"; // make full width
}
}
});
});
document.addEventListener("DOMContentLoaded", () => {
// Loop through each main mobile dropdown
document.querySelectorAll(".mobile-dropdown").forEach(drop => {
// Count inner subcollection blocks
const subCollections = drop.querySelectorAll(".mobile-subcollection");
// If ONLY ONE subcollection exists → convert to direct image dropdown
if (subCollections.length === 1) {
let mainToggle = drop.previousElementSibling; // .mobile-dropdown-toggle
let innerToggle = subCollections[0].querySelector(".collection-toggle");
let innerDropdown = subCollections[0].querySelector(".collection-dropdown");
// ------ Remove inner toggle completely ------
if (innerToggle) innerToggle.style.display = "none";
// ------ Move product grid directly under main dropdown ------
if (innerDropdown) {
innerDropdown.classList.add("direct-grid"); // optional class
drop.appendChild(innerDropdown); // Move OUT of subcollection
}
// ------ Remove the wrapper div (mobile-subcollection) ------
subCollections[0].remove();
// ------ When clicking the main toggle, open the images directly ------
mainToggle.addEventListener("click", () => {
innerDropdown.classList.toggle("active");
});
}
});
});
We've sent you an email with a link to update your password.