/* ===== Header → mockup look (desktop ≥992px) ===== */
@media (min-width: 992px) {
  /* --- ordering safety: anything not explicitly ordered goes last --- */
  .page-header.type2 > * { order: 50; }

  /* --- 1. Topbar → dark gray, white text --- */
  .page-header.type2 > .main-panel-top { order:1; flex:0 0 100%; background:#393c40; }
  .page-header.type2 > .main-panel-top .header-left { color:#fff; font-size:12.5px; font-weight:500; }
  .page-header.type2 > .main-panel-top .header-right .header.links > li > a { color:#cfd4d8; font-size:12.5px; }
  .page-header.type2 > .main-panel-top .header-right .header.links > li > a:hover { color:#fff; }

  /* --- 2. One-row flex header: logo | nav | search | cart --- */
  .page-header.type2 { display:flex; flex-wrap:wrap; align-items:center; background:#fff; border-bottom:1px solid #eceff1; }
  .page-header.type2 > .header-main { display:contents; }
  .page-header.type2 > .header-main > .header-row { display:contents; }

  /* logo — container-left edge, compact height */
  .page-header.type2 > .header-main .header-left {
    order:2; margin-left:max(24px, calc((100% - 1240px)/2 + 24px));
    padding-top:10px; padding-bottom:10px; width:auto !important; flex:0 0 auto;
    margin-right:0 !important; min-width:0;
  }
  .page-header.type2 .header-left .logo { width:auto !important; display:block; margin:0; min-width:0; }
  .page-header.type2 .header-left .logo img { height:46px !important; width:auto !important; max-width:none; }
  .page-header.type2 .header-left .logo img { height:46px; width:auto; }

  /* nav — inline after logo, transparent bar, dark links */
  .page-header.type2 > .sections.nav-sections {
    order:3; flex:0 1 auto; margin-left:28px; background:transparent !important;
  }
  .page-header.type2 > .sections.nav-sections .navigation,
  .page-header.type2 > .sections.nav-sections .sw-megamenu,
  .page-header.type2 > .sections.nav-sections .section-item-content,
  .page-header.type2 > .sections.nav-sections .section-items,
  .page-header.type2 > .sections.nav-sections .sw-megamenu > ul,
  .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0 { background:transparent !important; }
  .page-header.type2 > .sections.nav-sections .sw-megamenu > ul { display:flex; gap:18px; width:auto !important; margin:0; padding:0; }
  .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0 { white-space:nowrap; float:none !important; margin:0; }
  .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0 > a.level-top {
    color:#1a1d20 !important; font-size:13px; font-weight:600; text-transform:none;
    letter-spacing:0; padding:10px 0; border-bottom:3px solid transparent; background:transparent !important;
  }
  .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0:hover > a.level-top { color:#5da332 !important; }
  .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0.active > a.level-top {
    color:#5da332 !important; border-bottom:3px solid #7fc11a;
  }
  /* hide dropdown carets (submenus still open on hover) */
  .page-header.type2 > .sections.nav-sections .sw-megamenu li.parent > a.level-top:after { content:none !important; }

  /* search — right side, mockup box style */
  .page-header.type2 > .header-main .header-center { order:4; margin:0 0 0 auto !important; flex:0 1 220px; min-width:0; }
  .page-header.type2 .header-center .block-search input {
    border:1px solid #d5dade !important; border-radius:6px !important;
    font-size:12.5px; padding:9px 12px; height:auto; box-shadow:none;
  }
  /* kill Porto type2 wrapper border (double-outline fix) */
  .page-header.type2 .search-area .block.block-search { border:0 !important; box-shadow:none !important; }
  .page-header.type2 .search-area { border:0 !important; }

  /* cart — container-right edge, green count badge */
  .page-header.type2 > .header-main .header-right {
    order:5; margin-right:max(24px, calc((100% - 1240px)/2 + 24px));
    margin-left:14px; padding-top:10px; padding-bottom:10px; flex:0 0 auto; min-width:0;
  }
  .page-header.type2 .minicart-wrapper .action.showcart .counter.qty {
    background:#7fc11a !important; color:#fff !important; border-radius:50% !important;
    min-width:19px; height:19px; font-size:11px; font-weight:700;
  }
  .page-header.type2 .header-right .my-account,
  .page-header.type2 .minicart-wrapper .minicart-icon { color:#3c4349; }

  /* tighter nav on narrower desktops */
  @media (max-width: 1240px) {
    .page-header.type2 > .sections.nav-sections .sw-megamenu > ul { gap:12px; }
    .page-header.type2 > .sections.nav-sections { margin-left:16px; }
    .page-header.type2 > .sections.nav-sections .sw-megamenu ul li.level0 > a.level-top { font-size:12.5px; }
    .page-header.type2 > .header-main .header-center { flex-basis:180px; }
    .page-header.type2 .header-left .logo img { height:40px !important; }
  }
}

/* --- Flat nav: kill hover mega-dropdowns (mockup has none) --- */
@media (min-width: 992px) {
  .page-header.type2 .sections.nav-sections .sw-megamenu .level0.submenu,
  .page-header.type2 .sections.nav-sections .sw-megamenu li.parent .submenu,
  .page-header.type2 .sections.nav-sections .sw-megamenu li.parent .open-children-toggle {
    display:none !important; visibility:hidden !important; opacity:0 !important; pointer-events:none !important;
  }
}

/* --- Flat nav on mobile too: no accordion children, top links only --- */
@media (max-width: 991px) {
  .sw-megamenu li.parent .open-children-toggle { display:none !important; }
  .sw-megamenu .level0.submenu { display:none !important; }
}
