
/* TECH BAZAR — HEADER v5 */
/* Dark header + white navigation + blue hover */

#shop-header {
  background: #111722 !important;
  position: relative;
  z-index: 60;
}

#shop-header .header-inner {
  max-width: 1480px;
  min-height: 74px;
  gap: 16px;
  padding: 12px 24px;
  flex-wrap: nowrap;
}

#shop-header .logo {
  flex: none;
  max-width: 220px;
  letter-spacing: -.8px;
}

#shop-header .search {
  flex: 1 1 400px;
  width: min(38vw, 475px);
  max-width: 475px;
  min-width: 150px;
  margin: 0 auto 0 0;
  border-radius: 7px;
  box-shadow: 0 0 0 1px #ffffff18;
}

#shop-header .search input {
  height: 43px;
  padding: 0 15px;
  font-size: 13px;
}

#shop-header .search button {
  min-width: 77px;
  font-size: 13px;
  font-weight: 700;
  background: #34435a !important;
  transition: background .2s ease;
}

#shop-header .search button:hover {
  background: #244d91 !important;
}

#shop-header .header-actions {
  margin-left: auto;
  gap: 8px;
  flex: none;
}

#shop-header .header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 62px;
  height: 48px;
  padding: 5px 10px;
  border-radius: 7px;
  background: #303d52;
  color: white !important;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  transition: background .18s ease, transform .18s ease;
}

#shop-header .header-action:hover,
#shop-header .header-action:focus-visible {
  background: #415574;
  transform: translateY(-1px);
}

#shop-header .header-action svg {
  stroke: white !important;
  width: 18px;
  height: 18px;
  margin: 0;
}

#shop-header .count {
  right: 4px;
  top: 1px;
  background: #ed3c30;
}

/* Hide old navigation */
#shop-nav {
  display: none !important;
}

/* WHITE CATEGORY NAVIGATION */

#unified-category-nav {
  background: #fff !important;
  color: #141c2b !important;
  box-shadow: 0 2px 10px #131b2a12;
  border-bottom: 1px solid #e5e8ee;
  min-height: 44px;
  max-width: none;
  padding: 0 max(18px, calc((100% - 1480px)/2));
  flex-wrap: nowrap;
  gap: 0;
  overflow: visible;
  z-index: 55;
  font: 600 12px/1.3 'Segoe UI', Arial, sans-serif;
}

#unified-category-nav > .category-all {
  display: none !important;
}

#unified-category-nav > .category-branch {
  flex: 0 0 auto;
  position: relative;
}

#unified-category-nav .category-parent {
  min-height: 44px;
}

#unified-category-nav .category-parent > a {
  padding: 14px 10px;
  white-space: nowrap;
}

#unified-category-nav .category-parent > button {
  min-width: 15px;
  padding: 8px 3px 8px 0;
  color: #334155;
  transition: transform .2s ease;
}

/* REMOVE OLD ORANGE HOVER STYLES */

#unified-category-nav .category-branch::before,
#unified-category-nav .category-branch::after,
#unified-category-nav .category-parent::before,
#unified-category-nav .category-parent::after,
#unified-category-nav .category-parent > a::before,
#unified-category-nav .category-parent > a::after {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* BLUE HOVER FOR TOP LEVEL */

#unified-category-nav > .category-branch:hover,
#unified-category-nav > .category-branch:focus-within,
#unified-category-nav > .category-branch.expanded {
  background: #f0f4fb !important;
  box-shadow: inset 0 -3px #244d91 !important;
  border-color: #244d91 !important;
}

#unified-category-nav > .category-branch:hover > .category-parent > a,
#unified-category-nav > .category-branch:focus-within > .category-parent > a {
  color: #1d4ed8 !important;
}

/* DROPDOWN */

#unified-category-nav .category-children {
  display: block !important;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 230px;
  width: max-content;
  max-width: min(700px, 95vw);
  max-height: 70vh;
  overflow: visible;
  background: #fff;
  color: #192337;
  border: 1px solid #e1e5ed;
  border-top: 3px solid #234e92;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 35px #0b152733;
  padding: 5px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease,
              transform .18s ease,
              visibility .18s ease;
  z-index: 80;
}

#unified-category-nav .category-branch:hover > .category-children,
#unified-category-nav .category-branch:focus-within > .category-children,
#unified-category-nav .category-branch.expanded > .category-children {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* NESTED SUBCATEGORY */

#unified-category-nav .category-children .category-children {
  top: -6px;
  left: calc(100% - 2px);
  border-top: 1px solid #e1e5ed;
  border-radius: 7px;
  transform: translateX(8px);
}

