/* Trade-portal tab bar — per design.md v2 */

.trade-portal-tabs {
  display: flex;
  flex-wrap: wrap;                       /* D9: wrap before shrinking */
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 0;
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  background: var(--surface-color, transparent);
  position: relative;
  z-index: 100;                          /* above map overlays (proj toggle = 50) */
}

/* Push the absolutely-positioned projection toggle below the tab bar so it
   doesn't intercept clicks on the leftmost tab. */
.trade-portal .map-projection-toggle-host {
  top: 64px;
}
@media (max-width: 640px) {
  .trade-portal .map-projection-toggle-host {
    top: 58px;
  }
}

.trade-portal-tabs [role="tab"] {
  font-size: max(12px, 0.9rem);          /* D9: label ≥12px at all widths */
  font-family: inherit;
  padding: 0.4rem 0.85rem;
  background: transparent;
  color: var(--text-color, inherit);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.trade-portal-tabs [role="tab"]:hover {
  opacity: 1;
  background: var(--surface-color-hover, rgba(0, 0, 0, 0.04));
}

.trade-portal-tabs [role="tab"][aria-selected="true"] {
  opacity: 1;
  background: var(--surface-color, rgba(0, 0, 0, 0.04));
  border-color: var(--border-color, rgba(0, 0, 0, 0.12));
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;                   /* cover the tablist bottom border */
  font-weight: 600;
}

.trade-portal-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--accent-color, #3a7bd5);
  outline-offset: 2px;
}

/* Narrow viewports — flex-wrap already handles row-breaks; keep labels readable */
@media (max-width: 480px) {
  .trade-portal-tabs {
    padding: 0.4rem 0.5rem 0;
  }
  .trade-portal-tabs [role="tab"] {
    padding: 0.35rem 0.65rem;
  }
}
