/* Global Categories UI (header top bar + slideout menu) */

/* Header polish: remove rounded capsule look and ensure full-width + search visible */
body #header .menu-wrapper { background: transparent; box-shadow: none; border-radius: 0; }
body #header .grid-container { max-width: 100%; padding-left: 16px; padding-right: 16px; }
body #header .epcl-search-button { display: inline-flex !important; visibility: visible !important; opacity: 1 !important; }
body #header .main-nav .search-menu-item { display: inline-block !important; visibility: visible !important; opacity: 1 !important; }
body #header .main-nav .search-menu-item a { display: inline-flex !important; }

/* Fix header layout for all screen sizes - SEARCH LEFT */
@media (min-width: 768px) {
    body #header .grid-container { padding-left: 16px; padding-right: 16px; }
    body #header .epcl-flex.grid-wrapper {
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        flex-wrap: nowrap;
    }
    body #header .epcl-search-button { order: 1; flex: 0 0 auto; }
    body #header .main-nav { order: 2; flex: 0 0 auto; }
    body #header .site-logo { order: 3; flex: 1; text-align: center; }
    body #header .account { order: 4; flex: 0 0 auto; }
    body #header .open-menu { order: 5; flex: 0 0 auto; }
}
@media (min-width: 1200px) {
    body #header .grid-container { padding-left: 20px; padding-right: 20px; }
}

/* Top categories bar under header */
.categories-topbar { width: 100%; background: #ffffff; border-bottom: 1px solid #f3f4f6; }
.categories-topbar .topbar-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; padding: 6px 12px; }
.categories-topbar a.topcat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; background: #f3f4f6; color: #1f2937; text-decoration: none; border-radius: 999px; white-space: nowrap; font-size: 0.82rem; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.categories-topbar a.topcat-pill:hover {
  background: #e5e7eb;
  color: #4f46e5;
  transform: translateY(-1px);
}
.categories-topbar a.topcat-pill svg { width: 14px; height: 14px; }

/* Slideout categories menu (reused styles) */
.calculator-categories-menu { position: fixed; top: 0; right: -100%; width: 85%; max-width: 360px; height: 100vh; background: #ffffff; box-shadow: -2px 0 20px rgba(0,0,0,.2); z-index: 10000; transition: right .3s ease; overflow-y: auto; }
.calculator-categories-menu.active { right: 0; }
.categories-menu-header { display:flex; justify-content: space-between; align-items:center; padding: 50px 16px 14px; border-bottom: 1px solid #e5e7eb; background: linear-gradient(135deg,#667eea 0%, #764ba2 100%); }
.categories-menu-header h3 { font-size: 1.1rem; font-weight: 600; color: #fff; margin: 0; }
.categories-menu-close { background: rgba(255,255,255,.2); border:0; cursor:pointer; padding:6px; color:#fff; border-radius:6px; }
.categories-menu-close svg { width: 20px; height: 20px; }
.categories-menu-list { padding: 6px 0 16px; }
.categories-menu-list ul { list-style: none; margin:0; padding:0; }
.categories-menu-list li { border-bottom:1px solid #f3f4f6; }
.categories-menu-list a { display:flex; align-items:center; gap:12px; padding:12px 16px; text-decoration:none; color:#1f2937; font-weight:500; transition: background .2s ease, color .2s ease, padding .2s ease; }
.categories-menu-list a:hover { background:#f9fafb; color:#667eea; }
.categories-menu-list .menu-icon { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; color:#4f46e5; }
.categories-menu-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,.5); z-index: 9999; opacity:0; visibility:hidden; transition: all .3s ease; }
.categories-menu-overlay.active { opacity:1; visibility:visible; }

@media (max-width: 768px){
  /* 3 columns on mobile; auto wraps to multiple rows */
  .categories-topbar .topbar-inner { grid-template-columns: repeat(3, 1fr); padding: 6px 10px; gap: 6px 8px; }
  .categories-topbar a.topcat-pill { justify-content: center; width: 100%; padding: 6px 6px; font-size: .78rem; }
}


