/* AIA Trading header alignment. Scoped to the existing theme header. */
.site-header { position: relative; z-index: 20; }
.site-header .main-header {
  display: grid !important;
  grid-template-columns: clamp(185px, 18vw, 235px) minmax(0, 1fr) auto;
  grid-template-areas: "logo search actions";
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px) !important;
  min-height: 104px;
  padding-block: 20px;
}
.site-header .main-header > * { min-width: 0; }
.site-header .main-header .menu-toggle { display: none !important; }
.site-header .main-header .brand {
  grid-area: logo;
  width: 100%;
  max-width: 235px;
  margin: 0;
  line-height: 0;
}
.site-header .main-header .brand img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
  margin: 0 !important;
}
.site-header .product-search {
  grid-area: search;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: none !important;
  min-width: 0;
  margin: 0;
  height: 46px;
}
.site-header .product-search input[type="search"] {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
  height: 46px;
  padding: 11px 14px;
  border-radius: 3px 0 0 3px;
  font-size: 13px;
  line-height: 22px;
}
.site-header .product-search button {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 46px;
  padding: 0 !important;
  border-radius: 0 3px 3px 0;
}
.site-header .product-search button .aia-icon { width: 20px; height: 20px; }
.site-header .header-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 !important;
  white-space: nowrap;
}
.site-header .header-actions > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0;
  font-size: 13px;
  line-height: 1.2;
}
.site-header .header-actions .aia-icon {
  display: block;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
}
.site-header .cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin: 0;
  line-height: 1;
}
.site-header .category-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px clamp(15px, 2vw, 29px);
  padding-block: 0 17px;
}
.site-header .category-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 3px 0;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
}
.woocommerce-checkout .site-header .main-header {
  grid-template-columns: minmax(150px,235px) minmax(0,1fr);
  grid-template-areas: "logo back";
}
.site-header .back-cart {
  grid-area: back;
  justify-self: end;
  margin: 0 !important;
  text-align: right;
  font-size: 13px;
}
@media (min-width: 901px) and (max-width: 1150px) {
  .site-header .header-actions { gap: 6px; }
  .site-header .header-actions > a { min-width: 40px; }
  .site-header .header-actions span { display: none; }
  .site-header .header-actions > a:last-child { min-width: 56px; }
}
@media (max-width: 900px) {
  .site-header .main-header,
  .site-header .category-nav { width: min(1280px, calc(100% - 32px)); }
  .site-header .main-header {
    grid-template-columns: 40px minmax(0,1fr) 96px;
    grid-template-areas: "menu logo actions" "search search search";
    gap: 14px 8px !important;
    min-height: 0;
    padding: 16px 0 !important;
  }
  .site-header .main-header .menu-toggle {
    grid-area: menu;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: #3d2935;
    background: transparent;
    border: 0;
    line-height: 1;
    font-size: 25px;
  }
  .site-header .main-header .brand {
    justify-self: start;
    width: min(100%,180px);
    max-width: 180px;
  }
  .site-header .header-actions {
    width: 96px;
    gap: 4px !important;
  }
  .site-header .header-actions > a {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    gap: 0;
  }
  .site-header .header-actions span,
  .site-header .header-actions > a:nth-child(2) { display: none !important; }
  .site-header .header-actions .cart-count {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .site-header .product-search { height: 46px; }
  .site-header .product-search input[type="search"] { font-size: 16px; }
  .site-header .category-nav { display: none !important; padding: 0; }
  .site-header .category-nav.is-open {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0 18px;
    padding: 4px 0 16px;
  }
  .site-header .category-nav.is-open a {
    display: flex;
    justify-content: flex-start;
    min-height: 44px;
    padding: 11px 0;
    border-top: 1px solid #e5ddd5;
    white-space: normal;
    font-size: 13px;
    line-height: 1.4;
  }
  .woocommerce-checkout .site-header .main-header {
    grid-template-columns: minmax(0,180px) minmax(0,1fr);
    grid-template-areas: "logo back";
  }
  .woocommerce-checkout .site-header .main-header .menu-toggle { display: none !important; }
}
@media (max-width: 359px) {
  .site-header .main-header,
  .site-header .category-nav { width: calc(100% - 24px); }
  .site-header .category-nav.is-open { grid-template-columns: minmax(0,1fr); }
  .site-header .back-cart { font-size: 12px; }
}
