/* Compact category navigation for the Novo child theme. */
@media (min-width: 1200px) {
  .ps-mainmenu--desktop .ps-mainmenu__desktop {
    position: relative !important;
  }

  .ps-mainmenu--desktop .novo-category-submenu {
    right: auto;
    left: max(16px, calc((100vw - 1140px) / 2 + 128px));
    top: calc(100% - 4px);
    width: min(680px, calc(100vw - 32px));
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 14px 34px rgba(var(--bs-black-rgb), 0.14);
    transform: none;
  }

  .ps-mainmenu--desktop .novo-category-submenu__content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    color: var(--bs-body-color);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
  }

  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item::after {
    flex: 0 0 auto;
    content: "\2192";
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
  }

  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item:hover,
  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item:focus-visible,
  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item.active {
    color: var(--bs-link-hover-color);
    border-color: rgba(var(--bs-primary-rgb), 0.22);
    background: var(--bs-primary-bg-subtle);
    outline: none;
  }

  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item:hover::after,
  .ps-mainmenu--desktop .novo-category-submenu .submenu__left-item:focus-visible::after {
    color: var(--bs-link-hover-color);
    transform: translateX(3px);
  }

  .ps-mainmenu--desktop .novo-category-submenu__all {
    grid-column: 1 / -1;
    min-height: 64px;
    border-color: rgba(var(--bs-primary-rgb), 0.18) !important;
    background: rgba(var(--bs-primary-rgb), 0.06);
  }

  .ps-mainmenu--desktop .novo-category-submenu__all::after {
    content: "\2197" !important;
  }

  .ps-mainmenu--desktop .novo-category-submenu__title {
    font-size: 1.05rem;
  }

  .ps-mainmenu--desktop .novo-category-submenu__cta {
    margin-left: auto;
    color: var(--bs-link-color);
    font-size: 0.875rem;
    font-weight: 600;
  }

  .ps-mainmenu--desktop .novo-category-submenu__group {
    grid-column: 1 / -1;
    padding: 8px;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
  }

  .ps-mainmenu--desktop .novo-category-submenu__parent {
    background: rgba(var(--bs-primary-rgb), 0.04);
  }

  .ps-mainmenu--desktop .novo-category-submenu__children {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 6px;
  }

  .ps-mainmenu--desktop .novo-category-submenu .novo-category-submenu__child {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.9rem;
    font-weight: 500;
  }
}

@media (min-width: 1400px) {
  .ps-mainmenu--desktop .ps-mainmenu__tree {
    gap: 4px;
  }

  .ps-mainmenu--desktop .ps-mainmenu__tree-link {
    padding-inline: 6px;
  }

  .ps-mainmenu--desktop .novo-category-submenu {
    left: max(16px, calc((100vw - 1320px) / 2 + 128px));
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .ps-mainmenu--desktop .ps-mainmenu__desktop {
    display: none !important;
  }

  .ps-mainmenu--desktop .ps-mainmenu__mobile-toggle {
    display: block;
  }
}

@media (max-width: 1399.98px) {
  .ps-mainmenu--mobile .menu__link,
  .ps-mainmenu--mobile .menu__toggle-child {
    min-height: 48px;
  }

  .ps-mainmenu--mobile .menu__link {
    display: flex;
    align-items: center;
    padding-block: 12px;
    padding-inline: 16px 56px;
  }

  .ps-mainmenu--mobile .menu--childrens {
    position: relative;
  }

  .ps-mainmenu--mobile .menu__toggle-child {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    width: 48px;
    place-items: center;
  }

  .ps-mainmenu--mobile .menu__link:focus-visible,
  .ps-mainmenu--mobile .menu__toggle-child:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
  }
}

/* Keep all seven desktop navigation entries on one line. */
@media (min-width: 1400px) {
  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-link {
    font-size: .875rem;
    padding-inline: .25rem;
    white-space: nowrap;
  }
  .ps-mainmenu--desktop .ps-mainmenu__tree { column-gap: .125rem; }
}

/* === Novodix 2026-10-01: menu row below logo + search (START) ===
   Revert: delete from START to END and set head.tpl back to ?v=20261001-motos
   (originals kept in /var/www/vhosts/novodix.com/.control-backups/keep/2026-10-01-menu-row/). */
@media (min-width: 1200px) {
  .header-bottom .header-bottom__row { flex-wrap: wrap; row-gap: 0; }
  .header-bottom .header-bottom__logo { order: 1; }
  .header-bottom .header-bottom__row > .order-2 { order: 2; flex: 1 1 auto; justify-content: flex-end; }
  .header-bottom .header-bottom__row > .order-2 .ps-searchbar { width: 100%; max-width: 340px; }

  .header-bottom .ps-mainmenu--desktop {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    border-top: 1px solid var(--bs-border-color);
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__desktop { width: 100%; }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__mobile-toggle { display: none !important; }

  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    height: 52px;
    margin: 0;
    gap: 4px;
    column-gap: 4px;
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li { display: flex; align-items: center; }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-item-wrapper { height: 100%; display: flex; align-items: center; }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    color: var(--bs-body-color);
    font-size: .9375rem;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 transparent;
    transition: box-shadow .15s, color .15s;
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li:hover .ps-mainmenu__tree-link,
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li:focus-within .ps-mainmenu__tree-link {
    color: var(--bs-primary);
    box-shadow: inset 0 -2px 0 var(--bs-primary);
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li.type-link .ps-mainmenu__tree-link {
    color: var(--bs-secondary-color);
    font-weight: 500;
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li.type-category + li.type-link { position: relative; margin-left: 12px; padding-left: 12px; }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li.type-category + li.type-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 1px;
    background: var(--bs-border-color);
  }

  /* Each panel hangs from its own item. Hummingbird JS (positionSubMenu) writes an inline
     top measured from the header; the !important top overrides it once the li is positioned.
     Items from the 4th on open towards the left so the panel never leaves the screen. */
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li.has-submenu { position: relative; }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li .novo-category-submenu {
    top: 100% !important;
    right: auto;
    left: 0;
    width: min(720px, calc(100vw - 32px));
    border-top: 0;
    border-radius: 0 0 12px 12px;
    transform: none;
  }
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__tree > li:nth-child(n+4) .novo-category-submenu {
    right: 0;
    left: auto;
  }
}

/* The theme hides the desktop nav with layered !important utilities (.d-none / d-xxl-block);
   only a rule inside the same layer can show it from 1200px. */
@layer utilities {
  @media (min-width: 1200px) {
    .header-bottom .ps-mainmenu--desktop .ps-mainmenu__desktop { display: block !important; }
  }
}
/* === Novodix 2026-10-01: menu row below logo + search (END) === */
