/**
 * Mitoto.Life - Header layout modes
 *
 * Mobile (domyślnie): logo + 6 ikon (język, wiadomości, konto, ulubione, koszyk, lupa)
 * Desktop: tylko gdy html.is-desktop (js/nav-mode.js) - pasek szukaj, bez lupki
 */

/* --- Mobile default --- */
.navbar {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
  overflow-y: visible;
}

.nav-search-slot,
.nav-container > .nav-search {
  display: none !important;
}

.nav-toggle {
  display: flex !important;
}

.nav-lang {
  display: block !important;
  flex: 0 0 auto;
}

.nav-drawer {
  display: block;
}

.nav-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 8px;
  column-gap: 4px;
  align-items: center;
  overflow-x: clip;
}

.nav-actions,
.nav-icons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.nav-actions {
  justify-self: end;
}

.nav-logo {
  min-width: 0;
  max-width: min(30vw, 110px);
  overflow: hidden;
  justify-self: start;
}

.nav-logo a {
  display: flex;
  max-width: 100%;
}

.nav-logo img {
  height: 27px; /* +~10% vs 24px */
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.nav-actions .icon-btn,
.nav-toggle {
  width: 30px;
  height: 30px;
  min-width: 30px;
  flex: 0 0 30px;
  padding: 0;
  box-sizing: border-box;
}

.nav-actions .icon-btn svg,
.nav-toggle svg {
  width: 16px;
  height: 16px;
}

html.is-phone,
html.is-touch {
  zoom: 1 !important;
}

@media (max-width: 380px) {
  .nav-container {
    padding: 0 4px;
    column-gap: 2px;
  }

  .nav-logo {
    max-width: min(26vw, 96px);
  }

  .nav-logo img {
    height: 24px;
  }

  .nav-actions .icon-btn,
  .nav-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex: 0 0 28px;
  }

  .nav-actions .icon-btn svg,
  .nav-toggle svg {
    width: 15px;
    height: 15px;
  }
}

/* --- Desktop (opt-in class from nav-mode.js) --- */
html.is-desktop:not(.is-phone) .nav-search-slot {
  display: contents !important;
}

html.is-desktop:not(.is-phone) .nav-search-slot > .nav-search,
html.is-desktop:not(.is-phone) .nav-container > .nav-search {
  display: flex !important;
}

html.is-desktop:not(.is-phone) .nav-toggle {
  display: none !important;
}

html.is-desktop:not(.is-phone) .nav-drawer {
  display: none !important;
}

html.is-desktop:not(.is-phone) .nav-lang {
  display: block !important;
}

html.is-desktop:not(.is-phone) .nav-container {
  /* Równe skrzydła 1fr|1fr = search dokładnie na środku nagłówka */
  grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr);
  padding: 0 40px;
  column-gap: 16px;
  overflow: visible;
  max-width: var(--max-width, 1440px);
}

html.is-desktop:not(.is-phone) .nav-logo {
  max-width: none;
  justify-self: start;
}

html.is-desktop:not(.is-phone) .nav-logo img {
  height: 34px;
  max-width: none;
}

html.is-desktop:not(.is-phone) .nav-actions .icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  flex: 0 0 42px;
}

html.is-desktop:not(.is-phone) .nav-actions .icon-btn svg {
  width: 22px;
  height: 22px;
}

html.is-desktop:not(.is-phone) .navbar {
  overflow: visible;
  max-width: none;
}

html.is-desktop:not(.is-phone) .nav-search {
  overflow: visible !important;
  width: 100%;
  min-width: 0;
  max-width: 640px;
  justify-self: center;
  grid-column: 2;
}

html.is-desktop:not(.is-phone) .nav-actions {
  justify-self: end;
  flex-shrink: 0;
  grid-column: 3;
}

/* Węższy desktop: ciaśniej, search nadal wyśrodkowany */
@media (max-width: 1280px) {
  html.is-desktop:not(.is-phone) .nav-container {
    padding: 0 20px;
    column-gap: 12px;
  }

  html.is-desktop:not(.is-phone) .nav-category-trigger {
    min-width: 96px;
    max-width: 140px;
    padding: 0 8px 0 10px;
  }
}

@media (max-width: 1100px) {
  html.is-desktop:not(.is-phone) .nav-container {
    padding: 0 12px;
    column-gap: 8px;
  }

  html.is-desktop:not(.is-phone) .nav-category-trigger {
    min-width: 72px;
    max-width: 110px;
    font-size: 12px;
  }

  html.is-desktop:not(.is-phone) .nav-actions .icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex: 0 0 36px;
  }
}

html.is-desktop:not(.is-phone) .nav-container {
  overflow: visible;
}

html.is-desktop:not(.is-phone) .nav-search-suggest {
  z-index: 5000;
}
