{
  "id": "mega-menu",
  "name": "Mega Menu",
  "category": "navigation",
  "tags": [
    "dropdown",
    "multi-column",
    "header",
    "hover",
    "focus-within",
    "ecommerce"
  ],
  "description": "A wide multi-column dropdown panel under a nav item, opened on hover or keyboard focus.",
  "url": "https://copy-css.com/snippets/mega-menu",
  "markdown": "https://copy-css.com/snippets/mega-menu.md",
  "html": "<nav class=\"mega-menu\" aria-label=\"Main\">\n  <div class=\"mega-menu-item\">\n    <button class=\"mega-menu-trigger\" type=\"button\">Products</button>\n    <div class=\"mega-menu-panel\">\n      <div>\n        <p class=\"mega-menu-heading\">Build</p>\n        <a href=\"#\">Site builder</a>\n        <a href=\"#\">Forms</a>\n        <a href=\"#\">Checkout</a>\n      </div>\n      <div>\n        <p class=\"mega-menu-heading\">Grow</p>\n        <a href=\"#\">Email</a>\n        <a href=\"#\">Analytics</a>\n        <a href=\"#\">SEO tools</a>\n      </div>\n      <a class=\"mega-menu-promo\" href=\"#\">New: AI site audit</a>\n    </div>\n  </div>\n  <a href=\"#\">Pricing</a>\n  <a href=\"#\">Docs</a>\n</nav>",
  "css": ".mega-menu {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n  font: 500 14px system-ui, sans-serif;\n}\n\n.mega-menu-item {\n  position: relative;\n}\n\n.mega-menu > a,\n.mega-menu-trigger {\n  display: block;\n  padding: 9px 12px;\n  border: 0;\n  border-radius: 8px;\n  background: none;\n  color: #334155;\n  font: inherit;\n  text-decoration: none;\n  cursor: pointer;\n}\n\n.mega-menu > a:hover,\n.mega-menu-trigger:hover,\n.mega-menu-item:focus-within .mega-menu-trigger {\n  background: #e2e8f0;\n  color: #0f172a;\n}\n\n.mega-menu-panel {\n  position: absolute;\n  top: 100%;\n  left: 0;\n  z-index: 10;\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 4px 16px;\n  width: min(360px, calc(100vw - 32px));\n  margin-top: 8px;\n  padding: 16px;\n  border-radius: 14px;\n  background: #ffffff;\n  box-shadow: 0 0 0 1px #0f172a14, 0 18px 40px -12px #0f172a40;\n  opacity: 0;\n  visibility: hidden;\n  transform: translateY(-6px);\n  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;\n}\n\n/* Invisible bridge across the gap so hover is not lost */\n.mega-menu-panel::before {\n  content: \"\";\n  position: absolute;\n  top: -10px;\n  right: 0;\n  left: 0;\n  height: 10px;\n}\n\n.mega-menu-item:hover .mega-menu-panel,\n.mega-menu-item:focus-within .mega-menu-panel {\n  opacity: 1;\n  visibility: visible;\n  transform: none;\n}\n\n.mega-menu-heading {\n  margin: 0 8px 6px;\n  color: #64748b;\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n\n.mega-menu-panel a {\n  display: block;\n  padding: 7px 8px;\n  border-radius: 8px;\n  color: #0f172a;\n  text-decoration: none;\n}\n\n.mega-menu-panel a:hover {\n  background: #f1f5f9;\n}\n\n.mega-menu-panel .mega-menu-promo {\n  grid-column: 1 / -1;\n  margin-top: 8px;\n  padding: 10px 12px;\n  background: #eef2ff;\n  color: #4338ca;\n  font-weight: 600;\n}\n\n.mega-menu a:focus-visible,\n.mega-menu-trigger:focus-visible {\n  outline: 2px solid #4f46e5;\n  outline-offset: 1px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .mega-menu-panel { transition: none; }\n}",
  "features": [
    "transitions",
    "transforms",
    "box shadows",
    "CSS Grid",
    "Flexbox",
    "keyboard focus styles",
    "reduced-motion support"
  ],
  "customProperties": []
}