#unified-category-nav .category-children .category-branch:hover > .category-children,
#unified-category-nav .category-children .category-branch:focus-within > .category-children {
  transform: translateX(0);
}

#unified-category-nav .category-children .category-parent {
  min-height: 37px;
}

#unified-category-nav .category-children .category-parent > a {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  white-space: nowrap;
  font-weight: 500;
}

#unified-category-nav .category-children .category-parent > button {
  padding: 7px 10px;
  min-width: 30px;
}

#unified-category-nav .category-children .category-branch:hover {
  background: #244d91 !important;
  color: #fff !important;
  box-shadow: none !important;
  border-radius: 4px;
}

#unified-category-nav .category-children .category-branch:hover > .category-parent > a,
#unified-category-nav .category-children .category-branch:hover > .category-parent > button {
  color: #fff !important;
}

#unified-category-nav .category-children .category-parent > a:hover {
  background: transparent !important;
  color: inherit !important;
}

/* REMOVE ORANGE BORDERS INSIDE DROPDOWNS */

#unified-category-nav .category-children,
#unified-category-nav .category-children .category-branch,
#unified-category-nav .category-children .category-parent,
#unified-category-nav .category-children .category-parent > a {
  border-bottom-color: transparent !important;
}

/* MOBILE CATEGORY DRAWER */

#category-drawer {
  z-index: 100;
  background: #fff;
  color: #172033;
}

#category-drawer .category-children {
  position: static;
  display: none;
  max-height: none;
  box-shadow: none;
  border: 0;
  padding: 0 0 0 14px;
  overflow: visible;
}

#category-drawer .category-branch.expanded > .category-children {
  display: block;
}

#category-drawer .category-parent > button {
  color: #172033;
}

#category-drawer .category-all {
  display: none;
}

/* CART HOVER PREVIEW */

.tb-cart-preview {
  position: fixed;
  top: 68px;
  right: 90px;
  width: min(350px, calc(100vw - 28px));
  background: #fff;
  color: #152033;
  border: 1px solid #e2e7ed;
  border-radius: 9px;
  box-shadow: 0 15px 42px #0d172b38;
  z-index: 110;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease,
              transform .18s ease,
              visibility .18s ease;
}

.tb-cart-preview.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.tb-cart-preview .tb-cart-title {
  padding: 13px 15px;
  border-bottom: 1px solid #e9edf2;
  font-weight: 700;
  font-size: 14px;
}

.tb-cart-preview .tb-cart-list {
  max-height: 250px;
  overflow: auto;
  padding: 6px 12px;
}

.tb-cart-preview .tb-cart-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
}

.tb-cart-preview .tb-cart-item img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.tb-cart-preview .tb-cart-item a {
  display: block;
  line-height: 1.4;
  font-weight: 600;
}

.tb-cart-preview .tb-cart-item small {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

.tb-cart-preview .tb-cart-remove {
  border: 0;
  background: transparent;
  color: #9aa4b2;
  font-size: 19px;
  padding: 4px;
}

.tb-cart-preview .tb-cart-remove:hover {
  color: #d12e2e;
}

.tb-cart-preview .tb-cart-totals {
  padding: 10px 14px;
  font-size: 12px;
  display: grid;
  gap: 7px;
}

.tb-cart-preview .tb-cart-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tb-cart-preview .tb-cart-totals strong {
  color: #1f4589;
}

.tb-cart-preview .tb-cart-buttons {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #edf0f4;
}

.tb-cart-preview .tb-cart-buttons a {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 5px;
  border: 1px solid #d9e0e8;
  font-weight: 700;
  font-size: 12px;
}

.tb-cart-preview .tb-cart-buttons a:last-child {
  background: #172131;
  color: #fff;
  border-color: #172131;
}

.tb-cart-preview .tb-cart-buttons a:hover {
  background: #244d91;
  color: white;
}

/* RESPONSIVE */

@media (max-width: 1050px) {
  #shop-header .header-inner {
    gap: 9px;
    padding: 10px 12px;
  }

  #shop-header .logo {
    font-size: 23px;
  }

  #shop-header .header-action {
    min-width: 49px;
    padding: 5px;
  }

  #unified-category-nav {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  #unified-category-nav .category-children {
    position: fixed;
    top: auto;
  }
}

@media (max-width: 760px) {
  #shop-header .header-inner {
    flex-wrap: wrap;
  }

  #shop-header .search {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    max-width: none;
  }

  #shop-header .header-actions {
    margin-left: auto;
  }

  #unified-category-nav {
    display: none !important;
  }

  .tb-cart-preview {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-cart-preview,
  #unified-category-nav .category-children,
  #shop-header .header-action {
    transition: none !important;
  }
}
