/* iTrade Theme — fixed header (cloned from wes_theme/css/header.css 2026-05-17) */
.itrade-page-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(220,28,28,0.12);
  padding: 0 32px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.itrade-page-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--itrade-fg);
}
.itrade-page-logo img { height: 36px; width: auto; }
.itrade-page-logo-text {
  font-size: 13px; font-weight: 800;
  letter-spacing: 1px; color: var(--itrade-red);
}

.itrade-page-header h1 {
  margin: 0;
  line-height: 1.1;
}

.itrade-page-header .itrade-kicker {
  margin: 0 0 2px;
}

.itrade-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.itrade-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--itrade-fg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms, color 160ms;
}
.itrade-nav a:hover {
  background: var(--itrade-red-soft);
  color: var(--itrade-red);
  text-decoration: none;
}

.itrade-page-nav {
  display: flex; gap: 24px; justify-content: center;
}
.itrade-page-nav a {
  color: var(--itrade-fg); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: color 200ms;
}
.itrade-page-nav a:hover { color: var(--itrade-red); }

.itrade-page-header-actions {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
}

.itrade-product-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.itrade-product-topbar-left {
  min-width: 0;
  justify-self: start;
}

.itrade-product-topbar .itrade-product-tabs {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.itrade-product-topbar-actions {
  min-width: 0;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.itrade-product-topbar .itrade-product-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.itrade-product-avatar {
  min-height: 32px;
  white-space: nowrap;
}

.itrade-product-avatar.is-avatar {
  min-width: 36px;
}

.itrade-product-avatar.is-avatar .itrade-avatar-chip {
  padding: 1px 4px 1px 1px;
}

.itrade-product-avatar.is-avatar .itrade-avatar {
  width: 30px;
  height: 30px;
}

.itrade-admin-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.itrade-admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.itrade-admin-topbar-title {
  flex: 0 0 auto;
  min-width: 0;
}

.itrade-admin-topbar-title h1 {
  font-size: 18px;
  white-space: nowrap;
}

.itrade-admin-topnav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}

.itrade-admin-topnav .itrade-product-tab {
  flex: 0 0 auto;
}

/* Connect button (anonymous) */
.itrade-page-connect-btn {
  background: linear-gradient(135deg, var(--itrade-red), var(--itrade-red-2));
  color: #fff; border: 0; border-radius: 999px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220,28,28,0.25);
  transition: transform 100ms, box-shadow 200ms;
}
.itrade-page-connect-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(220,28,28,0.35);
}

/* Profile chip (logged in) */
.itrade-page-profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--itrade-border);
  border-radius: 999px; padding: 4px 12px 4px 4px;
  text-decoration: none; color: var(--itrade-fg);
  font-size: 12px; font-weight: 700;
  transition: all 200ms;
}
.itrade-page-profile-chip:hover {
  border-color: var(--itrade-red); text-decoration: none;
}
.itrade-page-profile-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #DC1C1C, #8B0000);
  flex: 0 0 auto;
}
.itrade-page-profile-name {
  max-width: 100px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.itrade-page-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; color: var(--itrade-fg-muted);
  font-size: 18px; text-decoration: none;
  transition: background 200ms, color 200ms;
}
.itrade-page-logout:hover {
  background: var(--itrade-red-soft); color: var(--itrade-red);
  text-decoration: none;
}

@media (max-width: 980px) {
  .itrade-page-header { padding: 0 16px; grid-template-columns: auto 1fr auto; }
  .itrade-page-nav,
  .itrade-nav { display: none; }
  .itrade-page-profile-name { max-width: 60px; }
  .itrade-product-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .itrade-product-topbar .itrade-product-tab {
    padding-inline: 10px;
  }
  .itrade-product-topbar .itrade-product-action {
    padding-inline: 10px;
  }
  .itrade-admin-topbar-left {
    gap: 10px;
  }
  .itrade-admin-topbar-title h1 {
    font-size: 16px;
  }
  .itrade-admin-topnav .itrade-product-tab {
    padding-inline: 10px;
  }
}

@media (max-width: 640px) {
  .itrade-product-topbar {
    height: auto;
    min-height: 64px;
    padding-block: 8px;
  }
  .itrade-product-topbar-left {
    max-width: 44vw;
    overflow-x: auto;
  }
  .itrade-product-topbar .itrade-product-action {
    font-size: 12px;
  }
  .itrade-product-avatar:not(.is-avatar) {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .itrade-admin-topbar-left {
    max-width: none;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .itrade-admin-topbar-title .itrade-kicker {
    display: none;
  }
  .itrade-admin-topnav {
    width: min(100%, calc(100vw - 136px));
  }
}
