/* =====================================================================
   ZippKart Navigation System — Phase 6
   A compact, stable storefront header for desktop, tablet and mobile.
   Loaded after the previous visual layers so old header overrides cannot
   enlarge the logo or force the category dropdown outside the viewport.
   ===================================================================== */

.site-body > header {
  position: relative;
  z-index: 300;
  background: #fff;
}

.site-body .topbar {
  background: #0c1b33;
  color: #d8e2f1;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.site-body .topbar .container {
  min-height: 34px;
  padding-block: 6px;
  gap: 16px;
}
.site-body .topbar a,
.site-body .topbar span { line-height: 1.25; }
.site-body .topbar .support-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  white-space: nowrap;
}
.site-body .topbar .support-link:hover { color: #fff; }

.site-body .navbar {
  position: sticky;
  top: 0;
  z-index: 310;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #e6ebf2;
  box-shadow: 0 5px 18px rgba(14,30,56,.055);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
}
.site-body .navbar .container {
  min-height: 76px;
  padding-block: 11px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 2.5vw, 34px);
}

/* Hard upper bounds prevent the uploaded logo canvas from ever taking over
   the header, even if a legacy selector or stale browser stylesheet exists. */
.site-body .navbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 210px;
  min-width: 0;
  overflow: hidden;
  flex: 0 0 auto;
}
.site-body .navbar .brand-logo-ic {
  display: block;
  width: auto !important;
  height: 40px !important;
  max-width: 50px !important;
  max-height: 40px !important;
  object-fit: contain;
  flex: 0 0 auto;
}
.site-body .navbar .brand-logo-word {
  display: block;
  width: auto !important;
  height: 22px !important;
  max-width: 132px !important;
  max-height: 22px !important;
  object-fit: contain;
  flex: 0 1 auto;
}

.site-body .navbar .search-form {
  width: 100%;
  max-width: 760px;
  justify-self: center;
  margin: 0;
}
.site-body .navbar .search-form input {
  height: 48px;
  min-height: 48px;
  padding-inline: 18px 54px;
  border: 1px solid #d7deea;
  background: #f8fafc;
  box-shadow: none;
  font-size: 14px;
}
.site-body .navbar .search-form input:focus {
  background: #fff;
  border-color: #1e6feb;
  box-shadow: 0 0 0 4px rgba(30,111,235,.12);
}
.site-body .navbar .search-form button {
  right: 5px;
  top: 5px;
  bottom: 5px;
  width: 38px;
  height: 38px;
  background: #0e1e38;
  transition: transform .16s ease, background .16s ease;
}
.site-body .navbar .search-form button:hover {
  background: #1e6feb;
  transform: scale(1.03);
}

.site-body .navbar .nav-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
}
.site-body .navbar .icon-btn,
.site-body .navbar .nav-hamburger {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  color: #0e1e38;
  border: 1px solid transparent;
}
.site-body .navbar .icon-btn:hover,
.site-body .navbar .nav-hamburger:hover {
  color: #1e6feb;
  background: #eef5ff;
  border-color: #d6e6ff;
  box-shadow: none;
}
.site-body .navbar .icon-badge {
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  border: 2px solid #fff;
  background: #1e6feb;
}
.site-body .account-dropdown {
  top: calc(100% + 10px);
  min-width: 230px;
  border-radius: 14px;
  border-color: #e1e7f0;
  box-shadow: 0 22px 55px rgba(14,30,56,.16);
}

.site-body .category-strip {
  position: relative;
  z-index: 305;
  background: #0e1e38;
  border: 0;
}
.site-body .category-strip .container {
  min-height: 48px;
  padding-block: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  overflow: visible;
}
.site-body .category-strip .container > a,
.site-body .category-strip .nav-dropdown-toggle {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 0;
  color: #d7deeb;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  transition: background .16s ease, color .16s ease;
}
.site-body .category-strip .container > a:hover,
.site-body .category-strip .container > a.active,
.site-body .category-strip .nav-dropdown:hover > .nav-dropdown-toggle,
.site-body .category-strip .nav-dropdown-toggle.active {
  color: #fff;
  background: rgba(30,111,235,.24);
}

.site-body .nav-dropdown { position: relative; }
.site-body .nav-dropdown-menu {
  top: calc(100% + 1px);
  left: 0;
  width: min(590px, calc(100vw - 32px));
  min-width: 0;
  max-width: calc(100vw - 32px);
  max-height: min(440px, calc(100vh - 170px));
  overflow-y: auto;
  overscroll-behavior: contain;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 3px 8px;
  padding: 14px;
  border: 1px solid #e1e7f0;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 24px 54px rgba(7,20,41,.2);
  transform: translateY(4px);
}
.site-body .nav-dropdown-menu a {
  min-width: 0;
  padding: 9px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  border-radius: 9px;
}
.site-body .nav-dropdown-all { grid-column: 1 / -1; }

/* Tablet navigation uses the same accessible drawer as mobile. */
@media (max-width: 1024px) {
  .site-body .category-strip { display: none !important; }
  .site-body .nav-hamburger { display: inline-flex !important; }
  .site-body .navbar .container {
    grid-template-columns: auto auto minmax(220px, 1fr) auto;
    gap: 12px;
  }
  .site-body .navbar .brand { max-width: 184px; }
  .site-body .navbar .brand-logo-ic {
    height: 36px !important;
    max-height: 36px !important;
    max-width: 44px !important;
  }
  .site-body .navbar .brand-logo-word {
    height: 19px !important;
    max-height: 19px !important;
    max-width: 116px !important;
  }
}

@media (max-width: 768px) {
  .site-body .topbar .container {
    min-height: 30px;
    padding-block: 5px;
  }
  .site-body .topbar .support-link .support-hours { display: none; }
  .site-body .navbar .container {
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    column-gap: 7px;
    row-gap: 9px;
    padding-block: 9px 10px;
  }
  .site-body .navbar .nav-hamburger { order: 1; }
  .site-body .navbar .brand {
    order: 2;
    flex: 1 1 auto;
    max-width: none;
    overflow: visible;
  }
  .site-body .navbar .nav-icons { order: 3; flex: 0 0 auto; gap: 0; }
  .site-body .navbar .search-form {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
  }
  .site-body .navbar .brand-logo-ic {
    height: 31px !important;
    max-height: 31px !important;
    max-width: 39px !important;
  }
  .site-body .navbar .brand-logo-word {
    height: 16px !important;
    max-height: 16px !important;
    max-width: 100px !important;
  }
  .site-body .navbar .icon-btn,
  .site-body .navbar .nav-hamburger {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .site-body .navbar .search-form input {
    height: 44px;
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom */
  }
  .site-body .navbar .search-form button {
    width: 36px;
    height: 36px;
    top: 4px;
    bottom: 4px;
  }
  .site-body .account-dropdown {
    position: fixed;
    top: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }
}

@media (max-width: 390px) {
  .site-body .navbar .brand-logo-word {
    height: 15px !important;
    max-height: 15px !important;
    max-width: 90px !important;
  }
  .site-body .navbar .nav-icons .icon-btn {
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
  }
}
